diff options
Diffstat (limited to 'WebCore')
995 files changed, 28040 insertions, 17254 deletions
diff --git a/WebCore/Android.derived.mk b/WebCore/Android.derived.mk index 8fb10b6..de36334 100644 --- a/WebCore/Android.derived.mk +++ b/WebCore/Android.derived.mk @@ -67,6 +67,7 @@ $(GEN): $(LOCAL_PATH)/html/DocTypeStrings.gperf $(intermediates)/html/HTMLDocument.o : $(GEN) +<<<<<<< HEAD # HTML entity table GEN := $(intermediates)/html/HTMLEntityTable.cpp @@ -82,6 +83,8 @@ $(GEN): $(LOCAL_PATH)/html/HTMLEntityNames.json LOCAL_GENERATED_SOURCES += $(GEN) +======= +>>>>>>> webkit.org at r66666 # color names GEN := $(intermediates)/platform/ColorData.cpp diff --git a/WebCore/Android.mk b/WebCore/Android.mk index b468d18..622318a 100644 --- a/WebCore/Android.mk +++ b/WebCore/Android.mk @@ -254,8 +254,18 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \ editing/markup.cpp \ editing/visible_units.cpp \ \ +<<<<<<< HEAD history/BackForwardController.cpp \ history/BackForwardListImpl.cpp \ +======= + fileapi/Blob.cpp \ + fileapi/BlobURL.cpp \ + fileapi/File.cpp \ + fileapi/FileList.cpp \ + fileapi/ThreadableBlobRegistry.cpp \ + \ + history/BackForwardList.cpp \ +>>>>>>> webkit.org at r66666 history/CachedFrame.cpp \ history/CachedPage.cpp \ history/HistoryItem.cpp \ @@ -264,12 +274,16 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \ history/android/HistoryItemAndroid.cpp \ \ html/AsyncImageResizer.cpp \ +<<<<<<< HEAD html/Blob.cpp \ html/BlobBuilder.cpp \ html/BlobURL.cpp \ +======= +>>>>>>> webkit.org at r66666 html/CollectionCache.cpp \ - html/CSSPreloadScanner.cpp \ + html/parser/CSSPreloadScanner.cpp \ html/DOMFormData.cpp \ +<<<<<<< HEAD html/DateComponents.cpp \ html/File.cpp \ html/FileList.cpp \ @@ -283,29 +297,30 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \ html/HTMLPreloadScanner.cpp \ html/HTMLScriptRunner.cpp \ html/HTMLTreeBuilder.cpp \ +======= + html/FormDataList.cpp \ +>>>>>>> webkit.org at r66666 html/HTMLAllCollection.cpp \ html/HTMLCollection.cpp \ - html/HTMLConstructionSite.cpp \ html/HTMLDataListElement.cpp \ html/HTMLDocument.cpp \ html/HTMLDocumentParser.cpp \ html/HTMLElementsAllInOne.cpp \ - html/HTMLElementStack.cpp \ - html/HTMLFormattingElementList.cpp \ html/HTMLFormCollection.cpp \ html/HTMLImageLoader.cpp \ html/HTMLNameCollection.cpp \ html/HTMLOptionsCollection.cpp \ html/HTMLParserErrorCodes.cpp \ - html/HTMLParserScheduler.cpp \ html/HTMLTableRowsCollection.cpp \ html/HTMLViewSourceDocument.cpp \ - html/HTMLViewSourceParser.cpp \ html/ImageData.cpp \ html/ImageResizerThread.cpp \ +<<<<<<< HEAD html/LabelsNodeList.cpp \ html/StepRange.cpp \ html/ThreadableBlobRegistry.cpp \ +======= +>>>>>>> webkit.org at r66666 html/TimeRanges.cpp \ html/ValidityState.cpp \ \ @@ -318,6 +333,18 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \ html/canvas/CanvasStyle.cpp \ html/canvas/Float32Array.cpp \ \ + html/parser/HTMLConstructionSite.cpp \ + html/parser/HTMLDocumentParser.cpp \ + html/parser/HTMLElementStack.cpp \ + html/parser/HTMLEntityParser.cpp \ + html/parser/HTMLFormattingElementList.cpp \ + html/parser/HTMLParserScheduler.cpp \ + html/parser/HTMLPreloadScanner.cpp \ + html/parser/HTMLScriptRunner.cpp \ + html/parser/HTMLTokenizer.cpp \ + html/parser/HTMLTreeBuilder.cpp \ + html/parser/HTMLViewSourceParser.cpp \ + \ loader/Cache.cpp \ loader/CachedCSSStyleSheet.cpp \ loader/CachedFont.cpp \ @@ -682,7 +709,8 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \ rendering/RenderHTMLCanvas.cpp \ rendering/RenderIFrame.cpp \ rendering/RenderImage.cpp \ - rendering/RenderImageGeneratedContent.cpp \ + rendering/RenderImageResource.cpp \ + rendering/RenderImageResourceStyleImage.cpp \ rendering/RenderInline.cpp \ rendering/RenderLayer.cpp \ rendering/RenderLayerBacking.cpp \ diff --git a/WebCore/CMakeLists.txt b/WebCore/CMakeLists.txt index 6dbf082..1d9159f 100644 --- a/WebCore/CMakeLists.txt +++ b/WebCore/CMakeLists.txt @@ -12,9 +12,11 @@ SET(WebCore_INCLUDE_DIRECTORIES "${WEBCORE_DIR}/dom" "${WEBCORE_DIR}/dom/default" "${WEBCORE_DIR}/editing" + "${WEBCORE_DIR}/fileapi" "${WEBCORE_DIR}/history" "${WEBCORE_DIR}/html" "${WEBCORE_DIR}/html/canvas" + "${WEBCORE_DIR}/html/parser" "${WEBCORE_DIR}/inspector" "${WEBCORE_DIR}/loader" "${WEBCORE_DIR}/loader/appcache" @@ -77,6 +79,7 @@ SET(WebCore_IDL_INCLUDES bindings/js css dom + fileapi html html/canvas inspector @@ -189,16 +192,17 @@ SET(WebCore_IDL_FILES dom/WebKitTransitionEvent.idl dom/WheelEvent.idl - html/Blob.idl - html/BlobBuilder.idl + fileapi/Blob.idl + fileapi/BlobBuilder.idl + fileapi/FileError.idl + fileapi/File.idl + fileapi/FileList.idl + fileapi/FileReader.idl + fileapi/FileWriter.idl + html/DataGridColumn.idl html/DataGridColumnList.idl html/DOMFormData.idl - html/FileError.idl - html/File.idl - html/FileList.idl - html/FileReader.idl - html/FileWriter.idl html/HTMLAllCollection.idl html/HTMLAnchorElement.idl html/HTMLAppletElement.idl @@ -335,17 +339,6 @@ SET(WebCore_IDL_FILES storage/Database.idl storage/DatabaseCallback.idl storage/DatabaseSync.idl - storage/DirectoryEntry.idl - storage/DirectoryReader.idl - storage/DOMFileSystem.idl - storage/EntriesCallback.idl - storage/Entry.idl - storage/EntryArray.idl - storage/EntryCallback.idl - storage/ErrorCallback.idl - storage/FileEntry.idl - storage/FileSystemCallback.idl - storage/Flags.idl storage/IDBAny.idl storage/IDBCursor.idl storage/IDBDatabaseError.idl @@ -361,8 +354,6 @@ SET(WebCore_IDL_FILES storage/IDBRequest.idl storage/IDBSuccessEvent.idl storage/IDBTransaction.idl - storage/Metadata.idl - storage/MetadataCallback.idl storage/SQLError.idl storage/SQLException.idl storage/SQLResultSet.idl @@ -542,16 +533,10 @@ IF (ENABLE_SVG) ENDIF() SET(WebCore_SOURCES - ${DERIVED_SOURCES_DIR}/HTMLElementFactory.cpp ${DERIVED_SOURCES_DIR}/HTMLEntityTable.cpp - ${DERIVED_SOURCES_DIR}/HTMLNames.cpp - ${DERIVED_SOURCES_DIR}/JSHTMLElementWrapperFactory.cpp - ${DERIVED_SOURCES_DIR}/MathMLElementFactory.cpp - ${DERIVED_SOURCES_DIR}/MathMLNames.cpp ${DERIVED_SOURCES_DIR}/UserAgentStyleSheetsData.cpp - ${DERIVED_SOURCES_DIR}/XMLNames.cpp - ${DERIVED_SOURCES_DIR}/XMLNSNames.cpp ${DERIVED_SOURCES_DIR}/InspectorBackendDispatcher.cpp + ${DERIVED_SOURCES_DIR}/JSWebSocket.cpp accessibility/AXObjectCache.cpp accessibility/AccessibilityARIAGrid.cpp @@ -679,6 +664,7 @@ SET(WebCore_SOURCES bindings/js/JSTreeWalkerCustom.cpp bindings/js/JSWebKitCSSMatrixCustom.cpp bindings/js/JSWebKitPointCustom.cpp + bindings/js/JSWebSocketCustom.cpp bindings/js/JSWorkerContextBase.cpp bindings/js/JSWorkerContextCustom.cpp bindings/js/JSWorkerContextErrorHandler.cpp @@ -934,6 +920,13 @@ SET(WebCore_SOURCES editing/markup.cpp editing/visible_units.cpp + fileapi/Blob.cpp + fileapi/BlobBuilder.cpp + fileapi/BlobURL.cpp + fileapi/File.cpp + fileapi/FileList.cpp + fileapi/ThreadableBlobRegistry.cpp + history/BackForwardController.cpp history/BackForwardListImpl.cpp history/CachedFrame.cpp @@ -942,25 +935,13 @@ SET(WebCore_SOURCES history/PageCache.cpp html/AsyncImageResizer.cpp - html/Blob.cpp - html/BlobBuilder.cpp - html/BlobURL.cpp html/CollectionCache.cpp - html/CSSPreloadScanner.cpp html/DOMDataGridDataSource.cpp html/DOMFormData.cpp html/DataGridColumn.cpp html/DataGridColumnList.cpp html/DateComponents.cpp - html/File.cpp - html/FileList.cpp html/FormDataList.cpp - html/HTMLEntityParser.cpp - html/HTMLTokenizer.cpp - html/HTMLDocumentParser.cpp - html/HTMLPreloadScanner.cpp - html/HTMLScriptRunner.cpp - html/HTMLTreeBuilder.cpp html/HTMLAllCollection.cpp html/HTMLAnchorElement.cpp html/HTMLAppletElement.cpp @@ -973,7 +954,6 @@ SET(WebCore_SOURCES html/HTMLButtonElement.cpp html/HTMLCanvasElement.cpp html/HTMLCollection.cpp - html/HTMLConstructionSite.cpp html/HTMLDListElement.cpp html/HTMLDataGridCellElement.cpp html/HTMLDataGridColElement.cpp @@ -984,11 +964,8 @@ SET(WebCore_SOURCES html/HTMLDivElement.cpp html/HTMLDocument.cpp html/HTMLElement.cpp - html/HTMLElementStack.cpp - html/HTMLEntitySearch.cpp html/HTMLEmbedElement.cpp html/HTMLFieldSetElement.cpp - html/HTMLFormattingElementList.cpp html/HTMLFontElement.cpp html/HTMLFormCollection.cpp html/HTMLFormControlElement.cpp @@ -1026,7 +1003,6 @@ SET(WebCore_SOURCES html/HTMLParagraphElement.cpp html/HTMLParamElement.cpp html/HTMLParserErrorCodes.cpp - html/HTMLParserScheduler.cpp html/HTMLPlugInElement.cpp html/HTMLPlugInImageElement.cpp html/HTMLPreElement.cpp @@ -1047,12 +1023,10 @@ SET(WebCore_SOURCES html/HTMLTitleElement.cpp html/HTMLUListElement.cpp html/HTMLViewSourceDocument.cpp - html/HTMLViewSourceParser.cpp html/ImageData.cpp html/ImageResizerThread.cpp html/LabelsNodeList.cpp html/StepRange.cpp - html/ThreadableBlobRegistry.cpp html/ValidityState.cpp html/canvas/CanvasGradient.cpp html/canvas/CanvasPattern.cpp @@ -1060,6 +1034,19 @@ SET(WebCore_SOURCES html/canvas/CanvasRenderingContext.cpp html/canvas/CanvasRenderingContext2D.cpp html/canvas/CanvasStyle.cpp + html/parser/CSSPreloadScanner.cpp + html/parser/HTMLConstructionSite.cpp + html/parser/HTMLDocumentParser.cpp + html/parser/HTMLElementStack.cpp + html/parser/HTMLEntityParser.cpp + html/parser/HTMLEntitySearch.cpp + html/parser/HTMLParserScheduler.cpp + html/parser/HTMLFormattingElementList.cpp + html/parser/HTMLPreloadScanner.cpp + html/parser/HTMLScriptRunner.cpp + html/parser/HTMLTokenizer.cpp + html/parser/HTMLTreeBuilder.cpp + html/parser/HTMLViewSourceParser.cpp inspector/ConsoleMessage.cpp inspector/InjectedScript.cpp @@ -1146,21 +1133,6 @@ SET(WebCore_SOURCES loader/icon/PageURLRecord.cpp loader/loader.cpp - mathml/MathMLElement.cpp - mathml/MathMLInlineContainerElement.cpp - mathml/MathMLMathElement.cpp - mathml/MathMLTextElement.cpp - mathml/RenderMathMLBlock.cpp - mathml/RenderMathMLFenced.cpp - mathml/RenderMathMLFraction.cpp - mathml/RenderMathMLMath.cpp - mathml/RenderMathMLOperator.cpp - mathml/RenderMathMLRoot.cpp - mathml/RenderMathMLRow.cpp - mathml/RenderMathMLSquareRoot.cpp - mathml/RenderMathMLSubSup.cpp - mathml/RenderMathMLUnderOver.cpp - page/BarInfo.cpp page/Chrome.cpp page/Console.cpp @@ -1211,7 +1183,6 @@ SET(WebCore_SOURCES page/animation/KeyframeAnimation.cpp platform/Arena.cpp - platform/BlobItem.cpp platform/ContentType.cpp platform/ContextMenu.cpp platform/CrossThreadCopier.cpp @@ -1311,8 +1282,8 @@ SET(WebCore_SOURCES platform/network/BlobRegistryImpl.cpp platform/network/BlobResourceHandle.cpp platform/network/Credential.cpp - platform/network/FormData.cpp platform/network/FormDataBuilder.cpp + platform/network/FormData.cpp platform/network/HTTPHeaderMap.cpp platform/network/HTTPParsers.cpp platform/network/NetworkStateNotifier.cpp @@ -1321,6 +1292,7 @@ SET(WebCore_SOURCES platform/network/ResourceHandle.cpp platform/network/ResourceRequestBase.cpp platform/network/ResourceResponseBase.cpp + platform/network/SocketStreamHandleBase.cpp platform/text/Base64.cpp platform/text/BidiContext.cpp @@ -1381,7 +1353,8 @@ SET(WebCore_SOURCES rendering/RenderHTMLCanvas.cpp rendering/RenderIFrame.cpp rendering/RenderImage.cpp - rendering/RenderImageGeneratedContent.cpp + rendering/RenderImageResource.cpp + rendering/RenderImageResourceStyleImage.cpp rendering/RenderIndicator.cpp rendering/RenderInline.cpp rendering/RenderLayer.cpp @@ -1456,14 +1429,6 @@ SET(WebCore_SOURCES storage/DatabaseTask.cpp storage/DatabaseThread.cpp storage/DatabaseTracker.cpp - storage/DirectoryEntry.cpp - storage/DirectoryReader.cpp - storage/DOMFilePath.cpp - storage/DOMFileSystem.cpp - storage/Entry.cpp - storage/EntryArray.cpp - storage/FileEntry.cpp - storage/FileSystemCallbacks.cpp storage/IDBAny.cpp storage/IDBDatabase.cpp storage/IDBDatabaseBackendImpl.cpp @@ -1509,6 +1474,7 @@ SET(WebCore_SOURCES websockets/WebSocketChannel.cpp websockets/WebSocketHandshake.cpp websockets/WebSocketHandshakeRequest.cpp + websockets/WebSocketHandshakeResponse.cpp websockets/WorkerThreadableWebSocketChannel.cpp workers/AbstractWorker.cpp @@ -1555,6 +1521,14 @@ SET(WebCore_SOURCES xml/XSLTUnicodeSort.cpp ) +IF (ENABLE_BLOB) + LIST(APPEND WebCore_SOURCES + fileapi/FileReader.cpp + fileapi/FileThread.cpp + fileapi/FileStreamProxy.cpp + platform/FileStream.cpp + ) +ENDIF () IF (ENABLE_DATABASE) LIST(APPEND WebCore_SOURCES @@ -1567,12 +1541,57 @@ IF (ENABLE_DATABASE) ) ENDIF () +IF (ENABLE_MATHML) + LIST(APPEND WebCore_SOURCES + mathml/MathMLElement.cpp + mathml/MathMLInlineContainerElement.cpp + mathml/MathMLMathElement.cpp + mathml/MathMLTextElement.cpp + mathml/RenderMathMLBlock.cpp + mathml/RenderMathMLFenced.cpp + mathml/RenderMathMLFraction.cpp + mathml/RenderMathMLMath.cpp + mathml/RenderMathMLOperator.cpp + mathml/RenderMathMLRoot.cpp + mathml/RenderMathMLRow.cpp + mathml/RenderMathMLSquareRoot.cpp + mathml/RenderMathMLSubSup.cpp + mathml/RenderMathMLUnderOver.cpp + ) +ENDIF () + +if (ENABLE_FILE_SYSTEM) + LIST(APPEND WebCore_SOURCES + fileapi/DirectoryEntry.cpp + fileapi/DirectoryReader.cpp + fileapi/DOMFilePath.cpp + fileapi/DOMFileSystem.cpp + fileapi/Entry.cpp + fileapi/EntryArray.cpp + fileapi/FileEntry.cpp + fileapi/FileSystemCallbacks.cpp + fileapi/LocalFileSystem.cpp + platform/AsyncFileSystem.cpp + ) + LIST(APPEND WebCore_IDL_FILES + fileapi/DirectoryEntry.idl + fileapi/DirectoryReader.idl + fileapi/DOMFileSystem.idl + fileapi/EntriesCallback.idl + fileapi/Entry.idl + fileapi/EntryArray.idl + fileapi/EntryCallback.idl + fileapi/ErrorCallback.idl + fileapi/FileEntry.idl + fileapi/FileSystemCallback.idl + fileapi/Flags.idl + fileapi/Metadata.idl + fileapi/MetadataCallback.idl + ) +ENDIF () + IF (ENABLE_SVG) LIST(APPEND WebCore_SOURCES - ${DERIVED_SOURCES_DIR}/JSSVGElementWrapperFactory.cpp - ${DERIVED_SOURCES_DIR}/SVGElementFactory.cpp - ${DERIVED_SOURCES_DIR}/SVGNames.cpp - ${DERIVED_SOURCES_DIR}/XLinkNames.cpp bindings/js/JSSVGElementInstanceCustom.cpp bindings/js/JSSVGLengthCustom.cpp bindings/js/JSSVGMatrixCustom.cpp @@ -1813,8 +1832,6 @@ ENDIF() IF (ENABLE_WML) LIST(APPEND WebCore_SOURCES - ${DERIVED_SOURCES_DIR}/WMLElementFactory.cpp - ${DERIVED_SOURCES_DIR}/WMLNames.cpp wml/WMLAElement.cpp wml/WMLAccessElement.cpp wml/WMLAnchorElement.cpp @@ -1872,7 +1889,7 @@ GENERATE_INSPECTOR_FROM_IDL(inspector/Inspector.idl) LIST(APPEND WebCore_SOURCES ${JS_IDL_FILES} ${Inspector_IDL_FILES}) -GENERATE_JSON(${WEBCORE_DIR}/html/HTMLEntityNames.json ${DERIVED_SOURCES_DIR}/HTMLEntityTable.cpp ${WEBCORE_DIR}/../WebKitTools/Scripts/create-html-entity-table) +GENERATE_ENTITIES(${WEBCORE_DIR}/html/parser/HTMLEntityNames.in ${DERIVED_SOURCES_DIR}/HTMLEntityTable.cpp ${WEBCORE_DIR}/html/parser/create-html-entity-table) GENERATE_GPERF(${WEBCORE_DIR}/platform/ColorData.gperf ${DERIVED_SOURCES_DIR}/ColorData.cpp findColor "") @@ -1906,13 +1923,43 @@ ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/css/CSSParser.cpp tokenizer.cpp) ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/html/HTMLTreeBuilder.cpp MathMLNames.cpp) ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/css/CSSStyleSelector.cpp UserAgentStyleSheetsData.cpp UserAgentStyleSheets.h) -GENERATE_DOM_NAMES_FACTORY(HTML ${WEBCORE_DIR}/html/HTMLTagNames.in ${WEBCORE_DIR}/html/HTMLAttributeNames.in "${HTML_FEATURES}") -GENERATE_DOM_NAMES_FACTORY(MathML ${WEBCORE_DIR}/mathml/mathtags.in ${WEBCORE_DIR}/mathml/mathattrs.in "${MATHML_FEATURES}") -GENERATE_DOM_NAMES_FACTORY(SVG ${WEBCORE_DIR}/svg/svgtags.in ${WEBCORE_DIR}/svg/svgattrs.in "${SVG_FEATURES}") -GENERATE_DOM_NAMES_FACTORY(WML ${WEBCORE_DIR}/wml/WMLTagNames.in ${WEBCORE_DIR}/wml/WMLAttributeNames.in "${WML_FEATURES}") -GENERATE_DOM_NAMES_ONLY(XLink ${WEBCORE_DIR}/svg/xlinkattrs.in) -GENERATE_DOM_NAMES_ONLY(XMLNS ${WEBCORE_DIR}/xml/xmlnsattrs.in) -GENERATE_DOM_NAMES_ONLY(XML ${WEBCORE_DIR}/xml/xmlattrs.in) + +GENERATE_DOM_NAMES(HTML ${WEBCORE_DIR}/html/HTMLAttributeNames.in ${WEBCORE_DIR}/html/HTMLTagNames.in "${HTML_FEATURES}") +LIST(APPEND WebCore_SOURCES ${DERIVED_SOURCES_DIR}/HTMLNames.cpp ${DERIVED_SOURCES_DIR}/HTMLElementFactory.cpp ${DERIVED_SOURCES_DIR}/JSHTMLElementWrapperFactory.cpp) + + +GENERATE_DOM_NAMES(MathML ${WEBCORE_DIR}/mathml/mathattrs.in ${WEBCORE_DIR}/mathml/mathtags.in "${MATHML_FEATURES}") +LIST(APPEND WebCore_SOURCES ${DERIVED_SOURCES_DIR}/MathMLNames.cpp) +IF (ENABLE_MATHML) + LIST(APPEND WebCore_SOURCES ${DERIVED_SOURCES_DIR}/MathMLElementFactory.cpp) +ENDIF () + + +GENERATE_DOM_NAMES(SVG ${WEBCORE_DIR}/svg/svgattrs.in ${WEBCORE_DIR}/svg/svgtags.in "${SVG_FEATURES}") +LIST(APPEND WebCore_SOURCES ${DERIVED_SOURCES_DIR}/SVGNames.cpp) +IF (ENABLE_SVG) + LIST(APPEND WebCore_SOURCES ${DERIVED_SOURCES_DIR}/SVGElementFactory.cpp ${DERIVED_SOURCES_DIR}/JSSVGElementWrapperFactory.cpp) +ENDIF () + + +GENERATE_DOM_NAMES(WML ${WEBCORE_DIR}/wml/WMLAttributeNames.in ${WEBCORE_DIR}/wml/WMLTagNames.in "${WML_FEATURES}") +LIST(APPEND WebCore_SOURCES ${DERIVED_SOURCES_DIR}/WMLNames.cpp) +IF (ENABLE_WML) + LIST(APPEND WebCore_SOURCES ${DERIVED_SOURCES_DIR}/WMLElementFactory.cpp) +ENDIF () + + +GENERATE_DOM_NAMES(XLink ${WEBCORE_DIR}/svg/xlinkattrs.in) +LIST(APPEND WebCore_SOURCES ${DERIVED_SOURCES_DIR}/XLinkNames.cpp) + + +GENERATE_DOM_NAMES(XMLNS ${WEBCORE_DIR}/xml/xmlnsattrs.in) +LIST(APPEND WebCore_SOURCES ${DERIVED_SOURCES_DIR}/XMLNSNames.cpp) + + +GENERATE_DOM_NAMES(XML ${WEBCORE_DIR}/xml/xmlattrs.in) +LIST(APPEND WebCore_SOURCES ${DERIVED_SOURCES_DIR}/XMLNames.cpp) + SET(WebCore_LIBRARIES ${JavaScriptCore_LIBRARY_NAME} diff --git a/WebCore/CMakeListsEfl.txt b/WebCore/CMakeListsEfl.txt index b58982d..1741baa 100644 --- a/WebCore/CMakeListsEfl.txt +++ b/WebCore/CMakeListsEfl.txt @@ -95,6 +95,7 @@ IF (WTF_USE_SOUP) platform/network/soup/ResourceHandleSoup.cpp platform/network/soup/ResourceRequestSoup.cpp platform/network/soup/ResourceResponseSoup.cpp + platform/network/soup/SocketStreamHandleSoup.cpp ) ENDIF () @@ -108,6 +109,7 @@ IF (WTF_USE_CURL) platform/network/curl/FormDataStreamCurl.cpp platform/network/curl/ResourceHandleCurl.cpp platform/network/curl/ResourceHandleManager.cpp + platform/network/curl/SocketStreamHandleCurl.cpp ) ENDIF () diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog index 90f722c..32a3cef 100644 --- a/WebCore/ChangeLog +++ b/WebCore/ChangeLog @@ -1,3 +1,7462 @@ +2010-09-02 Anton Muhin <antonm@chromium.org> + + Reviewed by Tony Chang. + + Fix indentation. + https://bugs.webkit.org/show_bug.cgi?id=44678 + + * bindings/scripts/CodeGeneratorV8.pm: + +2010-09-02 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r66655. + http://trac.webkit.org/changeset/66655 + https://bugs.webkit.org/show_bug.cgi?id=45104 + + broke some editing tests (Requested by kling on #webkit). + + * page/DOMSelection.cpp: + (WebCore::DOMSelection::collapse): + (WebCore::DOMSelection::selectAllChildren): + +2010-09-02 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r66649. + http://trac.webkit.org/changeset/66649 + https://bugs.webkit.org/show_bug.cgi?id=45103 + + It broke ~2000 tests on Qt bot (Requested by Ossy on #webkit). + + * dom/Document.cpp: + (WebCore::Document::open): + * dom/DocumentParser.cpp: + (WebCore::DocumentParser::DocumentParser): + (WebCore::DocumentParser::detach): + * dom/DocumentParser.h: + (WebCore::DocumentParser::isDetached): + (WebCore::DocumentParser::stopParsing): + * dom/RawDataDocumentParser.h: + (WebCore::RawDataDocumentParser::finish): + * dom/XMLDocumentParser.cpp: + (WebCore::XMLDocumentParser::append): + (WebCore::XMLDocumentParser::exitText): + * dom/XMLDocumentParserLibxml2.cpp: + (WebCore::XMLDocumentParser::doWrite): + (WebCore::XMLDocumentParser::startElementNs): + (WebCore::XMLDocumentParser::endElementNs): + (WebCore::XMLDocumentParser::characters): + (WebCore::XMLDocumentParser::error): + (WebCore::XMLDocumentParser::processingInstruction): + (WebCore::XMLDocumentParser::cdataBlock): + (WebCore::XMLDocumentParser::comment): + (WebCore::XMLDocumentParser::internalSubset): + (WebCore::XMLDocumentParser::initializeParserContext): + (WebCore::XMLDocumentParser::doEnd): + * dom/XMLDocumentParserQt.cpp: + (WebCore::XMLDocumentParser::initializeParserContext): + (WebCore::XMLDocumentParser::doEnd): + (WebCore::XMLDocumentParser::parse): + * html/parser/HTMLDocumentParser.cpp: + (WebCore::HTMLDocumentParser::pumpTokenizerIfPossible): + (WebCore::HTMLDocumentParser::pumpTokenizer): + (WebCore::HTMLDocumentParser::insert): + (WebCore::HTMLDocumentParser::append): + (WebCore::HTMLDocumentParser::end): + (WebCore::HTMLDocumentParser::attemptToEnd): + (WebCore::HTMLDocumentParser::endIfDelayed): + (WebCore::HTMLDocumentParser::notifyFinished): + * html/parser/HTMLDocumentParser.h: + * html/parser/HTMLScriptRunner.cpp: + (WebCore::HTMLScriptRunner::~HTMLScriptRunner): + (WebCore::HTMLScriptRunner::executeParsingBlockingScript): + (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent): + (WebCore::HTMLScriptRunner::runScript): + * html/parser/HTMLScriptRunner.h: + * loader/ImageDocument.cpp: + (WebCore::ImageDocumentParser::finish): + +2010-09-02 Eric Seidel <eric@webkit.org> + + Reviewed by Dimitri Glazkov. + + Share more code between HTMLObjectElement and HTMLEmbedElement + https://bugs.webkit.org/show_bug.cgi?id=45054 + + This pushes more of HTMLObjectElement code down into + HTMLPlugInImageElement so that it can be shared with + HTMLEmbedElement. + + The most notable changes are: + - HTMLEmbedElement now "delays" updating the widget until + all of its children are parsed (this matches HTMLObjectElement). + However, since HTMLEmbedElement can't have children, this is actually + no delay. + - useFallbackContent is now virtual, allowing HTMLEmbedElement and + HTMLObjectElement to share the same code paths, and the <embed> + case to just always return false for useFallbackContent(). + + This is the final (fourth) part of this change. + + No functional change, thus no tests. + + * html/HTMLEmbedElement.cpp: + * html/HTMLEmbedElement.h: + * html/HTMLObjectElement.cpp: + (WebCore::HTMLObjectElement::rendererIsNeeded): + * html/HTMLObjectElement.h: + * html/HTMLPlugInImageElement.cpp: + (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement): + (WebCore::HTMLPlugInImageElement::recalcStyle): + (WebCore::HTMLPlugInImageElement::attach): + (WebCore::HTMLPlugInImageElement::detach): + (WebCore::HTMLPlugInImageElement::finishParsingChildren): + * html/HTMLPlugInImageElement.h: + +2010-09-02 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Move takeAllChildrenFrom to ContainerNode + https://bugs.webkit.org/show_bug.cgi?id=45066 + + We're going to reuse this method for XMLDocumentLoader, so it's better + to put it in a more general location. + + * dom/ContainerNode.cpp: + (WebCore::ContainerNode::takeAllChildrenFrom): + * dom/ContainerNode.h: + * html/parser/HTMLTreeBuilder.cpp: + (WebCore::HTMLTreeBuilder::FragmentParsingContext::finished): + +2010-09-01 Andreas Kling <andreas.kling@nokia.com> + + Reviewed by Darin Adler. + + DOM Selection: collapse() and selectAllChildren() should throw WRONG_DOCUMENT_ERR if node belongs to other document + https://bugs.webkit.org/show_bug.cgi?id=44595 + + Spec links: + http://www.whatwg.org/specs/web-apps/current-work/#dom-selection-collapse + http://www.whatwg.org/specs/web-apps/current-work/#dom-selection-selectallchildren + + Test: fast/dom/Selection/wrong-document-err.html + + * page/DOMSelection.cpp: + (WebCore::DOMSelection::collapse): + (WebCore::DOMSelection::selectAllChildren): + +2010-09-02 Eric Seidel <eric@webkit.org> + + Reviewed by Dimitri Glazkov. + + Share more code between HTMLObjectElement and HTMLEmbedElement + https://bugs.webkit.org/show_bug.cgi?id=45054 + + This pushes more of HTMLObjectElement code down into + HTMLPlugInImageElement so that it can be shared with HTMLEmbedElement. + + This patch was originally written in one piece and reviewed by Dimitri. + I'm landing it as four separate changes for easier readability and less + chance of regression. + + No functional change, thus no tests. + + * html/HTMLEmbedElement.cpp: + (WebCore::HTMLEmbedElement::HTMLEmbedElement): + (WebCore::HTMLEmbedElement::create): + * html/HTMLEmbedElement.h: + * html/HTMLObjectElement.cpp: + (WebCore::HTMLObjectElement::HTMLObjectElement): + * html/HTMLObjectElement.h: + * html/HTMLPlugInImageElement.cpp: + (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement): + (WebCore::HTMLPlugInImageElement::detach): + (WebCore::HTMLPlugInImageElement::finishParsingChildren): + * html/HTMLPlugInImageElement.h: + * html/HTMLTagNames.in: + +2010-09-02 Eric Seidel <eric@webkit.org> + + Reviewed by Dimitri Glazkov. + + Share more code between HTMLObjectElement and HTMLEmbedElement + https://bugs.webkit.org/show_bug.cgi?id=45054 + + This pushes more of HTMLObjectElement code down into + HTMLPlugInImageElement so that it can be shared with HTMLEmbedElement. + + I also moved a little code from HTMLPluginElement to HTMLPlugInImageElement + since HTMLAppletElement does not need to share this same widget update logic. + This is a small correction from the previous change. + + This patch was originally written in one piece and reviewed by Dimitri. + I'm landing it as three separate changes for easier readability and less + chance of regression. + + No functional change, thus no tests. + + * html/HTMLEmbedElement.cpp: + * html/HTMLEmbedElement.h: + * html/HTMLObjectElement.cpp: + (WebCore::HTMLObjectElement::attach): + (WebCore::HTMLObjectElement::finishParsingChildren): + (WebCore::HTMLObjectElement::detach): + (WebCore::HTMLObjectElement::recalcStyle): + (WebCore::HTMLObjectElement::childrenChanged): + (WebCore::HTMLObjectElement::renderFallbackContent): + * html/HTMLObjectElement.h: + (WebCore::HTMLObjectElement::useFallbackContent): + * html/HTMLPlugInElement.cpp: + * html/HTMLPlugInElement.h: + * html/HTMLPlugInImageElement.cpp: + (WebCore::HTMLPlugInImageElement::createRenderer): + (WebCore::HTMLPlugInImageElement::updateWidget): + (WebCore::HTMLPlugInImageElement::updateWidgetCallback): + * html/HTMLPlugInImageElement.h: + (WebCore::HTMLPlugInImageElement::canLazyAttach): + (WebCore::HTMLPlugInImageElement::useFallbackContent): + +2010-09-02 Jer Noble <jer.noble@apple.com> + + Reviewed by Darin Adler. + + WebKit should not accept PDFs as video. + https://bugs.webkit.org/show_bug.cgi?id=45013 + + The code in MediaPlayerPrivate::createQTMovie has been re-arranged. + First, the component disabling is done only once. In 64-bit QTKit will + store the list of disabled components and disable them once QTKitServer + starts, so there is no need to disable them repeatedly. However, + because of a bug in 64-bit QTKit, additional requests of the exact same + component description will be ignored if QTKitServer is not yet running. + To work around this, we must provide the exact component flags for each + eat/PDF and grip/PDF component we wish to disable. + + * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: + (WebCore::disableComponentsOnce): Added. + (WebCore::MediaPlayerPrivate::createQTMovie): Moved the component + disabling code into disableComponentsOnce. + +2010-09-02 Philippe Normand <pnormand@igalia.com> + + Unreviewed, GTK build fix. + + * platform/graphics/gstreamer/GStreamerGWorld.cpp: + (WebCore::GStreamerGWorld::enterFullscreen): + +2010-09-02 Eric Seidel <eric@webkit.org> + + Reviewed by Dimitri Glazkov. + + Share more code between HTMLObjectElement and HTMLEmbedElement + https://bugs.webkit.org/show_bug.cgi?id=45054 + + This pushes more of HTMLObjectElement code down into + HTMLPlugInImageElement so that it can be shared with HTMLEmbedElement. + + I also moved a little code from HTMLPluginElement to HTMLPlugInImageElement + since HTMLAppletElement does not need to share this same widget update logic. + This is a small correction from the previous change. + + This patch was originally written in one piece and reviewed by Dimitri. + I'm landing it as two separate changes for easier readability and less + chance of regression. + + No functional change, thus no tests. + + * html/HTMLEmbedElement.cpp: + (WebCore::HTMLEmbedElement::HTMLEmbedElement): + (WebCore::HTMLEmbedElement::mapToEntry): + (WebCore::HTMLEmbedElement::parseMappedAttribute): + (WebCore::HTMLEmbedElement::rendererIsNeeded): + (WebCore::HTMLEmbedElement::attach): + (WebCore::HTMLEmbedElement::updateWidget): + (WebCore::HTMLEmbedElement::insertedIntoDocument): + (WebCore::HTMLEmbedElement::removedFromDocument): + (WebCore::HTMLEmbedElement::attributeChanged): + * html/HTMLEmbedElement.h: + * html/HTMLObjectElement.cpp: + (WebCore::HTMLObjectElement::HTMLObjectElement): + (WebCore::HTMLObjectElement::parseMappedAttribute): + (WebCore::HTMLObjectElement::rendererIsNeeded): + (WebCore::HTMLObjectElement::attach): + (WebCore::HTMLObjectElement::updateWidget): + (WebCore::HTMLObjectElement::finishParsingChildren): + (WebCore::HTMLObjectElement::detach): + (WebCore::HTMLObjectElement::insertedIntoDocument): + (WebCore::HTMLObjectElement::removedFromDocument): + (WebCore::HTMLObjectElement::recalcStyle): + (WebCore::HTMLObjectElement::childrenChanged): + (WebCore::HTMLObjectElement::renderFallbackContent): + * html/HTMLObjectElement.h: + * html/HTMLPlugInElement.cpp: + * html/HTMLPlugInElement.h: + * html/HTMLPlugInImageElement.cpp: + (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement): + (WebCore::HTMLPlugInImageElement::renderEmbeddedObject): + * html/HTMLPlugInImageElement.h: + (WebCore::HTMLPlugInImageElement::needsWidgetUpdate): + (WebCore::HTMLPlugInImageElement::setNeedsWidgetUpdate): + * loader/SubframeLoader.cpp: + (WebCore::SubframeLoader::requestObject): + (WebCore::SubframeLoader::loadPlugin): + * loader/SubframeLoader.h: + * rendering/RenderEmbeddedObject.cpp: + (WebCore::updateWidgetForObjectElement): + (WebCore::updateWidgetForEmbedElement): + +2010-09-02 Tony Gentilcore <tonyg@chromium.org> + + Reviewed by Adam Barth. + + Support <script defer> as specified by HTML5 + https://bugs.webkit.org/show_bug.cgi?id=40934 + + Tests: fast/dom/HTMLScriptElement/defer-double-defer-write.html + fast/dom/HTMLScriptElement/defer-double-write.html + fast/dom/HTMLScriptElement/defer-inline-script.html + fast/dom/HTMLScriptElement/defer-onbeforeload.html + fast/dom/HTMLScriptElement/defer-script-invalid-url.html + fast/dom/HTMLScriptElement/defer-write.html + fast/dom/HTMLScriptElement/two-defer-writes.html + http/tests/misc/script-defer-after-slow-stylesheet.html + http/tests/misc/script-defer.html + + * dom/Document.cpp: + (WebCore::Document::open): Allow implicit open for writes() while executing deferred scripts. + * dom/DocumentParser.cpp: + (WebCore::DocumentParser::DocumentParser): + (WebCore::DocumentParser::startParsing): + (WebCore::DocumentParser::prepareToStopParsing): If called when stopped or detached, it shouldn't reset to stopping. + (WebCore::DocumentParser::stopParsing): + (WebCore::DocumentParser::detach): + * dom/DocumentParser.h: + (WebCore::DocumentParser::isParsing): + (WebCore::DocumentParser::isActive): + (WebCore::DocumentParser::isStopping): + (WebCore::DocumentParser::isDetached): + * dom/RawDataDocumentParser.h: + (WebCore::RawDataDocumentParser::finish): + * dom/XMLDocumentParser.cpp: + (WebCore::XMLDocumentParser::append): + (WebCore::XMLDocumentParser::exitText): + * dom/XMLDocumentParserLibxml2.cpp: + (WebCore::XMLDocumentParser::doWrite): + (WebCore::XMLDocumentParser::startElementNs): + (WebCore::XMLDocumentParser::endElementNs): + (WebCore::XMLDocumentParser::characters): + (WebCore::XMLDocumentParser::error): + (WebCore::XMLDocumentParser::processingInstruction): + (WebCore::XMLDocumentParser::cdataBlock): + (WebCore::XMLDocumentParser::comment): + (WebCore::XMLDocumentParser::internalSubset): + (WebCore::XMLDocumentParser::initializeParserContext): + (WebCore::XMLDocumentParser::doEnd): + * html/parser/HTMLDocumentParser.cpp: + (WebCore::HTMLDocumentParser::prepareToStopParsing): + (WebCore::HTMLDocumentParser::pumpTokenizerIfPossible): + (WebCore::HTMLDocumentParser::pumpTokenizer): + (WebCore::HTMLDocumentParser::insert): + (WebCore::HTMLDocumentParser::append): + (WebCore::HTMLDocumentParser::end): + (WebCore::HTMLDocumentParser::attemptToEnd): + (WebCore::HTMLDocumentParser::endIfDelayed): + (WebCore::HTMLDocumentParser::notifyFinished): + * html/parser/HTMLDocumentParser.h: + * html/parser/HTMLScriptRunner.cpp: + (WebCore::HTMLScriptRunner::~HTMLScriptRunner): + (WebCore::HTMLScriptRunner::executeParsingBlockingScript): + (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent): + (WebCore::HTMLScriptRunner::executeScriptsWaitingForParsing): + (WebCore::HTMLScriptRunner::requestDeferredScript): + (WebCore::HTMLScriptRunner::runScript): + * html/parser/HTMLScriptRunner.h: + * loader/ImageDocument.cpp: + (WebCore::ImageDocumentParser::finish): + +2010-09-02 Ilya Sherman <isherman@google.com> + + Reviewed by Eric Seidel. + + Decompose computing an element's inherited language, expose this + capability to clients (in particular, for Chromium). + https://bugs.webkit.org/show_bug.cgi?id=44803 + + No new tests -- just refactoring + exposing code. + + * css/CSSStyleSelector.cpp: + (WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector): + * dom/Element.cpp: + (WebCore::Element::computeInheritedLang): + * dom/Element.h: + +2010-08-31 Philippe Normand <pnormand@igalia.com> + + Reviewed by Eric Carlson. + + [GStreamer] can't play m4v videos + https://bugs.webkit.org/show_bug.cgi?id=44951 + + Fixed registration of the m4v media type in the hashtable used by + the player to report if it supports a given media type. + + Test: media/media-can-play-mpeg4-video.html + + * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: + (WebCore::mimeTypeCache): + +2010-09-01 Philippe Normand <pnormand@igalia.com> + + Reviewed by Martin Robinson. + + [GTK] warning: unused variable "queryResult" + https://bugs.webkit.org/show_bug.cgi?id=44998 + + Fix the misbehavior introduced in r66573. The gst_element_query() + call needs to be done whatever the GStreamer version used. + + * platform/graphics/gstreamer/GStreamerGWorld.cpp: + (WebCore::GStreamerGWorld::enterFullscreen): + +2010-09-01 Jia Pu <jpu@apple.com> + + Reviewed by Dan Bernstein. + + Add support for autocorrection UI on Mac OS X. + https://bugs.webkit.org/show_bug.cgi?id=44958 + <rdar://problem/7326847> + + Several new member methods are added to EditorClient for communication + between WebCore and WebKit. A new handler, executeCancelOperation(), is + added to EditorCommand.cpp so that WebCore can intercept the ESC key event + to dismiss autocorrection UI. A new DocumentMarker value, RejectedCorrection, + is added to keep track of the corrections that user has rejected, so that it + will not be suggested again later. The autocorrection is driven by a timer. + Every time the editor inserts a new letter, the timer is reset. If the timer + fires, it means neither has user entered any new letter for current word, nor + has he entered whitespace or punctuation to complete the word. In this case, + we query for autocorrection. + + * WebCore.exp.in: Updated + + * dom/DocumentMarker.h: Added RejectedCorrection to indicate word on which user + has rejected autocorrection. + + * editing/Editor.cpp: + (WebCore::Editor::Editor): Initialize autocorrection timer. + (WebCore::Editor::~Editor): Make sure autocorrection UI is dismissed before + destroying Editor object. + (WebCore::Editor::markMisspellingsAfterTypingToPosition): Adopted new signature + of markAllMisspellingsAndBadGrammarInRanges(). + (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): Consolidated all + boolean arguments into one bitfield. This improves readability and allows us to + pass in a bit to indicate whether we want to show autocorrection UI. Also added + code to show autocorrection UI if it is necessary. + (WebCore::Editor::markMisspellingsAndBadGrammar): Adopted new signature of + markAllMisspellingsAndBadGrammarInRanges(). + (WebCore::Editor::correctionPanelTimerFired): Check to see if we should show + autocorrection UI when user pauses during typing. + (WebCore::Editor::handleRejectedCorrection): Update user dictionary when an autocorrection is rejected. + (WebCore::Editor::startCorrectionPanelTimer): Start autocorrection timer. + (WebCore::Editor::handleCancelOperation): Dismiss autocorrection UI when ESC key is pressed. + + * editing/Editor.h: Added autocorrection related member methods and variables. + + * editing/EditorCommand.cpp: + (WebCore::executeCancelOperation): Handle ESC key event. Dismiss autocorrection UI. + (WebCore::createCommandMap): Updated for executeCancelOperation(). + + * editing/TypingCommand.cpp: + (WebCore::TypingCommand::markMisspellingsAfterTyping): Reset autocorrection timer after insertion. + + * loader/EmptyClients.h: + (WebCore::EmptyEditorClient::showCorrectionPanel): Dummy implementation. + (WebCore::EmptyEditorClient::dismissCorrectionPanel): Ditto + + * page/EditorClient.h: Added methods for communication between WebCore and WebKit regarding autocorrection. + + * page/Frame.cpp: + (WebCore::Frame::respondToChangedSelection): Remove Replacement marker where we used to only remove Spelling + mark, because whenever we need to remove spelling underline we also should remove autocorrection underline. + + * platform/graphics/GraphicsContext.h: Added enum TextCheckingLineStyle to specify the underline + for different type of text checking result. Replaced drawLineForMisspellingOrBadGrammar() with + drawLineForTextChecking(), which allows autocorrection to have different indication from misspelling + and grammatical error. + + * platform/graphics/cairo/GraphicsContextCairo.cpp: + (WebCore::GraphicsContext::drawLineForTextChecking): Replaced drawLineForMisspellingOrBadGrammar() with drawLineForTextChecking(). + + * platform/graphics/haiku/GraphicsContextHaiku.cpp: + (WebCore::GraphicsContext::drawLineForTextChecking): Ditto + + * platform/graphics/mac/GraphicsContextMac.mm: + (WebCore::GraphicsContext::drawLineForTextChecking): Ditto + + * platform/graphics/openvg/GraphicsContextOpenVG.cpp: + (WebCore::GraphicsContext::drawLineForTextChecking): Ditto + + * platform/graphics/qt/GraphicsContextQt.cpp: + (WebCore::GraphicsContext::drawLineForTextChecking): Ditto + + * platform/graphics/skia/GraphicsContextSkia.cpp: + (WebCore::GraphicsContext::drawLineForTextChecking): Ditto + + * platform/graphics/win/GraphicsContextCGWin.cpp: + (WebCore::GraphicsContext::drawLineForTextChecking): Ditto + + * platform/graphics/wince/GraphicsContextWince.cpp: + (WebCore::GraphicsContext::drawLineForTextChecking): Ditto + + * platform/graphics/wx/GraphicsContextWx.cpp: + (WebCore::GraphicsContext::drawLineForTextChecking): Ditto + + * rendering/InlineTextBox.cpp: + (WebCore::textCheckingLineStyleForMarkerType): Return line style for a given document marker type. + (WebCore::InlineTextBox::paintSpellingOrGrammarMarker): Replaced drawLineForMisspellingOrBadGrammar() with drawLineForTextChecking(). + (WebCore::InlineTextBox::paintDocumentMarkers): Handle new marker value, RejectedCorrection. + +2010-09-01 Kinuko Yasuda <kinuko@google.com> + + Reviewed by Adam Barth. + + [V8] Support readonly Date attribute + https://bugs.webkit.org/show_bug.cgi?id=43943 + + Adds Date to non_wrapper_types in CodeGeneratorV8.pm. + + New tests will be added for Metadata when we add FileSystem implementation. + + * bindings/scripts/CodeGeneratorV8.pm: + * fileapi/Metadata.h: + * fileapi/Metadata.idl: + +2010-09-01 Mihai Parparita <mihaip@chromium.org> + + Reviewed by Chris Marrin. + + animations/suspend-resume-animation.html does not pass when accelerated compositing is off + https://bugs.webkit.org/show_bug.cgi?id=45057 + + Fix incorrect logic when resuming the animation (KeyframeAnimation::startAnimation + and RenderLayerBacking::startAnimation return true when running an accelerated + animation). + + * page/animation/AnimationBase.cpp: + (WebCore::AnimationBase::updateStateMachine): + +2010-09-01 Eric Carlson <eric.carlson@apple.com> + + Reviewed by Darin Adler. + + Question mark QuickTime icon when navigating to this MP3 file + https://bugs.webkit.org/show_bug.cgi?id=44846 + + Do not disable 'tmet' movie tracks, they carry meta data. + + No DRT test because I am not sure it is possible to have one of these tracks in + non-streaming movie. I will add a test later if I figure out how to create a movie. + + * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: + (WebCore::MediaPlayerPrivate::disableUnsupportedTracks): + +2010-09-01 Eric Seidel <eric@webkit.org> + + Reviewed by Dimitri Glazkov. + + Remove rendering types from SubframeLoader and split RenderEmbeddedObject::updateWidget in preparation for moving to DOM + https://bugs.webkit.org/show_bug.cgi?id=45007 + + This is just moving around code (and attempting to make it more sane). + I also tried to use more specific types where possible. + The SubframeLoader no longer uses any rendering types in its API. + + I split RenderEmbeddedObject::updateWidget into a bunch of functions. + It was obvious before, but now super-obvious after the split that these + new functions do not belong in RenderEmbeddedObject. Instead they + need to be moved to their respective DOM classes. I've added FIXMEs + next to each of the functions which should be moved, but I've not moved + any of the logic out of RenderEmbeddedObject.cpp yet in an effort to + keep this patch as simple as possible. + + No functional change, thus no tests. + + * html/HTMLEmbedElement.cpp: + (WebCore::HTMLEmbedElement::updateWidget): + * html/HTMLFrameElementBase.cpp: + (WebCore::HTMLFrameElementBase::attach): + (WebCore::HTMLFrameElementBase::width): + (WebCore::HTMLFrameElementBase::height): + * html/HTMLFrameOwnerElement.cpp: + (WebCore::HTMLFrameOwnerElement::renderPart): + * html/HTMLFrameOwnerElement.h: + * html/HTMLObjectElement.cpp: + (WebCore::HTMLObjectElement::renderWidgetForJSBindings): + (WebCore::HTMLObjectElement::createRenderer): + (WebCore::HTMLObjectElement::updateWidget): + * html/HTMLPlugInElement.cpp: + (WebCore::HTMLPlugInElement::renderEmbeddedObject): + * html/HTMLPlugInElement.h: + * loader/PluginDocument.cpp: + (WebCore::PluginDocumentParser::appendBytes): + * loader/SubframeLoader.cpp: + (WebCore::SubframeLoader::requestObject): + (WebCore::SubframeLoader::document): + (WebCore::SubframeLoader::loadPlugin): + * loader/SubframeLoader.h: + * rendering/RenderEmbeddedObject.cpp: + (WebCore::isNetscapePlugin): + (WebCore::hasFallbackContent): + (WebCore::parametersFromObject): + (WebCore::updateWidgetForObjectElement): + (WebCore::parametersFromEmbed): + (WebCore::updateWidgetForEmbedElement): + (WebCore::updateWidgetForMediaElement): + (WebCore::RenderEmbeddedObject::updateWidget): + * rendering/RenderEmbeddedObject.h: + (WebCore::RenderEmbeddedObject::setHasFallbackContent): + * rendering/RenderLayerCompositor.h: + +2010-09-01 Kinuko Yasuda <kinuko@chromium.org> + + Reviewed by Jian Li. + + Add more FileError and FileException code for FileWriter and FileSystem API + https://bugs.webkit.org/show_bug.cgi?id=45048 + + Adding SYNTAX_ERR for FileWriter. + http://dev.w3.org/2009/dap/file-system/file-writer.html + + Adding INVALID_STATE_ERR, INVALID_MODIFICATION_ERR and QUOTA_EXCEEDED_ERR for FileSystem. + http://dev.w3.org/2009/dap/file-system/file-dir-sys.html + + Adding NO_MODIFICATION_ALLOWED_ERR (to FileException) for both. + + * fileapi/FileError.idl: + * fileapi/FileException.idl: + +2010-09-01 Mihai Parparita <mihaip@chromium.org> + + Reviewed by Brady Eidson. + + popstate event is not fired until document opts in by calling pushstate. + https://bugs.webkit.org/show_bug.cgi?id=41372 + + Fire popstate even when we don't have a state object when a page is + loaded (for both regular loads and those from the page cache). Also + fire popstate when doing in-document navigation via fragment changes. + This is consistent with both Gecko and recent the HTML5 spec change: + http://html5.org/tools/web-apps-tracker?from=5376&to=5377 + + Tests: fast/loader/stateobjects/popstate-fires-on-history-traversal.html + fast/loader/stateobjects/popstate-fires-with-page-cache.html + + * bindings/js/SerializedScriptValue.cpp: + * bindings/js/SerializedScriptValue.h: + (WebCore::SerializedScriptValue::create): + * bindings/v8/SerializedScriptValue.cpp: + * bindings/v8/SerializedScriptValue.h: + * dom/Document.cpp: + (WebCore::Document::implicitClose): + * dom/Document.h: + * history/CachedFrame.cpp: + (WebCore::CachedFrameBase::restore): + * loader/FrameLoader.cpp: + (WebCore::FrameLoader::loadInSameDocument): + (WebCore::FrameLoader::transitionToCommitted): + * loader/HistoryController.cpp: + (WebCore::HistoryController::pushState): + (WebCore::HistoryController::replaceState): + +2010-09-01 Ryosuke Niwa <rniwa@webkit.org> + + Reviewed by Dimitri Glazkov. + + REGRESSION(r66431): WebCore::Editor::selectionStartCSSPropertyValue crashes if no background color is specified + https://bugs.webkit.org/show_bug.cgi?id=45068 + + The crash was caused by the assumption that every node has an ancestor with some background color, + which was obviously false. Fixed this by adding a null for ancestor. + + Test: editing/execCommand/backcolor-crash.html + + * editing/Editor.cpp: + (WebCore::Editor::selectionStartCSSPropertyValue): + +2010-08-31 Jer Noble <jer.noble@apple.com> + + Reviewed by Darin Adler. + + WebKit should not accept PDFs as video. + https://bugs.webkit.org/show_bug.cgi?id=45013 + + QuickTime will accept a PDF as the source for a movie, and happily + convert that PDF into a .mov. WebKit should disable the eat and grip + PDF components which allow this. + + Test: http/tests/media/pdf-served-as-pdf.html + + * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: + (WebCore::MediaPlayerPrivate::createQTMovie): Add PDF eat and grip + components to the components which are disabled before opening a + QTMovie. + +2010-09-01 Rob Buis <rwlbuis@gmail.com> + + Reviewed by Darin Adler. + + Support for Percentage Values in border-radius + https://bugs.webkit.org/show_bug.cgi?id=38354 + + Support percentage values on the border-radius family + of CSS properties. + + * css/CSSComputedStyleDeclaration.cpp: + (WebCore::getBorderRadiusCornerValue): + * css/CSSParser.cpp: + (WebCore::CSSParser::parseValue): + (WebCore::CSSParser::parseBorderRadius): + * css/CSSPrimitiveValue.cpp: + * css/CSSStyleSelector.cpp: + (WebCore::CSSStyleSelector::applyProperty): + * page/animation/AnimationBase.cpp: + (WebCore::AnimationBase::ensurePropertyMap): + * platform/Length.h: + * rendering/RenderObject.cpp: + (WebCore::RenderObject::repaintAfterLayoutIfNeeded): + * rendering/style/BorderData.h: + (WebCore::BorderData::BorderData): + (WebCore::BorderData::hasBorderRadius): + (WebCore::BorderData::topLeft): + (WebCore::BorderData::topRight): + (WebCore::BorderData::bottomLeft): + (WebCore::BorderData::bottomRight): + * rendering/style/RenderStyle.cpp: + (WebCore::RenderStyle::getBorderRadiiForRect): + (WebCore::RenderStyle::getInnerBorderRadiiForRectWithBorderWidths): + * rendering/style/RenderStyle.h: + (WebCore::InheritedFlags::borderTopLeftRadius): + (WebCore::InheritedFlags::borderTopRightRadius): + (WebCore::InheritedFlags::borderBottomLeftRadius): + (WebCore::InheritedFlags::borderBottomRightRadius): + (WebCore::InheritedFlags::setBorderTopLeftRadius): + (WebCore::InheritedFlags::setBorderTopRightRadius): + (WebCore::InheritedFlags::setBorderBottomLeftRadius): + (WebCore::InheritedFlags::setBorderBottomRightRadius): + (WebCore::InheritedFlags::setBorderRadius): + (WebCore::InheritedFlags::initialBorderRadius): + +2010-09-01 Andrey Kosyakov <caseq@chromium.org> + + Reviewed by Yury Semikhatsky. + + Web Inspector: webInspector.inspectedWindow.evaluate() should not fail if not passed callback. + https://bugs.webkit.org/show_bug.cgi?id=45037 + + * inspector/front-end/ExtensionAPI.js: + (WebInspector.injectedExtensionAPI.InspectedWindow.prototype.evaluate): + +2010-09-01 Dave Hyatt <hyatt@apple.com> + + Reviewed by Dan Bernstein and Simon Fraser. + + https://bugs.webkit.org/show_bug.cgi?id=44963, overhanging floats aren't positioned properly when they occur + in multi-column layout. Don't let floats overhang in multi-column blocks, since they are part of the column layout. + + fast/multicol/float-pagination-failure now succeeds, so will rename and move it. + + * rendering/RenderBlock.cpp: + (WebCore::RenderBlock::addOverhangingFloats): + +2010-08-31 Kenneth Russell <kbr@google.com> + + Reviewed by Simon Fraser. + + Add helpers to FloatRect to compute bounding box from points + https://bugs.webkit.org/show_bug.cgi?id=45015 + + Added fitToPoints, including a few overloaded variants for the + cases of two, three and four points. I opted not to add a + generalized version taking const FloatRect* or Vector<FloatRect> + at the present time because for my own purposes they are + unnecessary, and the specific versions can be more tightly coded. + Also added left() and top() for symmetry with right() and bottom(). + These changes have been tested with new code to be added later. + + * platform/graphics/FloatRect.cpp: + (WebCore::FloatRect::intersect): + (WebCore::FloatRect::unite): + (WebCore::FloatRect::fitToPoints): + * platform/graphics/FloatRect.h: + (WebCore::FloatRect::left): + (WebCore::FloatRect::top): + (WebCore::FloatRect::setLocationAndSizeFromEdges): + +2010-09-01 Anton Muhin <antonm@chromium.org> + + Reviewed by Dimitri Glazkov. + + [v8] Use Vector and DEFINE_STATIC_LOCAL instead of plain static array. + https://bugs.webkit.org/show_bug.cgi?id=45040 + + By code guidelines all the statics should be wrapped into appropriate macro. + + * bindings/v8/V8Binding.cpp: + (WebCore::int32ToWebCoreString): + +2010-09-01 Alejandro G. Castro <alex@igalia.com> + + Reviewed by Martin Robinson. + + [Gtk] very slow page scrolling on big -webkit-box-shadow areas + https://bugs.webkit.org/show_bug.cgi?id=39582 + + Add a new drawTiledShadow method to render a big shadow doing + tiling of parts of a smaller shadow. We create the minimum shadow + required to get the tiles we will use to render the real shadow + and we use drawPattern with those tiles to create the shadow. + + * platform/graphics/GraphicsContext.h: + * platform/graphics/cairo/FontCairo.cpp: + (WebCore::Font::drawGlyphs): + * platform/graphics/cairo/GraphicsContextCairo.cpp: + (WebCore::drawPathShadow): + (WebCore::drawBorderlessRectShadow): + (WebCore::GraphicsContext::fillRect): + (WebCore::GraphicsContext::applyPlatformShadow): + (WebCore::GraphicsContext::createShadowMask): + (WebCore::getPhase): + (WebCore::GraphicsContext::drawTiledShadow): + (WebCore::GraphicsContext::fillRoundedRect): + * platform/graphics/cairo/ImageCairo.cpp: + (WebCore::BitmapImage::draw): + +2010-09-01 Andrey Kosyakov <caseq@chromium.org> + + Reviewed by Yury Semikhatsky. + + Web Inspector, Extension API: Panel.onSelectionChanged event is never fired + Added command line API to the lexical context of code evaluated by webInspector.inspectedWindow.evaluate() + Fixed webInspector.inspectedWindow.evaluate() to return object rather than its stringified representation + https://bugs.webkit.org/show_bug.cgi?id=44957 + + Test: inspector/extensions-eval.html + + * inspector/front-end/ExtensionAPI.js: + (WebInspector.injectedExtensionAPI.InspectedWindow.prototype.evaluate): + * inspector/front-end/ExtensionServer.js: + (WebInspector.ExtensionServer.prototype._onEvaluateOnInspectedPage): + +2010-08-27 Philippe Normand <pnormand@igalia.com> + + Reviewed by Xan Lopez. + + [GStreamer] ImageGStreamer doesn't need to hold a Cairo surface + https://bugs.webkit.org/show_bug.cgi?id=44757 + + Pass the cairo surface to the BitmapImage constructor which will + handle its life-cycle. + + * platform/graphics/gstreamer/ImageGStreamer.h: + * platform/graphics/gstreamer/ImageGStreamerCairo.cpp: + (ImageGStreamer::ImageGStreamer): + (ImageGStreamer::~ImageGStreamer): + +2010-08-30 Patrick Gansterer <paroga@paroga.com> + + Reviewed by Dirk Schulze. + + RenderImage::imageChanged invalidates wrong area + https://bugs.webkit.org/show_bug.cgi?id=43779 + + Remove RenderImage inheritance from RenderSVGImage, it now inherits from RenderSVGModelObject. + + * rendering/RenderSVGImage.cpp: + (WebCore::RenderSVGImage::RenderSVGImage): + (WebCore::RenderSVGImage::~RenderSVGImage): + (WebCore::RenderSVGImage::layout): + (WebCore::RenderSVGImage::paint): + (WebCore::RenderSVGImage::imageChanged): + * rendering/RenderSVGImage.h: + (WebCore::RenderSVGImage::imageResource): + * rendering/RenderSVGModelObject.h: + * svg/SVGImageElement.cpp: + +2010-09-01 Nikolas Zimmermann <nzimmermann@rim.com> + + Reviewed by Dirk Schulze. + + Add culling to RenderSVGContainer + https://bugs.webkit.org/show_bug.cgi?id=44896 + + Cache object/strokeBoundingBox and repaintRectInLocalCoordinates() in RenderSVGContainer & RenderSVGRoot, just like it's done in RenderPath. + Propagate boundary changes up the render tree, in layout phase, in order to notify parents that they should update their cached boundaries. + + This is a huge speed benefit when interacting with an already layouted document, as there's no need anymore to traverse all children + of any container or <svg> element, just to retrieve the repaint rect. + + * rendering/RenderForeignObject.cpp: + (WebCore::RenderForeignObject::layout): Propagate boundary changes to parent, if neeeded. + * rendering/RenderObject.cpp: + (WebCore::RenderObject::setNeedsBoundariesUpdate): Ditto. + * rendering/RenderObject.h: + * rendering/RenderObjectChildList.cpp: + (WebCore::RenderObjectChildList::removeChildNode): Ditto. + * rendering/RenderPath.cpp: + (WebCore::RenderPath::layout): Ditto. + (WebCore::RenderPath::paint): Use new helper function to intersect the paintInfo.rect with the repaintRectInLocalCoordinates(). + * rendering/RenderPath.h: Remove styleWillChange(), it's in RenderSVGModelObject now. + (WebCore::RenderPath::setNeedsBoundariesUpdate): Mark as virtual, just like in RenderObject. + * rendering/RenderSVGContainer.cpp: + (WebCore::RenderSVGContainer::RenderSVGContainer): Initialize m_needsBoundariesUpdate to true. + (WebCore::RenderSVGContainer::layout): Only update cached boundaries, if needed, once by traversing the child tree. + (WebCore::RenderSVGContainer::paint): Use new helper function to intersect the paintInfo.rect with the repaintRectInLocalCoordinates(). + (WebCore::RenderSVGContainer::updateCachedBoundaries): Ask children for their boundaries, and cache them. + * rendering/RenderSVGContainer.h: + (WebCore::RenderSVGContainer::setNeedsBoundariesUpdate): Set m_needsBoundariesUpdate when called. + (WebCore::RenderSVGContainer::objectBoundingBox): Inlined, just returns a member variable now. + (WebCore::RenderSVGContainer::strokeBoundingBox): Ditto. + (WebCore::RenderSVGContainer::repaintRectInLocalCoordinates): Ditto. + (WebCore::RenderSVGContainer::calculateLocalTransform): Changed to return a boolean, wheter the transform was modified. + * rendering/RenderSVGGradientStop.h: + (WebCore::RenderSVGGradientStop::strokeBoundingBox): Add missing default implementation, return just FloatRect(). + * rendering/RenderSVGHiddenContainer.cpp: Remove repaintRectInLocalCoordinates() override, it's now needed for painting markers. + * rendering/RenderSVGHiddenContainer.h: + (WebCore::RenderSVGHiddenContainer::clippedOverflowRectForRepaint): Inlined, returning IntRect(). + * rendering/RenderSVGImage.cpp: + (WebCore::RenderSVGImage::layout): Propagate boundary changes to parent, if neeeded. + * rendering/RenderSVGRoot.cpp: Cache boundaries here as well, just like in RenderSVGContainer. + (WebCore::RenderSVGRoot::RenderSVGRoot): + (WebCore::RenderSVGRoot::layout): + (WebCore::RenderSVGRoot::updateCachedBoundaries): + * rendering/RenderSVGRoot.h: + (WebCore::RenderSVGRoot::setNeedsBoundariesUpdate): + (WebCore::RenderSVGRoot::setNeedsTransformUpdate): + (WebCore::RenderSVGRoot::objectBoundingBox): + (WebCore::RenderSVGRoot::strokeBoundingBox): + (WebCore::RenderSVGRoot::repaintRectInLocalCoordinates): + * rendering/RenderSVGText.cpp: + (WebCore::RenderSVGText::layout): Propagate boundary changes to parent, if neeeded. + * rendering/RenderSVGTransformableContainer.cpp: + (WebCore::RenderSVGTransformableContainer::calculateLocalTransform): Return true, if the localTransform changed. + * rendering/RenderSVGTransformableContainer.h: + * rendering/RenderSVGViewportContainer.cpp: + (WebCore::RenderSVGViewportContainer::calcViewport): Propagate boundary changes to parent, if neeeded. + * rendering/SVGRenderSupport.cpp: + (WebCore::SVGRenderSupport::computeContainerBoundingBoxes): Helper function calculating object/strokeBoundingBox and repaintRectInLocalCoordinates in one shot. + (WebCore::SVGRenderSupport::paintInfoIntersectsRepaintRect): Moved from RenderPath to share the culling functionality. + * rendering/SVGRenderSupport.h: + +2010-09-01 Mahesh Kulkarni <mahesh.kulkarni@nokia.com> + + Reviewed by Laszlo Gombos. + + [Qt] QWebPage::allowGeolocationRequest should be async API + https://bugs.webkit.org/show_bug.cgi?id=41364 + + Adding GeolocationPermissionClientQt.cpp/h to build script + + * WebCore.pro: + +2010-09-01 Andreas Kling <andreas.kling@nokia.com> + + Reviewed by Darin Adler. + + DOM Selection: collapseToStart() and collapseToEnd() should throw INVALID_STATE_ERR if there's no selection + https://bugs.webkit.org/show_bug.cgi?id=44598 + + Spec links: + http://www.whatwg.org/specs/web-apps/current-work/#dom-selection-collapsetostart + http://www.whatwg.org/specs/web-apps/current-work/#dom-selection-collapsetoend + + Test: fast/dom/Selection/collapseToX-empty-selection.html + + * page/DOMSelection.cpp: + (WebCore::DOMSelection::collapseToEnd): + (WebCore::DOMSelection::collapseToStart): + * page/DOMSelection.h: + * page/DOMSelection.idl: + +2010-09-01 Kinuko Yasuda <kinuko@chromium.org> + + Unreviewed; another build fix. + + * WebCore.pri: + +2010-09-01 Kinuko Yasuda <kinuko@chromium.org> + + Unreviewed; qt build fix. + + * CMakeLists.txt: + +2010-08-31 Kinuko Yasuda <kinuko@chromium.org> + + Reviewed by Adam Barth. + + Move FileSystem related files from WebCore/html to WebCore/fileapi. + https://bugs.webkit.org/show_bug.cgi?id=44925 + + No new tests; there should be no functional changes. + + * CMakeLists.txt: + * GNUmakefile.am: + * WebCore.gypi: + * WebCore.pro: + * WebCore.vcproj/WebCore.vcproj: + * WebCore.xcodeproj/project.pbxproj: + * fileapi/DOMFilePath.cpp: Renamed from WebCore/storage/DOMFilePath.cpp. + * fileapi/DOMFilePath.h: Renamed from WebCore/storage/DOMFilePath.h. + * fileapi/DOMFileSystem.cpp: Renamed from WebCore/storage/DOMFileSystem.cpp. + * fileapi/DOMFileSystem.h: Renamed from WebCore/storage/DOMFileSystem.h. + * fileapi/DOMFileSystem.idl: Renamed from WebCore/storage/DOMFileSystem.idl. + * fileapi/DirectoryEntry.cpp: Renamed from WebCore/storage/DirectoryEntry.cpp. + * fileapi/DirectoryEntry.h: Renamed from WebCore/storage/DirectoryEntry.h. + * fileapi/DirectoryEntry.idl: Renamed from WebCore/storage/DirectoryEntry.idl. + * fileapi/DirectoryReader.cpp: Renamed from WebCore/storage/DirectoryReader.cpp. + * fileapi/DirectoryReader.h: Renamed from WebCore/storage/DirectoryReader.h. + * fileapi/DirectoryReader.idl: Renamed from WebCore/storage/DirectoryReader.idl. + * fileapi/EntriesCallback.h: Renamed from WebCore/storage/EntriesCallback.h. + * fileapi/EntriesCallback.idl: Renamed from WebCore/storage/EntriesCallback.idl. + * fileapi/Entry.cpp: Renamed from WebCore/storage/Entry.cpp. + * fileapi/Entry.h: Renamed from WebCore/storage/Entry.h. + * fileapi/Entry.idl: Renamed from WebCore/storage/Entry.idl. + * fileapi/EntryArray.cpp: Renamed from WebCore/storage/EntryArray.cpp. + * fileapi/EntryArray.h: Renamed from WebCore/storage/EntryArray.h. + * fileapi/EntryArray.idl: Renamed from WebCore/storage/EntryArray.idl. + * fileapi/EntryCallback.h: Renamed from WebCore/storage/EntryCallback.h. + * fileapi/EntryCallback.idl: Renamed from WebCore/storage/EntryCallback.idl. + * fileapi/ErrorCallback.h: Renamed from WebCore/storage/ErrorCallback.h. + * fileapi/ErrorCallback.idl: Renamed from WebCore/storage/ErrorCallback.idl. + * fileapi/FileEntry.cpp: Renamed from WebCore/storage/FileEntry.cpp. + * fileapi/FileEntry.h: Renamed from WebCore/storage/FileEntry.h. + * fileapi/FileEntry.idl: Renamed from WebCore/storage/FileEntry.idl. + * fileapi/FileSystemCallback.h: Renamed from WebCore/storage/FileSystemCallback.h. + * fileapi/FileSystemCallback.idl: Renamed from WebCore/storage/FileSystemCallback.idl. + * fileapi/FileSystemCallbacks.cpp: Renamed from WebCore/storage/FileSystemCallbacks.cpp. + * fileapi/FileSystemCallbacks.h: Renamed from WebCore/storage/FileSystemCallbacks.h. + * fileapi/Flags.h: Renamed from WebCore/storage/Flags.h. + * fileapi/Flags.idl: Renamed from WebCore/storage/Flags.idl. + * fileapi/LocalFileSystem.cpp: Renamed from WebCore/storage/LocalFileSystem.cpp. + * fileapi/LocalFileSystem.h: Renamed from WebCore/storage/LocalFileSystem.h. + * fileapi/Metadata.h: Renamed from WebCore/storage/Metadata.h. + * fileapi/Metadata.idl: Renamed from WebCore/storage/Metadata.idl. + * fileapi/MetadataCallback.h: Renamed from WebCore/storage/MetadataCallback.h. + * fileapi/MetadataCallback.idl: Renamed from WebCore/storage/MetadataCallback.idl. + +2010-08-31 Nikolas Zimmermann <nzimmermann@rim.com> + + Reviewed by Dirk Schulze. + + Prepare RenderSVGContainer culling patch + https://bugs.webkit.org/show_bug.cgi?id=44955 + + Add styleWillChange methods for all SVG renderers, that call setNeedsBoundariesUpdate(). + It's currently a no-op, but will be used once the containers cache their boundaries, which + happens in a follow-up patch. + + * rendering/RenderSVGBlock.cpp: + (WebCore::RenderSVGBlock::styleWillChange): Call setNeedsBoundariesUpdate(). + * rendering/RenderSVGBlock.h: + * rendering/RenderSVGImage.cpp: + (WebCore::RenderSVGImage::styleWillChange): Ditto. + * rendering/RenderSVGImage.h: + * rendering/RenderSVGInline.cpp: + (WebCore::RenderSVGInline::styleWillChange): Ditto. + * rendering/RenderSVGInline.h: + * rendering/RenderSVGModelObject.cpp: + (WebCore::RenderSVGModelObject::styleWillChange): Ditto. + * rendering/RenderSVGModelObject.h: + * rendering/RenderSVGRoot.cpp: + (WebCore::RenderSVGRoot::styleWillChange): Ditto. + * rendering/RenderSVGRoot.h: + * rendering/SVGRenderSupport.cpp: + (WebCore::SVGRenderSupport::computeContainerBoundingBox): Skip hidden containers, not necessary to traverse them. + * rendering/style/SVGRenderStyle.cpp: + (WebCore::SVGRenderStyle::diff): svg-shadow changes need to cause relayouts, not only repaints, once container bounds are cached. + +2010-08-31 Justin Garcia <justin.garcia@apple.com> + + Reviewed by Dan Bernstein. + + https://bugs.webkit.org/show_bug.cgi?id=44915 + Need to handle CSSValueAuto in CSSPrimitiveValue::operator ETextAlign() + + * css/CSSPrimitiveValueMappings.h: + (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Map TAAUTO to -webkit-auto. "auto" is + not a valid text-align value. We use TAAUTO internally for the nameless value that acts + as left if direction:ltr and right for direction:rtl. + +2010-08-31 Gyuyoung Kim <gyuyoung.kim@samsung.com> + + Reviewed by Martin Robinson. + + [EFL] Add PlatformVideoWindowEfl.cpp for WebKit EFL + https://bugs.webkit.org/show_bug.cgi?id=44508 + + Add PlatformVideoWindowEfl.cpp in order to use gstreamer by + WebKit EFL. + + * platform/graphics/gstreamer/PlatformVideoWindow.h: + (WebCore::PlatformVideoWindow::window): + (WebCore::PlatformVideoWindow::videoWindowId): + * platform/graphics/gstreamer/PlatformVideoWindowEfl.cpp: Added. + (PlatformVideoWindow::PlatformVideoWindow): + (PlatformVideoWindow::~PlatformVideoWindow): + * platform/graphics/gstreamer/PlatformVideoWindowGtk.cpp: Include <gtk/gtk.h> directly. + +2010-08-31 Dave Hyatt <hyatt@apple.com> + + Reviewed by Sam Weinig. + + https://bugs.webkit.org/show_bug.cgi?id=44863, disentangle style recalc from layout, so that + the former can occur in more places without having to do the latter. + + * WebCore.exp.in: + * page/FocusController.cpp: + (WebCore::FocusController::setActive): + * page/Frame.cpp: + (WebCore::Frame::Frame): + * page/Frame.h: + * page/FrameView.cpp: + (WebCore::FrameView::enterCompositingMode): + (WebCore::FrameView::layout): + (WebCore::FrameView::needsLayout): + (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive): + * page/FrameView.h: + * page/Page.cpp: + (WebCore::Page::scheduleForcedStyleRecalcForAllPages): + * page/Page.h: + * page/Settings.cpp: + (WebCore::setNeedsRecalcStyleInAllFrames): + (WebCore::setLoadsImagesAutomaticallyInAllFrames): + (WebCore::Settings::setStandardFontFamily): + (WebCore::Settings::setFixedFontFamily): + (WebCore::Settings::setSerifFontFamily): + (WebCore::Settings::setSansSerifFontFamily): + (WebCore::Settings::setCursiveFontFamily): + (WebCore::Settings::setFantasyFontFamily): + (WebCore::Settings::setMinimumFontSize): + (WebCore::Settings::setMinimumLogicalFontSize): + (WebCore::Settings::setDefaultFontSize): + (WebCore::Settings::setDefaultFixedFontSize): + (WebCore::Settings::setLoadsImagesAutomatically): + (WebCore::Settings::setTextAreasAreResizable): + (WebCore::Settings::setAuthorAndUserStylesEnabled): + (WebCore::Settings::setFontRenderingMode): + (WebCore::Settings::setZoomMode): + (WebCore::Settings::setAcceleratedCompositingEnabled): + (WebCore::Settings::setShowDebugBorders): + (WebCore::Settings::setShowRepaintCounter): + * rendering/RenderTheme.cpp: + (WebCore::RenderTheme::platformColorsDidChange): + +2010-08-31 Jeremy Moskovich <jeremy@chromium.org> + + Reviewed by Dimitri Glazkov. + + Unfork Chromium's FontPlatformDataChromiumMac.mm. + + Modified FontPlatformDataCocoa to provide hooks needed by Chromium. + Moved Chromium's mechanics for OOP font loading to CrossProcessFontLoading.mm. + Added ::create() function to MemoryActivatedFont to match new guidelines for + RefCounted<> classes. + + Not possible to test due to sandbox interaction. + + * WebCore.gypi: Update files for chromium build. + * platform/graphics/chromium/CrossProcessFontLoading.h: Added. + (WebCore::MemoryActivatedFont::cgFont): + (WebCore::MemoryActivatedFont::atsFontRef): + * platform/graphics/chromium/CrossProcessFontLoading.mm: Added. + (WebCore::MemoryActivatedFont::create): + (WebCore::MemoryActivatedFont::MemoryActivatedFont): + (WebCore::MemoryActivatedFont::~MemoryActivatedFont): + (WebCore::FontPlatformData::loadFont): + * platform/graphics/chromium/FontPlatformDataChromiumMac.mm: Removed. + * platform/graphics/cocoa/FontPlatformData.h: + * platform/graphics/cocoa/FontPlatformDataCocoa.mm: + (WebCore::FontPlatformData::loadFont): + (WebCore::FontPlatformData::FontPlatformData): + (WebCore::FontPlatformData::operator=): + (WebCore::FontPlatformData::setFont): + +2010-08-31 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Adam Barth. + + [GTK] warning: unused variable "queryResult" + https://bugs.webkit.org/show_bug.cgi?id=44998 + + No new tests as functionality has not changed. + + * platform/graphics/gstreamer/GStreamerGWorld.cpp: + (WebCore::GStreamerGWorld::enterFullscreen): Move queryResult within the gstreamer + version guards, where it is used. + +2010-08-31 Dave Hyatt <hyatt@apple.com> + + Reviewed by Adam Roben. + + Refinement to previous checkin for pagination of block-level replaced elements. Don't bother to + paginate floating block-level replaced elements for now. + + Added fast/multicol/float-pagination-failure.html + + * rendering/RenderBlock.cpp: + (WebCore::RenderBlock::paintChildren): + +2010-08-31 Kinuko Yasuda <kinuko@chromium.org> + + Reviewed by Jian Li. + + Add LocalFileSystem.requestFileSystem interface to DOMWindow + https://bugs.webkit.org/show_bug.cgi?id=44734 + + No new tests; tests will be added later. + + * bindings/generic/RuntimeEnabledFeatures.cpp: + * bindings/generic/RuntimeEnabledFeatures.h: + (WebCore::RuntimeEnabledFeatures::fileSystemEnabled): + (WebCore::RuntimeEnabledFeatures::setFileSystemEnabled): + (WebCore::RuntimeEnabledFeatures::requestFileSystemEnabled): + * page/DOMWindow.cpp: + (WebCore::DOMWindow::requestFileSystem): + * page/DOMWindow.h: + (WebCore::DOMWindow::): + * page/DOMWindow.idl: + * page/Settings.cpp: + (WebCore::Settings::setFileSystemRootPath): + * page/Settings.h: + (WebCore::Settings::fileSystemRootPath): + +2010-08-31 Kwang Yul Seo <skyul@company100.net> + + Reviewed by Adam Barth. + + [BREWMP] Add PLATFORM(BREWMP) guard to PluginViewNone + https://bugs.webkit.org/show_bug.cgi?id=44768 + + Build fix. Add PLATFORM(BREWMP) guard to add dummy PluginView::privateBrowsingStateChanged + and PluginView::setJavaScriptPaused. + + * plugins/PluginViewNone.cpp: + +2010-08-31 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Adam Barth. + + https://bugs.webkit.org/show_bug.cgi?id=40947 + <rdar://problem/8124723> REGRESSION (r57544): XMLHttpRequest POSTed multipart/form-data + wrongfully gets a charset appended + + Test: http/tests/xmlhttprequest/post-with-boundary.html + + * xml/XMLHttpRequest.cpp: + (WebCore::replaceCharsetInMediaType): Changed to only set charset if it was already present, + and never append. + (WebCore::XMLHttpRequest::send): Updated for replaceCharsetInMediaType renaming. + +2010-08-31 Daniel Cheng <dcheng@chromium.org> + + Reviewed by Tony Chang. + + [chromium] Implement Readable/Writable versions of ChromiumDataObjectNew + https://bugs.webkit.org/show_bug.cgi?id=44917 + + This is the second of several patches to update Chromium to support + arbitrary data types in event.dataTransfer. + ReadableDataObject simply calls through to several Chromium IPCs to + retrieve the appropriate data. + WritableDataObject ostensibly buffers arbitrary data internally until + a call is made to flush the data to the platform-specific abstraction; + unfortunately, a special exception is currently made for pasteboard + handling due to how it is handled in WebCore. + + No new tests. + + * WebCore.gypi: + * platform/chromium/ChromiumDataObjectNew.h: Removed. + * platform/chromium/ClipboardChromium.cpp: + * platform/chromium/ClipboardMimeTypes.cpp: Added. + * platform/chromium/ClipboardMimeTypes.h: Added. + * platform/chromium/ReadableDataObject.cpp: Added. + (WebCore::clipboardBuffer): + (WebCore::ReadableDataObject::create): + (WebCore::ReadableDataObject::ReadableDataObject): + (WebCore::ReadableDataObject::hasData): + (WebCore::ReadableDataObject::types): + (WebCore::ReadableDataObject::getData): + (WebCore::ReadableDataObject::getURL): + (WebCore::ReadableDataObject::getHTML): + (WebCore::ReadableDataObject::hasFilenames): + (WebCore::ReadableDataObject::filenames): + (WebCore::ReadableDataObject::ensureTypeCacheInitialized): + * platform/chromium/ReadableDataObject.h: Added. + * platform/chromium/WritableDataObject.cpp: Added. + (WebCore::WritableDataObject::create): + (WebCore::WritableDataObject::WritableDataObject): + (WebCore::WritableDataObject::clearData): + (WebCore::WritableDataObject::clearAllExceptFiles): + (WebCore::WritableDataObject::clearAll): + (WebCore::WritableDataObject::setData): + (WebCore::WritableDataObject::setURL): + (WebCore::WritableDataObject::setHTML): + (WebCore::WritableDataObject::dataMap): + (WebCore::WritableDataObject::urlTitle): + (WebCore::WritableDataObject::htmlBaseURL): + (WebCore::WritableDataObject::fileExtension): + (WebCore::WritableDataObject::fileContentFilename): + (WebCore::WritableDataObject::fileContent): + (WebCore::WritableDataObject::setFileExtension): + (WebCore::WritableDataObject::setFileContentFilename): + (WebCore::WritableDataObject::setFileContent): + * platform/chromium/WritableDataObject.h: Added. + +2010-08-31 Darin Adler <darin@apple.com> + + Reviewed by Sam Weinig. + + Null-deref when decoding web archive with no data key in LegacyWebArchive::createResource + https://bugs.webkit.org/show_bug.cgi?id=45000 + + Test: webarchive/loading/missing-data.html + + * loader/archive/cf/LegacyWebArchive.cpp: + (WebCore::LegacyWebArchive::createResource): Use wrapCFData instead of CFDataGetBytePtr/GetLength, + which is both more efficient, and can handle null. Also fixed incorrect use of ParsedURLString, + since the string is coming from a file and so there are no guarantees about its format. + +2010-08-31 Kenneth Russell <kbr@google.com> + + Reviewed by Chris Marrin. + + Add length and related operations to FloatPoint and FloatSize + https://bugs.webkit.org/show_bug.cgi?id=44994 + + Added length and squared length operations to both FloatPoint and + FloatSize, and added set(x, y), dot and normalize operations to + FloatPoint. These changes have been tested with new code to be + added later. + + * platform/graphics/FloatPoint.cpp: + (WebCore::FloatPoint::normalize): + (WebCore::FloatPoint::length): + * platform/graphics/FloatPoint.h: + (WebCore::FloatPoint::set): + (WebCore::FloatPoint::dot): + (WebCore::FloatPoint::lengthSquared): + (WebCore::operator*): + * platform/graphics/FloatSize.cpp: + (WebCore::FloatSize::diagonalLength): + * platform/graphics/FloatSize.h: + (WebCore::FloatSize::diagonalLengthSquared): + +2010-08-31 Zhenyao Mo <zmo@google.com> + + Reviewed by Kenneth Russell. + + gl-teximage.html and tex-image-and-sub-image-2d-with-image.html failed on Chromium Mac bots (10.5) + https://bugs.webkit.org/show_bug.cgi?id=44993 + + * platform/graphics/cg/GraphicsContext3DCG.cpp: + (WebCore::GraphicsContext3D::getImageData): Take into consideration the source image pixel row alignment. + +2010-08-31 Patrick Gansterer <paroga@paroga.com> + + Reviewed by Kenneth Rohde Christiansen. + + [CMake] Unify GENERATE_DOM_NAMES code + https://bugs.webkit.org/show_bug.cgi?id=44842 + + * CMakeLists.txt: Added property svn:eol-style. + +2010-08-31 Beth Dakin <bdakin@apple.com> + + Rubber-stamped by Dan Bernstein.. + + Variable name change. m_shouldFirePostLayoutTimer is now + m_hasPendingPostLayoutTasks + + * page/FrameView.cpp: + (WebCore::FrameView::FrameView): + (WebCore::FrameView::~FrameView): + (WebCore::FrameView::reset): + (WebCore::FrameView::layout): + (WebCore::FrameView::performPostLayoutTasks): + * page/FrameView.h: + +2010-08-31 Beth Dakin <bdakin@apple.com> + + Reviewed by Dave Hyatt. + + Fix for https://bugs.webkit.org/show_bug.cgi?id=44828 FrameView + should make more calls to postLayoutTasks() using the timer + -and corresponding- + <rdar://problem/8064938> + + This change only allows synchronous calls to postLayoutTasks() if + we are not already in a synchronous call to postLayoutTasks(). + Furthermore, it de-couples the notion of "the post layout timer + should fire" from m_postLayoutTasksTimer.isActive(), instead using + a boolean to track the need to use the timer. + + * page/FrameView.cpp: + (WebCore::FrameView::FrameView): + (WebCore::FrameView::~FrameView): + (WebCore::FrameView::reset): + (WebCore::FrameView::layout): + (WebCore::FrameView::unscheduleRelayout): + (WebCore::FrameView::performPostLayoutTasks): + * page/FrameView.h: + +2010-08-30 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Fix 32-bit WebKit2 build. + + * WebCore.exp.in: + +2010-08-31 Nate Chapin <japhet@chromium.org> + + Reviewed by Darin Fisher. + + Regression in r63528: Custom http headers for loads of type + FrameLoadTypeReloadFromOrigin are not being correctly + propagated to subresource loads. + + https://bugs.webkit.org/show_bug.cgi?id=44987 + + No tests, since DRT doesn't seem to have a way to trigger a + FrameLoadTypeReloadFromOrigin load. + + * loader/FrameLoader.cpp: + (WebCore::FrameLoader::addExtraFieldsToRequest): + +2010-08-31 Sam Weinig <sam@webkit.org> + + Reviewed by Darin Adler. + + Add ability to count text matches without marking + https://bugs.webkit.org/show_bug.cgi?id=43996 + + Safari needs to be able to count text matches without triggering lots of repainting. + Rename markAllMatchesForText() to countMatchesForText() and add a markMatches parameter. + + * WebCore.exp.in: + * page/Frame.cpp: + (WebCore::Frame::countMatchesForText): + * page/Frame.h: + * page/Page.cpp: + (WebCore::Page::markAllMatchesForText): + +2010-08-31 Eric Carlson <eric.carlson@apple.com> + + Reviewed by Darin Adler. + + canPlayType("application/octet-stream") must return "" + https://bugs.webkit.org/show_bug.cgi?id=44985 + + * platform/graphics/MediaPlayer.cpp: + (WebCore::MediaPlayer::supportsType): Always return IsNotSupported for application/octet-stream + +2010-08-31 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Gustavo Noronha Silva. + + [GTK] ScrollbarThemeGtk should respond to theme changes + https://bugs.webkit.org/show_bug.cgi?id=44782 + + Scrollbar is currently written with the assumption that scrollbars never change + thickness. In GTK+ changing the current theme can alter scrollbar thickness. This + change manually resizes interior frame scrollbar widgets when the GTK+ theme changes. + Since we are now tracking style changes, we may also cache theme properties to avoid + having to call moz_gtk_get_scrollbar_metrics repeatedly during rendering. + + * platform/gtk/RenderThemeGtk.cpp: + (WebCore::RenderThemeGtk::gtkScrollbar): Added accessor for the Mozilla theming code's + scrollbar widget. We access it here, because RenderThemGtk takes care of initializing + the Mozilla code. + * platform/gtk/RenderThemeGtk.h: Added accessor declaration. + * platform/gtk/ScrollbarThemeGtk.cpp: + (WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk): Update the style property cache during construction. + (WebCore::ScrollbarThemeGtk::registerScrollbar): Track all interior frame scrollbars. + (WebCore::ScrollbarThemeGtk::unregisterScrollbar): Ditto. + (WebCore::ScrollbarThemeGtk::updateThemeProperties): Added this method which updates the style cache. + (WebCore::gtkStyleSetCallback): Added this signal handler for when the style changes. + (WebCore::ScrollbarThemeGtk::backButtonRect): Use the style cache instead of calling moz_gtk_get_scrollbar_metrics. + (WebCore::ScrollbarThemeGtk::forwardButtonRect): Ditto. + (WebCore::ScrollbarThemeGtk::trackRect): Ditto. + (WebCore::ScrollbarThemeGtk::paintTrackBackground): Ditto. + (WebCore::ScrollbarThemeGtk::thumbRect): Ditto. + (WebCore::ScrollbarThemeGtk::paint): Ditto. + (WebCore::ScrollbarThemeGtk::scrollbarThickness): Ditto. + (WebCore::ScrollbarThemeGtk::buttonSize): Ditto. + (WebCore::ScrollbarThemeGtk::minimumThumbLength): Ditto. + * platform/gtk/ScrollbarThemeGtk.h: Added new method declarations. + +2010-08-31 Darin Adler <darin@apple.com> + + Reviewed by Anders Carlsson. + + Web archives are created with a size of 0 due to PassRefPtr mistake + https://bugs.webkit.org/show_bug.cgi?id=44984 + rdar://problem/8042283 + + * loader/archive/ArchiveResource.cpp: + (WebCore::ArchiveResource::ArchiveResource): Merge the three constructors into one. + (WebCore::ArchiveResource::create): Merge the two create functions into one, and + fix the logic so there is no use of a PassRefPtr after it has been passed. + * loader/archive/ArchiveResource.h: Use default arguments instead of overloading + to cut down from three create functions to two. Remove two of the constructors. + +2010-08-31 Jian Li <jianli@chromium.org> + + Reviewed by David Levin. + + Expose WorkerContext.createBlobURL and WorkerContext.revokeBlobURL. + https://bugs.webkit.org/show_bug.cgi?id=44972 + + Test: fast/files/workers/worker-apply-blob-url-to-xhr.html + + * page/SecurityOrigin.cpp: + (WebCore::SecurityOrigin::canRequest): + * workers/WorkerContext.cpp: + (WebCore::WorkerContext::createBlobURL): + (WebCore::WorkerContext::revokeBlobURL): + * workers/WorkerContext.h: + * workers/WorkerContext.idl: + +2010-08-31 Darin Adler <darin@apple.com> + + Reviewed by Anders Carlsson. + + * editing/TextIterator.cpp: + (WebCore::TextIterator::handleTextBox): + Added a cast so we can mix int and unsigned in a single ?: expression. + This warns with clang, but strangely not with gcc. + + * html/parser/HTMLTreeBuilder.cpp: Removed unused functions. + The clang compiler notices and complains about these. If we need them + later we should use Subversion to bring them back. + +2010-08-31 Kenneth Russell <kbr@google.com> + + Reviewed by Simon Fraser. + + Add cross product and arithmetic operations to FloatPoint3D + https://bugs.webkit.org/show_bug.cgi?id=44970 + + Added set, move, and scale operations similar to FloatPoint's, + addition and subtraction operators, length, lengthSquared and + cross product. These changes have been tested with new code to be + added later. + + * platform/graphics/FloatPoint3D.cpp: + (WebCore::FloatPoint3D::normalize): + (WebCore::FloatPoint3D::length): + * platform/graphics/FloatPoint3D.h: + (WebCore::FloatPoint3D::set): + (WebCore::FloatPoint3D::move): + (WebCore::FloatPoint3D::scale): + (WebCore::FloatPoint3D::dot): + (WebCore::FloatPoint3D::cross): + (WebCore::FloatPoint3D::lengthSquared): + (WebCore::operator +=): + (WebCore::operator -=): + (WebCore::operator+): + (WebCore::operator-): + (WebCore::operator*): + +2010-08-31 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Gustavo Noronha Silva. + + [GTK] Isolate all GTK+ typedefs into one file + https://bugs.webkit.org/show_bug.cgi?id=44900 + + * platform/graphics/gtk/CairoUtilities.h: Remove GTK+ typedefs. + * platform/gtk/ClipboardGtk.h: Ditto. + * platform/gtk/DataObjectGtk.h: Ditto. + * platform/gtk/GOwnPtrGtk.h: Ditto. + * platform/gtk/GRefPtrGtk.h: Ditto. + * platform/gtk/PasteboardHelper.h: Ditto. + * platform/gtk/PopupMenuGtk.h: Ditto. + * platform/gtk/RenderThemeGtk.h: Ditto. + * platform/gtk/ScrollbarGtk.h: Ditto. + * platform/gtk/gtk2drawing.c: Remove unused Assertions.h. + +2010-08-31 Tony Chang <tony@chromium.org> + + Unreviewed, fix chromium compile. + + * bindings/v8/custom/V8DeviceOrientationEventCustom.cpp: + +2010-08-31 Chris Rogers <crogers@google.com> + + Reviewed by Kenneth Russell. + + audio engine: add FFTConvolver class + https://bugs.webkit.org/show_bug.cgi?id=34907 + + No new tests since audio API is not yet implemented. + + * platform/audio: Added. + * platform/audio/FFTConvolver.cpp: Added. + (WebCore::FFTConvolver::FFTConvolver): + (WebCore::FFTConvolver::process): + (WebCore::FFTConvolver::reset): + * platform/audio/FFTConvolver.h: Added. + (WebCore::FFTConvolver::fftSize): + +2010-08-31 Jian Li <jianli@chromium.org> + + Reviewed by Darin Fisher and David Levin. + + Fix ThreadableBlobRegistry methods not to rely on WorkerContext. + https://bugs.webkit.org/show_bug.cgi?id=44971 + + We could hit an ASSERT when we're performing some blob related cleanup + in ScriptExecutionContext destructor when WorkerContext dies. The fix + is to use isMainThread and callOnMainThread. + + * fileapi/ThreadableBlobRegistry.cpp: + (WebCore::BlobRegistryContext::BlobRegistryContext): + (WebCore::registerBlobURLTask): + (WebCore::ThreadableBlobRegistry::registerBlobURL): + (WebCore::registerBlobURLFromTask): + (WebCore::unregisterBlobURLTask): + (WebCore::ThreadableBlobRegistry::unregisterBlobURL): + +2010-08-31 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Gustavo Noronha Silva. + + [GTK] Fix 'make dist' in preparation of the 1.3.3 release + https://bugs.webkit.org/show_bug.cgi?id=44978 + + * GNUmakefile.am: Add missing and moved headers to the sources list. + +2010-08-31 Ryuan Choi <ryuan.choi@samsung.com> + + Reviewed by Antonio Gomes. + + [EFL] crashes while dragging any contents + https://bugs.webkit.org/show_bug.cgi?id=44940 + + Fix crashes caused by returning newly assigned value instead of adoptRef + value. + + * page/efl/EventHandlerEfl.cpp: + (WebCore::EventHandler::createDraggingClipboard): + * platform/efl/ClipboardEfl.cpp: + (WebCore::Editor::newGeneralClipboard): + * platform/efl/ClipboardEfl.h: + (WebCore::ClipboardEfl::create): + +2010-08-31 Ilya Tikhonovsky <loislo@chromium.org> + + Reviewed by Yury Semikhatsky. + + WebInspector: The parser of Inspector protocol messages should be covered by a test. + + The inspector protocol is based on messages in JSON format. + Each message should be a JSON object with a number of properties. + InspectorBackendDispatcher is parsing these messages and should be + able to detect wrong formatted messages. + It has these functionality but no tests for it. + + https://bugs.webkit.org/show_bug.cgi?id=44947 + + + * inspector/CodeGeneratorInspector.pm: + +2010-08-31 Anton Muhin <antonm@chromium.org> + + Reviewed by Adam Barth. + + [v8] More correct and faster error handling when converting v8 objects to various WebCore strings + https://bugs.webkit.org/show_bug.cgi?id=44678 + + Split v8 object conversion into two phase: 1st, which can throw an exception, and + 2nd, which must always succeed. That allows to report correctly the case when exception + happens. + + * bindings/scripts/CodeGeneratorV8.pm: + * bindings/v8/V8Binding.cpp: + (WebCore::int32ToWebCoreString): + (WebCore::v8NonStringValueToWebCoreString): + * bindings/v8/V8Binding.h: + (WebCore::V8ParameterBase::operator String): + (WebCore::V8ParameterBase::operator AtomicString): + (WebCore::V8ParameterBase::V8ParameterBase): + (WebCore::V8ParameterBase::prepareBase): + (WebCore::V8ParameterBase::object): + (WebCore::V8ParameterBase::setString): + (WebCore::V8ParameterBase::toString): + (WebCore::): + (WebCore::::prepare): + * bindings/v8/custom/V8BindingMacros.h: + * bindings/v8/custom/V8DeviceMotionEventCustom.cpp: + (WebCore::V8DeviceMotionEvent::initDeviceMotionEventCallback): + * bindings/v8/cstom/V8DeviceOrientationEventCustom.cpp: + (WebCore::V8DeviceMotionEvent::initDeviceOrientationEventCallback): + +2010-08-30 Ilya Tikhonovsky <loislo@chromium.org> + + Reviewed by Joseph Pecoraro. + + WebInspector: it'd be better to introduce inspector API related tests. + + As far as we have some kind of API for Inspector + it'd be better to have API related tests. This is the test + for API wrappers. These wrappers are tracking the types of arguments + of API functions. + + https://bugs.webkit.org/show_bug.cgi?id=44875 + + Test: inspector/protocol-error.html + + * inspector/CodeGeneratorInspector.pm: + * inspector/front-end/inspector.js: + (WebInspector_syncDispatch): + (WebInspector.reportProtocolError): + +2010-08-31 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r66484. + http://trac.webkit.org/changeset/66484 + https://bugs.webkit.org/show_bug.cgi?id=44966 + + Broke EFL build (Requested by acidx on #webkit). + + * CMakeLists.txt: + +2010-08-31 Ojan Vafai <ojan@chromium.org> + + Reviewed by Tony Chang. + + deduplicate code from Node::checkReplaceChild and Node::checkAddChild + https://bugs.webkit.org/show_bug.cgi?id=44962 + + Remove duplicate code in preparation for fixing https://bugs.webkit.org/show_bug.cgi?id=19524 + No new tests since there is no change in functionality. + + * dom/Node.cpp: + (WebCore::isChildTypeAllowed): + (WebCore::Node::canReplaceChild): + (WebCore::checkAcceptChild): + (WebCore::transferOwnerDocument): + (WebCore::Node::checkReplaceChild): + (WebCore::Node::checkAddChild): + +2010-08-30 Zhenyao Mo <zmo@google.com> + + Reviewed by Kenneth Russell. + + [Chromium] bindTexture(TEXTURE_CUBE_MAP) shouldn't generate errors with valid cubemap texture + https://bugs.webkit.org/show_bug.cgi?id=44922 + + * html/canvas/WebGLRenderingContext.cpp: Remove TEXTURE_WRAP_R code. + (WebCore::WebGLRenderingContext::bindTexture): + * html/canvas/WebGLTexture.cpp: Remove the code for tracking TEXTURE_WRAP_R. + (WebCore::WebGLTexture::WebGLTexture): + * html/canvas/WebGLTexture.h: Ditto. + +2010-08-31 Jian Li <jianli@chromium.org> + + Rubber-stamped by David Levin. + + Rename addTwoCStrings to concatenateTwoCStrings. + + * fileapi/BlobBuilder.cpp: + (WebCore::concatenateTwoCStrings): + (WebCore::BlobBuilder::append): + +2010-08-31 Jian Li <jianli@chromium.org> + + Reviewed by Darin Fisher. + + Improve BlobBuilder to combine adjacent strings. + https://bugs.webkit.org/show_bug.cgi?id=44884 + + * fileapi/BlobBuilder.cpp: + (WebCore::addTwoCStrings): + (WebCore::BlobBuilder::append): + +2010-08-31 Darin Adler <darin@apple.com> + + Reviewed by Simon Fraser. + + Make DOM classes start with a reference count of 1, like all other RefCounted + https://bugs.webkit.org/show_bug.cgi?id=28068 + + * dom/Document.cpp: + (WebCore::Document::accessSVGExtensions): Use adoptPtr instead of set. + + * dom/Document.h: Removed initialRefCount in Node constructor. It's always 1 now. + + * dom/Node.h: Removed CreateWithZeroRefCountFlag, CreateStyledElementZeroRefCount, + CreateSVGElementZeroRefCount, and initialRefCount. + + * platform/TreeShared.h: Removed initialRefCount argument. It's always 1 now. + + * rendering/RenderSVGShadowTreeRootContainer.cpp: + (WebCore::RenderSVGShadowTreeRootContainer::updateFromElement): Use create + instead of new. + + * rendering/SVGResources.h: Inherit from Noncopyable. + + * rendering/SVGResourcesCache.cpp: + (WebCore::SVGResourcesCache::~SVGResourcesCache): Removed unneeded special + case code. + + * rendering/SVGShadowTreeElements.cpp: + (WebCore::SVGShadowTreeContainerElement::create): Added. + (WebCore::SVGShadowTreeRootElement::SVGShadowTreeRootElement): Made argument + type more specific. + (WebCore::SVGShadowTreeRootElement::create): Added. + * rendering/SVGShadowTreeElements.h: Added create functions, and made the + argument type more specific. + + * svg/SVGDocumentExtensions.cpp: + (WebCore::SVGDocumentExtensions::SVGDocumentExtensions): Use adoptPtr. + * svg/graphics/SVGImage.cpp: + (WebCore::SVGImage::dataChanged): Use adoptPtr instead of set. + + * svg/SVGElement.cpp: + (WebCore::SVGElement::SVGElement): Use CreateSVGElement instead of + CreateSVGElementZeroRefCount. + (WebCore::SVGElement::create): Use adoptRef. + + * wml/WMLElement.cpp: + (WebCore::WMLElement::WMLElement): Use CreateStyledElement instead of + CreateStyledElementZeroRefCount. + (WebCore::WMLElement::create): Use adoptRef. + + * svg/SVGAElement.cpp: + (WebCore::SVGAElement::create): + * svg/SVGAltGlyphElement.cpp: + (WebCore::SVGAltGlyphElement::create): + * svg/SVGAnimateColorElement.cpp: + (WebCore::SVGAnimateColorElement::create): + * svg/SVGAnimateElement.cpp: + (WebCore::SVGAnimateElement::create): + * svg/SVGAnimateMotionElement.cpp: + (WebCore::SVGAnimateMotionElement::create): + * svg/SVGAnimateTransformElement.cpp: + (WebCore::SVGAnimateTransformElement::create): + * svg/SVGCircleElement.cpp: + (WebCore::SVGCircleElement::create): + * svg/SVGClipPathElement.cpp: + (WebCore::SVGClipPathElement::create): + * svg/SVGCursorElement.cpp: + (WebCore::SVGCursorElement::create): + * svg/SVGDefsElement.cpp: + (WebCore::SVGDefsElement::create): + * svg/SVGDescElement.cpp: + (WebCore::SVGDescElement::create): + * svg/SVGEllipseElement.cpp: + (WebCore::SVGEllipseElement::create): + * svg/SVGFEBlendElement.cpp: + (WebCore::SVGFEBlendElement::create): + * svg/SVGFEColorMatrixElement.cpp: + (WebCore::SVGFEColorMatrixElement::create): + * svg/SVGFEComponentTransferElement.cpp: + (WebCore::SVGFEComponentTransferElement::create): + * svg/SVGFECompositeElement.cpp: + (WebCore::SVGFECompositeElement::create): + * svg/SVGFEConvolveMatrixElement.cpp: + (WebCore::SVGFEConvolveMatrixElement::create): + * svg/SVGFEDiffuseLightingElement.cpp: + (WebCore::SVGFEDiffuseLightingElement::create): + * svg/SVGFEDisplacementMapElement.cpp: + (WebCore::SVGFEDisplacementMapElement::create): + * svg/SVGFEDistantLightElement.cpp: + (WebCore::SVGFEDistantLightElement::create): + * svg/SVGFEFloodElement.cpp: + (WebCore::SVGFEFloodElement::create): + * svg/SVGFEFuncAElement.cpp: + (WebCore::SVGFEFuncAElement::create): + * svg/SVGFEFuncBElement.cpp: + (WebCore::SVGFEFuncBElement::create): + * svg/SVGFEFuncGElement.cpp: + (WebCore::SVGFEFuncGElement::create): + * svg/SVGFEFuncRElement.cpp: + (WebCore::SVGFEFuncRElement::create): + * svg/SVGFEGaussianBlurElement.cpp: + (WebCore::SVGFEGaussianBlurElement::create): + * svg/SVGFEImageElement.cpp: + (WebCore::SVGFEImageElement::create): + * svg/SVGFEMergeElement.cpp: + (WebCore::SVGFEMergeElement::create): + * svg/SVGFEMergeNodeElement.cpp: + (WebCore::SVGFEMergeNodeElement::create): + * svg/SVGFEMorphologyElement.cpp: + (WebCore::SVGFEMorphologyElement::create): + * svg/SVGFEOffsetElement.cpp: + (WebCore::SVGFEOffsetElement::create): + * svg/SVGFEPointLightElement.cpp: + (WebCore::SVGFEPointLightElement::create): + * svg/SVGFESpecularLightingElement.cpp: + (WebCore::SVGFESpecularLightingElement::create): + * svg/SVGFESpotLightElement.cpp: + (WebCore::SVGFESpotLightElement::create): + * svg/SVGFETileElement.cpp: + (WebCore::SVGFETileElement::create): + * svg/SVGFETurbulenceElement.cpp: + (WebCore::SVGFETurbulenceElement::create): + * svg/SVGFilterElement.cpp: + (WebCore::SVGFilterElement::create): + * svg/SVGFontElement.cpp: + (WebCore::SVGFontElement::create): + * svg/SVGFontFaceElement.cpp: + (WebCore::SVGFontFaceElement::create): + * svg/SVGFontFaceFormatElement.cpp: + (WebCore::SVGFontFaceFormatElement::create): + * svg/SVGFontFaceNameElement.cpp: + (WebCore::SVGFontFaceNameElement::create): + * svg/SVGFontFaceSrcElement.cpp: + (WebCore::SVGFontFaceSrcElement::create): + * svg/SVGFontFaceUriElement.cpp: + (WebCore::SVGFontFaceUriElement::create): + * svg/SVGForeignObjectElement.cpp: + (WebCore::SVGForeignObjectElement::create): + * svg/SVGGElement.cpp: + (WebCore::SVGGElement::create): + * svg/SVGGlyphElement.cpp: + (WebCore::SVGGlyphElement::create): + * svg/SVGHKernElement.cpp: + (WebCore::SVGHKernElement::create): + * svg/SVGImageElement.cpp: + (WebCore::SVGImageElement::create): + * svg/SVGLineElement.cpp: + (WebCore::SVGLineElement::create): + * svg/SVGLinearGradientElement.cpp: + (WebCore::SVGLinearGradientElement::create): + * svg/SVGMPathElement.cpp: + (WebCore::SVGMPathElement::create): + * svg/SVGMarkerElement.cpp: + (WebCore::SVGMarkerElement::create): + * svg/SVGMaskElement.cpp: + (WebCore::SVGMaskElement::create): + * svg/SVGMetadataElement.cpp: + (WebCore::SVGMetadataElement::create): + * svg/SVGMissingGlyphElement.cpp: + (WebCore::SVGMissingGlyphElement::create): + * svg/SVGPathElement.cpp: + (WebCore::SVGPathElement::create): + * svg/SVGPatternElement.cpp: + (WebCore::SVGPatternElement::create): + * svg/SVGPolygonElement.cpp: + (WebCore::SVGPolygonElement::create): + * svg/SVGPolylineElement.cpp: + (WebCore::SVGPolylineElement::create): + * svg/SVGRadialGradientElement.cpp: + (WebCore::SVGRadialGradientElement::create): + * svg/SVGRectElement.cpp: + (WebCore::SVGRectElement::create): + * svg/SVGSVGElement.cpp: + (WebCore::SVGSVGElement::create): + (WebCore::SVGSVGElement::currentView): + * svg/SVGScriptElement.cpp: + (WebCore::SVGScriptElement::create): + * svg/SVGSetElement.cpp: + (WebCore::SVGSetElement::create): + * svg/SVGStopElement.cpp: + (WebCore::SVGStopElement::create): + * svg/SVGStyleElement.cpp: + (WebCore::SVGStyleElement::create): + * svg/SVGSwitchElement.cpp: + (WebCore::SVGSwitchElement::create): + * svg/SVGSymbolElement.cpp: + (WebCore::SVGSymbolElement::create): + * svg/SVGTRefElement.cpp: + (WebCore::SVGTRefElement::create): + * svg/SVGTSpanElement.cpp: + (WebCore::SVGTSpanElement::create): + * svg/SVGTextElement.cpp: + (WebCore::SVGTextElement::create): + * svg/SVGTextPathElement.cpp: + (WebCore::SVGTextPathElement::create): + * svg/SVGTitleElement.cpp: + (WebCore::SVGTitleElement::create): + * svg/SVGUseElement.cpp: + (WebCore::SVGUseElement::create): + (WebCore::SVGUseElement::expandUseElementsInShadowTree): + * svg/SVGVKernElement.cpp: + (WebCore::SVGVKernElement::create): + * svg/SVGViewElement.cpp: + (WebCore::SVGViewElement::create): + * wml/WMLAElement.cpp: + (WebCore::WMLAElement::create): + * wml/WMLAccessElement.cpp: + (WebCore::WMLAccessElement::create): + * wml/WMLAnchorElement.cpp: + (WebCore::WMLAnchorElement::create): + * wml/WMLBRElement.cpp: + (WebCore::WMLBRElement::create): + * wml/WMLCardElement.cpp: + (WebCore::WMLCardElement::create): + * wml/WMLDoElement.cpp: + (WebCore::WMLDoElement::create): + * wml/WMLDocument.h: + (WebCore::WMLDocument::create): + * wml/WMLFieldSetElement.cpp: + (WebCore::WMLFieldSetElement::create): + * wml/WMLFormControlElement.cpp: + (WebCore::WMLFormControlElement::create): + * wml/WMLGoElement.cpp: + (WebCore::WMLGoElement::create): + * wml/WMLImageElement.cpp: + (WebCore::WMLImageElement::create): + * wml/WMLInputElement.cpp: + (WebCore::WMLInputElement::create): + * wml/WMLInsertedLegendElement.cpp: + (WebCore::WMLInsertedLegendElement::create): + * wml/WMLIntrinsicEvent.cpp: + (WebCore::WMLIntrinsicEvent::create): + * wml/WMLMetaElement.cpp: + (WebCore::WMLMetaElement::create): + * wml/WMLNoopElement.cpp: + (WebCore::WMLNoopElement::create): + * wml/WMLOnEventElement.cpp: + (WebCore::WMLOnEventElement::create): + * wml/WMLOptGroupElement.cpp: + (WebCore::WMLOptGroupElement::create): + * wml/WMLOptionElement.cpp: + (WebCore::WMLOptionElement::create): + * wml/WMLPElement.cpp: + (WebCore::WMLPElement::create): + * wml/WMLPostfieldElement.cpp: + (WebCore::WMLPostfieldElement::create): + * wml/WMLPrevElement.cpp: + (WebCore::WMLPrevElement::create): + * wml/WMLRefreshElement.cpp: + (WebCore::WMLRefreshElement::create): + * wml/WMLSelectElement.cpp: + (WebCore::WMLSelectElement::create): + * wml/WMLSetvarElement.cpp: + (WebCore::WMLSetvarElement::create): + * wml/WMLTableElement.cpp: + (WebCore::WMLTableElement::create): + * wml/WMLTaskElement.cpp: + (WebCore::WMLTaskElement::create): + * wml/WMLTemplateElement.cpp: + (WebCore::WMLTemplateElement::create): + * wml/WMLTimerElement.cpp: + (WebCore::WMLTimerElement::create): + Use adoptRef. + +2010-08-31 Justin Schuh <jschuh@chromium.org> + + Reviewed by Nate Chapin. + + Local frame loads should check against origin (not referrer) + https://bugs.webkit.org/show_bug.cgi?id=44888 + + Test: fast/frames/iframe-no-src-local-origin-allow.html + + * loader/SubframeLoader.cpp: + (WebCore::SubframeLoader::loadSubframe): + +2010-08-25 Zhenyao Mo <zmo@google.com> + + Reviewed by Kenneth Russell. + + Passing premultiplyAlpha=false to tex{Sub}Image2D loses information (cg) + https://bugs.webkit.org/show_bug.cgi?id=44566 + + * platform/graphics/cg/GraphicsContext3DCG.cpp: + (WebCore::GraphicsContext3D::getImageData): Fix the premultiplyAlpha issue for cg. + +2010-08-31 Dave Hyatt <hyatt@apple.com> + + Reviewed by Adam Roben. + + https://bugs.webkit.org/show_bug.cgi?id=44956, paginate block-level replaced elements. + <rdar://problem/8000991> Images with display:block get split between columns or pages + + Added fast/multicol/paginate-block-replaced.html + + * rendering/RenderBlock.cpp: + (WebCore::RenderBlock::paintChildren): + +2010-08-31 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=36515 + CSS style definitions are ignored if they just follow a "@charset" which appears in lines + other than the first line in stylesheet. + + Test: fast/css/misplaced-charset.html + + * css/CSSGrammar.y: Ignore a misplaced charset rule without consuming extra characters and + thus breaking subsequent rules. + +2010-08-31 Patrick Gansterer <paroga@paroga.com> + + Reviewed by Antonio Gomes. + + [CMake] Add IF (ENABLE_MATHML) around MathML sources + https://bugs.webkit.org/show_bug.cgi?id=44927 + + * CMakeLists.txt: + +2010-08-31 Patrick Gansterer <paroga@paroga.com> + + Reviewed by Kenneth Rohde Christiansen. + + [CMake] Unify GENERATE_DOM_NAMES code + https://bugs.webkit.org/show_bug.cgi?id=44842 + + * CMakeLists.txt: Added property svn:eol-style. + +2010-08-31 Daniel Cheng <dcheng@chromium.org> + + Reviewed by Tony Chang. + + [chromium] Add an interface for platform copy/paste drag/drop data objects + https://bugs.webkit.org/show_bug.cgi?id=44914 + + Currently, Chromium only supports a few hardcoded data types in + event.dataTransfer. This is the first of several patches to add support + for arbitrary data types. + + No new tests. + + * WebCore.gypi: + * platform/chromium/ChromiumDataObjectNew.h: Added. + * platform/chromium/ClipboardChromium.cpp: + +2010-08-30 Andrey Kosyakov <caseq@chromium.org> + + Reviewed by Yury Semikhatsky. + + Web Inspector: add audits support to extension API + Exposed (late) adding of categories from AuditPanel. + Removed indexOfObjectInListSortedByFunction in favor of + insertionIndexForObjectInListSortedByFunction (the former had + weird interface always returning negative numbers and was only used in + the latter). + https://bugs.webkit.org/show_bug.cgi?id=44518 + + Tests: inspector/extensions-audits-api.html + inspector/extensions-audits.html + + * WebCore.gypi: + * WebCore.vcproj/WebCore.vcproj: + * inspector/front-end/AuditFormatters.js: Added. + (WebInspector.applyFormatters): + (WebInspector.AuditFormatters.text): + (WebInspector.AuditFormatters.snippet): + (WebInspector.AuditFormatters.concat): + (WebInspector.AuditFormatters.url): + * inspector/front-end/AuditLauncherView.js: + (WebInspector.AuditLauncherView): + (WebInspector.AuditLauncherView.prototype.addCategory.compareCategories): + (WebInspector.AuditLauncherView.prototype.addCategory): + (WebInspector.AuditLauncherView.prototype._launchButtonClicked): + (WebInspector.AuditLauncherView.prototype._selectAllClicked): + (WebInspector.AuditLauncherView.prototype._categoryClicked): + (WebInspector.AuditLauncherView.prototype._createCategoryElement): + (WebInspector.AuditLauncherView.prototype._createLauncherUI): + * inspector/front-end/AuditResultView.js: + (WebInspector.AuditCategoryResultPane.prototype._appendResult): + * inspector/front-end/AuditsPanel.js: + (WebInspector.AuditsPanel): + (WebInspector.AuditsPanel.prototype.addCategory): + (WebInspector.AuditsPanel.prototype.getCategory): + (WebInspector.AuditsPanel.prototype._executeAudit): + (WebInspector.AuditCategory.prototype.run): + * inspector/front-end/ExtensionAPI.js: + (WebInspector.injectedExtensionAPI): + (WebInspector.injectedExtensionAPI.EventSinkImpl.prototype.addListener): + (WebInspector.injectedExtensionAPI.EventSinkImpl.prototype._fire): + (WebInspector.injectedExtensionAPI.EventSinkImpl.prototype._dispatch): + (WebInspector.injectedExtensionAPI.EventSink): + (WebInspector.injectedExtensionAPI.InspectorExtensionAPI): + (WebInspector.injectedExtensionAPI.Panels.prototype.create): + (WebInspector.injectedExtensionAPI.Audits): + (WebInspector.injectedExtensionAPI.Audits.prototype.addCategory): + (WebInspector.injectedExtensionAPI.AuditCategory.customDispatch): + (WebInspector.injectedExtensionAPI.AuditCategory): + (WebInspector.injectedExtensionAPI.AuditCategoryImpl): + (WebInspector.injectedExtensionAPI.AuditResult): + (WebInspector.injectedExtensionAPI.AuditResult.prototype.get Severity): + (WebInspector.injectedExtensionAPI.AuditResultImpl): + (WebInspector.injectedExtensionAPI.AuditResultImpl.prototype.addResult): + (WebInspector.injectedExtensionAPI.AuditResultImpl.prototype.createResult): + (WebInspector.injectedExtensionAPI.AuditResultImpl.prototype.done): + (WebInspector.injectedExtensionAPI.AuditResultImpl.prototype._nodeFactory): + (WebInspector.injectedExtensionAPI.AuditResultNode): + (WebInspector.injectedExtensionAPI.AuditResultNode.prototype.addChild): + * inspector/front-end/ExtensionAuditCategory.js: Added. + (WebInspector.ExtensionAuditCategory): + (WebInspector.ExtensionAuditCategory.prototype.get id): + (WebInspector.ExtensionAuditCategory.prototype.get displayName): + (WebInspector.ExtensionAuditCategory.prototype.get ruleCount): + (WebInspector.ExtensionAuditCategory.prototype.run): + (WebInspector.ExtensionAuditCategoryResults): + (WebInspector.ExtensionAuditCategoryResults.prototype.get complete): + (WebInspector.ExtensionAuditCategoryResults.prototype.cancel): + (WebInspector.ExtensionAuditCategoryResults.prototype.addResult): + (WebInspector.ExtensionAuditCategoryResults.prototype._addNode): + (WebInspector.ExtensionAuditCategoryResults.prototype._addResult): + * inspector/front-end/ExtensionCommon.js: Added. + (WebInspector.commonExtensionSymbols): + * inspector/front-end/ExtensionServer.js: + (WebInspector.ExtensionServer): + (WebInspector.ExtensionServer.prototype.startAuditRun): + (WebInspector.ExtensionServer.prototype.stopAuditRun): + (WebInspector.ExtensionServer.prototype._postNotification): + (WebInspector.ExtensionServer.prototype._onAddAuditCategory): + (WebInspector.ExtensionServer.prototype._onAddAuditResult): + (WebInspector.ExtensionServer.prototype._onStopAuditCategoryRun): + (WebInspector.ExtensionServer.prototype._addExtensions): + (WebInspector.ExtensionServer.prototype._buildExtensionAPIInjectedScript): + (WebInspector.ExtensionStatus): + * inspector/front-end/WebKit.qrc: + * inspector/front-end/inspector.html: + * inspector/front-end/utilities.js: + (): + +2010-08-31 Justin Schuh <jschuh@chromium.org> + + Reviewed by Nate Chapin. + + Remove unused canReferToParentFrameEncoding() function from FrameLoader.cpp + https://bugs.webkit.org/show_bug.cgi?id=44895 + + No new tests; no behavior changed. + + * loader/FrameLoader.cpp: + +2010-08-31 Jeremy Orlow <jorlow@chromium.org> + + Build fix. + + * storage/IDBObjectStoreBackendImpl.cpp: + (WebCore::IDBObjectStoreBackendImpl::openCursor): + +2010-08-24 Jeremy Orlow <jorlow@chromium.org> + + Reviewed by Steve Block. + + Implement the rest of IDBCursors + make them persistent + https://bugs.webkit.org/show_bug.cgi?id=44546 + + Because the old (memory only) backend didn't support ranges, IDBCursors + were never really finished. This completes them on top of SQLite like + the rest of IndexedDB. + + Test: storage/indexeddb/objectstore-cursor.html + + * storage/IDBCursor.cpp: + (WebCore::IDBCursor::value): + * storage/IDBCursorBackendImpl.cpp: + (WebCore::IDBCursorBackendImpl::IDBCursorBackendImpl): + (WebCore::IDBCursorBackendImpl::key): + (WebCore::IDBCursorBackendImpl::value): + (WebCore::IDBCursorBackendImpl::update): + (WebCore::IDBCursorBackendImpl::continueFunction): + (WebCore::IDBCursorBackendImpl::remove): + (WebCore::IDBCursorBackendImpl::loadCurrentRow): + * storage/IDBCursorBackendImpl.h: + (WebCore::IDBCursorBackendImpl::create): + * storage/IDBCursorBackendInterface.h: + * storage/IDBKey.cpp: + (WebCore::IDBKey::isEqual): + * storage/IDBKey.h: + * storage/IDBKeyRange.cpp: + (WebCore::IDBKeyRange::leftBound): + (WebCore::IDBKeyRange::rightBound): + (WebCore::IDBKeyRange::bound): + * storage/IDBObjectStoreBackendImpl.cpp: + (WebCore::cursorWhereFragment): + (WebCore::IDBObjectStoreBackendImpl::openCursor): + +2010-08-27 John Gregg <johnnyg@google.com> + + Reviewed by David Levin. + + Notifications should support a click event + https://bugs.webkit.org/show_bug.cgi?id=44800 + + Test: fast/notifications/notifications-click-event.html + + * notifications/Notification.h: + * notifications/Notification.idl: + +2010-08-31 Kent Tamura <tkent@chromium.org> + + Reviewed by Adam Barth. + + [V8] Custom binding for "dataset" + https://bugs.webkit.org/show_bug.cgi?id=44930 + + * WebCore.gyp/WebCore.gyp: Remove the exclusion of DOMStringMap.idl. + * WebCore.gypi: Add V8DOMStringMapCustom.cpp. + * bindings/v8/custom/V8DOMStringMapCustom.cpp: Added. + (WebCore::V8DOMStringMap::namedPropertyQuery): + (WebCore::V8DOMStringMap::namedPropertyGetter): + (WebCore::V8DOMStringMap::namedPropertyEnumerator): + (WebCore::V8DOMStringMap::namedPropertyDeleter): + (WebCore::V8DOMStringMap::namedPropertySetter): + * dom/Element.idl: Remove V8 exclusion. + * page/DOMWindow.idl: ditto. + +2010-08-31 Jian Li <jianli@chromium.org> + + Fix chromium build break. + + * page/DOMWindow.h: + +2010-08-31 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Stale document crashes at multiple URLs (with new parser) + https://bugs.webkit.org/show_bug.cgi?id=44885 + + We're not supposed to load resources in detached documents. According + to several locations I examined, it's the job of the caller of + DocLoader to check this invariant. Like most code dealing with + detached documents, this check isn't overly consistent. At some point, + we'll need to rationalize all the different patterns here. However, at + this point, this patch appears correct because it matches what we do + for <link rel="stylesheet">. + + Test: fast/dom/HTMLLinkElement/prefetch-detached.html + + * html/HTMLLinkElement.cpp: + (WebCore::HTMLLinkElement::process): + * loader/DocLoader.cpp: + (WebCore::DocLoader::requestLinkPrefetch): + +2010-08-31 Jian Li <jianli@chromium.org> + + Reviewed by David Levin. + + Expose window.createBlobURL and window.revokeBlobURL. + https://bugs.webkit.org/show_bug.cgi?id=44908 + + Tests: fast/files/apply-blob-url-to-img.html + fast/files/apply-blob-url-to-xhr.html + + * page/DOMWindow.cpp: + (WebCore::DOMWindow::createBlobURL): + (WebCore::DOMWindow::revokeBlobURL): + * page/DOMWindow.h: + * page/DOMWindow.idl: + * xml/XMLHttpRequest.cpp: + (WebCore::XMLHttpRequest::createRequest): + +2010-08-31 Jian Li <jianli@chromium.org> + + Reviewed by David Levin. + + Support FileReaderSync in workers. + https://bugs.webkit.org/show_bug.cgi?id=44657 + + Also add FileException interface and make Blob/File/FileError useable in + workers. + + Tests: fast/files/workers/worker-read-blob-async.html + fast/files/workers/worker-read-blob-sync.html + fast/files/workers/worker-read-file-async.html + fast/files/workers/worker-read-file-sync.html + + * DerivedSources.cpp: + * DerivedSources.make: + * WebCore.gypi: + * WebCore.pro: + * WebCore.vcproj/WebCore.vcproj: + * WebCore.xcodeproj/project.pbxproj: + * fileapi/Blob.idl: Added NoStaticTables attribute. + * fileapi/File.idl: Added NoStaticTables attribute. + * fileapi/FileError.idl: Added NoStaticTables attribute. + * fileapi/FileException.h: Added. + * fileapi/FileException.idl: Added. + * fileapi/FileReaderSync.cpp: Added. + * fileapi/FileReaderSync.h: Added. + * fileapi/FileReaderSync.idl: Added. + * workers/WorkerContext.idl: Expose FileReaderSync and BlodBuilder in workers. + +2010-08-30 Philippe Normand <pnormand@igalia.com> + + Reviewed by Martin Robinson. + + [GTK] Buffered ranges drawing support + https://bugs.webkit.org/show_bug.cgi?id=44869 + + Refactored the media slider track painting code to support + multiple buffered ranges painting. This change introduces no + functional regression. + + * platform/gtk/RenderThemeGtk.cpp: + (WebCore::RenderThemeGtk::paintMediaSliderTrack): + +2010-08-30 Mihai Parparita <mihaip@chromium.org> + + Reviewed by Adam Barth. + + HISTORY_ALWAYS_ASYNC should be removed (history should always be async) + https://bugs.webkit.org/show_bug.cgi?id=44315 + + Remove check in RedirectScheduler::scheduleHistoryNavigation that would + dispatch some navigations synchronously. + + Test: fast/history/history-traversal-is-asynchronous.html + + * loader/RedirectScheduler.cpp: + (WebCore::RedirectScheduler::scheduleHistoryNavigation): + +2010-08-30 Jian Li <jianli@chromium.org> + + Try to fix break again. + + * fileapi/ThreadableBlobRegistry.cpp: + (WebCore::ThreadableBlobRegistry::registerBlobURL): + (WebCore::ThreadableBlobRegistry::unregisterBlobURL): + +2010-08-30 Jian Li <jianli@chromium.org> + + Fix another build break. Also fix directory upload test break. + + * fileapi/File.cpp: + (WebCore::File::File): + * fileapi/ThreadableBlobRegistry.cpp: + +2010-08-30 Jian Li <jianli@chromium.org> + + Fix build break. + + * xml/XMLHttpRequest.cpp: + (WebCore::XMLHttpRequest::send): + +2010-08-30 Jian Li <jianli@chromium.org> + + Fix qt/gtk build break. + + * platform/network/BlobRegistryImpl.cpp: + +2010-08-30 Jian Li <jianli@chromium.org> + + Reviewed by Darin Fisher. + + Switch the Blob implementation to using the blob data registration model + https://bugs.webkit.org/show_bug.cgi?id=44389 + + Tests: fast/files/read-blob-async.html + fast/files/read-file-async.html + + With this switch, File/Blob/BlobBuilder are changed to register the blob + data. FileReader is changed to route through loading the blob resource. + FormData is also updated to take BlobData. The WebKit mac implementation + is updated to resolve the blob references in the BlobData. + + * CMakeLists.txt: Update the project file to remove BlobItem.*. + * GNUmakefile.am: Update the project file to remove BlobItem.*. + * WebCore.gypi: Update the project file to remove BlobItem.*. + * WebCore.pro: Update the project file to remove BlobItem.*. + * WebCore.vcproj/WebCore.vcproj: Update the project file to remove BlobItem.*. + * WebCore.xcodeproj/project.pbxproj: Update the project file to remove BlobItem.*. + * fileapi/Blob.cpp: Switch to using BlobData. + (WebCore::Blob::Blob): + (WebCore::Blob::slice): + * fileapi/Blob.h: Switch to using BlobData. + (WebCore::Blob::create): + (WebCore::Blob::size): + (WebCore::Blob::isFile): + * fileapi/BlobBuilder.cpp: Switch to using BlobData. + (WebCore::BlobBuilder::BlobBuilder): + (WebCore::BlobBuilder::append): + (WebCore::BlobBuilder::getBlob): + * fileapi/BlobBuilder.h: Switch to using BlobData. + * fileapi/BlobURL.cpp: Add a new helper method used in FormData. + (WebCore::BlobURL::getIdentifier): + * fileapi/BlobURL.h: + * fileapi/File.cpp: Switch to using BlobData. + (WebCore::createBlobDataForFile): + (WebCore::File::File): + (WebCore::File::size): + (WebCore::File::captureSnapshot): + * fileapi/File.h: Switch to using BlobData. + (WebCore::File::create): + (WebCore::File::path): + (WebCore::File::name): + (WebCore::File::webkitRelativePath): + * fileapi/FileReader.cpp: Change the reading to route through blob resource loading. + (WebCore::FileReader::FileReader): + (WebCore::FileReader::readAsBinaryString): + (WebCore::FileReader::readAsText): + (WebCore::FileReader::readAsDataURL): + (WebCore::delayedStart): + (WebCore::FileReader::readInternal): + (WebCore::FileReader::terminate): + (WebCore::FileReader::start): + (WebCore::FileReader::didReceiveResponse): + (WebCore::FileReader::didReceiveData): + (WebCore::FileReader::didFinishLoading): + (WebCore::FileReader::didFail): + (WebCore::FileReader::failed): + (WebCore::FileReader::httpStatusCodeToExceptionCode): + (WebCore::FileReader::result): + (WebCore::FileReader::convertToDataURL): + * fileapi/FileReader.h: + * html/FormDataList.cpp: Account to BlobData change. + (WebCore::FormDataList::appendString): + (WebCore::FormDataList::appendBlob): + * html/FormDataList.h: Account to BlobData change. + (WebCore::FormDataList::appendBlob): + (WebCore::FormDataList::Item::Item): + (WebCore::FormDataList::Item::data): + (WebCore::FormDataList::Item::blob): + (WebCore::FormDataList::items): + * loader/FormSubmission.cpp: Account to BlobData change. + (WebCore::FormSubmission::create): + * platform/BlobItem.cpp: Removed. + * platform/BlobItem.h: Removed. + * platform/network/BlobRegistryImpl.cpp: Add the implementations for resource loading. + (WebCore::BlobRegistryImpl::createResourceHandle): + (WebCore::BlobRegistryImpl::loadResourceSynchronously): + * platform/network/BlobResourceHandle.cpp: Fix a bug that the ref is not added. + (WebCore::BlobResourceHandle::BlobResourceHandle): + * platform/network/FormData.cpp: Account to BlobData change. + (WebCore::FormData::create): + (WebCore::FormData::createMultiPart): + (WebCore::FormData::deepCopy): + (WebCore::FormData::appendFile): + (WebCore::FormData::appendKeyValuePairItems): + * platform/network/FormData.h: Account to BlobData change. + * platform/network/mac/FormDataStreamMac.mm: Resolve blob references in the form data. + (WebCore::closeCurrentStream): + (WebCore::advanceCurrentStream): + (WebCore::formCreate): + (WebCore::formRead): + (WebCore::setHTTPBody): + * xml/XMLHttpRequest.cpp: Account to BlobData change. + (WebCore::XMLHttpRequest::send): + +2010-08-30 Eric Seidel <eric@webkit.org> + + Unreviewed, rolling out r66418. + http://trac.webkit.org/changeset/66418 + https://bugs.webkit.org/show_bug.cgi?id=44896 + + Adam tried to roll this out with: + https://bugs.webkit.org/show_bug.cgi?id=44924 + but we hit a commit-queue edgecase and it failed, trying again. + + Causing test failures on multiple bots + + * rendering/RenderForeignObject.cpp: + (WebCore::RenderForeignObject::layout): + * rendering/RenderObject.cpp: + * rendering/RenderObject.h: + (WebCore::RenderObject::setNeedsBoundariesUpdate): + * rendering/RenderObjectChildList.cpp: + (WebCore::RenderObjectChildList::removeChildNode): + * rendering/RenderPath.cpp: + (WebCore::RenderPath::layout): + (WebCore::RenderPath::paint): + (WebCore::RenderPath::styleWillChange): + * rendering/RenderPath.h: + (WebCore::RenderPath::setNeedsBoundariesUpdate): + * rendering/RenderSVGBlock.cpp: + * rendering/RenderSVGBlock.h: + * rendering/RenderSVGContainer.cpp: + (WebCore::RenderSVGContainer::RenderSVGContainer): + (WebCore::RenderSVGContainer::layout): + (WebCore::RenderSVGContainer::paint): + (WebCore::RenderSVGContainer::objectBoundingBox): + (WebCore::RenderSVGContainer::strokeBoundingBox): + (WebCore::RenderSVGContainer::repaintRectInLocalCoordinates): + * rendering/RenderSVGContainer.h: + (WebCore::RenderSVGContainer::calculateLocalTransform): + * rendering/RenderSVGGradientStop.h: + * rendering/RenderSVGHiddenContainer.cpp: + (WebCore::RenderSVGHiddenContainer::clippedOverflowRectForRepaint): + (WebCore::RenderSVGHiddenContainer::objectBoundingBox): + (WebCore::RenderSVGHiddenContainer::repaintRectInLocalCoordinates): + * rendering/RenderSVGHiddenContainer.h: + * rendering/RenderSVGImage.cpp: + (WebCore::RenderSVGImage::layout): + * rendering/RenderSVGImage.h: + * rendering/RenderSVGInline.cpp: + * rendering/RenderSVGInline.h: + * rendering/RenderSVGModelObject.cpp: + * rendering/RenderSVGModelObject.h: + * rendering/RenderSVGRoot.cpp: + (WebCore::RenderSVGRoot::RenderSVGRoot): + (WebCore::RenderSVGRoot::layout): + (WebCore::RenderSVGRoot::objectBoundingBox): + (WebCore::RenderSVGRoot::strokeBoundingBox): + (WebCore::RenderSVGRoot::repaintRectInLocalCoordinates): + * rendering/RenderSVGRoot.h: + * rendering/RenderSVGText.cpp: + (WebCore::RenderSVGText::layout): + * rendering/RenderSVGTransformableContainer.cpp: + (WebCore::RenderSVGTransformableContainer::calculateLocalTransform): + * rendering/RenderSVGTransformableContainer.h: + * rendering/RenderSVGViewportContainer.cpp: + (WebCore::RenderSVGViewportContainer::calcViewport): + * rendering/SVGRenderSupport.cpp: + (WebCore::SVGRenderSupport::computeContainerBoundingBox): + * rendering/SVGRenderSupport.h: + * rendering/style/SVGRenderStyle.cpp: + (WebCore::SVGRenderStyle::diff): + +2010-08-30 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Implement CDATASection state for the HTMLTokenizer + https://bugs.webkit.org/show_bug.cgi?id=44923 + + In the spec, this state refers back to the HTMLTreeBuilder from the + HTMLTokenizer. Rather that introduce that (backwards) dependencies, we + have the tree builder set a bit on the tokenizer. + + * html/parser/HTMLTokenizer.cpp: + (WebCore::HTMLTokenizer::reset): + (WebCore::HTMLTokenizer::nextToken): + * html/parser/HTMLTokenizer.h: + (WebCore::HTMLTokenizer::shouldAllowCDATA): + (WebCore::HTMLTokenizer::setShouldAllowCDATA): + * html/parser/HTMLTreeBuilder.cpp: + (WebCore::HTMLTreeBuilder::constructTreeFromToken): + +2010-08-30 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Enable HTML5lib's test_innerHTML01.dat + https://bugs.webkit.org/show_bug.cgi?id=44919 + + These tests provoked two branches that we hadn't implemented yet. + + * html/parser/HTMLTreeBuilder.cpp: + (WebCore::HTMLTreeBuilder::processStartTag): + (WebCore::HTMLTreeBuilder::processEndTag): + +2010-08-30 Mark Rowe <mrowe@apple.com> + + Reviewed by Darin Adler. + + Stop using a QuickDraw function that was only used for debugging purposes. + + * platform/graphics/mac/SimpleFontDataMac.mm: + (WebCore::pathFromFont): + +2010-08-30 Ryosuke Niwa <rniwa@webkit.org> + + Reviewed by Darin Adler. + + queryCommandValue("BackColor") returns rgb(0,0,0) for elements with transparent background + https://bugs.webkit.org/show_bug.cgi?id=21680 + + The bug was caused by WebKit's using the computed style to obtain the background color, + which is rgba(0,0,0,0) for nodes with transparent background color. While this is correct + in the accordance to CSS2 because background-color is not inherited by default, + it is not desirable for editing purposes where the background color in effect is expected. + + Modified valueStyle in EditorCommand.cpp to call Editor::selectionStartCSSPropertyValue, + instead of Frame::selectionStartStylePropertyValue, which traverses common ancestors of + the selected range or caret to retrieve the effective background color of the selected region + instead of the background color at the start of the selection. + This takes effect when the original background color is transparent or the selection is range + (to avoid picking up the background color only present at the start of paragraph). + + Removed selectionStartStylePropertyValue and migrated it to Editor::selectionStartCSSPropertyValue. + + Test: editing/execCommand/query-command-value-background-color.html + + * editing/Editor.cpp: + (WebCore::hasTransparentBackgroundColor): Checks whether the specified style's background color is transparent or not. + (WebCore::Editor::selectionStartCSSPropertyValue): Migrated the contents of selectionStartStylePropertyValue and + added the special case for background color. + * editing/Editor.h: Added the prototype for selectionStartCSSPropertyValue. + * editing/EditorCommand.cpp: + (WebCore::valueStyle): Calls Editor::selectionStartCSSPropertyValue. + * page/Frame.cpp: Removed selectionStartStylePropertyValue. + * page/Frame.h: Ditto. + +2010-08-30 Lei Zhang <thestig@chromium.org> + + Reviewed by Shinichiro Hamaji. + + Defer printing until the FrameLoader finishes loading. + https://bugs.webkit.org/show_bug.cgi?id=43658 + + * manual-tests/print-before-load.html: Added. + + * loader/FrameLoader.cpp: + (WebCore::FrameLoader::finishedLoading): + * page/DOMWindow.cpp: + (WebCore::DOMWindow::DOMWindow): + (WebCore::DOMWindow::print): + * page/DOMWindow.h: + (WebCore::DOMWindow::printDeferred): + +2010-08-30 Chris Rogers <crogers@google.com> + + Reviewed by Kenneth Russell. + + audio engine: add ReverbConvolver class + https://bugs.webkit.org/show_bug.cgi?id=34912 + + No new tests since audio API is not yet implemented. + + * platform/audio: Added. + * platform/audio/ReverbAccumulationBuffer.cpp: Added. + (WebCore::ReverbAccumulationBuffer::ReverbAccumulationBuffer): + (WebCore::ReverbAccumulationBuffer::readAndClear): + (WebCore::ReverbAccumulationBuffer::updateReadIndex): + (WebCore::ReverbAccumulationBuffer::accumulate): + (WebCore::ReverbAccumulationBuffer::reset): + * platform/audio/ReverbAccumulationBuffer.h: Added. + (WebCore::ReverbAccumulationBuffer::readIndex): + (WebCore::ReverbAccumulationBuffer::readTimeFrame): + * platform/audio/ReverbConvolver.cpp: Added. + (WebCore::backgroundThreadEntry): + (WebCore::ReverbConvolver::ReverbConvolver): + (WebCore::ReverbConvolver::~ReverbConvolver): + (WebCore::ReverbConvolver::backgroundThreadEntry): + (WebCore::ReverbConvolver::process): + (WebCore::ReverbConvolver::reset): + * platform/audio/ReverbConvolver.h: Added. + (WebCore::ReverbConvolver::impulseResponseLength): + (WebCore::ReverbConvolver::inputBuffer): + (WebCore::ReverbConvolver::useBackgroundThreads): + * platform/audio/ReverbConvolverStage.cpp: Added. + (WebCore::ReverbConvolverStage::ReverbConvolverStage): + (WebCore::ReverbConvolverStage::processInBackground): + (WebCore::ReverbConvolverStage::process): + (WebCore::ReverbConvolverStage::reset): + * platform/audio/ReverbConvolverStage.h: Added. + (WebCore::ReverbConvolverStage::inputReadIndex): + * platform/audio/ReverbInputBuffer.cpp: Added. + (WebCore::ReverbInputBuffer::ReverbInputBuffer): + (WebCore::ReverbInputBuffer::write): + (WebCore::ReverbInputBuffer::directReadFrom): + (WebCore::ReverbInputBuffer::reset): + * platform/audio/ReverbInputBuffer.h: Added. + (WebCore::ReverbInputBuffer::writeIndex): + +2010-08-30 Nikolas Zimmermann <nzimmermann@rim.com> + + Reviewed by Dirk Schulze. + + Add culling to RenderSVGContainer + https://bugs.webkit.org/show_bug.cgi?id=44896 + + Cache object/strokeBoundingBox and repaintRectInLocalCoordinates() in RenderSVGContainer & RenderSVGRoot, just like it's done in RenderPath. + Propagate boundary changes up the render tree, in layout phase, in order to notify parents that they should update their cached boundaries. + + This is a huge speed benefit when interacting with an already layouted document, as there's no need anymore to traverse all children + of any container or <svg> element, just to retrieve the repaint rect. + + * rendering/RenderForeignObject.cpp: + (WebCore::RenderForeignObject::layout): + * rendering/RenderObject.cpp: + (WebCore::RenderObject::setNeedsBoundariesUpdate): + * rendering/RenderObject.h: + * rendering/RenderObjectChildList.cpp: + (WebCore::RenderObjectChildList::removeChildNode): + * rendering/RenderPath.cpp: + (WebCore::RenderPath::layout): + (WebCore::RenderPath::paint): + * rendering/RenderPath.h: + (WebCore::RenderPath::path): + (WebCore::RenderPath::setNeedsBoundariesUpdate): + * rendering/RenderSVGBlock.cpp: + (WebCore::RenderSVGBlock::styleWillChange): + * rendering/RenderSVGBlock.h: + * rendering/RenderSVGContainer.cpp: + (WebCore::RenderSVGContainer::RenderSVGContainer): + (WebCore::RenderSVGContainer::layout): + (WebCore::RenderSVGContainer::paint): + (WebCore::RenderSVGContainer::updateCachedBoundaries): + * rendering/RenderSVGContainer.h: + (WebCore::RenderSVGContainer::setNeedsBoundariesUpdate): + (WebCore::RenderSVGContainer::objectBoundingBox): + (WebCore::RenderSVGContainer::strokeBoundingBox): + (WebCore::RenderSVGContainer::repaintRectInLocalCoordinates): + (WebCore::RenderSVGContainer::calculateLocalTransform): + * rendering/RenderSVGGradientStop.h: + (WebCore::RenderSVGGradientStop::strokeBoundingBox): + * rendering/RenderSVGHiddenContainer.cpp: + * rendering/RenderSVGHiddenContainer.h: + (WebCore::RenderSVGHiddenContainer::clippedOverflowRectForRepaint): + * rendering/RenderSVGImage.cpp: + (WebCore::RenderSVGImage::layout): + (WebCore::RenderSVGImage::styleWillChange): + * rendering/RenderSVGImage.h: + * rendering/RenderSVGInline.cpp: + (WebCore::RenderSVGInline::styleWillChange): + * rendering/RenderSVGInline.h: + * rendering/RenderSVGModelObject.cpp: + (WebCore::RenderSVGModelObject::styleWillChange): + * rendering/RenderSVGModelObject.h: + * rendering/RenderSVGRoot.cpp: + (WebCore::RenderSVGRoot::RenderSVGRoot): + (WebCore::RenderSVGRoot::layout): + (WebCore::RenderSVGRoot::styleWillChange): + (WebCore::RenderSVGRoot::updateCachedBoundaries): + * rendering/RenderSVGRoot.h: + (WebCore::RenderSVGRoot::setNeedsBoundariesUpdate): + (WebCore::RenderSVGRoot::setNeedsTransformUpdate): + (WebCore::RenderSVGRoot::objectBoundingBox): + (WebCore::RenderSVGRoot::strokeBoundingBox): + (WebCore::RenderSVGRoot::repaintRectInLocalCoordinates): + * rendering/RenderSVGText.cpp: + (WebCore::RenderSVGText::layout): + * rendering/RenderSVGTransformableContainer.cpp: + (WebCore::RenderSVGTransformableContainer::calculateLocalTransform): + * rendering/RenderSVGTransformableContainer.h: + * rendering/RenderSVGViewportContainer.cpp: + (WebCore::RenderSVGViewportContainer::calcViewport): + * rendering/SVGRenderSupport.cpp: + (WebCore::SVGRenderSupport::computeContainerBoundingBoxes): + (WebCore::SVGRenderSupport::paintInfoIntersectsRepaintRect): + * rendering/SVGRenderSupport.h: + * rendering/style/SVGRenderStyle.cpp: + (WebCore::SVGRenderStyle::diff): + +2010-08-30 Leandro Pereira <leandro@profusion.mobi> + + [EFL] Unreviewed. Build fix when ENABLE_WEB_SOCKETS=ON. + + EFL port does not yet support automated tests. + + * CMakeLists.txt: Add missing files. + * CMakeListsEfl.txt: Ditto. + +2010-08-30 Kenneth Russell <kbr@google.com> + + Reviewed by Chris Marrin. + + Expose Vector3 and associated operations + https://bugs.webkit.org/show_bug.cgi?id=44666 + + Rolling out earlier patch exposing Vector3 class in + TransformationMatrix.h. A different approach will be taken under + another bug. + + * platform/graphics/transforms/TransformationMatrix.cpp: + (WebCore::v3Length): + (WebCore::v3Scale): + (WebCore::v3Dot): + (WebCore::v3Combine): + (WebCore::v3Cross): + (WebCore::decompose): + * platform/graphics/transforms/TransformationMatrix.ha: + +2010-08-30 Jer Noble <jer.noble@apple.com> + + Build fix; Unreviewed. + + Added a export symbol to the WebCore.exp.in list. + + * WebCore.exp.in: + +2010-08-30 Chris Rogers <crogers@google.com> + + Reviewed by Kenneth Russell. + + Add audio cone effect files. The cone effect operates as defined in the OpenAL specification. + https://bugs.webkit.org/show_bug.cgi?id=44712 + + No new tests since audio API not implemented yet. + + * platform/audio: Added. + * platform/audio/Cone.cpp: Added. + (WebCore::ConeEffect::ConeEffect): + (WebCore::ConeEffect::gain): + * platform/audio/Cone.h: Added. + (WebCore::ConeEffect::setInnerAngle): + (WebCore::ConeEffect::innerAngle): + (WebCore::ConeEffect::setOuterAngle): + (WebCore::ConeEffect::outerAngle): + (WebCore::ConeEffect::setOuterGain): + (WebCore::ConeEffect::outerGain): + +2010-08-30 Chris Rogers <crogers@google.com> + + Reviewed by Chris Marrin. + + audio engine: add Reverb class + https://bugs.webkit.org/show_bug.cgi?id=36466 + + No new tests since audio API is not yet implemented. + + * platform/audio: Added. + * platform/audio/Reverb.cpp: Added. + (WebCore::calculateNormalizationScale): + (WebCore::Reverb::Reverb): + (WebCore::Reverb::initialize): + (WebCore::Reverb::process): + (WebCore::Reverb::reset): + * platform/audio/Reverb.h: Added. + (WebCore::Reverb::): + (WebCore::Reverb::impulseResponseLength): + +2010-08-30 Chris Rogers <crogers@google.com> + + Unreviewed + + Add WebCore/platform/audio directory + in preparation for landing: https://bugs.webkit.org/show_bug.cgi?id=36466 + + * platform/audio: Added. + +2010-08-27 Jer Noble <jer.noble@apple.com> + + Reviewed by Eric Carlson. + + text/plain non-video files cause <video> to hang (while reading them?) + https://bugs.webkit.org/show_bug.cgi?id=44212 + + Disable all the QuickTime components which ingest .txt files. + + New tests: + * http/tests/media/video-served-as-text.html: Added. + * http/tests/media/text-served-as-text.html: Added. + + * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: + (WebCore::MediaPlayerPrivate::createQTMovie): Disable all four text + 'eat' components. + * platform/mac/WebCoreSystemInterface.h: Add wkQTMovieDisableComponent. + * platform/mac/WebCoreSystemInterface.mm: Add wkQTMovieDisableComponent. + +2010-08-30 Robert Hogan <robert@webkit.org> + + Reviewed by Simon Hausmann. + + allow ports with windowed plugins to support windowless plugin tests + + https://bugs.webkit.org/show_bug.cgi?id=40730 + + Ports that implement plugins windowed by default need to have a way of + supporting plugin tests that assume the plugin is windowless. Add this + feature to the tests and support it in the webkit test plugin. Also + add mouse and keyboard event logging to the webkit-test plugin on Unix. + + Unskip the following tests on Qt: + + plugins/mouse-events.html + plugins/keyboard-events.html + plugins/mouse-events-fixedpos.html + + * plugins/qt/PluginViewQt.cpp: + (WebCore::PluginView::setFocus): + (WebCore::setXKeyEventSpecificFields): + +2010-08-30 Kinuko Yasuda <kinuko@chromium.org> + + Reviewed by Darin Fisher. + + Add DOMFileSystem implementation to support Entry manipulation operations + https://bugs.webkit.org/show_bug.cgi?id=44732 + + No new tests; tests will be added later. + + * storage/DOMFileSystem.cpp: + (WebCore::DOMFileSystem::root): + (WebCore::checkValidityForForCopyOrMove): Added. + (WebCore::DOMFileSystem::getMetadata): Added. + (WebCore::DOMFileSystem::move): Added. + (WebCore::DOMFileSystem::copy): Added. + (WebCore::DOMFileSystem::remove): Added. + (WebCore::DOMFileSystem::getParent): Added. + (WebCore::DOMFileSystem::getFile): Added. + (WebCore::DOMFileSystem::getDirectory): Added. + (WebCore::DOMFileSystem::readDirectory): Added. + * storage/DirectoryEntry.cpp: + (WebCore::DirectoryEntry::getFile): Added implementation. + (WebCore::DirectoryEntry::getDirectory): Added implementation. + * storage/DirectoryReader.cpp: + (WebCore::DirectoryReader::DirectoryReader): Added implementation. + (WebCore::DirectoryReader::readEntries): Added implementation. + * storage/DirectoryReader.h: + * storage/Entry.cpp: + (WebCore::Entry::getMetadata): Added implementation. + (WebCore::Entry::moveTo): Added implementation. + (WebCore::Entry::copyTo): Added implementation. + (WebCore::Entry::remove): Added implementation. + (WebCore::Entry::getParent): Added implementation. + * storage/Entry.h: + * storage/FileEntry.h: + + Added a helper template to schedule callbacks. + * storage/DOMFileSystem.h: + (WebCore::DOMFileSystem::DispatchCallbackTask): Added to schedule callbacks. + (WebCore::DOMFileSystem::scheduleCallback): Added to schedule callbacks. + + Changed to fire callbacks asynchronously. + * storage/LocalFileSystem.cpp: + (WebCore::LocalFileSystem::requestFileSystem): + +2010-08-30 Alejandro G. Castro <alex@igalia.com> + + Reviewed by Xan Lopez. + + Fixed compilation error, now that we have included the + GtkVersioning.h we have to remove some version dependent code from + EventSender. + + * platform/gtk/GtkVersioning.c: + (gdk_window_get_root_coords): + * platform/gtk/GtkVersioning.h: + +2010-08-30 Beth Dakin <bdakin@apple.com> + + Reviewed by Sam Weinig. + + Fix for https://bugs.webkit.org/show_bug.cgi?id=44804 Crashes in + RenderMathMLRoot::layout() and RenderMathMLRoot::paint() + -and corresponding- + <rdar://problem/8342055> + + All of the calls to firstChild() and lastChild() in + RenderMathMLRoot::layout() and RenderMathMLRoot::paint() need to be + null checked. + + * mathml/RenderMathMLRoot.cpp: + (WebCore::RenderMathMLRoot::paint): + (WebCore::RenderMathMLRoot::layout): + +2010-08-30 Beth Dakin <bdakin@apple.com> + + Reviewed by Darin Adler. + + Fix for https://bugs.webkit.org/show_bug.cgi?id=44801 Crash in + RenderMathMLSubSup::layout() + -and corresponding- + <rdar://problem/8325203> + + Null-check m_scripts. It is null-checked everywhere else in the + class and can legitimately be null. + + * mathml/RenderMathMLSubSup.cpp: + (WebCore::RenderMathMLSubSup::layout): + +2010-08-30 Alejandro G. Castro <alex@igalia.com> + + Reviewed by Martin Robinson. + + [Gtk] gdk_display_get_core_pointer and gdk_device_get_core_pointer + are deprecated + https://bugs.webkit.org/show_bug.cgi?id=44787 + + We have replaced GtkVersioning.cpp with GtkVersioning.c and + created a function (getDefaultGDKPointerDevice) to get the pointer + of the window with the new APIs. We added that function to DRT and + copyandpaste unit test. + + * GNUmakefile.am: + * platform/gtk/GtkVersioning.c: Added. + (gtk_adjustment_set_value): + (gtk_adjustment_configure): + (getDefaultGDKPointerDevice): + * platform/gtk/GtkVersioning.cpp: Removed. + * platform/gtk/GtkVersioning.h: + +2010-08-30 Darin Adler <darin@apple.com> + + Reviewed by Sam Weinig. + + Make SVG constructors private to make sure callers all use create + https://bugs.webkit.org/show_bug.cgi?id=44872 + + Made as many members private and protected as possible, and got rid of many + unneeded empty constructor and destructor definitions, in some cases changing + a class to be non-polymorphic. Made some functions inline. Used the word document + instead of the abbreviation doc. Removed unneeded explicit base class + initialization in cases where it is no different from the default behavior. + + * svg/SVGAElement.cpp: + (WebCore::SVGAElement::SVGAElement): + (WebCore::SVGAElement::childShouldCreateRenderer): + * svg/SVGAElement.h: + * svg/SVGAltGlyphElement.cpp: + (WebCore::SVGAltGlyphElement::SVGAltGlyphElement): + * svg/SVGAltGlyphElement.h: + * svg/SVGAngle.cpp: + * svg/SVGAngle.h: + * svg/SVGAnimateColorElement.cpp: + (WebCore::SVGAnimateColorElement::SVGAnimateColorElement): + * svg/SVGAnimateColorElement.h: + * svg/SVGAnimateElement.cpp: + (WebCore::SVGAnimateElement::SVGAnimateElement): + * svg/SVGAnimateElement.h: + * svg/SVGAnimateMotionElement.cpp: + (WebCore::SVGAnimateMotionElement::SVGAnimateMotionElement): + * svg/SVGAnimateMotionElement.h: + * svg/SVGAnimateTransformElement.cpp: + (WebCore::SVGAnimateTransformElement::SVGAnimateTransformElement): + * svg/SVGAnimateTransformElement.h: + * svg/SVGAnimatedPathData.cpp: + * svg/SVGAnimatedPathData.h: + * svg/SVGAnimatedPoints.cpp: + * svg/SVGAnimatedPoints.h: + * svg/SVGAnimationElement.cpp: + (WebCore::SVGAnimationElement::SVGAnimationElement): + * svg/SVGAnimationElement.h: + * svg/SVGCircleElement.cpp: + (WebCore::SVGCircleElement::SVGCircleElement): + * svg/SVGCircleElement.h: + * svg/SVGClipPathElement.cpp: + (WebCore::SVGClipPathElement::SVGClipPathElement): + * svg/SVGClipPathElement.h: + * svg/SVGColor.cpp: + * svg/SVGColor.h: + * svg/SVGComponentTransferFunctionElement.cpp: + (WebCore::SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement): + * svg/SVGComponentTransferFunctionElement.h: + * svg/SVGCursorElement.cpp: + (WebCore::SVGCursorElement::SVGCursorElement): + * svg/SVGCursorElement.h: + * svg/SVGDefsElement.cpp: + (WebCore::SVGDefsElement::SVGDefsElement): + * svg/SVGDefsElement.h: + * svg/SVGDescElement.cpp: + (WebCore::SVGDescElement::SVGDescElement): + * svg/SVGDescElement.h: + * svg/SVGDocument.cpp: + * svg/SVGDocument.h: + * svg/SVGDocumentExtensions.cpp: + (WebCore::SVGDocumentExtensions::SVGDocumentExtensions): + (WebCore::SVGDocumentExtensions::reportWarning): + (WebCore::SVGDocumentExtensions::reportError): + * svg/SVGDocumentExtensions.h: + * svg/SVGElement.h: + * svg/SVGElementInstanceList.h: + * svg/SVGEllipseElement.cpp: + (WebCore::SVGEllipseElement::SVGEllipseElement): + * svg/SVGEllipseElement.h: + * svg/SVGExternalResourcesRequired.cpp: + * svg/SVGExternalResourcesRequired.h: + * svg/SVGFEBlendElement.cpp: + (WebCore::SVGFEBlendElement::SVGFEBlendElement): + * svg/SVGFEBlendElement.h: + * svg/SVGFEColorMatrixElement.cpp: + (WebCore::SVGFEColorMatrixElement::SVGFEColorMatrixElement): + * svg/SVGFEColorMatrixElement.h: + * svg/SVGFEComponentTransferElement.cpp: + (WebCore::SVGFEComponentTransferElement::SVGFEComponentTransferElement): + * svg/SVGFEComponentTransferElement.h: + * svg/SVGFECompositeElement.cpp: + (WebCore::SVGFECompositeElement::SVGFECompositeElement): + * svg/SVGFECompositeElement.h: + * svg/SVGFEConvolveMatrixElement.cpp: + (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement): + * svg/SVGFEConvolveMatrixElement.h: + * svg/SVGFEDiffuseLightingElement.cpp: + (WebCore::SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement): + * svg/SVGFEDiffuseLightingElement.h: + * svg/SVGFEDisplacementMapElement.cpp: + (WebCore::SVGFEDisplacementMapElement::SVGFEDisplacementMapElement): + * svg/SVGFEDisplacementMapElement.h: + * svg/SVGFEDistantLightElement.cpp: + (WebCore::SVGFEDistantLightElement::SVGFEDistantLightElement): + * svg/SVGFEDistantLightElement.h: + * svg/SVGFEFloodElement.cpp: + (WebCore::SVGFEFloodElement::SVGFEFloodElement): + * svg/SVGFEFloodElement.h: + * svg/SVGFEFuncAElement.cpp: + (WebCore::SVGFEFuncAElement::SVGFEFuncAElement): + * svg/SVGFEFuncAElement.h: + * svg/SVGFEFuncBElement.cpp: + (WebCore::SVGFEFuncBElement::SVGFEFuncBElement): + * svg/SVGFEFuncBElement.h: + * svg/SVGFEFuncGElement.cpp: + (WebCore::SVGFEFuncGElement::SVGFEFuncGElement): + * svg/SVGFEFuncGElement.h: + * svg/SVGFEFuncRElement.cpp: + (WebCore::SVGFEFuncRElement::SVGFEFuncRElement): + * svg/SVGFEFuncRElement.h: + * svg/SVGFEGaussianBlurElement.cpp: + (WebCore::SVGFEGaussianBlurElement::SVGFEGaussianBlurElement): + * svg/SVGFEGaussianBlurElement.h: + * svg/SVGFEImageElement.cpp: + (WebCore::SVGFEImageElement::SVGFEImageElement): + * svg/SVGFEImageElement.h: + * svg/SVGFELightElement.cpp: + (WebCore::SVGFELightElement::SVGFELightElement): + * svg/SVGFELightElement.h: + * svg/SVGFEMergeElement.cpp: + (WebCore::SVGFEMergeElement::SVGFEMergeElement): + * svg/SVGFEMergeElement.h: + * svg/SVGFEMergeNodeElement.cpp: + (WebCore::SVGFEMergeNodeElement::SVGFEMergeNodeElement): + * svg/SVGFEMergeNodeElement.h: + * svg/SVGFEMorphologyElement.cpp: + (WebCore::SVGFEMorphologyElement::SVGFEMorphologyElement): + * svg/SVGFEMorphologyElement.h: + * svg/SVGFEOffsetElement.cpp: + (WebCore::SVGFEOffsetElement::SVGFEOffsetElement): + * svg/SVGFEOffsetElement.h: + * svg/SVGFEPointLightElement.cpp: + (WebCore::SVGFEPointLightElement::SVGFEPointLightElement): + (WebCore::SVGFEPointLightElement::lightSource): + * svg/SVGFEPointLightElement.h: + * svg/SVGFESpecularLightingElement.cpp: + (WebCore::SVGFESpecularLightingElement::SVGFESpecularLightingElement): + * svg/SVGFESpecularLightingElement.h: + * svg/SVGFESpotLightElement.cpp: + (WebCore::SVGFESpotLightElement::SVGFESpotLightElement): + * svg/SVGFESpotLightElement.h: + * svg/SVGFETileElement.cpp: + (WebCore::SVGFETileElement::SVGFETileElement): + * svg/SVGFETileElement.h: + * svg/SVGFETurbulenceElement.cpp: + (WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement): + * svg/SVGFETurbulenceElement.h: + * svg/SVGFilterElement.cpp: + (WebCore::SVGFilterElement::SVGFilterElement): + * svg/SVGFilterElement.h: + * svg/SVGFilterPrimitiveStandardAttributes.cpp: + (WebCore::SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes): + * svg/SVGFilterPrimitiveStandardAttributes.h: + * svg/SVGFitToViewBox.cpp: + * svg/SVGFitToViewBox.h: + * svg/SVGFontData.cpp: + * svg/SVGFontData.h: + * svg/SVGFontElement.cpp: + (WebCore::SVGFontElement::SVGFontElement): + * svg/SVGFontElement.h: + * svg/SVGFontFaceElement.cpp: + (WebCore::SVGFontFaceElement::SVGFontFaceElement): + * svg/SVGFontFaceElement.h: + * svg/SVGFontFaceFormatElement.cpp: + (WebCore::SVGFontFaceFormatElement::SVGFontFaceFormatElement): + * svg/SVGFontFaceFormatElement.h: + * svg/SVGFontFaceNameElement.cpp: + (WebCore::SVGFontFaceNameElement::SVGFontFaceNameElement): + * svg/SVGFontFaceNameElement.h: + * svg/SVGFontFaceSrcElement.cpp: + (WebCore::SVGFontFaceSrcElement::SVGFontFaceSrcElement): + * svg/SVGFontFaceSrcElement.h: + * svg/SVGFontFaceUriElement.cpp: + (WebCore::SVGFontFaceUriElement::SVGFontFaceUriElement): + * svg/SVGFontFaceUriElement.h: + * svg/SVGForeignObjectElement.cpp: + (WebCore::SVGForeignObjectElement::SVGForeignObjectElement): + * svg/SVGForeignObjectElement.h: + * svg/SVGGElement.cpp: + (WebCore::SVGGElement::SVGGElement): + * svg/SVGGElement.h: + * svg/SVGGlyphElement.cpp: + (WebCore::SVGGlyphElement::SVGGlyphElement): + * svg/SVGGlyphElement.h: + * svg/SVGGradientElement.cpp: + (WebCore::SVGGradientElement::SVGGradientElement): + * svg/SVGGradientElement.h: + * svg/SVGHKernElement.cpp: + (WebCore::SVGHKernElement::SVGHKernElement): + * svg/SVGHKernElement.h: + * svg/SVGImageElement.cpp: + (WebCore::SVGImageElement::SVGImageElement): + * svg/SVGImageElement.h: + * svg/SVGImageLoader.cpp: + * svg/SVGImageLoader.h: + * svg/SVGLangSpace.cpp: + * svg/SVGLangSpace.h: + * svg/SVGLengthList.cpp: + * svg/SVGLengthList.h: + * svg/SVGLineElement.cpp: + (WebCore::SVGLineElement::SVGLineElement): + * svg/SVGLineElement.h: + * svg/SVGLinearGradientElement.cpp: + (WebCore::SVGLinearGradientElement::SVGLinearGradientElement): + * svg/SVGLinearGradientElement.h: + * svg/SVGLocatable.cpp: + * svg/SVGLocatable.h: + * svg/SVGMPathElement.cpp: + (WebCore::SVGMPathElement::SVGMPathElement): + * svg/SVGMPathElement.h: + * svg/SVGMarkerElement.cpp: + (WebCore::SVGMarkerElement::SVGMarkerElement): + * svg/SVGMarkerElement.h: + * svg/SVGMaskElement.cpp: + (WebCore::SVGMaskElement::SVGMaskElement): + * svg/SVGMaskElement.h: + * svg/SVGMetadataElement.cpp: + (WebCore::SVGMetadataElement::SVGMetadataElement): + * svg/SVGMetadataElement.h: + * svg/SVGMissingGlyphElement.cpp: + (WebCore::SVGMissingGlyphElement::SVGMissingGlyphElement): + * svg/SVGMissingGlyphElement.h: + * svg/SVGNumberList.cpp: + * svg/SVGNumberList.h: + * svg/SVGPaint.cpp: + * svg/SVGPaint.h: + * svg/SVGParserUtilities.cpp: + (WebCore::genericParseNumber): + (WebCore::parseNumber): + * svg/SVGPathBlender.cpp: + * svg/SVGPathBlender.h: + * svg/SVGPathBuilder.h: + * svg/SVGPathByteStreamBuilder.h: + * svg/SVGPathByteStreamSource.cpp: + * svg/SVGPathByteStreamSource.h: + * svg/SVGPathConsumer.h: + * svg/SVGPathElement.cpp: + (WebCore::SVGPathElement::SVGPathElement): + * svg/SVGPathElement.h: + * svg/SVGPathParser.cpp: + * svg/SVGPathParser.h: + * svg/SVGPathSeg.cpp: + * svg/SVGPathSeg.h: + * svg/SVGPathSegArc.h: + * svg/SVGPathSegClosePath.cpp: + * svg/SVGPathSegClosePath.h: + * svg/SVGPathSegCurvetoCubic.h: + * svg/SVGPathSegCurvetoCubicSmooth.h: + * svg/SVGPathSegCurvetoQuadratic.h: + * svg/SVGPathSegCurvetoQuadraticSmooth.h: + * svg/SVGPathSegLineto.h: + * svg/SVGPathSegLinetoHorizontal.h: + * svg/SVGPathSegLinetoVertical.h: + * svg/SVGPathSegList.cpp: + * svg/SVGPathSegList.h: + * svg/SVGPathSegListBuilder.h: + * svg/SVGPathSegListSource.cpp: + * svg/SVGPathSegListSource.h: + * svg/SVGPathSegMoveto.h: + * svg/SVGPathSource.h: + * svg/SVGPathStringBuilder.cpp: + * svg/SVGPathStringBuilder.h: + * svg/SVGPathStringSource.cpp: + * svg/SVGPathStringSource.h: + * svg/SVGPatternElement.cpp: + (WebCore::SVGPatternElement::SVGPatternElement): + * svg/SVGPatternElement.h: + * svg/SVGPointList.cpp: + * svg/SVGPointList.h: + * svg/SVGPolyElement.cpp: + (WebCore::SVGPolyElement::SVGPolyElement): + * svg/SVGPolyElement.h: + * svg/SVGPolygonElement.cpp: + (WebCore::SVGPolygonElement::SVGPolygonElement): + * svg/SVGPolygonElement.h: + * svg/SVGPolylineElement.cpp: + (WebCore::SVGPolylineElement::SVGPolylineElement): + * svg/SVGPolylineElement.h: + * svg/SVGPreserveAspectRatio.cpp: + * svg/SVGPreserveAspectRatio.h: + * svg/SVGRadialGradientElement.cpp: + (WebCore::SVGRadialGradientElement::SVGRadialGradientElement): + * svg/SVGRadialGradientElement.h: + * svg/SVGRectElement.cpp: + (WebCore::SVGRectElement::SVGRectElement): + * svg/SVGRectElement.h: + * svg/SVGSVGElement.h: + * svg/SVGScriptElement.cpp: + (WebCore::SVGScriptElement::SVGScriptElement): + * svg/SVGScriptElement.h: + * svg/SVGSetElement.cpp: + (WebCore::SVGSetElement::SVGSetElement): + * svg/SVGSetElement.h: + * svg/SVGStopElement.cpp: + (WebCore::SVGStopElement::SVGStopElement): + * svg/SVGStopElement.h: + * svg/SVGStringList.cpp: + * svg/SVGStringList.h: + * svg/SVGStylable.cpp: + * svg/SVGStylable.h: + * svg/SVGStyleElement.cpp: + (WebCore::SVGStyleElement::SVGStyleElement): + * svg/SVGStyleElement.h: + * svg/SVGStyledElement.cpp: + (WebCore::SVGStyledElement::SVGStyledElement): + * svg/SVGStyledElement.h: + * svg/SVGStyledLocatableElement.cpp: + (WebCore::SVGStyledLocatableElement::SVGStyledLocatableElement): + * svg/SVGStyledLocatableElement.h: + * svg/SVGStyledTransformableElement.cpp: + (WebCore::SVGStyledTransformableElement::SVGStyledTransformableElement): + * svg/SVGStyledTransformableElement.h: + * svg/SVGSwitchElement.cpp: + (WebCore::SVGSwitchElement::SVGSwitchElement): + (WebCore::SVGSwitchElement::childShouldCreateRenderer): + * svg/SVGSwitchElement.h: + * svg/SVGSymbolElement.cpp: + (WebCore::SVGSymbolElement::SVGSymbolElement): + * svg/SVGSymbolElement.h: + * svg/SVGTRefElement.cpp: + (WebCore::SVGTRefElement::SVGTRefElement): + * svg/SVGTRefElement.h: + * svg/SVGTSpanElement.cpp: + (WebCore::SVGTSpanElement::SVGTSpanElement): + * svg/SVGTests.cpp: + * svg/SVGTests.h: + * svg/SVGTextContentElement.cpp: + (WebCore::SVGTextContentElement::SVGTextContentElement): + * svg/SVGTextContentElement.h: + * svg/SVGTextElement.cpp: + (WebCore::SVGTextElement::SVGTextElement): + * svg/SVGTextElement.h: + * svg/SVGTextPathElement.cpp: + (WebCore::SVGTextPathElement::SVGTextPathElement): + * svg/SVGTextPathElement.h: + * svg/SVGTextPositioningElement.cpp: + (WebCore::SVGTextPositioningElement::SVGTextPositioningElement): + * svg/SVGTextPositioningElement.h: + * svg/SVGTitleElement.cpp: + (WebCore::SVGTitleElement::SVGTitleElement): + * svg/SVGTransform.cpp: + * svg/SVGTransform.h: + * svg/SVGTransformable.cpp: + * svg/SVGTransformable.h: + * svg/SVGURIReference.cpp: + * svg/SVGURIReference.h: + * svg/SVGUseElement.cpp: + (WebCore::SVGUseElement::SVGUseElement): + (WebCore::SVGUseElement::expandSymbolElementsInShadowTree): + * svg/SVGUseElement.h: + * svg/SVGViewElement.cpp: + (WebCore::SVGViewElement::SVGViewElement): + * svg/SVGViewElement.h: + * svg/SVGViewSpec.cpp: + (WebCore::SVGViewSpec::SVGViewSpec): + * svg/SVGViewSpec.h: + * svg/SVGZoomAndPan.cpp: + * svg/SVGZoomAndPan.h: + * svg/SVGZoomEvent.cpp: + * svg/SVGZoomEvent.h: + +2010-08-30 Eric Carlson <eric.carlson@apple.com> + + Reviewed by Dan Bernstein. + + Disable automatic looping + https://bugs.webkit.org/show_bug.cgi?id=44844 + + Test: media/video-does-not-loop.html + + * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: + (WebCore::MediaPlayerPrivate::createQTMovie): Disable QuickTime automatic looping. + + * platform/graphics/win/QTMovie.cpp: + (QTMoviePrivate::createMovieController): Ditto. + +2010-08-30 Ryosuke Niwa <rniwa@webkit.org> + + Reviewed by Darin Adler. + + ApplyStyleCommand::applyInlineStyle needs cleanup + https://bugs.webkit.org/show_bug.cgi?id=44458 + + Cleanup: + 1. Isolated code to find the highest ancestor with embedding style, and deployed it in + ApplyStyleCommand::applyInlineStyle. + 2. Combined the code to remove embedding style up to enclosing block and the code to + remove unicode-bidi and direction properties between start and end nodes. + 3. Simplified the conditionals to apply embedding styles. + + No new tests are added since this is a cleanup. + + * editing/ApplyStyleCommand.cpp: + (WebCore::highestEmbeddingAncestor): Added. + (WebCore::ApplyStyleCommand::applyInlineStyle): See above. + +2010-08-30 Martin Robinson <mrobinson@igalia.com> + + Build fix. Add the new fileapi directory to the IDL vpath. + + * GNUmakefile.am: + +2010-08-30 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Xan Lopez. + + [GTK] WebKit DOM bindings build should not depend on output GNUMakefile + https://bugs.webkit.org/show_bug.cgi?id=44805 + + Move WebKit DOM bindings build rules to bindings/gobject/GNUmakefile.am to + prevent full WebKit API rebuilds when the automake files change. + + No new tests as this is just a build change. + + * bindings/gobject/GNUmakefile.am: Added. + +2010-08-30 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Yury Semikhatsky. + + Web Inspector: event listener properties are rendered as [object Object]. + https://bugs.webkit.org/show_bug.cgi?id=44779 + + * inspector/front-end/EventListenersSidebarPane.js: + +2010-08-30 Ryuan Choi <ryuan.choi@samsung.com> + + Unreviewed build fix with Blob Support + + [EFL] Build break with Blob support + https://bugs.webkit.org/show_bug.cgi?id=44858 + + No new features added, so no new tests. + + * CMakeLists.txt: + +2010-08-30 Andras Becsi <abecsi@webkit.org> + + Unreviewed trivial fix. + + [Qt] Let qmake know about HTML parser headers. + + No new tests needed. + + * WebCore.pro: + +2010-08-30 Andras Becsi <abecsi@webkit.org> + + Unreviewed build fix. + + [Qt] Fix fileapi header paths to fix warnings after r66365. + + No new tests needed. + + * WebCore.pro: + +2010-08-30 Csaba Osztrogonác <ossy@webkit.org> + + Reviewed by Kent Tamura. + + REGRESSION(r66355): Fix warnings in html/DateComponents.cpp + https://bugs.webkit.org/show_bug.cgi?id=44855 + + * html/DateComponents.cpp: + (WebCore::DateComponents::setMillisecondsSinceEpochForWeek): Suggested parentheses added around && within || + +2010-08-30 Csaba Osztrogonác <ossy@webkit.org> + + Reviewed by Darin Adler. + + REGRESSION(r66324): Fix warnings in editing/ApplyStyleCommand.cpp + https://bugs.webkit.org/show_bug.cgi?id=44843 + + * editing/ApplyStyleCommand.cpp: + (WebCore::ApplyStyleCommand::removeImplicitlyStyledElement): Suggested parentheses added around && within || + +2010-08-30 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r66198. + http://trac.webkit.org/changeset/66198 + https://bugs.webkit.org/show_bug.cgi?id=44856 + + It made tests crash on Qt bot (Requested by Ossy_ on #webkit). + + * inspector/Inspector.idl: + * inspector/InspectorController.cpp: + (WebCore::InspectorController::inspectedPageDestroyed): + (WebCore::InspectorController::close): + * inspector/InspectorFrontendClient.h: + * inspector/InspectorFrontendHost.cpp: + * inspector/InspectorFrontendHost.h: + * inspector/InspectorFrontendHost.idl: + * inspector/front-end/InspectorFrontendHostStub.js: + * inspector/front-end/inspector.js: + (WebInspector.inspectedPageDestroyed): + +2010-08-30 Marc-Antoine Ruel <maruel@chromium.org> + + Reviewed by Kent Tamura. + + Split webcore_svg off webcore_remaining. webcore_svg contains all svg + sources files. + https://bugs.webkit.org/show_bug.cgi?id=44840 + + * WebCore.gyp/WebCore.gyp: + +2010-08-13 MORITA Hajime <morrita@google.com> + + Reviewed by Kent Tamura. + + https://bugs.webkit.org/show_bug.cgi?id=43960 + [Chromium] styled scroll bar on the window is painted badly. + + WebKit assumes outermost scrollbar always painted. + So force their style to have the background color if it isn't + given by the stylesheet. + + Test: scrollbars/custom-scrollbar-with-incomplete-style.html + + * rendering/RenderObject.h: + (WebCore::RenderObject::hasBackground): Extracted body to RenderStyle for sharing. + * rendering/RenderScrollbar.cpp: + (WebCore::RenderScrollbar::getScrollbarPseudoStyle): Added the workaround as mentioned above. + * rendering/RenderScrollbar.h: + * rendering/style/RenderStyle.h: + (WebCore::InheritedFlags::hasBackground): Extracted from RenderObject. + +2010-08-30 Adam Barth <abarth@webkit.org> + + Reviewed by Darin Adler. + + WebCore::RenderBlock::addChild* NULL ptrs + https://bugs.webkit.org/show_bug.cgi?id=43722 + + Also includes some cleanup of comments and ASSERTs. + + Test: fast/ruby/before-doesnt-crash.html + + * rendering/RenderRuby.cpp: + (WebCore::RenderRubyAsInline::addChild): + +2010-08-30 Marc-Antoine Ruel <maruel@chromium.org> + + Reviewed by Kent Tamura + + Move most dependencies to webcore_prerequisites + https://bugs.webkit.org/show_bug.cgi?id=44814 + + * WebCore.gyp/WebCore.gyp: + +2010-08-30 Adam Barth <abarth@webkit.org> + + Move AsyncImageResizer back to html to fix Chromium build. + + * WebCore.gypi: + +2010-08-30 Adam Barth <abarth@webkit.org> + + Fix silly typo that breaks the build. + + * WebCore.pro: + +2010-08-30 Adam Barth <abarth@webkit.org> + + Attempt to fix the Qt build. + + * WebCore.pri: + +2010-08-30 Adam Barth <abarth@webkit.org> + + Attempt to fix Chromium build. + + * WebCore.gyp/WebCore.gyp: + +2010-08-29 Adam Barth <abarth@webkit.org> + + Rubber-stamped by Maciej Stachowiak. + + Move File and Blob related files from WebCore/html to WebCore/fileapi. + + * Android.mk: + * CMakeLists.txt: + * DerivedSources.make: + * GNUmakefile.am: + * WebCore.gypi: + * WebCore.pro: + * WebCore.vcproj/WebCore.vcproj: + * WebCore.vcproj/WebCoreCommon.vsprops: + * WebCore.xcodeproj/project.pbxproj: + * fileapi: Added. + * fileapi/AsyncFileWriter.h: Copied from WebCore/html/AsyncFileWriter.h. + * fileapi/Blob.cpp: Copied from WebCore/html/Blob.cpp. + * fileapi/Blob.h: Copied from WebCore/html/Blob.h. + * fileapi/Blob.idl: Copied from WebCore/html/Blob.idl. + * fileapi/BlobBuilder.cpp: Copied from WebCore/html/BlobBuilder.cpp. + * fileapi/BlobBuilder.h: Copied from WebCore/html/BlobBuilder.h. + * fileapi/BlobBuilder.idl: Copied from WebCore/html/BlobBuilder.idl. + * fileapi/BlobURL.cpp: Copied from WebCore/html/BlobURL.cpp. + * fileapi/BlobURL.h: Copied from WebCore/html/BlobURL.h. + * fileapi/File.cpp: Copied from WebCore/html/File.cpp. + * fileapi/File.h: Copied from WebCore/html/File.h. + * fileapi/File.idl: Copied from WebCore/html/File.idl. + * fileapi/FileError.h: Copied from WebCore/html/FileError.h. + * fileapi/FileError.idl: Copied from WebCore/html/FileError.idl. + * fileapi/FileList.cpp: Copied from WebCore/html/FileList.cpp. + * fileapi/FileList.h: Copied from WebCore/html/FileList.h. + * fileapi/FileList.idl: Copied from WebCore/html/FileList.idl. + * fileapi/FileReader.cpp: Copied from WebCore/html/FileReader.cpp. + * fileapi/FileReader.h: Copied from WebCore/html/FileReader.h. + * fileapi/FileReader.idl: Copied from WebCore/html/FileReader.idl. + * fileapi/FileStreamProxy.cpp: Copied from WebCore/html/FileStreamProxy.cpp. + * fileapi/FileStreamProxy.h: Copied from WebCore/html/FileStreamProxy.h. + * fileapi/FileThread.cpp: Copied from WebCore/html/FileThread.cpp. + * fileapi/FileThread.h: Copied from WebCore/html/FileThread.h. + * fileapi/FileThreadTask.h: Copied from WebCore/html/FileThreadTask.h. + * fileapi/FileWriter.cpp: Copied from WebCore/html/FileWriter.cpp. + * fileapi/FileWriter.h: Copied from WebCore/html/FileWriter.h. + * fileapi/FileWriter.idl: Copied from WebCore/html/FileWriter.idl. + * fileapi/FileWriterClient.h: Copied from WebCore/html/FileWriterClient.h. + * fileapi/ThreadableBlobRegistry.cpp: Copied from WebCore/html/ThreadableBlobRegistry.cpp. + * fileapi/ThreadableBlobRegistry.h: Copied from WebCore/html/ThreadableBlobRegistry.h. + * html/AsyncFileWriter.h: Removed. + * html/Blob.cpp: Removed. + * html/Blob.h: Removed. + * html/Blob.idl: Removed. + * html/BlobBuilder.cpp: Removed. + * html/BlobBuilder.h: Removed. + * html/BlobBuilder.idl: Removed. + * html/BlobURL.cpp: Removed. + * html/BlobURL.h: Removed. + * html/File.cpp: Removed. + * html/File.h: Removed. + * html/File.idl: Removed. + * html/FileError.h: Removed. + * html/FileError.idl: Removed. + * html/FileList.cpp: Removed. + * html/FileList.h: Removed. + * html/FileList.idl: Removed. + * html/FileReader.cpp: Removed. + * html/FileReader.h: Removed. + * html/FileReader.idl: Removed. + * html/FileStreamProxy.cpp: Removed. + * html/FileStreamProxy.h: Removed. + * html/FileThread.cpp: Removed. + * html/FileThread.h: Removed. + * html/FileThreadTask.h: Removed. + * html/FileWriter.cpp: Removed. + * html/FileWriter.h: Removed. + * html/FileWriter.idl: Removed. + * html/FileWriterClient.h: Removed. + * html/ThreadableBlobRegistry.cpp: Removed. + * html/ThreadableBlobRegistry.h: Removed. + +2010-08-29 Marc-Antoine Ruel <maruel@chromium.org> + + Reviewed by Kent Tamura. + + Move more common settings to webcore_prerequisites + https://bugs.webkit.org/show_bug.cgi?id=44812 + + * WebCore.gyp/WebCore.gyp: + +2010-08-29 Darin Adler <darin@apple.com> + + Reviewed by Maciej Stachowiak. + + Create SVG and WML elements with create functions instead of direct invocations of new + https://bugs.webkit.org/show_bug.cgi?id=44851 + + Added the create functions, made some existing constructors protected and private, + made some other member functions protected and and private, added some missing virtual + keywords for clarity to functions that already were overriding virtual functions, + fixed some inconsistent indentation, and removed some unneeded empty destructors. + + In the future, it will be good to have the constructors all be private so we don't + use them by accident. Then we'll change the reference count rule globally and add + all the necessary calls to adoptRef. + + The SVG changes are compiled and tested. The WML changes are speculative and untested. + + * dom/make_names.pl: Removed supportfor the createWithNew keyword. + * svg/svgtags.in: Removed all the createWithNew keywords. + * wml/WMLTagNames.in: Ditto. + + * svg/SVGAElement.cpp: + (WebCore::SVGAElement::create): Added. + * svg/SVGAElement.h: + * svg/SVGAltGlyphElement.cpp: + (WebCore::SVGAltGlyphElement::create): Added. + * svg/SVGAltGlyphElement.h: + * svg/SVGAnimateColorElement.cpp: + (WebCore::SVGAnimateColorElement::create): Added. + * svg/SVGAnimateColorElement.h: + * svg/SVGAnimateElement.cpp: + (WebCore::SVGAnimateElement::create): Added. + * svg/SVGAnimateElement.h: + * svg/SVGAnimateMotionElement.cpp: + (WebCore::SVGAnimateMotionElement::create): Added. + * svg/SVGAnimateMotionElement.h: + * svg/SVGAnimateTransformElement.cpp: + (WebCore::SVGAnimateTransformElement::create): Added. + * svg/SVGAnimateTransformElement.h: + * svg/SVGCircleElement.cpp: + (WebCore::SVGCircleElement::create): Added. + * svg/SVGCircleElement.h: + * svg/SVGClipPathElement.cpp: + (WebCore::SVGClipPathElement::create): Added. + * svg/SVGClipPathElement.h: + * svg/SVGCursorElement.cpp: + (WebCore::SVGCursorElement::create): Added. + * svg/SVGCursorElement.h: + * svg/SVGDefsElement.cpp: + (WebCore::SVGDefsElement::create): Added. + * svg/SVGDefsElement.h: + * svg/SVGDescElement.cpp: + (WebCore::SVGDescElement::create): Added. + * svg/SVGDescElement.h: + * svg/SVGEllipseElement.cpp: + (WebCore::SVGEllipseElement::create): Added. + * svg/SVGEllipseElement.h: + * svg/SVGFEBlendElement.cpp: + (WebCore::SVGFEBlendElement::create): Added. + * svg/SVGFEBlendElement.h: + * svg/SVGFEColorMatrixElement.cpp: + (WebCore::SVGFEColorMatrixElement::create): Added. + * svg/SVGFEColorMatrixElement.h: + * svg/SVGFEComponentTransferElement.cpp: + (WebCore::SVGFEComponentTransferElement::create): Added. + * svg/SVGFEComponentTransferElement.h: + * svg/SVGFECompositeElement.cpp: + (WebCore::SVGFECompositeElement::create): Added. + * svg/SVGFECompositeElement.h: + * svg/SVGFEConvolveMatrixElement.cpp: + (WebCore::SVGFEConvolveMatrixElement::create): Added. + * svg/SVGFEConvolveMatrixElement.h: + * svg/SVGFEDiffuseLightingElement.cpp: + (WebCore::SVGFEDiffuseLightingElement::create): Added. + * svg/SVGFEDiffuseLightingElement.h: + * svg/SVGFEDisplacementMapElement.cpp: + (WebCore::SVGFEDisplacementMapElement::create): Added. + * svg/SVGFEDisplacementMapElement.h: + * svg/SVGFEDistantLightElement.cpp: + (WebCore::SVGFEDistantLightElement::create): Added. + * svg/SVGFEDistantLightElement.h: + * svg/SVGFEFloodElement.cpp: + (WebCore::SVGFEFloodElement::create): Added. + * svg/SVGFEFloodElement.h: + * svg/SVGFEFuncAElement.cpp: + (WebCore::SVGFEFuncAElement::create): Added. + * svg/SVGFEFuncAElement.h: + * svg/SVGFEFuncBElement.cpp: + (WebCore::SVGFEFuncBElement::create): Added. + * svg/SVGFEFuncBElement.h: + * svg/SVGFEFuncGElement.cpp: + (WebCore::SVGFEFuncGElement::create): Added. + * svg/SVGFEFuncGElement.h: + * svg/SVGFEFuncRElement.cpp: + (WebCore::SVGFEFuncRElement::create): Added. + * svg/SVGFEFuncRElement.h: + * svg/SVGFEGaussianBlurElement.cpp: + (WebCore::SVGFEGaussianBlurElement::create): Added. + * svg/SVGFEGaussianBlurElement.h: + * svg/SVGFEImageElement.cpp: + (WebCore::SVGFEImageElement::create): Added. + * svg/SVGFEImageElement.h: + * svg/SVGFEMergeElement.cpp: + (WebCore::SVGFEMergeElement::create): Added. + * svg/SVGFEMergeElement.h: + * svg/SVGFEMergeNodeElement.cpp: + (WebCore::SVGFEMergeNodeElement::create): Added. + * svg/SVGFEMergeNodeElement.h: + * svg/SVGFEMorphologyElement.cpp: + (WebCore::SVGFEMorphologyElement::create): Added. + * svg/SVGFEMorphologyElement.h: + * svg/SVGFEOffsetElement.cpp: + (WebCore::SVGFEOffsetElement::create): Added. + * svg/SVGFEOffsetElement.h: + * svg/SVGFEPointLightElement.cpp: + (WebCore::SVGFEPointLightElement::create): Added. + * svg/SVGFEPointLightElement.h: + * svg/SVGFESpecularLightingElement.cpp: + (WebCore::SVGFESpecularLightingElement::create): Added. + * svg/SVGFESpecularLightingElement.h: + * svg/SVGFESpotLightElement.cpp: + (WebCore::SVGFESpotLightElement::create): Added. + * svg/SVGFESpotLightElement.h: + * svg/SVGFETileElement.cpp: + (WebCore::SVGFETileElement::create): Added. + * svg/SVGFETileElement.h: + * svg/SVGFETurbulenceElement.cpp: + (WebCore::SVGFETurbulenceElement::create): Added. + * svg/SVGFETurbulenceElement.h: + * svg/SVGFilterElement.cpp: + (WebCore::SVGFilterElement::create): Added. + * svg/SVGFilterElement.h: + * svg/SVGFontElement.cpp: + (WebCore::SVGFontElement::create): Added. + * svg/SVGFontElement.h: + * svg/SVGFontFaceElement.cpp: + (WebCore::SVGFontFaceElement::create): Added. + * svg/SVGFontFaceElement.h: + * svg/SVGFontFaceFormatElement.cpp: + (WebCore::SVGFontFaceFormatElement::create): Added. + * svg/SVGFontFaceFormatElement.h: + * svg/SVGFontFaceNameElement.cpp: + (WebCore::SVGFontFaceNameElement::create): Added. + * svg/SVGFontFaceNameElement.h: + * svg/SVGFontFaceSrcElement.cpp: + (WebCore::SVGFontFaceSrcElement::create): Added. + * svg/SVGFontFaceSrcElement.h: + * svg/SVGFontFaceUriElement.cpp: + (WebCore::SVGFontFaceUriElement::create): Added. + * svg/SVGFontFaceUriElement.h: + * svg/SVGForeignObjectElement.cpp: + (WebCore::SVGForeignObjectElement::create): Added. + * svg/SVGForeignObjectElement.h: + * svg/SVGGElement.cpp: + (WebCore::SVGGElement::create): Added. + * svg/SVGGElement.h: + * svg/SVGGlyphElement.cpp: + (WebCore::SVGGlyphElement::create): Added. + * svg/SVGGlyphElement.h: + * svg/SVGHKernElement.cpp: + (WebCore::SVGHKernElement::create): Added. + * svg/SVGHKernElement.h: + * svg/SVGImageElement.cpp: + (WebCore::SVGImageElement::create): Added. + * svg/SVGImageElement.h: + * svg/SVGLineElement.cpp: + (WebCore::SVGLineElement::create): Added. + * svg/SVGLineElement.h: + * svg/SVGLinearGradientElement.cpp: + (WebCore::SVGLinearGradientElement::create): Added. + * svg/SVGLinearGradientElement.h: + * svg/SVGMPathElement.cpp: + (WebCore::SVGMPathElement::create): Added. + * svg/SVGMPathElement.h: + * svg/SVGMarkerElement.cpp: + (WebCore::SVGMarkerElement::create): Added. + * svg/SVGMarkerElement.h: + * svg/SVGMaskElement.cpp: + (WebCore::SVGMaskElement::create): Added. + * svg/SVGMaskElement.h: + * svg/SVGMetadataElement.cpp: + (SVGMetadataElement::create): Added. + * svg/SVGMetadataElement.h: + * svg/SVGMissingGlyphElement.cpp: + (WebCore::SVGMissingGlyphElement::create): Added. + * svg/SVGMissingGlyphElement.h: + * svg/SVGPathElement.cpp: + (WebCore::SVGPathElement::create): Added. + * svg/SVGPathElement.h: + * svg/SVGPatternElement.cpp: + (WebCore::SVGPatternElement::create): Added. + * svg/SVGPatternElement.h: + * svg/SVGPolygonElement.cpp: + (WebCore::SVGPolygonElement::create): Added. + * svg/SVGPolygonElement.h: + * svg/SVGPolylineElement.cpp: + (WebCore::SVGPolylineElement::create): Added. + * svg/SVGPolylineElement.h: + * svg/SVGRadialGradientElement.cpp: + (WebCore::SVGRadialGradientElement::create): Added. + * svg/SVGRadialGradientElement.h: + * svg/SVGRectElement.cpp: + (WebCore::SVGRectElement::create): Added. + * svg/SVGRectElement.h: + * svg/SVGSVGElement.cpp: + (WebCore::SVGSVGElement::create): Added. + * svg/SVGSVGElement.h: + * svg/SVGScriptElement.cpp: + (WebCore::SVGScriptElement::create): Added. + * svg/SVGScriptElement.h: + * svg/SVGSetElement.cpp: + (WebCore::SVGSetElement::create): Added. + * svg/SVGSetElement.h: + * svg/SVGStopElement.cpp: + (WebCore::SVGStopElement::create): Added. + * svg/SVGStopElement.h: + (WebCore::SVGStyleElement::create): Added. + * svg/SVGStyleElement.h: + * svg/SVGSwitchElement.cpp: + (WebCore::SVGSwitchElement::create): Added. + * svg/SVGSwitchElement.h: + * svg/SVGSymbolElement.cpp: + (WebCore::SVGSymbolElement::create): Added. + * svg/SVGSymbolElement.h: + * svg/SVGTRefElement.cpp: + (WebCore::SVGTRefElement::create): Added. + * svg/SVGTRefElement.h: + * svg/SVGTSpanElement.cpp: + (WebCore::SVGTSpanElement::create): Added. + * svg/SVGTSpanElement.h: + * svg/SVGTextContentElement.h: + * svg/SVGTextElement.cpp: + (WebCore::SVGTextElement::create): Added. + * svg/SVGTextElement.h: + * svg/SVGTextPathElement.cpp: + (WebCore::SVGTextPathElement::create): Added. + * svg/SVGTextPathElement.h: + * svg/SVGTextPositioningElement.h: + * svg/SVGTitleElement.cpp: + (WebCore::SVGTitleElement::create): Added. + * svg/SVGTitleElement.h: + * svg/SVGUseElement.cpp: + (WebCore::SVGUseElement::create): Added. + * svg/SVGUseElement.h: + * svg/SVGVKernElement.cpp: + (WebCore::SVGVKernElement::create): Added. + * svg/SVGVKernElement.h: + * svg/SVGViewElement.cpp: + (WebCore::SVGViewElement::create): Added. + * svg/SVGViewElement.h: + * wml/WMLAElement.cpp: + (WebCore::WMLAElement::create): Added. + * wml/WMLAElement.h: + * wml/WMLAccessElement.cpp: + (WebCore::WMLAccessElement::create): Added. + * wml/WMLAccessElement.h: + * wml/WMLAnchorElement.cpp: + (WebCore::WMLAnchorElement::create): Added. + * wml/WMLAnchorElement.h: + * wml/WMLBRElement.cpp: + (WebCore::WMLBRElement::create): Added. + * wml/WMLBRElement.h: + * wml/WMLCardElement.cpp: + (WebCore::WMLCardElement::create): Added. + * wml/WMLCardElement.h: + * wml/WMLDoElement.cpp: + (WebCore::WMLDoElement::create): Added. + * wml/WMLDoElement.h: + * wml/WMLFieldSetElement.cpp: + (WebCore::WMLFieldSetElement::create): Added. + * wml/WMLFieldSetElement.h: + * wml/WMLFormControlElement.cpp: + (WebCore::WMLFormControlElement::create): Added. + * wml/WMLGoElement.cpp: + (WebCore::WMLGoElement::create): Added. + * wml/WMLGoElement.h: + * wml/WMLImageElement.cpp: + (WebCore::WMLImageElement::create): Added. + * wml/WMLImageElement.h: + * wml/WMLInputElement.cpp: + (WebCore::WMLInputElement::create): Added. + * wml/WMLInputElement.h: + * wml/WMLInsertedLegendElement.cpp: + (WebCore::WMLInsertedLegendElement::create): Added. + * wml/WMLInsertedLegendElement.h: + * wml/WMLIntrinsicEvent.cpp: + (WebCore::WMLIntrinsicEvent::create): Added. + * wml/WMLMetaElement.cpp: + (WebCore::WMLMetaElement::create): Added. + * wml/WMLMetaElement.h: + * wml/WMLNoopElement.cpp: + (WebCore::WMLNoopElement::create): Added. + * wml/WMLNoopElement.h: + * wml/WMLOnEventElement.cpp: + (WebCore::WMLOnEventElement::create): Added. + * wml/WMLOnEventElement.h: + * wml/WMLOptGroupElement.cpp: + (WebCore::WMLOptGroupElement::create): Added. + * wml/WMLOptGroupElement.h: + * wml/WMLOptionElement.cpp: + (WebCore::WMLOptionElement::create): Added. + * wml/WMLOptionElement.h: + * wml/WMLPElement.cpp: + (WebCore::WMLPElement::create): Added. + * wml/WMLPElement.h: + * wml/WMLPostfieldElement.cpp: + (WebCore::WMLPostfieldElement::create): Added. + * wml/WMLPostfieldElement.h: + * wml/WMLPrevElement.cpp: + (WebCore::WMLPrevElement::create): Added. + * wml/WMLPrevElement.h: + * wml/WMLRefreshElement.cpp: + (WebCore::WMLRefreshElement::create): Added. + * wml/WMLRefreshElement.h: + * wml/WMLSelectElement.cpp: + (WebCore::WMLSelectElement::create): Added. + * wml/WMLSelectElement.h: + * wml/WMLSetvarElement.cpp: + (WebCore::WMLSetvarElement::create): Added. + * wml/WMLSetvarElement.h: + * wml/WMLTableElement.cpp: + (WebCore::WMLTableElement::create): Added. + * wml/WMLTableElement.h: + * wml/WMLTaskElement.cpp: + (WebCore::WMLTaskElement::create): Added. + * wml/WMLTaskElement.h: + * wml/WMLTemplateElement.cpp: + (WebCore::WMLTemplateElement::create): Added. + * wml/WMLTemplateElement.h: + * wml/WMLTimerElement.cpp: + (WebCore::WMLTimerElement::create): Added. + * wml/WMLTimerElement.h: + +2010-08-29 Marc-Antoine Ruel <maruel@chromium.org> + + Reviewed by Kent Tamura. + + Rename webcore to 'webcore_remaining'. + https://bugs.webkit.org/show_bug.cgi?id=44796 + + Create a meta-target webcore that inherits from every webcore_XXX targets. (Currently 1) + Move direct_dependent_settings and export_dependent_settings from webcore_remaining to webcore + + Obviously, there will be other webcore_XXX targets. Keeping the change as small as possible. + + * WebCore.gyp/WebCore.gyp: + +2010-08-29 Jeremy Moskovich <jeremy@chromium.org> + + Reviewed by Dimitri Glazkov. + + First step in unforking Chrome's FontPlatformDataMac.mm. + Move files from platform/graphics/mac to platform/graphics/cocoa + + https://bugs.webkit.org/show_bug.cgi?id=41398 + + Just moving files around so no new tests. + + * WebCore.gyp/WebCore.gyp: + * WebCore.gypi: + * WebCore.xcodeproj/project.pbxproj: + * platform/graphics/chromium/FontPlatformDataChromiumMac.mm: + * platform/graphics/cocoa/FontPlatformData.h: Copied from WebCore/platform/graphics/mac/FontPlatformData.h. + * platform/graphics/cocoa/FontPlatformDataCocoa.mm: Copied from WebCore/platform/graphics/mac/FontPlatformDataMac.mm. + * platform/graphics/mac/FontPlatformData.h: Removed. + * platform/graphics/mac/FontPlatformDataMac.mm: Removed. + +2010-08-29 Kent Tamura <tkent@chromium.org> + + Reviewed by Darin Adler. + + Introduce isValidValue(const String&) of HTMLInputElement and HTMLTextAreaElement + https://bugs.webkit.org/show_bug.cgi?id=43537 + + isValidValue() is useful for browser implementations to propose + form field values without breaking form validity. + No new tests because these functions are not exposed to JavaScript. + + * html/HTMLFormControlElement.h: + (WebCore::HTMLTextFormControlElement::): + Remove virtual valueMissing(), patternMismatch(), and tooLong(). + * html/HTMLInputElement.cpp: + (WebCore::isValidColorString): Moved from ValidityState. + (WebCore::isValidEmailAddress): ditto. + (WebCore::HTMLInputElement::isValidValue): Added. + (WebCore::HTMLInputElement::typeMismatch): Add a String parameter. + (WebCore::HTMLInputElement::valueMissing): Add a String parameter. + (WebCore::HTMLInputElement::patternMismatch): Add a String parameter. + (WebCore::HTMLInputElement::tooLong): Add String and NeedsToCheckDirtyFlag parameters. + (WebCore::HTMLInputElement::rangeUnderflow): Add a String parameter. + (WebCore::HTMLInputElement::rangeOverflow): Add a String parameter. + (WebCore::HTMLInputElement::stepMismatch): Add a String parameter. + * html/HTMLInputElement.h: + * html/HTMLTextAreaElement.cpp: + (WebCore::HTMLTextAreaElement::tooLong): Add String and NeedsToCheckDirtyFlag parameters. + (WebCore::HTMLTextAreaElement::isValidValue): Added. + * html/HTMLTextAreaElement.h: + (WebCore::HTMLTextAreaElement::valueMissing): + * html/ValidityState.cpp: + (WebCore::ValidityState::valueMissing): Calls valueMissing() of HTMLInputElement or HTMLTextAreaElement. + (WebCore::ValidityState::typeMismatch): Passes value() to HTMLInputElement::typeMismatch(). + (WebCore::ValidityState::patternMismatch): Calls patternMismatch() of HTMLInputElement. + (WebCore::ValidityState::tooLong): Calls valueMissing() of HTMLInputElement or HTMLTextAreaElement. + (WebCore::ValidityState::rangeUnderflow): Passes value() to HTMLInputElement::rangeUnderflow(). + (WebCore::ValidityState::rangeOverflow): Passes value() to HTMLInputElement::rangeUnderflow(). + (WebCore::ValidityState::stepMismatch): Passes value() to HTMLInputElement::stepMismatch(). + * html/ValidityState.h: + +2010-08-29 Kent Tamura <tkent@chromium.org> + + Reviewed by Darin Adler. + + Change lower and higher limits of date/datetime/datetime-local/month/week types + https://bugs.webkit.org/show_bug.cgi?id=39737 + + According to the latest draft of HTML5, ISO-8601 dates in HTML5 + should support A.D.0001 in Gregorian calendar though Gregorian + calendar started in 1582. So, we change the lower limits of + date&time types to 0001-01-01T00:00. + + We also introduce the common higher limit, 275760-09-13T00:00. It + is the higher limit of Date type of ECMAScript. + + * html/DateComponents.cpp: + (WebCore::DateComponents::parseYear): + Rejects years less than A.D.1 and years greater than 275760. + (WebCore::withinHTMLDateLimits): + Helper functions to check lower and higher limits. + (WebCore::DateComponents::addDay): + - Remove an overflow check. 'year' can't be so large number because + parseYear() rejects such numbers. + - Add withinHTMLDateLimits() calls. + (WebCore::DateComponents::addMinute): + - Add an assertion for the base date. + - Add withinHTMLDateLimits() calls. + (WebCore::DateComponents::parseMonth): + Add withinHTMLDateLimits() call. + (WebCore::DateComponents::parseDate): ditto. + (WebCore::DateComponents::parseWeek): ditto. + (WebCore::DateComponents::parseDateTimeLocal): ditto. + (WebCore::DateComponents::parseDateTime): ditto. + (WebCore::DateComponents::setMillisecondsSinceEpochForDate): ditto. + (WebCore::DateComponents::setMillisecondsSinceEpochForDateTime): ditto. + (WebCore::DateComponents::setMillisecondsSinceEpochForMonth): ditto. + (WebCore::DateComponents::setMonthsSinceEpoch): + Add year range check and withinHTMLDateLimits() call. + (WebCore::DateComponents::setMillisecondsSinceEpochForWeek): + Add year range check and week range check. + * html/DateComponents.h: + Update minimum/maximum constant values. + (WebCore::DateComponents::minimumDate): + (WebCore::DateComponents::minimumDateTime): + (WebCore::DateComponents::minimumMonth): + (WebCore::DateComponents::minimumWeek): + (WebCore::DateComponents::maximumDate): + (WebCore::DateComponents::maximumDateTime): + (WebCore::DateComponents::maximumMonth): + (WebCore::DateComponents::maximumWeek): + +2010-08-29 Kwang Yul Seo <skyul@company100.net> + + Reviewed by Kent Tamura. + + [BREWMP] Port SharedBuffer::createWithContentsOfFile + https://bugs.webkit.org/show_bug.cgi?id=34412 + + Implement SharedBuffer::createWithContentsOfFile with IFile. + + * platform/brew/SharedBufferBrew.cpp: Added. + (WebCore::SharedBuffer::createWithContentsOfFile): + +2010-08-29 Enrica Casucci <enrica@apple.com> + + Reviewed by Adele Peterson. + + Crash when dragging text in Google Docs + https://bugs.webkit.org/show_bug.cgi?id=20471 + <rdar://problem/7783629> + + This fixes the crash but also fixes the generated markup when + performing a replacement at the border with an inline, to avoid the + new content being merged into the inline. + The crash is happening when doApply detects the need of merging + the start and the end of the new paragraph and the destination position + is moved inside an inline. + + I've added new test cases to an existing layout test. + + * editing/ReplaceSelectionCommand.cpp: + (WebCore::ReplaceSelectionCommand::doApply): When the situation described above is detected, + we insert a placeholder to avoid merging into the inline. + +2010-08-29 Adam Barth <abarth@webkit.org> + + Reviewed by Darin Adler. + + Implement HTML5's fakepath + https://bugs.webkit.org/show_bug.cgi?id=29000 + + The HTML 5 spec says to prepend C:\fakepath\ to the value of an + <input type="file"> control, so that's what we do now. + + * html/HTMLInputElement.cpp: + (WebCore::HTMLInputElement::value): + +2010-08-29 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r66329. + http://trac.webkit.org/changeset/66329 + https://bugs.webkit.org/show_bug.cgi?id=44845 + + broke chromium mac (Requested by jamesr on #webkit). + + * WebCore.gypi: + * WebCore.xcodeproj/project.pbxproj: + * platform/graphics/mac/FontPlatformData.h: Renamed from WebCore/platform/graphics/cocoa/FontPlatformData.h. + (WebCore::toCTFontRef): + (WebCore::FontPlatformData::FontPlatformData): + (WebCore::FontPlatformData::isHashTableDeletedValue): + (WebCore::FontPlatformData::size): + (WebCore::FontPlatformData::syntheticBold): + (WebCore::FontPlatformData::syntheticOblique): + (WebCore::FontPlatformData::hash): + (WebCore::FontPlatformData::operator==): + (WebCore::FontPlatformData::font): + (WebCore::FontPlatformData::isColorBitmapFont): + (WebCore::FontPlatformData::cgFont): + (WebCore::FontPlatformData::hashTableDeletedFontValue): + * platform/graphics/mac/FontPlatformDataMac.mm: Renamed from WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm. + (WebCore::FontPlatformData::FontPlatformData): + (WebCore::~FontPlatformData): + (WebCore::FontPlatformData::operator=): + (WebCore::FontPlatformData::setFont): + (WebCore::FontPlatformData::roundsGlyphAdvances): + (WebCore::FontPlatformData::allowsLigatures): + (WebCore::FontPlatformData::ctFont): + (WebCore::FontPlatformData::description): + +2010-08-29 Simon Fraser <simon.fraser@apple.com> + + Reviewed by Darin Adler. + + Fix RenderStyle::addCursor to use a StyleImage, not a CachedImage + https://bugs.webkit.org/show_bug.cgi?id=44719 + + Modernize the CSS cursor code to use a StyleImage, rather + than a CachedImage in the CursorData, and handle the loading + of pending images for the cursor property. + + Covered by manual tests in WebCore/manual-tests + + * css/CSSComputedStyleDeclaration.cpp: + (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): + * css/CSSStyleSelector.cpp: + (WebCore::CSSStyleSelector::applyProperty): + (WebCore::CSSStyleSelector::loadPendingImages): + * html/canvas/WebGLRenderingContext.cpp: + * page/EventHandler.cpp: + (WebCore::EventHandler::selectCursor): + * rendering/style/CursorData.h: + (WebCore::CursorData::CursorData): + (WebCore::CursorData::image): + (WebCore::CursorData::setImage): + * rendering/style/CursorList.h: + (WebCore::CursorList::operator[]): + * rendering/style/RenderStyle.cpp: + (WebCore::RenderStyle::addCursor): + * rendering/style/RenderStyle.h: + +2010-08-29 Simon Fraser <simon.fraser@apple.com> + + Reviewed by Darin Adler. + + When properties are missing from animation keyframes, interpolate between those keyframes that specify them + https://bugs.webkit.org/show_bug.cgi?id=40794 + + When a property does not appear in all keyframes of a keyframe animation, we currently use the + value of that property from the unanimated style. That forces the author to use additional + keyframes for properties that need to "skip a keyframe", which is laborious. + + With this change, properties are interpolated between the keyframes in which they appear. + This is equivalent to splitting each property out into its own set of keyframes. + + Tests: animations/missing-keyframe-properties-repeating.html + animations/missing-keyframe-properties-timing-function.html + animations/missing-keyframe-properties.html + + * css/CSSStyleSelector.h: + * css/CSSStyleSelector.cpp: + (WebCore::CSSStyleSelector::styleForKeyframe): Pass a KeyframeValue in so that we can + collect which properties are represented per keyframe. + (WebCore::CSSStyleSelector::keyframeStylesForAnimation): Keyframes are inserted into a + KeyframeList by object now, rather than by key and style. + + * page/animation/AnimationBase.cpp: + (WebCore::AnimationBase::progress): Use AnimationDirectionAlternate for readability. + + * page/animation/KeyframeAnimation.cpp: + (WebCore::KeyframeAnimation::fetchIntervalEndpointsForProperty): Renamed from getKeyframeAnimationInterval. + Use fractionalTime etc to match AnimationBase::progress(), and do lookups per-property. + Simplify the code that finds the relevant keyframe to do less work. + (WebCore::KeyframeAnimation::animate): Call fetchIntervalEndpointsForProperty() for each property, rather than just once for the + entire keyframe. + (WebCore::KeyframeAnimation::getAnimatedStyle): Ditto. + (WebCore::KeyframeAnimation::hasAnimationForProperty): FIXME comment. + + * page/animation/KeyframeAnimation.h: Rename getKeyframeAnimationInterval() to fetchIntervalEndpointsForProperty(). + + * rendering/RenderLayerBacking.cpp: + (WebCore::RenderLayerBacking::startAnimation): For hardware animations, only insert values + for keyframes which contain the property. + + (WebCore::KeyframeList::KeyframeList): insert() takes a KeyframeValue now. + * rendering/style/KeyframeList.cpp: + (WebCore::KeyframeList::operator==): + (WebCore::KeyframeList::insert): Fix insert/replace logic, and ensure we maintain the + m_properties hash. + + * rendering/style/KeyframeList.h: + (WebCore::KeyframeValue::KeyframeValue): Make members private, with accessors. + Add a m_properties HashSet for the properties animated in this keyframe. + + +2010-08-29 Csaba Osztrogonác <ossy@webkit.org> + + Reviewed by Darin Adler. + + REGRESSION(r66324): Fix warnings in editing/ApplyStyleCommand.cpp + https://bugs.webkit.org/show_bug.cgi?id=44843 + + * editing/ApplyStyleCommand.cpp: + (WebCore::ApplyStyleCommand::removeImplicitlyStyledElement): Suggested parentheses added around && within || + +2010-08-29 Darin Adler <darin@apple.com> + + Try to fix Mac build. + + * WebCore.xcodeproj/project.pbxproj: Mark CounterContent.h Private instead of Project. + +2010-08-29 Pawel Hajdan <phajdan.jr@chromium.org> + + Reviewed by Darin Adler. + + Fix libxml workarounds to work with recent versions of libxml. + I was testing locally with libxml2-2.7.6. + https://bugs.webkit.org/show_bug.cgi?id=30508 + + Based on patch by Philippe Normand <pnormand@igalia.com>. + + This also fixes a Chromium bug: + http://code.google.com/p/chromium/issues/detail?id=29333 + + * dom/XMLDocumentParserLibxml2.cpp: + (WebCore::switchToUTF16): + (WebCore::XMLParserContext::createStringParser): + (WebCore::XMLDocumentParser::doWrite): + (WebCore::startDocumentHandler): + +2010-08-29 Darin Adler <darin@apple.com> + + Try to fix Windows build. + + * rendering/style/ContentData.h: Added include of CounterContent.h. + + * css/CSSStyleSelector.cpp: Removed include of CounterContent.h. + * rendering/style/ContentData.cpp: Ditto. + * rendering/style/RenderStyle.cpp: Ditto. + +2010-08-29 Darin Adler <darin@apple.com> + + Reviewed by Sam Weinig. + + Deploy OwnPtr, PassOwnPtr, and adoptPtr in some CSS-related files + https://bugs.webkit.org/show_bug.cgi?id=44834 + + * css/CSSFunctionValue.cpp: + (WebCore::CSSFunctionValue::CSSFunctionValue): Updated since + CSSParserFunction::args is an OwnPtr. + (WebCore::CSSFunctionValue::parserValue): Ditto. + + * css/CSSGrammar.y: Added leakPtr calls for putting MediaQueryExp* + into the media query expression list, which is a vector of raw pointers + that are deleted explicitly. + + * css/CSSImportRule.cpp: + (WebCore::CSSImportRule::setCSSStyleSheet): Updated to use document instead of doc. + (WebCore::CSSImportRule::insertedIntoParent): Ditto. + * css/CSSMutableStyleDeclaration.cpp: + (WebCore::CSSMutableStyleDeclaration::setNeedsStyleRecalc): Ditto. + + * css/CSSNamespace.h: Took the "m_" off the names of the data members of + this structure. Used OwnPtr for the parent data member. Rewrote the + namespaceForPrefix function so it's iterative instead of recursive. + + * css/CSSParser.cpp: + (WebCore::CSSParser::CSSParser): Update since m_mediaQuery, m_floatingMediaQuery, + m_floatingMediaQueryExp, and m_floatingMediaQueryExpList are now all OwnPtr and + thus don't need to be initialized. + (WebCore::CSSParser::~CSSParser): Update to not delete the above OwnPtr. + (WebCore::CSSParser::parseMediaQuery): Replaced the code that sets m_mediaQuery + to 0 with an assertion. Also use release when passing the media query to + appendMediaQuery. + (WebCore::CSSParser::document): Updated to use document instead of doc and to + use early return instead of a nested if. + (WebCore::CSSParser::parseContent): Added a get() call needed since + CSSParserFunction::args is an OwnPtr. + (WebCore::CSSParser::parseAnimationTimingFunction): Ditto. + (WebCore::CSSParser::parseDashboardRegions): Ditto. + (WebCore::CSSParser::parseShape): Ditto. + (WebCore::isValidFormatFunction): Ditto. + (WebCore::CSSParser::parseFontFaceSrc): Ditto. + (WebCore::CSSParser::parseColorParameters): Ditto. + (WebCore::CSSParser::parseHSLParameters): Ditto. + (WebCore::parseGradientColorStop): Ditto. + (WebCore::CSSParser::parseGradient): Ditto. + (WebCore::CSSParser::parseCanvas): Ditto. + (WebCore::CSSParser::parseTransform): Ditto. + (WebCore::CSSParser::createFloatingMediaQueryExp): Updated to use adoptPtr and + remove the explicit deletion. + (WebCore::CSSParser::sinkFloatingMediaQueryExp): Updated to use release. + (WebCore::CSSParser::createFloatingMediaQueryExpList): Ditto. + (WebCore::CSSParser::sinkFloatingMediaQueryExpList): Ditto. + (WebCore::CSSParser::createFloatingMediaQuery): Ditto. + (WebCore::CSSParser::sinkFloatingMediaQuery): Ditto. + (WebCore::CSSParser::checkForVariables): Use get for CSSParserFunction::args. + + * css/CSSParser.h: Made return values for sinkFloatingMediaQueryExp, + sinkFloatingMediaQueryExpList, and sinkFloatingMediaQuery be PassOwnPtr. + Made createFloatingMediaQuery take a PassOwnPtr. Made m_mediaQuery, + m_floatingMediaQuery, m_floatingMediaQueryExp, and m_floatingMediaQueryExpList + be OwnPtr. + + * css/CSSParserValues.h: Made args be an OwnPtr. + + * css/CSSStyleSelector.cpp: Made CSSRuleSet m_universalRules and m_pageRules + be OwnPtr. + (WebCore::CSSStyleSelector::CSSStyleSelector): Use document instead of doc. + Got rid of the init function, only called here, because it did nothing that + wasn't already done. Eliminated unneeded code to set m_userStyle to 0, since + it's now an OwnPtr and will be 0 automatically. Use adoptPtr when initializing + m_medium, m_authorStyle, and m_useStyle. + (WebCore::CSSStyleSelector::~CSSStyleSelector): Got rid of unneeded delete of + m_medium, m_authorStyle, and m_userStyle, and unneded clear of m_keyframesRuleMap. + (WebCore::CSSStyleSelector::styleForElement): Use get with m_userStyle and + m_authorStyle. + (WebCore::CSSStyleSelector::pseudoStyleForElement): Ditto. + (WebCore::CSSStyleSelector::styleForPage): Ditto. + (WebCore::CSSStyleSelector::pseudoStyleRulesForElement): Ditto. + (WebCore::CSSRuleSet::CSSRuleSet): Got rid of unneeded initialization of + m_universalRules and m_pageRules. + (WebCore::CSSRuleSet::~CSSRuleSet): Got rid of unneeed deletion of same. + (WebCore::CSSRuleSet::addRule): Use adoptPtr to initialize m_universalRules. + (WebCore::CSSRuleSet::addPageRule): Use adoptPtr to initialize m_pageRules. + (WebCore::CSSStyleSelector::applyProperty): Use adopPtr to create counter + context object. + + * css/CSSStyleSelector.h: Made m_authorStyle, m_userStyle, and m_medium use + OwnPtr. Got rid of init function. + + * css/CSSStyleSheet.cpp: + (WebCore::CSSStyleSheet::CSSStyleSheet): Updatd for name change from m_doc + and doc to m_document and document. Eliminated unneeded initialization of + m_namespaces now that it is an OwnPtr. + (WebCore::CSSStyleSheet::~CSSStyleSheet): Got rid of unneeded deletion of same. + (WebCore::CSSStyleSheet::cssRules): Updated doc to document. + (WebCore::CSSStyleSheet::addNamespace): Added adopPtr when setting m_namespaces. + (WebCore::CSSStyleSheet::determineNamespace): Updated for changes to the + CSSNamespace class, using uri data member instead of function. + (WebCore::CSSStyleSheet::styleSheetChanged): Use document instead of doc. + + * css/CSSStyleSheet.h: Renamed doc and m_doc to document and m_document. + Made m_namespaces an OwnPtr. + + * css/CSSValueList.cpp: + (WebCore::CSSValueList::CSSValueList): Clean up logic a bit. + (WebCore::CSSValueList::createParserValueList): Clean up logic a bit and + return a PassOwnPtr. + + * css/CSSValueList.h: Changed createParserValueList to return a PassOwnPtr. + + * css/CSSVariablesDeclaration.cpp: + (WebCore::CSSVariablesDeclaration::setNeedsStyleRecalc): Updated to use + document instead of doc. + + * css/MediaList.cpp: + (WebCore::MediaList::deleteMedium): Use OwnPtr instead of a boolean to + make sure the newly-created query here is deleted. + (WebCore::MediaList::appendMediaQuery): Updated to take PassOwnPtr. + + * css/MediaList.h: Changed appendMediaQuery to take a PassOwnPtr. + + * inspector/InspectorDOMAgent.cpp: + (WebCore::InspectorDOMAgent::getStyleSheet): Use document instead of doc. + (WebCore::InspectorDOMAgent::getRuleRanges): Ditto. + (WebCore::InspectorDOMAgent::buildObjectForStyleSheet): Ditto. + + * rendering/style/ContentData.cpp: + (WebCore::ContentData::clear): Update since data members are OwnPtr. + Also, fixed iterative deletion algorithm to be much simpler. + (WebCore::ContentData::dataEquivalent): Added FIXMEs and tweaked formatting. + (WebCore::ContentData::deleteContent): Tweaked formatting. + + * rendering/style/ContentData.h: Changed m_next to an OwnPtr. + Added assertions to getters to check that we get the correct type. + Use leakRef instead of releaseRef. Changed setCounter and setNext functions + to take PassOwnPtr arguments. + + * rendering/style/RenderStyle.cpp: + (WebCore::RenderStyle::prepareToSetContent): Refactored common part of the + into a shared function so the three setContent functions don't have to repeat + the logic. Used an OwnPtr to avoid confusing logic and leakPtr. + (WebCore::RenderStyle::setContent): Changed argument to PassOwnPtr. + + * rendering/style/RenderStyle.h: Changed setContent argument to a PassOwnPtr. + Added declaration of prepareToSetContent helper function. + +2010-08-29 Patrick Gansterer <paroga@paroga.com> + + Reviewed by Adam Roben. + + [WINCE] Port ScrollbarThemeWin to WinCE + https://bugs.webkit.org/show_bug.cgi?id=44818 + + Add a #ifdef around usage of unsupported DFCS_FLAT. + + * platform/win/ScrollbarThemeWin.cpp: + (WebCore::ScrollbarThemeWin::paintButton): + +2010-08-29 Patrick Gansterer <paroga@paroga.com> + + Reviewed by Adam Roben. + + [WINCE] Port SystemInfo to WinCE + https://bugs.webkit.org/show_bug.cgi?id=44817 + + * platform/win/SystemInfo.cpp: + (WebCore::isRunningOnVistaOrLater): + +2010-08-28 Jeremy Moskovich <jeremy@chromium.org> + + Reviewed by Dimitri Glazkov. + + First step in unforking Chrome's FontPlatformDataMac.mm. + Move files from platform/graphics/mac to platform/graphics/cocoa + + https://bugs.webkit.org/show_bug.cgi?id=41398 + + Just moving files around so no new tests. + + * WebCore.gypi: + * WebCore.xcodeproj/project.pbxproj: + * platform/graphics/cocoa: Added. + * platform/graphics/cocoa/FontPlatformData.h: Copied from WebCore/platform/graphics/mac/FontPlatformData.h. + * platform/graphics/cocoa/FontPlatformDataCocoa.mm: Copied from WebCore/platform/graphics/mac/FontPlatformDataMac.mm. + * platform/graphics/mac/FontPlatformData.h: Removed. + * platform/graphics/mac/FontPlatformDataMac.mm: Removed. + +2010-08-28 Darin Adler <darin@apple.com> + + Reviewed by Sam Weinig. + + Some IDL attributes don't reflect URL content attributes properly + https://bugs.webkit.org/show_bug.cgi?id=43650 + + * dom/Document.cpp: + (WebCore::Document::processBaseElement): Added. Implements the rules for base elements + from the HTML5 specification. Handles multiple base elements in the same document. + + * dom/Document.h: Removed setBaseElementURL and setBaseElementTarget, replacing them + with processBaseElement. + + * html/HTMLBaseElement.cpp: + (WebCore::HTMLBaseElement::parseMappedAttribute): Call the new processBaseElement + function. + (WebCore::HTMLBaseElement::insertedIntoDocument): Ditto. + (WebCore::HTMLBaseElement::removedFromDocument): Ditto. + (WebCore::HTMLBaseElement::isURLAttribute): Added. + (WebCore::HTMLBaseElement::target): Moved here from the .h file and changed to not + realy on an m_target local variable. + + * html/HTMLBaseElement.h: Added an override of the isURLAttribute function. Removed + unneeded process function. Removed declaration of nonexistent setHref and setTarget + functions. Removed unneeded m_hrefAttrValue, m_href, and m_target. Moved + implementation of target function into the .cpp file. + + * html/HTMLBaseElement.idl: Marked the href attribute as URL. + + * html/HTMLBlockquoteElement.cpp: + (WebCore::HTMLBlockquoteElement::isURLAttribute): Added. + * html/HTMLBlockquoteElement.h: Added isURLAttribute. + * html/HTMLBlockquoteElement.idl: Marked the cite attribute as URL. + + * html/HTMLEmbedElement.idl: Marked the src attribute as URL. + + * html/HTMLFormElement.cpp: Added a comment about the action function, which should + be removed. + + * html/HTMLFormElement.idl: Marked the action attribute as URL. + + * html/HTMLHtmlElement.cpp: + (WebCore::HTMLHtmlElement::isURLAttribute): Added. + (WebCore::HTMLHtmlElement::insertedIntoDocument): Tweaked a bit. + * html/HTMLHtmlElement.h: Added isURLAttribute. + * html/HTMLHtmlElement.idl: Marked the manifest attribute as URL. + + * html/HTMLIFrameElement.idl: Marked the src attribute a URL. + + * html/HTMLModElement.cpp: + (WebCore::HTMLModElement::isURLAttribute): Added. + * html/HTMLModElement.h: Added isURLAttribute. + * html/HTMLModElement.idl: Marked the cite attribute as URL. + + * html/HTMLQuoteElement.cpp: + (WebCore::HTMLQuoteElement::isURLAttribute): Added. + * html/HTMLQuoteElement.h: Added isURLAttribute. + * html/HTMLQuoteElement.idl: Marked the cite attribute as URL. + + * html/HTMLViewSourceDocument.cpp: + (WebCore::HTMLViewSourceDocument::processTagToken): Changed code to create a base + element instead of calling setBaseElementURL directly. + (WebCore::HTMLViewSourceDocument::addSpanWithClassName): Use AtomicString instead of String. + (WebCore::HTMLViewSourceDocument::addLine): Ditto. + (WebCore::HTMLViewSourceDocument::addText): Ditto. + (WebCore::HTMLViewSourceDocument::addBase): Added. Creates a base element and inserts it. + (WebCore::HTMLViewSourceDocument::addLink): Use AtomicString instead of String. + + * html/HTMLViewSourceDocument.h: Updated function declarations as above. + + * bindings/scripts/test/CPP/WebDOMTestCallback.h: + * bindings/scripts/test/CPP/WebDOMTestInterface.h: + * bindings/scripts/test/CPP/WebDOMTestObj.h: + * bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp: + * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp: + Updated results, which changed due to the fixes for at + least these bugs, and perhaps a few more: + https://bugs.webkit.org/show_bug.cgi?id=42115 + https://bugs.webkit.org/show_bug.cgi?id=44597 + https://bugs.webkit.org/show_bug.cgi?id=44738 + + * bindings/scripts/test/TestObj.idl: + * html/HTMLAnchorElement.idl: + * html/HTMLAreaElement.idl: + * html/HTMLEmbedElement.idl: + * html/HTMLFormElement.cpp: + * html/HTMLFormElement.idl: + * html/HTMLFrameElement.idl: + * html/HTMLIFrameElement.idl: + * html/HTMLImageElement.idl: + * html/HTMLInputElement.idl: + * html/HTMLLinkElement.idl: + * html/HTMLMediaElement.idl: + * html/HTMLObjectElement.idl: + * html/HTMLScriptElement.idl: + * html/HTMLSourceElement.idl: + * html/HTMLVideoElement.idl: + Tweaked formatting. + +2010-08-28 Ryosuke Niwa <rniwa@webkit.org> + + Reviewed by Darin Adler. + + The logic to escape entities in appendEscapedContent and appendAttributeValue should be merged + https://bugs.webkit.org/show_bug.cgi?id=44831 + + Added appendCharactersReplacingEntities to escape &, <, >, ", and nbsp based on the mask. + Removed escapeContentText because it was only used in appendText, which now directly calls + appendCharactersReplacingEntities. Replaced appendEscapedContent, ucharRange, and appendUCharRange + by appendNodeValue. + + No new tests are added since this is a cleanup. + + * editing/markup.cpp: + (WebCore::): + (WebCore::appendCharactersReplacingEntities): Added. + (WebCore::MarkupAccumulator::appendAttributeValue): Calls appendCharactersReplacingEntities. + (WebCore::MarkupAccumulator::appendNodeValue): Added. + (WebCore::MarkupAccumulator::appendText): Calls appendNodeValue and appendCharactersReplacingEntities. + (WebCore::urlToMarkup): Calls escapeEntities. + +2010-08-27 Ryosuke Niwa <rniwa@webkit.org> + + Reviewed by Darin Adler. + + cannot remove text-decoration when style is added by u or s + https://bugs.webkit.org/show_bug.cgi?id=44560 + + The bug was caused by WebKit not pushing down implicitly added styles to descendent nodes. + Fixed the bug by pushing down all elements that implicitly add style. + + extractInlineStyleToPushDown now calls removeImplicitlyStyledElement, which was modified to extract + the style implicitly added by the element to extractStyle. + + This revealed a bug in applyInlineStyleToPushDown where applyInlineStyleIfNeeded could add + an implicitly styled element inside an element with a conflicting style, thereby overriding the style of the element. + Fixed this by extending the logic to honor the existing inline style declaration used in + the case of rewriting inline style declaration to all cases including the one calling addInlineStyleIfNeeded. + + Also fixed a bug in removeInlineStyle where pushDownInlineStyleAroundNode was called on a text node + outside of selection if start was at the end of the text node. + + Test: editing/style/push-down-implicit-styles.html + + * editing/ApplyStyleCommand.cpp: + (WebCore::ApplyStyleCommand::removeImplicitlyStyledElement): Added extractedStyle, which receives + the style implicitly added by the element being removed. + (WebCore::ApplyStyleCommand::extractInlineStyleToPushDown): Calls removeImplicitlyStyledElement + to remove the implicitly styled element and extract the inline style added by the element. + (WebCore::ApplyStyleCommand::applyInlineStyleToPushDown): Fixed a bug that addInlineStyleIfNeeded + could override the inline style declaration style of the node. + (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode): Uses extractInlineStyleToPushDown + (WebCore::ApplyStyleCommand::removeInlineStyle): See above. + * editing/ApplyStyleCommand.h: Prototype changes. + +2010-08-27 Mark Rowe <mrowe@apple.com> + + Reviewed by Adam Barth. + + <http://webkit.org/b/44802> REGRESSION (r65351): WebCore build fails due to attempting to directly access WebKitTools/Scripts + + Move create-html-entity-table in to WebCore so that the build is again self-contained. + The script is also updated to take input as a CSV file rather than JSON as the former + can be parsed without requiring a third-party Python module be installed. + + * CMakeLists.txt: + * DerivedSources.make: + * GNUmakefile.am: + * WebCore.gyp/WebCore.gyp: + * WebCore.pri: + * WebCore.xcodeproj/project.pbxproj: Stop copying the input file in to the WebCore framework wrapper. + * html/parser/HTMLEntityNames.in: Added. + * html/parser/HTMLEntityNames.json: Removed. + * html/parser/create-html-entity-table: Renamed from WebKitTools/Scripts/create-html-entity-table. + +2010-08-28 Daniel Bates <dbates@rim.com> + + Attempt to fix Chromium Mac Release bot after changeset 66305 <http://trac.webkit.org/changeset/66305>. + + * accessibility/chromium/AXObjectCacheChromium.cpp: + (WebCore::AXObjectCache::postPlatformNotification): Added case statements for missing enum values. + These case statements simply fall through to a "break" statement. + +2010-08-26 Kevin Ollivier <kevino@theolliviers.com> + + Reviewed by Nikolas Zimmermann. + + Add explicit destructor for C++ DOM bindings to avoid memory leaks when using SWIG. + https://bugs.webkit.org/attachment.cgi?bugid=44738 + + * bindings/scripts/CodeGeneratorCPP.pm: + +2010-08-28 Eric Carlson <eric.carlson@apple.com> + + Reviewed by Dan Bernstein. + + Add WebM MIME types to type registry + https://bugs.webkit.org/show_bug.cgi?id=44826 + + * platform/MIMETypeRegistry.cpp: + (WebCore::TypeExtensionPair::): Add "video/webm" and "audio/webm" types. + +2010-08-28 Eric Carlson <eric.carlson@apple.com> + + Reviewed by Simon Fraser. + + Crash reloading fast/events/tabindex-focus-blur-all.html test + https://bugs.webkit.org/show_bug.cgi?id=44743 + + * html/HTMLMediaElement.cpp: + (WebCore::HTMLMediaElement::asyncEventTimerFired): If m_isWaitingToDecrementLoadEventDelayCount + is true, call setShouldDelayLoadEvent(false) and set the timer to fire the pending events + on the next idle. + (WebCore::HTMLMediaElement::setShouldDelayLoadEvent): Don't clear the delay from within a + media engine callback because document 'load' event handlers that cause the page to become + inactive will delete the media engine. + * html/HTMLMediaElement.h: Add m_isWaitingToDecrementLoadEventDelayCount. + +2010-08-28 Simon Fraser <simon.fraser@apple.com> + + Reviewed by Sam Weinig. + + When properties are missing from animation keyframes, interpolate between those keyframes that specify them + https://bugs.webkit.org/show_bug.cgi?id=40794 + + Some preliminary cleanup; for vectors, prefer indexed access rather than using iterators. + + No behavior changes. + + * css/CSSStyleSelector.cpp: + (WebCore::CSSStyleSelector::keyframeStylesForAnimation): + * page/animation/KeyframeAnimation.cpp: + (WebCore::KeyframeAnimation::getKeyframeAnimationInterval): + (WebCore::KeyframeAnimation::validateTransformFunctionList): + * rendering/RenderLayerBacking.cpp: + (WebCore::RenderLayerBacking::startAnimation): + * rendering/style/KeyframeList.h: + (WebCore::KeyframeList::at): + (WebCore::KeyframeList::keyframes): + +2010-08-28 Dan Bernstein <mitz@apple.com> + + Reviewed by Simon Fraser. + + Speculative fix for <rdar://problem/7275077> Crash in InlineBox::root() under RenderTextControl::textWithHardLineBreaks() + https://bugs.webkit.org/show_bug.cgi?id=44816 + + No test because I could not reproduce the crash. + + In a common variant of the crash, InlineBox::root() is called with this == 12. This suggests that + a RenderInline* was cast into a RenderBox*, so RenderBox::inlineBoxWrapper() interpreted the + m_lineHeight and m_verticalPosition members of a RenderInline as a pointer to an InlineBox. + + The cast into RenderBox* in textWithHardLineBreaks() was introduced in r40881 with no exaplanation. + + * rendering/RenderTextControl.cpp: + (WebCore::RenderTextControl::textWithHardLineBreaks): Fetch the first line directly from the inner + text block instead of relying on the first child being a text node. + +2010-08-28 Moritz Lipp <mlq@pwmt.org> + + Reviewed by Xan Lopez. + + [GTK] Improper webkit_dom_document_evaluate implementation. + https://bugs.webkit.org/show_bug.cgi?id=42115 + + The generated webkit_dom_document_evaluate() function does not meet the + evaluate interface described in the W3 Documentation + http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathEvaluator-evaluate + "If this is specified as nullor the implementation does not reuse the + specified result,...". The current implementation did not accept the + result parameter to be NULL. + + * bindings/scripts/CodeGeneratorGObject.pm: + +2010-08-28 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + HTMLTreeBuilder needs to call HTMLFormElement::setDemoted + https://bugs.webkit.org/show_bug.cgi?id=44781 + + This patch teaches the HTMLTreeBuilder about demoted form elements. + Demoting a form element magically stops the form element from + rendering. Demoted form elements are a concept from the + LegacyHTMLTreeBuilder, but they are somewhat of a hack because + rendering should be DOM-based. We'll likely look for a better solution + in a future patch. + + * html/parser/HTMLConstructionSite.cpp: + (WebCore::HTMLConstructionSite::insertHTMLFormElement): + * html/parser/HTMLConstructionSite.h: + * html/parser/HTMLTreeBuilder.cpp: + (WebCore::HTMLTreeBuilder::processStartTagForInTable): + +2010-08-28 Chris Guillory <chris.guillory@google.com> + + Reviewed by Chris Fleizach. + + Add AX notification for childrenChanged + https://bugs.webkit.org/show_bug.cgi?id=44472 + + Test by running platform/chromium/accessibility/children-changed-notification.html within chromium's DRT + + * accessibility/AXObjectCache.h: + (WebCore::AXObjectCache::): + * accessibility/AccessibilityRenderObject.cpp: + (WebCore::AccessibilityRenderObject::childrenChanged): + * accessibility/chromium/AXObjectCacheChromium.cpp: + (WebCore::AXObjectCache::postPlatformNotification): + * page/chromium/ChromeClientChromium.h: + +2010-08-28 Eric Uhrhane <ericu@chromium.org> + + Reviewed by Darin Fisher. + + Implement the DOM FileWriter class + https://bugs.webkit.org/show_bug.cgi?id=44362 + + No new tests until the delegate class has an implementation; bug logged. + + Build file additions. + * GNUmakefile.am: + * WebCore.gypi: + * WebCore.pro: + * WebCore.vcproj/WebCore.vcproj: + * WebCore.xcodeproj/project.pbxproj: + + The AsyncFileWriter is an abstract interface to which FileWriter delegates all the hard work. + * html/AsyncFileWriter.h: Added. + + The FileWriterClient is the interface for communications back from the AsyncFileWriter [success/failure, progress events]. + * html/FileWriterClient.h: Added. + (WebCore::FileWriterClient::~FileWriterClient): + + Added all delegation, state tracking, and progress event processing. + * html/FileWriter.cpp: + (WebCore::FileWriter::FileWriter): + (WebCore::FileWriter::initialize): + (WebCore::FileWriter::~FileWriter): + ActiveDomObject stuff + (WebCore::FileWriter::hasPendingActivity): + (WebCore::FileWriter::stop): + (WebCore::FileWriter::write): + FileWriter public interface + (WebCore::FileWriter::seek): + (WebCore::FileWriter::truncate): + (WebCore::FileWriter::abort): + FileWriterClient interface + (WebCore::FileWriter::didWrite): + (WebCore::FileWriter::didTruncate): + (WebCore::FileWriter::didFail): + Progress events + (WebCore::FileWriter::fireEvent): + * html/FileWriter.h: + +2010-08-28 Marc-Antoine Ruel <maruel@chromium.org> + + Reviewed by Dimitri Glazkov. + + Preparatory patch to split libwebcore in multiple libraries. + + Start with a webcore_prerequisites pseudo-target what will be the common + target for all the other ones. + + * WebCore.gyp/WebCore.gyp: + +2010-08-28 Pratik Solanki <psolanki@apple.com> + + Reviewed by Dan Bernstein. + + Add an ENABLE define for purgeable memory support + https://bugs.webkit.org/show_bug.cgi?id=44777 + + * platform/PurgeableBuffer.h: + * platform/mac/PurgeableBufferMac.cpp: + +2010-08-28 Lucas De Marchi <lucas.demarchi@profusion.mobi> + + Reviewed by Kenneth Rohde Christiansen. + + [EFL] Fix error message when theme loading fails + https://bugs.webkit.org/show_bug.cgi?id=44775 + + Parameters for logging were in the wrong order. + + No new functionality so no new tests. + + * platform/efl/ScrollbarEfl.cpp: + (ScrollbarEfl::setParent): exchange argument order in log function + call + +2010-08-27 Nikolas Zimmermann <nzimmermann@rim.com> + + Reviewed by Dirk Schulze. + + REGRESSION: some tests no longer painting + https://bugs.webkit.org/show_bug.cgi?id=44773 + + Fix regression from the RenderImageResource introduction, fast/canvas/canvas-as-image.html + and fast/canvas/canvas-as-image-incremental-repaint.html pixel tests did not work anymore. + + * rendering/RenderImageResource.h: + (WebCore::RenderImageResource::hasImage): Make hasImage virtual. + * rendering/RenderImageResourceStyleImage.h: + (WebCore::RenderImageResourceStyleImage::hasImage): Always return true, just like RenderImageGeneratedContent did. + +2010-08-27 Kimmo Kinnunen <kimmo.t.kinnunen@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Cache plugin info to a persistent database + + https://bugs.webkit.org/show_bug.cgi?id=43179 + + Implement a cache of NPAPI plugin metadata. Write the metadata to aa + file that gets rewritten if any plugin is added / removed. Compilation + of the feature is controlled by #if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE) + + Currently only enabled for Qt UNIX flavors. + + * WebCore.pro: Enable NETSCAPE_PLUGIN_METADATA_CACHE for UNIX builds + * platform/qt/FileSystemQt.cpp: + (WebCore::openFile): Added. + (WebCore::readFromFile): Added. + * plugins/PluginDatabase.cpp: + (WebCore::persistentPluginMetadataCachePath): Static accessor for the path + (WebCore::PluginDatabase::PluginDatabase): Add instance variable. + (WebCore::PluginDatabase::refresh): + (WebCore::PluginDatabase::pluginForMIMEType): Ensure returned plugin is loaded. + (WebCore::PluginDatabase::MIMETypeForExtension): Ensure returned plugin is loaded. + (WebCore::PluginDatabase::clear): + (WebCore::fillBufferWithContentsOfFile): Static helper function. + (WebCore::readUTF8String): Static helper function. + (WebCore::readTime): Static helper function. + (WebCore::PluginDatabase::loadPersistentMetadataCache): + (WebCore::writeUTF8String): Static helper function. + (WebCore::writeTime): Static helper function. + (WebCore::PluginDatabase::updatePersistentMetadataCache): Added. + (WebCore::PluginDatabase::isPersistentMetadataCacheEnabled): Added. + (WebCore::PluginDatabase::setPersistentMetadataCacheEnabled):Added. + (WebCore::PluginDatabase::persistentMetadataCachePath): Added. + (WebCore::PluginDatabase::setPersistentMetadataCachePath): Added. + * plugins/PluginDatabase.h: + * plugins/PluginPackage.cpp: + (WebCore::PluginPackage::PluginPackage): Add instance variable. + (WebCore::PluginPackage::createPackageFromCache): Added. + (WebCore::PluginPackage::ensurePluginLoaded): Added. + * plugins/PluginPackage.h: + (WebCore::PluginPackage::fullMIMEDescription): Added. + * plugins/qt/PluginPackageQt.cpp: + (WebCore::PluginPackage::fetchInfo): Split mime parsing. + (WebCore::PluginPackage::setMIMEDescription): Added. Mime parsing. + +2010-08-27 Daniel Bates <dbates@rim.com> + + Reviewed by Darin Adler. + + Implement symbolic CSS3 list-style-types + https://bugs.webkit.org/show_bug.cgi?id=36734 + + Implements all of the symbolic CSS3 list-style-types as per + section 4.5 of the CSS3 Lists module <http://www.w3.org/TR/css3-lists/#symbolic>. + + Test: fast/lists/w3-css3-list-styles-symbolic.html + + * css/CSSPrimitiveValueMappings.h: + (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Added list style types Asterisks and Footnotes. + * css/CSSValueKeywords.in: Ditto. + * inspector/front-end/SourceCSSTokenizer.re2js: Ditto. + * rendering/RenderListMarker.cpp: + (WebCore::toAlphabeticOrNumeric): Changed type of parameter sequenceSize from int to unsigned. + (WebCore::toSymbolic): Added. + (WebCore::toAlphabetic): Changed type of parameter alphabetSize from int to unsigned. + (WebCore::toNumeric): Changed type of parameter numeralsSize from int to unsigned. + (WebCore::effectiveListMarkerType): Added. + (WebCore::listMarkerSuffix): Added list style types Asterisks and Footnotes. + (WebCore::listMarkerText): Ditto. + (WebCore::RenderListMarker::paint): Ditto. + (WebCore::RenderListMarker::calcPrefWidths): Ditto. + (WebCore::RenderListMarker::getRelativeMarkerRect): Ditto. + * rendering/style/RenderStyleConstants.h: Ditto. + (WebCore::): + +2010-08-27 Vincent Scheib <scheib@chromium.org> + + Reviewed by Darin Fisher. + + CanvasRenderingContext2D::willDraw changed to didDraw + + Solves issue with canvas to canvas draw calls, and simplifies + mixed software and GPU acceleration of GraphicsContext implementations + which must track dirty rects for backing stores. + + https://bugs.webkit.org/show_bug.cgi?id=44741 + + * html/HTMLCanvasElement.cpp: + (WebCore::HTMLCanvasElement::didDraw): + * html/HTMLCanvasElement.h: + * html/canvas/CanvasRenderingContext2D.cpp: + (WebCore::CanvasRenderingContext2D::fill): + (WebCore::CanvasRenderingContext2D::stroke): + (WebCore::CanvasRenderingContext2D::clearRect): + (WebCore::CanvasRenderingContext2D::fillRect): + (WebCore::CanvasRenderingContext2D::strokeRect): + (WebCore::CanvasRenderingContext2D::drawImage): + (WebCore::CanvasRenderingContext2D::drawImageFromRect): + (WebCore::CanvasRenderingContext2D::didDraw): + (WebCore::CanvasRenderingContext2D::putImageData): + (WebCore::CanvasRenderingContext2D::drawTextInternal): + * html/canvas/CanvasRenderingContext2D.h: + * html/canvas/WebGLRenderingContext.cpp: + (WebCore::WebGLRenderingContext::markContextChanged): + +2010-08-27 Daniel Cheng <dcheng@chromium.org> + + Reviewed by Tony Chang. + + [chromium] Add new WebClipboard method for setting generic data in copy/cut handlers. + https://bugs.webkit.org/show_bug.cgi?id=42121 + + No new tests. + + * platform/chromium/ChromiumBridge.h: + +2010-08-27 Patrick Gansterer <paroga@paroga.com> + + Reviewed by Adam Roben. + + Remove unnecessary AlphaBlend in PasteboardWin. + https://bugs.webkit.org/show_bug.cgi?id=44720 + + Replacing AlphaBlend with BitBlt is safe because testing showed that alpha + never survives copy-and-paste on Windows in any browser, and StretchBlt + was a overkill since the source and destination size are always equal. + + * platform/win/PasteboardWin.cpp: + (WebCore::Pasteboard::writeImage): + +2010-08-26 Zhenyao Mo <zmo@google.com> + + Reviewed by Kenneth Russell. + + Passing premultiplyAlpha=false to tex{Sub}Image2D loses information (skia) + https://bugs.webkit.org/show_bug.cgi?id=38282 + + * platform/graphics/skia/GraphicsContext3DSkia.cpp: Dealing with the case of texImage2D with HTMLCanvasElement input. + (WebCore::GraphicsContext3D::getImageData): + +2010-08-26 Vangelis Kokkevis <vangelis@chromium.org> + + Reviewed by Darin Fisher. + + [chromium] Working around compile issue in LayerRendererChromium.cpp + when DEBUG_GL_CALLS=1 + https://bugs.webkit.org/show_bug.cgi?id=44739 + + No new functionality, no new tests. + + * platform/graphics/chromium/LayerRendererChromium.cpp: + (WebCore::LayerRendererChromium::drawLayerIntoStencilBuffer): + +2010-08-27 Patrick Gansterer <paroga@paroga.com> + + Reviewed by Adam Roben. + + [WINCE] Port SoftLinking to WinCE + https://bugs.webkit.org/show_bug.cgi?id=44693 + + WinCE provides GetProcAddressW and GetProcAddressA for softlinking. + Unfortunately WinNT provides only GetProcAddress (without A or W). + + Add a platform dependent macro for GetProcAddress. + + * platform/win/SoftLinking.h: + +2010-08-27 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Xan Lopez. + + [GTK] ScrollbarThemeGtk should account for the trough_under_steppers property + https://bugs.webkit.org/show_bug.cgi?id=44742 + + No new tests until this code is activated, at which point pixel tests will + test the scrollbar rendering. + + * platform/gtk/ScrollbarThemeGtk.cpp: + (WebCore::ScrollbarThemeGtk::paintTrackBackground): Only inflate the track background + if the style specifies trough_under_steppers. + (WebCore::ScrollbarThemeGtk::paint): If the theme specifies trough_under_steppers, + a dirty stepper also triggers a repaint of the trough region. + +2010-08-27 Joseph Pecoraro <joepeck@webkit.org> + + Reviewed by Alexey Proskuryakov. + + Extra Events triggered by <input> on focus + https://bugs.webkit.org/show_bug.cgi?id=44731 + + Tests: fast/events/input-focus-no-duplicate-events.html + fast/events/input-tab-focus-no-duplicate-events.html + + * dom/Element.cpp: + (WebCore::Element::focus): do not continue and update the appearance of the element if it was not focused. + * page/FocusController.cpp: + (WebCore::FocusController::setFocusedNode): respect the return value of Document::setFocusedNode. + +2010-08-26 Joseph Pecoraro <joepeck@webkit.org> + + Reviewed by Pavel Feldman. + + Web Inspector: attribute nodes don't get rendered in the console + https://bugs.webkit.org/show_bug.cgi?id=44736 + + Extended Test: inspector/console-format.html + + * inspector/InspectorDOMAgent.cpp: + (WebCore::InspectorDOMAgent::buildObjectForNode): add "name" and "value" properties for Attribute nodes. + * inspector/front-end/DOMAgent.js: + (WebInspector.DOMNode): add "name" and "value" properties for Attribute nodes. + * inspector/front-end/ElementsTreeOutline.js: display html for Attribute nodes. + +2010-08-27 Adam Barth <abarth@webkit.org> + + Rubber-stamped by Eric Seidel. + + Finshing moving the HTML parser into WebCore/html/parser. + + * Android.derived.mk: + * Android.mk: + * CMakeLists.txt: + * DerivedSources.make: + * GNUmakefile.am: + * WebCore.gyp/WebCore.gyp: + * WebCore.gypi: + * WebCore.pri: + * WebCore.pro: + * WebCore.vcproj/WebCore.vcproj: + * WebCore.xcodeproj/project.pbxproj: + * html/CSSPreloadScanner.cpp: Removed. + * html/CSSPreloadScanner.h: Removed. + * html/HTMLConstructionSite.cpp: Removed. + * html/HTMLConstructionSite.h: Removed. + * html/HTMLDocumentParser.cpp: Removed. + * html/HTMLDocumentParser.h: Removed. + * html/HTMLEntityNames.json: Removed. + * html/HTMLEntityParser.cpp: Removed. + * html/HTMLEntityParser.h: Removed. + * html/HTMLEntitySearch.cpp: Removed. + * html/HTMLEntitySearch.h: Removed. + * html/HTMLEntityTable.h: Removed. + * html/HTMLFormattingElementList.cpp: Removed. + * html/HTMLFormattingElementList.h: Removed. + * html/HTMLParserScheduler.cpp: Removed. + * html/HTMLParserScheduler.h: Removed. + * html/HTMLPreloadScanner.cpp: Removed. + * html/HTMLPreloadScanner.h: Removed. + * html/HTMLScriptRunner.cpp: Removed. + * html/HTMLScriptRunner.h: Removed. + * html/HTMLScriptRunnerHost.h: Removed. + * html/HTMLTokenizer.cpp: Removed. + * html/HTMLTokenizer.h: Removed. + * html/HTMLViewSourceParser.cpp: Removed. + * html/HTMLViewSourceParser.h: Removed. + * html/parser/CSSPreloadScanner.cpp: Copied from WebCore/html/CSSPreloadScanner.cpp. + * html/parser/CSSPreloadScanner.h: Copied from WebCore/html/CSSPreloadScanner.h. + * html/parser/HTMLConstructionSite.cpp: Copied from WebCore/html/HTMLConstructionSite.cpp. + * html/parser/HTMLConstructionSite.h: Copied from WebCore/html/HTMLConstructionSite.h. + * html/parser/HTMLDocumentParser.cpp: Copied from WebCore/html/HTMLDocumentParser.cpp. + * html/parser/HTMLDocumentParser.h: Copied from WebCore/html/HTMLDocumentParser.h. + * html/parser/HTMLEntityNames.json: Copied from WebCore/html/HTMLEntityNames.json. + * html/parser/HTMLEntityParser.cpp: Copied from WebCore/html/HTMLEntityParser.cpp. + * html/parser/HTMLEntityParser.h: Copied from WebCore/html/HTMLEntityParser.h. + * html/parser/HTMLEntitySearch.cpp: Copied from WebCore/html/HTMLEntitySearch.cpp. + * html/parser/HTMLEntitySearch.h: Copied from WebCore/html/HTMLEntitySearch.h. + * html/parser/HTMLEntityTable.h: Copied from WebCore/html/HTMLEntityTable.h. + * html/parser/HTMLFormattingElementList.cpp: Copied from WebCore/html/HTMLFormattingElementList.cpp. + * html/parser/HTMLFormattingElementList.h: Copied from WebCore/html/HTMLFormattingElementList.h. + * html/parser/HTMLParserScheduler.cpp: Copied from WebCore/html/HTMLParserScheduler.cpp. + * html/parser/HTMLParserScheduler.h: Copied from WebCore/html/HTMLParserScheduler.h. + * html/parser/HTMLPreloadScanner.cpp: Copied from WebCore/html/HTMLPreloadScanner.cpp. + * html/parser/HTMLPreloadScanner.h: Copied from WebCore/html/HTMLPreloadScanner.h. + * html/parser/HTMLScriptRunner.cpp: Copied from WebCore/html/HTMLScriptRunner.cpp. + * html/parser/HTMLScriptRunner.h: Copied from WebCore/html/HTMLScriptRunner.h. + * html/parser/HTMLScriptRunnerHost.h: Copied from WebCore/html/HTMLScriptRunnerHost.h. + * html/parser/HTMLTokenizer.cpp: Copied from WebCore/html/HTMLTokenizer.cpp. + * html/parser/HTMLTokenizer.h: Copied from WebCore/html/HTMLTokenizer.h. + * html/parser/HTMLViewSourceParser.cpp: Copied from WebCore/html/HTMLViewSourceParser.cpp. + * html/parser/HTMLViewSourceParser.h: Copied from WebCore/html/HTMLViewSourceParser.h. + +2010-08-27 Simon Fraser <simon.fraser@apple.com> + + Reviewed by Tony Chang. + + Insertion point does not show when dragging text into an editable area + https://bugs.webkit.org/show_bug.cgi?id=44295 + + r65681 caused the caret to use the last-computed caret rect when + painting, rather than forcing a style update. Because of this, + we now need to eagerly update the caret rect when changing + the drag selection. + + Not testable in DRT because the drag selection is always cleared + before EventSender returns, so the drag caret can never show in + the pixel results. + + Tested by running editing/selection/drag-in-iframe.html manually. + + * editing/SelectionController.cpp: + (WebCore::SelectionController::setSelection): + +2010-08-27 Adam Barth <abarth@webkit.org> + + Attempt to fix the Windows build. + + * WebCore.vcproj/WebCoreCommon.vsprops: + +2010-08-27 Adam Barth <abarth@webkit.org> + + Attempt to fix the Qt build. + + * WebCore.pro: + +2010-08-27 Adam Barth <abarth@webkit.org> + + Rubber-stamped by Eric Seidel. + + Move HTMLTreeBuilder and HTMLElementStack to WebCore/html/parser. + + * Android.mk: + * CMakeLists.txt: + * GNUmakefile.am: + * WebCore.gypi: + * WebCore.pro: + * WebCore.vcproj/WebCore.vcproj: + * WebCore.xcodeproj/project.pbxproj: + * html/HTMLElementStack.cpp: Removed. + * html/HTMLElementStack.h: Removed. + * html/HTMLTreeBuilder.cpp: Removed. + * html/HTMLTreeBuilder.h: Removed. + * html/parser/HTMLElementStack.cpp: Copied from WebCore/html/HTMLElementStack.cpp. + * html/parser/HTMLElementStack.h: Copied from WebCore/html/HTMLElementStack.h. + * html/parser/HTMLTreeBuilder.cpp: Copied from WebCore/html/HTMLTreeBuilder.cpp. + * html/parser/HTMLTreeBuilder.h: Copied from WebCore/html/HTMLTreeBuilder.h. + +2010-08-27 Adam Barth <abarth@webkit.org> + + Reviewed by Darin Adler. + + Create WebCore/html/parser + https://bugs.webkit.org/show_bug.cgi?id=44792 + + This patch begins the process of moving the HTML parser code to the + WebCore/html/parser directory. This patch moves a single header file. + More files will follow in future patches. + + * CMakeLists.txt: + * GNUmakefile.am: + * WebCore.gyp/WebCore.gyp: + * WebCore.gypi: + * WebCore.pro: + * WebCore.vcproj/WebCore.vcproj: + * WebCore.vcproj/WebCoreCommon.vsprops: + * WebCore.xcodeproj/project.pbxproj: + * html/parser/HTMLToken.h: Renamed from WebCore/html/HTMLToken.h. + +2010-08-27 Chris Marrin <cmarrin@apple.com> + + Reviewed by Simon Fraser. + + https://bugs.webkit.org/show_bug.cgi?id=42862 + WebGL in CSS Canvas crashes + + This fixes the crash, which was a simple null pointer deref. But this + revealed that -webkit-canvas no longer works for WebGL. I believe this + is due to the recent ImageBuffer optimizations done by Dave Hyatt + (https://bugs.webkit.org/show_bug.cgi?id=43507). This changed ImageBuffer + from always keeping a copy of the pixels to doing a copy to get them + when needed. Since We need to get pixels out of the WebGL drawing buffer + to use them as a CSS background, I had to change when I return those + pixels to the ImageBuffer. + + Tests: fast/canvas/webgl/css-webkit-canvas-repaint.html + fast/canvas/webgl/css-webkit-canvas.html + + * html/HTMLCanvasElement.cpp: + (WebCore::HTMLCanvasElement::copiedImage): Add logic to get image from WebGL so it works with new ImageBuffer logic (see above) + * html/canvas/WebGLRenderingContext.cpp: + (WebCore::WebGLRenderingContext::create): Fixed null pointer deref + +2010-08-27 James Robinson <jamesr@chromium.org> + + Reviewed by Dimitri Glazkov. + + Move Shader class from platform/graphics/chromium to platform/graphics/gpu + https://bugs.webkit.org/show_bug.cgi?id=44793 + + The Shader class and its subclasses are not chromium-specific. This moves + them to a common location so they can be re-used on all platforms. Also + moves the Shader subclasses into their own .h/.cpp files. + + Refactor, no new tests. + + * WebCore.gypi: + * platform/graphics/chromium/GLES2Canvas.cpp: + * platform/graphics/chromium/Shader.cpp: Removed. + * platform/graphics/chromium/Shader.h: Removed. + * platform/graphics/gpu/Shader.cpp: Added. + (WebCore::Shader::affineTo3x3): + (WebCore::Shader::loadShader): + (WebCore::Shader::loadProgram): + (WebCore::Shader::Shader): + (WebCore::Shader::~Shader): + * platform/graphics/gpu/Shader.h: Added. + * platform/graphics/gpu/SolidFillShader.cpp: Added. + (WebCore::SolidFillShader::SolidFillShader): + (WebCore::SolidFillShader::create): + (WebCore::SolidFillShader::use): + * platform/graphics/gpu/SolidFillShader.h: Added. + * platform/graphics/gpu/TexShader.cpp: Added. + (WebCore::TexShader::TexShader): + (WebCore::TexShader::create): + (WebCore::TexShader::use): + * platform/graphics/gpu/TexShader.h: Added. + +2010-08-27 Kinuko Yasuda <kinuko@chromium.org> + + Reviewed by Darin Fisher. + + Add AsyncFileSystem interface for platform-dependent FileSystem API implementation + https://bugs.webkit.org/show_bug.cgi?id=44433 + + No new tests; tests will be added later. + + * CMakeLists.txt: + * WebCore.gypi: + * WebCore.pro: + * WebCore.vcproj/WebCore.vcproj: + * WebCore.xcodeproj/project.pbxproj: + * platform/AsyncFileSystem.cpp: Added. + * platform/AsyncFileSystem.h: Added. + * platform/AsyncFileSystemCallbacks.h: Added. + * storage/DOMFileSystem.cpp: + (WebCore::DOMFileSystem::DOMFileSystem): + (WebCore::DOMFileSystem::~DOMFileSystem): + (WebCore::DOMFileSystem::stop): + (WebCore::DOMFileSystem::hasPendingActivity): + (WebCore::DOMFileSystem::contextDestroyed): + * storage/DOMFileSystem.h: + (WebCore::DOMFileSystem::create): + * storage/FileSystemCallbacks.cpp: + (WebCore::FileSystemCallbacksBase::didFail): + (WebCore::FileSystemCallbacks::FileSystemCallbacks): + (WebCore::FileSystemCallbacks::didOpenFileSystem): + * storage/FileSystemCallbacks.h: + * storage/LocalFileSystem.cpp: Added. + * storage/LocalFileSystem.h: Added. + + * storage/Flags.h: Nits fix. + +2010-07-27 Jer Noble <jer.noble@apple.com> + + Reviewed by Eric Carlson. + + Add JavaScript API to allow a page to go fullscreen. + rdar://problem/6867795 + https://bugs.webkit.org/show_bug.cgi?id=43099 + + Mozilla has proposed a new set of JavaScript APIs which allow any element in + a document to go full-screen. The current revision of their proposal can be + found here: + <https://wiki.mozilla.org/index.php?title=Gecko:FullScreenAPI&oldid=243429> + + The proposed specification includes the following: + + Document: + - Three new methods on Document: + + void requestFullScreen() + + void requestFullScreenWithKeys() + + void cancelFullScreen() + - Three new attributes of Document: + + readonly attribute boolean fullScreen + + readonly attribute boolean fullScreenWithKeys + + (optional) readonly attribute Element currentFullScreenElement + + Element: + - Two new methods on Element: + + void requestFullScreen() + + void requestFullScreenWithKeys() + + Events: + - One new event: + + fullScreenChange + + CSS Pseudo-classes: + - Three new Pseudo-classes: + + :full-screen + + :full-screen-doc + + :full-screen-root-with-target + + For WebKit's initial implementation, all the above new APIs will be prefixed with + "webkit" or "-webkit" where appropriate. + + New tests: + LayoutTests/fullscreen/full-screen-api.html + LayoutTests/fullscreen/full-screen-css.html + LayoutTests/fullscreen/full-screen-request.html + + Project file changes: + * Configurations/FeatureDefines.xcconfig: Added an ENABLE_FULLSCREEN_API entry. + * DerivedSources.make: Added rules for fullscreen.css and WebCore.FullScreen.exp. + * WebCore.FullScreen.exp: Added export symbols for Document and Element functions. + * WebCore.xcodeproj/project.pbxproj: New source files added to the project. + + IDL changes: + * dom/Document.idl: Added the new full-screen API to the Document's javascript interface. + * dom/Element.idl: Added the new full-screen API to the Element's javascript interface. + + Source changes: + * bindings/objc/PublicDOMInterfaces.h: Exposed Document and Element fullscreen functions in the DOM classes. + * css/CSSSelector.cpp: Added new FullScreen pseudo-classes. + * css/CSSSelector.h: Added new full-screen pseudo classes to the PseudoType enum. + * css/CSSStyleSelector.cpp: + (WebCore::loadFullDefaultStyle): Pull the fullscreen.css sheet into the defaultStyle and the defaultQuirksStyle sheets. + (WebCore::loadSimpleDefaultStyle): Pull the fullscreen.css sheet into the defaultStyle sheet. + (WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector): Check for the new FullScreen pseudo classes. + * dom/Document.cpp: + (WebCore::Document::createEvent): Support creating a "WebKitFullScreenChange" event. + (WebCore::Document::addListenerTypeIfNeeded): Support listening for a "webKitFullScreenChangeEvent" + (WebCore::Document::webkitRequestFullScreenForElement): Passes request to the chrome client to enter full screen mode. + (WebCore::Document::webkitCancelFullScreen): Passes request to the chrome client to exit full screen mode. + (WebCore::Document::webkitWillEnterFullScreenForElement): Sets the FullScreen pseudo-classes on the full-screen element and its document. + (WebCore::Document::webkitDidEnterFullScreenForElement): Currently a no-op. + (WebCore::Document::webkitWillExitFullScreenForElement): Currently a no-op. + (WebCore::Document::webkitDidExitFullScreenForElement): Clears the FullScreen pseudo-classes on the full-screen element and its document. + * dom/Document.h: Added const accessors for new full-screen instance variables. + (WebCore::Document::): + (WebCore::Document::webkitIsFullScreen): Accessor for m_isFullScreen. + (WebCore::Document::webkitIsFullScreenWithKeysEnabled): Accessor for m_isFullScren and m_areKeysEnabled. + (WebCore::Document::webkitCurrentFullScreenElement): Accessor for m_fullScreenElement. + * dom/Element.cpp: + (WebCore::Element::webkitRequestFullScreen): Calls Document::webkitRequestFullScreenForElement. + * dom/Element.h: + * dom/EventNames.h: Add a webkitfullscreenchange event name. + * html/HTMLElement.cpp: + (WebCore::HTMLElement::parseMappedAttribute): Parse the new "onwebkitfullscreenchange" attribute and register a listener. + * page/ChromeClient.h: + (WebCore::ChromeClient::supportsFullscreenForElement): Pass through to the current UI delegate. + (WebCore::ChromeClient::enterFullscreenForElement): Create a WebKitFullScreenListener and pass through to the current UI delegate. + (WebCore::ChromeClient::exitFullscreenForElement): Create a WebKitFullScreenListener and pass through to the current UI delegate. + * page/Settings.cpp: + (WebCore::Settings::Settings): + * page/Settings.h: Add a new setting to control runtime support for full screen mode (defaults to off) + * rendering/MediaControlElements.cpp: + (WebCore::MediaControlFullscreenButtonElement::defaultEventHandler): The full screen button now toggles full screen mode (previously, it only entered). + * rendering/style/RenderStyleConstants.h: Added new style constants. + +2010-08-27 James Robinson <jamesr@chromium.org> + + Reviewed by Darin Fisher. + + Move Texture class from p/g/chromium to p/g/gpu + https://bugs.webkit.org/show_bug.cgi?id=44783 + + This class and its support were developed in platform/graphics/chromium but are not chromium-specific + in any way. This patch moves them to a common location so they can be shared by all platforms. + + Pure refactor, so no new tests. + + * WebCore.gyp/WebCore.gyp: + * WebCore.gypi: + * platform/graphics/chromium/GLES2Canvas.cpp: + (WebCore::GLES2Canvas::drawTexturedRect): + (WebCore::GLES2Canvas::drawTexturedRectTile): + (WebCore::GLES2Canvas::createTexture): + (WebCore::GLES2Canvas::getTexture): + * platform/graphics/chromium/GLES2Canvas.h: + * platform/graphics/chromium/GLES2Texture.cpp: Removed. + * platform/graphics/chromium/GLES2Texture.h: Removed. + * platform/graphics/gpu/Texture.cpp: Added. + (WebCore::Texture::Texture): + (WebCore::Texture::~Texture): + (WebCore::convertFormat): + (WebCore::Texture::create): + (WebCore::copySubRect): + (WebCore::Texture::load): + (WebCore::Texture::bindTile): + * platform/graphics/gpu/Texture.h: Added. + (WebCore::Texture::): + (WebCore::Texture::format): + (WebCore::Texture::tiles): + * platform/graphics/gpu/TilingData.cpp: Renamed from WebCore/platform/graphics/chromium/TilingData.cpp. + (WebCore::computeNumTiles): + (WebCore::TilingData::TilingData): + (WebCore::TilingData::tileXIndexFromSrcCoord): + (WebCore::TilingData::tileYIndexFromSrcCoord): + (WebCore::TilingData::tileBounds): + (WebCore::TilingData::tileBoundsWithBorder): + (WebCore::TilingData::tileBoundsNormalized): + (WebCore::TilingData::tilePositionX): + (WebCore::TilingData::tilePositionY): + (WebCore::TilingData::tileSizeX): + (WebCore::TilingData::tileSizeY): + (WebCore::TilingData::overlappedTileIndices): + (WebCore::TilingData::intersectDrawQuad): + * platform/graphics/gpu/TilingData.h: Renamed from WebCore/platform/graphics/chromium/TilingData.h. + (WebCore::TilingData::maxTextureSize): + (WebCore::TilingData::totalSizeX): + (WebCore::TilingData::totalSizeY): + (WebCore::TilingData::numTiles): + (WebCore::TilingData::numTilesX): + (WebCore::TilingData::numTilesY): + (WebCore::TilingData::tileIndex): + (WebCore::TilingData::tileXIndex): + (WebCore::TilingData::tileYIndex): + (WebCore::TilingData::TilingData): + (WebCore::TilingData::assertTile): + * platform/graphics/skia/ImageSkia.cpp: + (WebCore::drawBitmapGLES2): + * platform/graphics/skia/PlatformContextSkia.cpp: + (WebCore::PlatformContextSkia::uploadSoftwareToHardware): + * platform/graphics/skia/PlatformContextSkia.h: + +2010-08-27 David Hyatt <hyatt@apple.com> + + Reviewed by Simon Fraser. + + https://bugs.webkit.org/show_bug.cgi?id=44788, implement HTML5-compliant doctype switching. + + Rename the various modes to match the HTML5 specification: + ParseMode -> CompatibilityMode + CompatMode -> QuirksMode + AlmostStrictMode -> LimitedQuirksMode + StrictMode -> NoQuirksMode + + Remove the htmlHacks() accessor from RenderStyle and make rendering code just go to the document + instead. This makes switching modes avoid forcing all RenderStyles to detect as changed. + + Clean up user stylesheets to minimize style recalculation when the mode is switched. + + Fix bugs with the propagation of correct modes in the HTML5 parser. Make sure the + dummy document created for fragment parsing properly inherits the real document's CompatibilityMode. + Make sure the tree builder properly changes the insertion mode to "BeforeHTML" after handling + a doctype token. + + determineParseMode -> setCompatibilityModeFromDoctype, and it now implements the HTML5 algorithm + precisely. + + * WebCore.exp.in: + * css/CSSStyleSelector.cpp: + (WebCore::CSSStyleSelector::styleForDocument): + (WebCore::CSSStyleSelector::applyProperty): + (WebCore::CSSStyleSelector::fontSizeForKeyword): + * dom/ClassNodeList.cpp: + (WebCore::ClassNodeList::ClassNodeList): + * dom/DecodedDataDocumentParser.cpp: + (WebCore::DecodedDataDocumentParser::appendBytes): + * dom/Document.cpp: + (WebCore::Document::Document): + (WebCore::Document::setCompatibilityMode): + (WebCore::Document::setDocType): + (WebCore::Document::unscheduleStyleRecalc): + (WebCore::Document::recalcStyle): + (WebCore::Document::updateStyleIfNeeded): + (WebCore::Document::createStyleSelector): + (WebCore::Document::implicitOpen): + (WebCore::Document::pageUserSheet): + (WebCore::Document::clearPageUserSheet): + (WebCore::Document::updatePageUserSheet): + (WebCore::Document::pageGroupUserSheets): + (WebCore::Document::clearPageGroupUserSheets): + (WebCore::Document::updatePageGroupUserSheets): + (WebCore::Document::findAnchor): + * dom/Document.h: + (WebCore::Document::): + (WebCore::Document::setCompatibilityModeFromDoctype): + (WebCore::Document::lockCompatibilityMode): + (WebCore::Document::compatibilityMode): + (WebCore::Document::inQuirksMode): + (WebCore::Document::inLimitedQuirksMode): + (WebCore::Document::inNoQuirksMode): + * dom/Element.cpp: + (WebCore::Element::clientWidth): + (WebCore::Element::clientHeight): + (WebCore::Element::webkitMatchesSelector): + * dom/NamedNodeMap.cpp: + (WebCore::NamedNodeMap::setClass): + * dom/Node.cpp: + (WebCore::Node::querySelector): + (WebCore::Node::querySelectorAll): + * dom/OptionElement.cpp: + (WebCore::OptionElement::collectOptionLabelOrText): + * dom/SelectorNodeList.cpp: + (WebCore::createSelectorNodeList): + * dom/StyleElement.cpp: + (WebCore::StyleElement::createSheet): + * dom/StyledElement.cpp: + (WebCore::StyledElement::createInlineStyleDecl): + (WebCore::StyledElement::parseMappedAttribute): + * editing/ReplaceSelectionCommand.cpp: + (WebCore::ReplaceSelectionCommand::shouldRemoveEndBR): + * html/HTMLBodyElement.cpp: + (WebCore::HTMLBodyElement::createLinkDecl): + * html/HTMLCanvasElement.cpp: + (WebCore::HTMLCanvasElement::getContext): + * html/HTMLConstructionSite.cpp: + (WebCore::HTMLConstructionSite::insertDoctype): + * html/HTMLDocument.cpp: + (WebCore::HTMLDocument::HTMLDocument): + (WebCore::HTMLDocument::compatMode): + (WebCore::HTMLDocument::setCompatibilityModeFromDoctype): + * html/HTMLDocument.h: + * html/HTMLLinkElement.cpp: + (WebCore::HTMLLinkElement::setCSSStyleSheet): + * html/HTMLTreeBuilder.cpp: + (WebCore::HTMLTreeBuilder::HTMLTreeBuilder): + (WebCore::HTMLTreeBuilder::FragmentParsingContext::FragmentParsingContext): + (WebCore::HTMLTreeBuilder::processDoctypeToken): + (WebCore::HTMLTreeBuilder::processStartTagForInBody): + (WebCore::HTMLTreeBuilder::defaultForInitial): + * html/HTMLViewSourceDocument.cpp: + (WebCore::HTMLViewSourceDocument::HTMLViewSourceDocument): + * loader/DocumentWriter.cpp: + (WebCore::DocumentWriter::replaceDocument): + (WebCore::DocumentWriter::reportDataReceived): + * loader/DocumentWriter.h: + * loader/ImageDocument.cpp: + (WebCore::ImageDocument::ImageDocument): + * loader/MediaDocument.cpp: + (WebCore::MediaDocument::MediaDocument): + * loader/PluginDocument.cpp: + (WebCore::PluginDocument::PluginDocument): + * loader/SinkDocument.cpp: + (WebCore::SinkDocument::SinkDocument): + * loader/TextDocument.cpp: + (WebCore::TextDocument::TextDocument): + * page/Page.cpp: + (WebCore::Page::userStyleSheetLocationChanged): + * page/PageGroup.cpp: + (WebCore::PageGroup::resetUserStyleCacheInAllFrames): + * page/Settings.cpp: + (WebCore::Settings::Settings): + (WebCore::Settings::setEnforceCSSMIMETypeInNoQuirksMode): + * page/Settings.h: + (WebCore::Settings::enforceCSSMIMETypeInNoQuirksMode): + * rendering/AutoTableLayout.cpp: + (WebCore::AutoTableLayout::recalcColumn): + * rendering/FixedTableLayout.cpp: + (WebCore::FixedTableLayout::calcPrefWidths): + * rendering/InlineFlowBox.cpp: + (WebCore::InlineFlowBox::paintBoxDecorations): + (WebCore::InlineFlowBox::paintMask): + (WebCore::InlineFlowBox::paintTextDecorations): + * rendering/InlineTextBox.cpp: + (WebCore::InlineTextBox::paint): + * rendering/RenderBlock.cpp: + (WebCore::RenderBlock::isSelfCollapsingBlock): + (WebCore::RenderBlock::collapseMargins): + (WebCore::RenderBlock::handleBottomOfBlock): + (WebCore::RenderBlock::calcInlinePrefWidths): + (WebCore::RenderBlock::calcBlockPrefWidths): + * rendering/RenderBlockLineLayout.cpp: + (WebCore::createInlineBoxForRenderer): + (WebCore::RenderBlock::findNextLineBreak): + * rendering/RenderBox.cpp: + (WebCore::RenderBox::calcPercentageHeight): + (WebCore::RenderBox::calcAbsoluteHorizontal): + (WebCore::RenderBox::calcAbsoluteHorizontalReplaced): + * rendering/RenderBox.h: + (WebCore::RenderBox::stretchesToViewHeight): + * rendering/RenderListItem.cpp: + (WebCore::getParentOfFirstLineBox): + * rendering/RenderTable.cpp: + (WebCore::RenderTable::layout): + * rendering/RenderTableSection.cpp: + (WebCore::RenderTableSection::calcRowHeight): + * rendering/RootInlineBox.cpp: + (WebCore::RootInlineBox::verticallyAlignBoxes): + * rendering/style/RenderStyle.cpp: + (WebCore::RenderStyle::diff): + * rendering/style/RenderStyle.h: + (WebCore::): + (WebCore::InheritedFlags::setBitDefaults): + +2010-08-27 Gavin Barraclough <barraclough@apple.com> + + Reviewed by Oliver Hunt. + + Bug 44745 - Number.toFixed/toExponential/toPrecision are inaccurate. + + These methods should be using a version of dtoa that can generate results accurate + to the requested precision, whereas our version of dtoa is only currently able to + support producing results sufficiently accurate to distinguish the value from any + other IEEE-754 double precision number. + + * html/HTMLTreeBuilder.cpp: + (WebCore::serializeForNumberType): + doubleToStringInJavaScriptFormat renamed to numberToString. + +2010-08-27 Michael Nordman <michaeln@google.com> + + Reviewed by David Levin. + + https://bugs.webkit.org/show_bug.cgi?id=44133 + IDL bindings for XmlHttpRequest.responseBlob support, doesn't do anything yet. + Adds two new attributes, asBlob and responseBlob. + Runtime disabled by default, also behind a new ENABLE_XHR_RESPONSE_BLOB compile time guard. + + No new tests, just adding some stubs. + + * bindings/generic/RuntimeEnabledFeatures.cpp: + * bindings/generic/RuntimeEnabledFeatures.h: + (WebCore::RuntimeEnabledFeatures::setResponseBlobEnabled): + (WebCore::RuntimeEnabledFeatures::responseBlobEnabled): + (WebCore::RuntimeEnabledFeatures::asBlobEnabled): + * bindings/js/JSXMLHttpRequestCustom.cpp: + (WebCore::JSXMLHttpRequest::responseText): Changed to allow an exceptional return path. + * bindings/v8/custom/V8XMLHttpRequestCustom.cpp: + (WebCore::V8XMLHttpRequest::responseTextAccessorGetter): Changed to allow an exceptional return path. + * xml/XMLHttpRequest.cpp: + (WebCore::XMLHttpRequest::responseText): Changed to raise an exception when accessed with asBlob set to true. + (WebCore::XMLHttpRequest::responseXML): Changed to raise an exception when accessed with asBlob set to true. + (WebCore::XMLHttpRequest::responseBlob): Added stub method, returns 0 for now. + (WebCore::XMLHttpRequest::setAsBlob): Sets the asBlob attribute, raises exception if called at an inappropriate time. + (WebCore::XMLHttpRequest::open): Resets asBlob to false, the default value. + (WebCore::XMLHttpRequest::abort): Clears m_responseBlob. + (WebCore::XMLHttpRequest::clearResponse): Clears m_responseBlob. + (WebCore::XMLHttpRequest::didFinishLoading): Added a FIXME to populate m_responseBlob. + * xml/XMLHttpRequest.h: + (WebCore::XMLHttpRequest::asBlob): + * xml/XMLHttpRequest.idl: + +2010-08-27 Simon Fraser <simon.fraser@apple.com> + + Reviewed by Tony Chang. + + Crash in CSSStyleSelector.cpp + https://bugs.webkit.org/show_bug.cgi?id=44780 + + Need to null-check the images when replacing pending images, because a later + rule may have replaced an image with 'none'. + + Test: fast/css/pending-images-crash.html + + * css/CSSStyleSelector.cpp: + (WebCore::CSSStyleSelector::loadPendingImages): + * page/FrameView.cpp: + (WebCore::FrameView::paintContents): Fix unrelated log message. + +2010-08-27 Andrey Kosyakov <caseq@chromium.org> + + Unreviewed. Revert r66218 & r66220 due to GTK test failures. + + * WebCore.gypi: + * WebCore.vcproj/WebCore.vcproj: + * inspector/front-end/AuditLauncherView.js: + (WebInspector.AuditLauncherView.categorySortFunction): + (WebInspector.AuditLauncherView): + (WebInspector.AuditLauncherView.prototype._launchButtonClicked): + (WebInspector.AuditLauncherView.prototype._selectAllClicked): + (WebInspector.AuditLauncherView.prototype._categoryClicked): + (WebInspector.AuditLauncherView.prototype._createCategoryElement): + (WebInspector.AuditLauncherView.prototype._createLauncherUI): + * inspector/front-end/AuditResultView.js: + (WebInspector.AuditCategoryResultPane.prototype._appendResult): + * inspector/front-end/AuditsPanel.js: + (WebInspector.AuditsPanel): + (WebInspector.AuditsPanel.prototype._executeAudit): + (WebInspector.AuditCategory.prototype.runRules): + * inspector/front-end/ExtensionAPI.js: + (injectedExtensionAPI): + (injectedExtensionAPI.EventSinkImpl.prototype.addListener): + (injectedExtensionAPI.EventSinkImpl.prototype._fire): + (injectedExtensionAPI.EventSink): + (injectedExtensionAPI.InspectorExtensionAPI): + (injectedExtensionAPI.Panels.prototype.create): + * inspector/front-end/ExtensionServer.js: + (WebInspector.ExtensionServer): + (WebInspector.ExtensionServer.prototype._postNotification): + (WebInspector.ExtensionServer.prototype._addExtensions): + (WebInspector.ExtensionStatus): + * inspector/front-end/WebKit.qrc: + * inspector/front-end/inspector.html: + * inspector/front-end/utilities.js: + (): + +2010-08-27 Mihai Parparita <mihaip@chromium.org> + + Reviewed by Darin Fisher. + + Crash in HistoryController::recursiveGoToItem when navigating in a frame + while another frame has a custom window name + https://bugs.webkit.org/show_bug.cgi?id=44183 + + Fix up HistoryController::recursiveGoToItem to better check whether the + current document frames, the curent history item frames, and the + destination history frames match up. + + Test: fast/history/history-subframe-with-name.html + + * history/HistoryItem.cpp: + (WebCore::HistoryItem::childItemWithDocumentSequenceNumber): Add linear + lookup of child by document sequence number + (WebCore::HistoryItem::hasSameDocuments): Remove assumption that the + other item has the children in the same order (it doesn't seem to be + true) + (WebCore::HistoryItem::hasSameFrames): Add recursive comparison of child + frames. + * history/HistoryItem.h: + * loader/FrameLoader.cpp: + (WebCore::FrameLoader::loadItem): Compare full set of documents in + history items, not just the topmost ones. Otherwise when going between + framesets where only one of the subframes changed we wouldn't trigger a + load. + * loader/HistoryController.cpp: + (WebCore::HistoryController::recursiveGoToItem): Also check that the + two history items have the same frames + (WebCore::HistoryController::currentFramesMatchItem): Refactor + childFramesMatchItem to also check the top-most frame, to make + recursiveGoToItem easier to read. + * loader/HistoryController.h: + +2010-08-27 Patrick Gansterer <paroga@paroga.com> + + Reviewed by Nikolas Zimmermann. + + [WINCE] Buildfix for graphics code after r65449 + https://bugs.webkit.org/show_bug.cgi?id=44510 + + * platform/graphics/wince/GraphicsContextWince.cpp: + * platform/graphics/wince/ImageBufferWince.cpp: + (WebCore::ImageBuffer::drawsUsingCopy): + (WebCore::ImageBuffer::copyImage): + (WebCore::ImageBuffer::clip): + (WebCore::ImageBuffer::draw): + (WebCore::ImageBuffer::drawPattern): + +2010-08-27 Dawit Alemayehu <adawit@kde.org> + + Reviewed by Simon Hausmann. + + [Qt] Search the Windows registry for the location of the Java plugin DLL. + https://bugs.webkit.org/show_bug.cgi?id=38911 + + This change, in addition to the ones 34539 and 38911, is needed to + make Java applet work in QtWebKit on the Windows platform. + + * plugins/win/PluginDatabaseWin.cpp: + (WebCore::addJavaPluginDirectory): + (WebCore::PluginDatabase::defaultPluginDirectories): + +2010-08-27 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Yury Semikhatsky. + + Web Inspector: color-code property values in object notation. + https://bugs.webkit.org/show_bug.cgi?id=44766 + + * inspector/front-end/ObjectPropertiesSection.js: + (WebInspector.ObjectPropertyTreeElement.prototype.update): + +2010-08-27 Patrick Gansterer <paroga@paroga.com> + + Reviewed by Nikolas Zimmermann. + + [WINCE] Buildfix for FontPlatformData after r65021 + https://bugs.webkit.org/show_bug.cgi?id=44467 + + * platform/graphics/wince/FontPlatformData.h: + +2010-08-27 Patrick Gansterer <paroga@paroga.com> + + Reviewed by Nikolas Zimmermann. + + RenderImage::imageChanged invalidates wrong area + https://bugs.webkit.org/show_bug.cgi?id=43779 + + At the moment RenderSVGImage inherits from RenderImage, which makes non-SVG compatible + assumptions about repainting, and thus has to be fixed to inherit from RenderSVGModelObject. + + This patch moves the CachedImage from RenderImage into a separate class. + The new class contains the common behavior of RenderImage and RenderSVGImage. + An additional patch will remove the inheritance of RenderImage at RenderSVGImage. + + * Android.mk: + * CMakeLists.txt: + * GNUmakefile.am: + * WebCore.gypi: + * WebCore.pro: + * WebCore.vcproj/WebCore.vcproj: + * WebCore.xcodeproj/project.pbxproj: + * html/HTMLEmbedElement.cpp: + (WebCore::HTMLEmbedElement::createRenderer): + (WebCore::HTMLEmbedElement::attach): + * html/HTMLImageElement.cpp: + (WebCore::HTMLImageElement::createRenderer): + (WebCore::HTMLImageElement::attach): + * html/HTMLInputElement.cpp: + (WebCore::HTMLInputElement::createRenderer): + (WebCore::HTMLInputElement::attach): + * html/HTMLObjectElement.cpp: + (WebCore::HTMLObjectElement::createRenderer): + * html/HTMLVideoElement.cpp: + (WebCore::HTMLVideoElement::attach): + (WebCore::HTMLVideoElement::parseMappedAttribute): + * loader/ImageLoader.cpp: + (WebCore::ImageLoader::setImage): + (WebCore::ImageLoader::updateFromElement): + (WebCore::ImageLoader::renderImageResource): + (WebCore::ImageLoader::updateRenderer): + * loader/ImageLoader.h: + * rendering/RenderImage.cpp: + (WebCore::RenderImage::RenderImage): + (WebCore::RenderImage::~RenderImage): + (WebCore::RenderImage::setImageResource): + (WebCore::RenderImage::imageChanged): + (WebCore::RenderImage::notifyFinished): + (WebCore::RenderImage::paintReplaced): + (WebCore::RenderImage::paintIntoRect): + (WebCore::RenderImage::minimumReplacedHeight): + (WebCore::RenderImage::calcReplacedWidth): + (WebCore::RenderImage::calcReplacedHeight): + (WebCore::RenderImage::calcAspectRatioWidth): + (WebCore::RenderImage::calcAspectRatioHeight): + * rendering/RenderImage.h: + (WebCore::RenderImage::imageResource): + (WebCore::RenderImage::cachedImage): + (WebCore::RenderImage::intrinsicSizeChanged): + (WebCore::toRenderImage): + * rendering/RenderImageGeneratedContent.cpp: Removed. + * rendering/RenderImageGeneratedContent.h: Removed. + * rendering/RenderImageResource.cpp: Added. + (WebCore::RenderImageResource::RenderImageResource): + (WebCore::RenderImageResource::~RenderImageResource): + (WebCore::RenderImageResource::initialize): + (WebCore::RenderImageResource::shutdown): + (WebCore::RenderImageResource::setCachedImage): + (WebCore::RenderImageResource::resetAnimation): + (WebCore::RenderImageResource::setImageContainerSize): + (WebCore::RenderImageResource::nullImage): + * rendering/RenderImageResource.h: Added. + (WebCore::RenderImageResource::create): + (WebCore::RenderImageResource::cachedImage): + (WebCore::RenderImageResource::hasImage): + (WebCore::RenderImageResource::image): + (WebCore::RenderImageResource::errorOccurred): + (WebCore::RenderImageResource::usesImageContainerSize): + (WebCore::RenderImageResource::imageHasRelativeWidth): + (WebCore::RenderImageResource::imageHasRelativeHeight): + (WebCore::RenderImageResource::imageSize): + (WebCore::RenderImageResource::imagePtr): + * rendering/RenderImageResourceStyleImage.cpp: Added. + (WebCore::RenderImageResourceStyleImage::RenderImageResourceStyleImage): + (WebCore::RenderImageResourceStyleImage::~RenderImageResourceStyleImage): + (WebCore::RenderImageResourceStyleImage::initialize): + (WebCore::RenderImageResourceStyleImage::shutdown): + * rendering/RenderImageResourceStyleImage.h: Added. + (WebCore::RenderImageResourceStyleImage::create): + (WebCore::RenderImageResourceStyleImage::image): + (WebCore::RenderImageResourceStyleImage::errorOccurred): + (WebCore::RenderImageResourceStyleImage::setImageContainerSize): + (WebCore::RenderImageResourceStyleImage::usesImageContainerSize): + (WebCore::RenderImageResourceStyleImage::imageHasRelativeWidth): + (WebCore::RenderImageResourceStyleImage::imageHasRelativeHeight): + (WebCore::RenderImageResourceStyleImage::imageSize): + (WebCore::RenderImageResourceStyleImage::imagePtr): + * rendering/RenderMedia.cpp: + (WebCore::RenderMedia::RenderMedia): + * rendering/RenderObject.cpp: + (WebCore::RenderObject::createObject): + * rendering/RenderObjectChildList.cpp: + (WebCore::RenderObjectChildList::updateBeforeAfterContent): + * rendering/RenderSVGImage.cpp: + (WebCore::RenderSVGImage::RenderSVGImage): + (WebCore::RenderSVGImage::layout): + (WebCore::RenderSVGImage::paint): + * rendering/RenderVideo.cpp: + (WebCore::RenderVideo::calculateIntrinsicSize): + * svg/SVGImageElement.cpp: + (WebCore::SVGImageElement::attach): + * wml/WMLImageElement.cpp: + (WebCore::WMLImageElement::createRenderer): + +2010-08-27 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: Elements panel breaks after calling "Edit as HTML" on <body> + https://bugs.webkit.org/show_bug.cgi?id=44765 + + * inspector/InspectorDOMAgent.cpp: + (WebCore::InspectorDOMAgent::setOuterHTML): + +2010-08-25 Jeremy Orlow <jorlow@chromium.org> + + Reviewed by Steve Block. + + Add setVersion to IndexedDB + https://bugs.webkit.org/show_bug.cgi?id=44630 + + * storage/IDBDatabase.cpp: + (WebCore::IDBDatabase::setVersion): + * storage/IDBDatabase.h: + * storage/IDBDatabase.idl: + * storage/IDBDatabaseBackendImpl.cpp: + (WebCore::IDBDatabaseBackendImpl::removeObjectStore): + (WebCore::IDBDatabaseBackendImpl::setVersion): + * storage/IDBDatabaseBackendImpl.h: + * storage/IDBDatabaseBackendInterface.h: + +2010-08-26 Pavel Podivilov <podivilov@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: use context menu items with checkbox for setting and removing DOM breakpoints + https://bugs.webkit.org/show_bug.cgi?id=44687 + + * English.lproj/localizedStrings.js: + * inspector/front-end/BreakpointsSidebarPane.js: + (WebInspector.DOMBreakpointItem): + * inspector/front-end/DOMAgent.js: + (WebInspector.DOMBreakpointManager.prototype.findBreakpoint): + (WebInspector.DOMBreakpoint.labelForType): + (WebInspector.DOMBreakpoint.contextMenuLabelForType): + * inspector/front-end/ElementsTreeOutline.js: + (WebInspector.ElementsTreeElement.prototype._populateTagContextMenu): + * inspector/front-end/inspector.js: + (WebInspector.pausedScript): + +2010-08-27 Steve Block <steveblock@google.com> + + Reviewed by Jeremy Orlow. + + Calls to IndexedDB methods from V8Proxy::didLeaveScriptContext() are missing enable guards + https://bugs.webkit.org/show_bug.cgi?id=44760 + + No new tests, build fix only. + + * bindings/v8/V8Proxy.cpp: + (WebCore::V8Proxy::didLeaveScriptContext): + +2010-08-27 Dirk Schulze <krit@webkit.org> + + Reviewed by Nikolas Zimmermann. + + getPointAtLength returns incorrect values for paths closed with the closepath command + https://bugs.webkit.org/show_bug.cgi?id=44197 + + The closepath segment was traversed by the wrong direction. Swap starting point and + end point for closeSubpath. + + Test: svg/dom/path-pointAtLength.html + + * platform/graphics/PathTraversalState.cpp: + (WebCore::PathTraversalState::closeSubpath): + +2010-08-27 Dirk Schulze <krit@webkit.org> + + Reviewed by Nikolas Zimmermann. + + SVG Filter with wrong results on repaint for non-CG platforms + https://bugs.webkit.org/show_bug.cgi?id=44706 + + The result of SVG Filter is transformed to linearRGB on every repaint. + Transform the result just once, right after creating it. + + Test: svg/repaint/filter-repaint.svg + + * rendering/RenderSVGResourceFilter.cpp: + (WebCore::RenderSVGResourceFilter::postApplyResource): + +2010-08-27 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + REGRESSION: Crash occurs at objc_msgSend when closing a window that is displaying the web inspector + https://bugs.webkit.org/show_bug.cgi?id=44230 + + * inspector/Inspector.idl: + * inspector/InspectorController.cpp: + (WebCore::InspectorController::inspectedPageDestroyed): + (WebCore::InspectorController::close): + * inspector/InspectorFrontendClient.h: + * inspector/InspectorFrontendHost.cpp: + (WebCore::InspectorFrontendHost::disconnectFromBackend): don't try to notify InspectorController + that frontend closes if InspectorController triggered the action. + * inspector/InspectorFrontendHost.h: + * inspector/InspectorFrontendHost.idl: + * inspector/front-end/InspectorFrontendHostStub.js: + (.WebInspector.InspectorFrontendHostStub.prototype.disconnectFromBackend): + * inspector/front-end/inspector.js: + (WebInspector.disconnectFromBackend): + +2010-08-27 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r66188. + http://trac.webkit.org/changeset/66188 + https://bugs.webkit.org/show_bug.cgi?id=44756 + + "Graphic libraries handle segement length differently. Fixing + one platform might break another one. Rolling out this patch + and think about another solution to get getPointAtLength" + (Requested by krit on #webkit). + + * platform/graphics/PathTraversalState.cpp: + (WebCore::PathTraversalState::closeSubpath): + +2010-08-27 Simon Fraser <simon.fraser@apple.com> + + Reviewed by Nikolas Zimmermann. + + r66141 caused fast/forms/select-style.html to fail on mac: + https://bugs.webkit.org/show_bug.cgi?id=44737 + + Handle the fact that a CSSImageValue may have a value of CSSValueNone, + in which case we should not return a pending image. + + * css/CSSImageValue.cpp: + (WebCore::CSSImageValue::cachedOrPendingImage): + * css/CSSStyleSelector.cpp: + (WebCore::CSSStyleSelector::cachedOrPendingFromValue): + +2010-08-27 Alejandro G. Castro <alex@igalia.com> + + Reviewed by Dan Bernstein. + + drawGDIGlyphs checks if the offset is empty incorrectly causing + problems with the shadow + https://bugs.webkit.org/show_bug.cgi?id=44619 + + Removed the offset empty condition, now we just check if we have + offset or blur. + + * platform/graphics/win/FontCGWin.cpp: + (WebCore::drawGDIGlyphs): + +2010-08-27 Dirk Schulze <krit@webkit.org> + + Reviewed by Nikolas Zimmermann. + + getPointAtLength returns incorrect values for paths closed with the closepath command + https://bugs.webkit.org/show_bug.cgi?id=44197 + + The closepath segment was traversed by the wrong direction. Swap starting point and + end point for closeSubpath. + + Test: svg/dom/path-pointAtLength.html + + * platform/graphics/PathTraversalState.cpp: + (WebCore::PathTraversalState::closeSubpath): + +2010-08-27 Nikolas Zimmermann <nzimmermann@rim.com> + + Reviewed by Dirk Schulze. + + SVGLocatable.getScreenCTM ignores scrolling + https://bugs.webkit.org/show_bug.cgi?id=44083 + + getScreenCTM needs to include the FrameViews scrollOffset in the e/f parameters of the AffineTransform. + Adding three new tests, which cover scrolling & getScreenCTM in large svgs with scrollbars, and with (nested) divs in overflow="scroll" mode. + + Tests: svg/custom/getscreenctm-in-scrollable-div-area-nested.xhtml + svg/custom/getscreenctm-in-scrollable-div-area.xhtml + svg/custom/getscreenctm-in-scrollable-svg-area.xhtml + + * svg/SVGSVGElement.cpp: + (WebCore::SVGSVGElement::localCoordinateSpaceTransform): + +2010-08-25 Ryosuke Niwa <rniwa@webkit.org> + + Reviewed by Darin Adler. + + implicitlyStyledElementShouldBeRemovedWhenApplyingStyle, removeHTMLFontStyle, and removeHTMLBidiEmbeddingStyle should be merged + https://bugs.webkit.org/show_bug.cgi?id=44622 + + Merged shouldRemoveTextDecorationTag, implicitlyStyledElementShouldBeRemovedWhenApplyingStyle, removeHTMLFontStyle, + and removeHTMLBidiEmbeddingStyle into removeImplicitlyStyledElement. New function uses CSSPropertyElementMapping to + support all different cases dealt separately in each function. + + No new tests are added since this is a cleanup. + + * editing/ApplyStyleCommand.cpp: + (WebCore::ApplyStyleCommand::removeInlineStyleFromElement): Calls removeImplicitlyStyledElement. + (WebCore::): + (WebCore::ApplyStyleCommand::removeImplicitlyStyledElement): Added. + * editing/ApplyStyleCommand.h: + +2010-08-26 Andy Estes <aestes@apple.com> + + Reviewed by Darin Adler. + + Based on a patch by Mihnea Ovidenie <mihnea@adobe.com>. + + Percentage top value on position:relative descendant not resolved + correctly if containing block height is not specified explicitly. + https://bugs.webkit.org/show_bug.cgi?id=26396 + + If the containing block height is auto and the element is positioned + relatively, and if the element's top/bottom is percent, then resolve the + top/bottom as auto. + + Test: fast/css/percent-top-relative-container-height-unspecified.html + + * rendering/RenderBoxModelObject.cpp: + (WebCore::RenderBoxModelObject::relativePositionOffsetY): + +2010-08-26 James Robinson <jamesr@chromium.org> + + Another chromium mac build fix. What a dumb version of GCC. + + * platform/graphics/chromium/GLES2Texture.cpp: + (WebCore::GLES2Texture::create): + +2010-08-26 Kent Tamura <tkent@chromium.org> + + Unreviewed, build fix for Chromium-mac. + + * platform/graphics/chromium/Shader.cpp: + (WebCore::loadShader): + +2010-08-26 James Robinson <jamesr@chromium.org> + + Fix chromium mac build. Unreviewed. + + * platform/graphics/chromium/GLES2Canvas.cpp: + (WebCore::GLES2Canvas::GLES2Canvas): + * platform/graphics/chromium/GLES2Texture.cpp: + (WebCore::GLES2Texture::load): + +2010-08-26 Mark Rowe <mrowe@apple.com> + + Darin pointed out that the braces are unnecessary in an Objective-C interface + declaration when there are no data members. + + * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: Begone, evil braces! + +2010-08-26 Gavin Barraclough <barraclough@apple.com> + + Rubber Stamped by Oliver Hunt. + + Partially revert r65959. The toString changes regressed the v8 tests, + but keep the toFixed/toExponential/toPrecision changes. + + * html/HTMLTreeBuilder.cpp: + (WebCore::serializeForNumberType): + +2010-08-26 Mark Rowe <mrowe@apple.com> + + Reviewed by Adam Roben. + + Fix two build issues that are revealed when building with clang. + + * platform/mac/PopupMenuMac.h: Forward-declare as an Objective-C class when compiling for Objective-C. + * platform/network/BlobResourceHandle.h: Forward-declare as a struct to match the real declaration. + +2010-08-26 Mark Rowe <mrowe@apple.com> + + Reviewed by Sam Weinig. + + <rdar://problem/8339008> WebCore's MediaPlayerPrivateQTKit.mm fails to build with clang. + + * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: + (WebCore::mainThreadSetNeedsDisplay): Remove some ambiguity in the return type of -delegate. + Since the message was being sent to a receiver of type id the compiler cannot accurately + determine the return type. Typically this would be resolved by using a more specific type + for the receiver. However, due to lazy loading shenanigans that we play with QTKit we're + unable to directly cast to the relevant type (QTMovieView*). Instead we fake up an interface + with the correct type of the method we care about (-delegate) and cast to that type instead. + +2010-08-26 Andy Estes <aestes@apple.com> + + Reviewed by Darin Adler. + + If an <embed> is part of an <object> element's fallback content, WebKit + should only render the <embed> if the <object> fails to load. + https://bugs.webkit.org/show_bug.cgi?id=44567 + <rdar://problem/7699852> + + Tests: fast/replaced/invalid-object-with-fallback.html + fast/replaced/object-with-embed-url-param.html + + * html/HTMLEmbedElement.cpp: + (WebCore::HTMLEmbedElement::rendererIsNeeded): An <embed> now needs a + renderer if its parent is an <object> but the <object> is using fallback + content. + * html/HTMLObjectElement.h: + (WebCore::HTMLObjectElement::useFallbackContent): Add a public getter + for m_useFallbackContent for use in HTMLEmbedElement::rendererIsNeeded. + * rendering/RenderEmbeddedObject.cpp: + (WebCore::RenderEmbeddedObject::updateWidget): Change the logic that + determines the plug-in parameters to pass to the loader. Do not override + parameters from <object> with those from a child <embed>. + +2010-08-26 James Robinson <jamesr@chromium.org> + + Reviewed by Darin Fisher. + + [chromium] Remove the USE(GLES2_RENDERING) define and associated code + https://bugs.webkit.org/show_bug.cgi?id=43761 + + USE(GLES2_RENDERING) will not be useful since we'll be coding to GraphicsContext3D + instead of OpenGL and can use ENABLE(ACCELERATED_2D_CANVAS) for canvas 2d specific + changes. This deletes the macro and deletes the ChromeClient API to query + GLES2Contexts since we'll never need one of these outside of the compositor, which + is created in platform-specific code. + + * loader/EmptyClients.h: + * page/ChromeClient.h: + * platform/graphics/chromium/GLES2Canvas.cpp: + * platform/graphics/chromium/GLES2Canvas.h: + * platform/graphics/chromium/GLES2Texture.cpp: + * platform/graphics/chromium/GLES2Texture.h: + * platform/graphics/skia/GraphicsContextSkia.cpp: + (WebCore::GraphicsContext::savePlatformState): + (WebCore::GraphicsContext::restorePlatformState): + (WebCore::GraphicsContext::clearRect): + (WebCore::GraphicsContext::concatCTM): + (WebCore::GraphicsContext::fillRect): + (WebCore::GraphicsContext::scale): + (WebCore::GraphicsContext::setAlpha): + (WebCore::GraphicsContext::setCompositeOperation): + (WebCore::GraphicsContext::setPlatformFillColor): + (WebCore::GraphicsContext::rotate): + (WebCore::GraphicsContext::translate): + (WebCore::GraphicsContext::setGraphicsContext3D): + (WebCore::GraphicsContext::syncSoftwareCanvas): + * platform/graphics/skia/ImageSkia.cpp: + (WebCore::drawBitmapGLES2): + (WebCore::BitmapImage::draw): + (WebCore::BitmapImageSingleFrameSkia::draw): + * platform/graphics/skia/PlatformContextSkia.cpp: + (WebCore::PlatformContextSkia::PlatformContextSkia): + (WebCore::PlatformContextSkia::~PlatformContextSkia): + * platform/graphics/skia/PlatformContextSkia.h: + +2010-08-26 Martin Robinson <mrobinson@igalia.com> + + Build fix for GTK+, after a bad merge. + + * platform/gtk/RenderThemeGtk.cpp: + (WebCore::RenderThemeGtk::paintMozillaGtkWidget): + +2010-08-23 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Gustavo Noronha Silva. + + [GTK] ScrollbarThemeGtk is incomplete + https://bugs.webkit.org/show_bug.cgi?id=44471 + + Add theme drawing code for GTK+ scrollbars. Turn RenderThemeGtk::paintMozillaWidget + into a public method so that ScrollbarThemeGtk can access Mozilla theme API properly. + + Tests for this issue will be activated in the form of pixel tests, but + only after fully-fake scrollbars are activated. + + * platform/gtk/RenderThemeGtk.cpp: + (WebCore::RenderThemeGtk::paintMozillaGtkWidget): Added this public method which takes + the proper widget state, widget type, graphics context and rectangle and renders a + widget using the Mozilla theming API. + (WebCore::RenderThemeGtk::paintRenderObject): Added this method which first calculates + the widget state before passing the information on to paintMozillaGtkWidget. + (WebCore::RenderThemeGtk::paintCheckbox): Switch to use paintRenderObject. + (WebCore::RenderThemeGtk::paintRadio): Switch to use paintRenderObject. + (WebCore::RenderThemeGtk::paintButton): Switch to use paintRenderObject. + (WebCore::RenderThemeGtk::paintMenuList): Switch to use paintRenderObject. + (WebCore::RenderThemeGtk::paintTextField): Switch to use paintRenderObject. + (WebCore::RenderThemeGtk::paintSliderTrack): Switch to use paintRenderObject. + (WebCore::RenderThemeGtk::paintSliderThumb): Switch to use paintRenderObject. + (WebCore::RenderThemeGtk::paintProgressBar): Switch to use paintRenderObject. + * platform/gtk/RenderThemeGtk.h: Added new method declarations. + * platform/gtk/ScrollbarThemeGtk.cpp: Added code which can render GTK+ scrollbars. + (WebCore::ScrollbarThemeGtk::hasThumb): Added. + (WebCore::ScrollbarThemeGtk::backButtonRect): Added. + (WebCore::ScrollbarThemeGtk::forwardButtonRect): Added. + (WebCore::ScrollbarThemeGtk::trackRect): Added. + (WebCore::ScrollbarThemeGtk::paintTrackBackground): Added. + (WebCore::ScrollbarThemeGtk::paintScrollbarBackground): Added. + (WebCore::ScrollbarThemeGtk::paintThumb): Added. + (WebCore::ScrollbarThemeGtk::thumbRect): Added. + (WebCore::ScrollbarThemeGtk::paint): Added. + (WebCore::ScrollbarThemeGtk::paintButton): Added. + (WebCore::ScrollbarThemeGtk::paintScrollCorner): Added. + (WebCore::ScrollbarThemeGtk::shouldCenterOnThumb): Added. + (WebCore::ScrollbarThemeGtk::scrollbarThickness): Always get the metrics from the + theme drawing API so that it stays up to date with theme changes. + (WebCore::ScrollbarThemeGtk::buttonSize): Added. + (WebCore::ScrollbarThemeGtk::minimumThumbLength): Added. + * platform/gtk/ScrollbarThemeGtk.h: + (WebCore::ScrollbarThemeGtk::hasButtons): Added. + (WebCore::ScrollbarThemeGtk::initialAutoscrollTimerDelay): Added. + (WebCore::ScrollbarThemeGtk::autoscrollTimerDelay): Added. + +2010-08-26 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Sam Weinig. + + https://bugs.webkit.org/show_bug.cgi?id=44726 + <rdar://problem/7935518> WebFrameProxies aren't destroyed until a page is destroyed + + * loader/FrameLoader.cpp: + (WebCore::FrameLoader::closeAndRemoveChild): + (WebCore::FrameLoader::detachFromParent): + Added a few FIXME comments. The logic we have to track frames is extremely convoluted. + +2010-08-26 Ryosuke Niwa <rniwa@webkit.org> + + Unreviewed; build fix. + + Speculative chromium mac fix by including "Color.h". + + * platform/graphics/chromium/Shader.cpp: + +2010-08-26 Simon Fraser <simon.fraser@apple.com> + + Reviewed by Dave Hyatt. + + CSS downloads all background images related to element, instead of just final rule + https://bugs.webkit.org/show_bug.cgi?id=24223 + + We used to kick off image loads at the point where the style selector + applies a CSS rule to an element, even if that rule was overridden + by a rule in a later block of rules. This caused loads of images that + weren't actually used. + + Fix this by delaying image loads until the style has been fully + resolved. This is achieved by inserting a StylePendingImage into + the RenderStyle for duration of the style resolution, and keeping + an entry in a hash for the relevant CSS property. + + At the end of style resolution, we iterate through the hash, and + replace the StylePendingImage with StyleCachedImages, which + causes the loads to happen only for images that are in the final style. + + Tests: http/tests/css/border-image-loading.html + http/tests/css/mask-image-loading.html + http/tests/css/reflection-mask-image-loading.html + + * GNUmakefile.am: Add StylePendingImage.h + * WebCore.gypi: Ditto + * WebCore.vcproj/WebCore.vcproj: Ditto + + * css/CSSImageValue.h: Change m_image to a RefPtr<StyleImage>, + since it may be a StylePendingImage or StyleCachedImage. + * css/CSSImageValue.cpp: + (WebCore::CSSImageValue::~CSSImageValue): Only call removeClient if it's a cachedImage. + (WebCore::CSSImageValue::cachedOrPendingImage): If we have an image (pending or cached), + return it. Otherwise make a pending image and return it. + (WebCore::CSSImageValue::cachedImage): Only return the image if it's a cached image. + (WebCore::CSSImageValue::cachedImageURL): + (WebCore::CSSImageValue::clearCachedImage): + + * css/CSSStyleSelector.h: + * css/CSSStyleSelector.cpp: + (WebCore::CSSStyleSelector::initForStyleResolve): Clear m_pendingImageProperties. + (WebCore::CSSStyleSelector::styleForElement): Load pending images. + (WebCore::CSSStyleSelector::styleForKeyframe): Ditto. + (WebCore::CSSStyleSelector::pseudoStyleForElement): Ditto. + (WebCore::CSSStyleSelector::styleForPage): Ditto. + (WebCore::CSSStyleSelector::applyProperty): Pull property into a local variable + so we can use it in macros. + (WebCore::CSSStyleSelector::mapFillAttachment): Pass the property down (needed to avoid + additional macro complexity). + (WebCore::CSSStyleSelector::mapFillClip): Ditto + (WebCore::CSSStyleSelector::mapFillComposite): Ditto + (WebCore::CSSStyleSelector::mapFillOrigin): Ditto + (WebCore::CSSStyleSelector::styleImage): Call cachedOrPendingFromValue() + (WebCore::CSSStyleSelector::cachedOrPendingFromValue): Get the cachedOrPendingImage() + from the CSSValue, and if it's a pending image, record the property. + (WebCore::CSSStyleSelector::mapFillImage): Pass the property down (needed to avoid + additional macro complexity). + (WebCore::CSSStyleSelector::mapFillRepeatX): Ditto + (WebCore::CSSStyleSelector::mapFillRepeatY): Ditto + (WebCore::CSSStyleSelector::mapFillSize): Ditto + (WebCore::CSSStyleSelector::mapFillXPosition): Ditto + (WebCore::CSSStyleSelector::mapFillYPosition): Ditto + (WebCore::CSSStyleSelector::mapNinePieceImage): Ditto + (WebCore::CSSStyleSelector::loadPendingImages): Iterate through the m_pendingImageProperties + hash, and replace the pending images with cached images. + + * rendering/style/StyleCachedImage.h: Make cssValue() const. + * rendering/style/StyleCachedImage.cpp: + (WebCore::StyleCachedImage::cssValue): + + * rendering/style/StyleGeneratedImage.h: Make cssValue() const. + * rendering/style/StyleGeneratedImage.cpp: + (WebCore::StyleGeneratedImage::cssValue): + + * rendering/style/StyleImage.h: + (WebCore::StyleImage::operator==): Make const. + (WebCore::StyleImage::isPendingImage): + * rendering/style/StylePendingImage.h: Added. + +2010-08-26 Sam Weinig <sam@webkit.org> + + Reviewed by Darin Adler. + + Add PassOwnArrayPtr + https://bugs.webkit.org/show_bug.cgi?id=44627 + + Add new forwarding headers. + + * ForwardingHeaders/wtf/OwnArrayPtrCommon.h: Added. + * ForwardingHeaders/wtf/PassOwnArrayPtr.h: Added. + +2010-08-26 Stanislav Brabec <sbrabec@suse.cz> + + Reviewed by Martin Robinson. + + [GTK] [PATCH] plugin loading invalid symlink evaluation deadlock + https://bugs.webkit.org/show_bug.cgi?id=44683 + + Fix symlink resolution in PluginPackageGtk. + + * plugins/gtk/PluginPackageGtk.cpp: + (WebCore::PluginPackage::load): g_file_resolve_relative_path must be called with a + a directory, not a file. + +2010-08-26 Andy Estes <aestes@apple.com> + + Reviewed by Eric Carlson. + + A URL in a <param> should be parsed the same as if it were specified as + the data attribute of an <object>. + https://bugs.webkit.org/show_bug.cgi?id=44671 + + Test: fast/replaced/object-param-url-control-char.html + + * rendering/RenderEmbeddedObject.cpp: + (WebCore::RenderEmbeddedObject::updateWidget): Call deprecatedParseURL() + on <param> values of names that we treat as URLs ("src", "movie", "code" + and "url"). + +2010-08-26 Stephen White <senorblanco@chromium.org> + + Unreviewed; build fix. + + Fix for Chromium/Mac. + + * platform/graphics/chromium/Shader.cpp: + +2010-08-26 Tony Chang <tony@chromium.org> + + Reviewed by David Hyatt. + + crash when rendering scrollbar gradient + https://bugs.webkit.org/show_bug.cgi?id=44549 + + Test: scrollbars/scrollbar-gradient-crash.html + + * css/CSSImageGeneratorValue.cpp: + (WebCore::CSSImageGeneratorValue::getImage): Keep this alive. + +2010-08-26 Stephen White <senorblanco@chromium.org> + + Reviewed by Kenneth Russell. + + [CHROMIUM] Give <canvas> 2D shaders their own class hierarchy. + https://bugs.webkit.org/show_bug.cgi?id=44682 + + Covered by fast/canvas layout tests. + + * WebCore.gypi: + Add Shader.cpp, Shader.h to chromium build. + * platform/graphics/chromium/GLES2Canvas.cpp: + (WebCore::GLES2Canvas::GLES2Canvas): + (WebCore::GLES2Canvas::~GLES2Canvas): + (WebCore::GLES2Canvas::fillRect): + (WebCore::GLES2Canvas::drawTexturedRect): + (WebCore::GLES2Canvas::drawTexturedRectTile): + Rip out all shader initialization and compilation code. + Instantiate specialized shaders instead. + * platform/graphics/chromium/GLES2Canvas.h: + * platform/graphics/chromium/Shader.cpp: Added. + (WebCore::affineTo3x3): + (WebCore::Shader::Shader): + (WebCore::Shader::~Shader): + Implement Shader base class. + (WebCore::loadShader): + (WebCore::loadProgram): + Utility functions refactored from GLES2Canvas. + (WebCore::SolidFillShader::SolidFillShader): + (WebCore::TexShader::TexShader): + (WebCore::SolidFillShader::create): + (WebCore::SolidFillShader::use): + (WebCore::TexShader::create): + (WebCore::TexShader::use): + * platform/graphics/chromium/Shader.h: Added. + +2010-08-26 Brian Weinstein <bweinstein@apple.com> + + Reviewed by Adam Roben. + + User scripts injected at start are not run for plugin and media documents + <https://bugs.webkit.org/show_bug.cgi?id=44711> + <rdar://problem/8359288> + + http://trac.webkit.org/changeset/61271 made scripts injected at start run on ImageDocuments, + but didn't implement this behavior for MediaDocuments and PluginDocuments. + + * loader/MediaDocument.cpp: + (WebCore::MediaDocumentParser::createDocumentStructure): Make sure we fire dispatchDocumentElementAvailable. + * loader/PluginDocument.cpp: + (WebCore::PluginDocumentParser::createDocumentStructure): Ditto. + +2010-08-26 Peter Kasting <pkasting@google.com> + + Reviewed by Dimitri Glazkov. + + Misc. cleanup split off from bug 32356. + https://bugs.webkit.org/show_bug.cgi?id=44696 + + * WebCore.gyp/WebCore.gyp: + * dom/Element.cpp: + (WebCore::localZoomForRenderer): + * platform/ScrollView.cpp: + (WebCore::ScrollView::wheelEvent): + * platform/ScrollView.h: + * platform/Scrollbar.cpp: + (WebCore::Scrollbar::scroll): + * platform/Scrollbar.h: + (WebCore::Scrollbar::isScrollbar): + * platform/ScrollbarClient.h: + (WebCore::ScrollbarClient::~ScrollbarClient): + * platform/qt/ScrollbarQt.cpp: + (WebCore::Scrollbar::contextMenu): + * rendering/RenderBox.h: + * rendering/RenderLayer.cpp: + (WebCore::RenderLayer::scroll): + * rendering/RenderLayer.h: + * rendering/RenderListBox.h: + * rendering/RenderTextControlSingleLine.h: + +2010-08-26 David Hyatt <hyatt@apple.com> + + Reviewed by Simon Fraser. + + https://bugs.webkit.org/show_bug.cgi?id=39647, font face loads do a synchronous recalcStyle(Force) + on the whole document. Change these calls to do async recalcStyles instead. + + * css/CSSFontSelector.cpp: + (WebCore::CSSFontSelector::fontLoaded): + (WebCore::CSSFontSelector::fontCacheInvalidated): + * dom/Document.cpp: + (WebCore::Document::scheduleForcedStyleRecalc): + (WebCore::Document::styleSelectorChanged): + * dom/Document.h: + +2010-08-26 Xan Lopez <xlopez@igalia.com> + + Reviewed by Martin Robinson. + + Fix double free (we were passing const memory to a GOwnPtr) by + getting rid of unneeded temp variable. + + * platform/gtk/FileSystemGtk.cpp: + (WebCore::directoryName): + +2010-08-26 Mikhail Naganov <mnaganov@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: Store heap snapshots in InspectorProfilerAgent. + + Change the way heap snapshots are transported to Inspector + to be aligned with CPU profiles. As a result, the Heap snapshots + view of Profiles panel was upstreamed into WebCore. + + https://bugs.webkit.org/show_bug.cgi?id=44531 + + * English.lproj/localizedStrings.js: + * GNUmakefile.am: + * WebCore.gypi: + * WebCore.pro: + * WebCore.vcproj/WebCore.vcproj: + * WebCore.xcodeproj/project.pbxproj: + * bindings/js/ScriptHeapSnapshot.h: Added. + (WebCore::ScriptHeapSnapshot::~ScriptHeapSnapshot): + (WebCore::ScriptHeapSnapshot::title): + (WebCore::ScriptHeapSnapshot::uid): + (WebCore::ScriptHeapSnapshot::buildInspectorObjectForHead): + (WebCore::ScriptHeapSnapshot::ScriptHeapSnapshot): + * bindings/js/ScriptProfiler.h: + (WebCore::ScriptProfiler::takeHeapSnapshot): + * bindings/v8/ScriptHeapSnapshot.cpp: Added. + (WebCore::ScriptHeapSnapshot::title): + (WebCore::ScriptHeapSnapshot::uid): + (WebCore::buildInspectorObjectFor): + (WebCore::ScriptHeapSnapshot::buildInspectorObjectForHead): + * bindings/v8/ScriptHeapSnapshot.h: Added. + (WebCore::ScriptHeapSnapshot::create): + (WebCore::ScriptHeapSnapshot::~ScriptHeapSnapshot): + (WebCore::ScriptHeapSnapshot::ScriptHeapSnapshot): + * bindings/v8/ScriptProfile.cpp: + (WebCore::buildInspectorObjectFor): + * bindings/v8/ScriptProfiler.cpp: + (WebCore::ScriptProfiler::takeHeapSnapshot): + * bindings/v8/ScriptProfiler.h: + * inspector/Inspector.idl: + * inspector/InspectorBackend.cpp: + * inspector/InspectorBackend.h: + * inspector/InspectorProfilerAgent.cpp: + (WebCore::InspectorProfilerAgent::InspectorProfilerAgent): + (WebCore::InspectorProfilerAgent::createSnapshotHeader): + (WebCore::InspectorProfilerAgent::getProfileHeaders): + (WebCore::InspectorProfilerAgent::getProfile): + (WebCore::InspectorProfilerAgent::removeProfile): + (WebCore::InspectorProfilerAgent::resetState): + (WebCore::InspectorProfilerAgent::takeHeapSnapshot): + * inspector/InspectorProfilerAgent.h: + * inspector/front-end/HeapSnapshotView.js: Added. + (WebInspector.HeapSnapshotView.profileCallback): + (WebInspector.HeapSnapshotView.resetCompleted): + (WebInspector.HeapSnapshotView): + (WebInspector.HeapSnapshotView.prototype.get statusBarItems): + (WebInspector.HeapSnapshotView.prototype.get profile): + (WebInspector.HeapSnapshotView.prototype.set profile): + (WebInspector.HeapSnapshotView.prototype.show): + (WebInspector.HeapSnapshotView.prototype.hide): + (WebInspector.HeapSnapshotView.prototype.resize): + (WebInspector.HeapSnapshotView.prototype.refresh): + (WebInspector.HeapSnapshotView.prototype.refreshShowAsPercents): + (WebInspector.HeapSnapshotView.prototype._deleteSearchMatchedFlags): + (WebInspector.HeapSnapshotView.prototype.searchCanceled): + (WebInspector.HeapSnapshotView.prototype.performSearch): + (WebInspector.HeapSnapshotView.prototype.jumpToFirstSearchResult.WebInspector.CPUProfileView.prototype.jumpToFirstSearchResult.jumpToLastSearchResult.WebInspector.CPUProfileView.prototype.jumpToLastSearchResult.jumpToNextSearchResult.WebInspector.CPUProfileView.prototype.jumpToNextSearchResult.jumpToPreviousSearchResult.WebInspector.CPUProfileView.prototype.jumpToPreviousSearchResult.showingFirstSearchResult.WebInspector.CPUProfileView.prototype.showingFirstSearchResult.showingLastSearchResult.WebInspector.CPUProfileView.prototype.showingLastSearchResult._jumpToSearchResult.WebInspector.CPUProfileView.prototype._jumpToSearchResult.refreshVisibleData): + (WebInspector.HeapSnapshotView.prototype._changeBase.resetCompleted): + (WebInspector.HeapSnapshotView.prototype._changeBase): + (WebInspector.HeapSnapshotView.prototype._createSnapshotDataGridList): + (WebInspector.HeapSnapshotView.prototype._getProfiles): + (WebInspector.HeapSnapshotView.prototype._loadProfile.loadedCallback): + (WebInspector.HeapSnapshotView.prototype._loadProfile): + (WebInspector.HeapSnapshotView.prototype._mouseDownInDataGrid): + (WebInspector.HeapSnapshotView.prototype.get _isShowingAsPercent): + (WebInspector.HeapSnapshotView.prototype._percentClicked): + (WebInspector.HeapSnapshotView.prototype._prepareProfile.mergeRetainers): + (WebInspector.HeapSnapshotView.prototype._prepareProfile): + (WebInspector.HeapSnapshotView.prototype._resetDataGridList.profileLoaded): + (WebInspector.HeapSnapshotView.prototype._resetDataGridList): + (WebInspector.HeapSnapshotView.prototype._sortData): + (WebInspector.HeapSnapshotView.prototype._updateBaseOptions): + (WebInspector.HeapSnapshotView.prototype._updatePercentButton): + (WebInspector.HeapSnapshotView.prototype._updateSummaryGraph): + (WebInspector.HeapSnapshotView.SearchHelper.operations.LESS): + (WebInspector.HeapSnapshotView.SearchHelper.operations.LESS_OR_EQUAL): + (WebInspector.HeapSnapshotView.SearchHelper.operations.EQUAL): + (WebInspector.HeapSnapshotView.SearchHelper.operations.GREATER_OR_EQUAL): + (WebInspector.HeapSnapshotView.SearchHelper.operations.GREATER): + (WebInspector.HeapSnapshotView.SearchHelper.parseOperationAndNumber): + (WebInspector.HeapSummaryCalculator): + (WebInspector.HeapSummaryCalculator.prototype.computeSummaryValues): + (WebInspector.HeapSummaryCalculator.prototype.formatValue): + (WebInspector.HeapSummaryCalculator.prototype.get showAsPercent): + (WebInspector.HeapSummaryCalculator.prototype.set showAsPercent): + (WebInspector.HeapSummaryCountCalculator): + (WebInspector.HeapSummaryCountCalculator.prototype._highFromLow): + (WebInspector.HeapSummaryCountCalculator.prototype._valueToString): + (WebInspector.HeapSummarySizeCalculator): + (WebInspector.HeapSummarySizeCalculator.prototype._highFromLow): + (WebInspector.HeapSnapshotDataGridNodeWithRetainers): + (WebInspector.HeapSnapshotDataGridNodeWithRetainers.prototype.get _hasRetainers): + (WebInspector.HeapSnapshotDataGridNodeWithRetainers.prototype.get _parent): + (WebInspector.HeapSnapshotDataGridNodeWithRetainers.prototype._populate): + (WebInspector.HeapSnapshotDataGridNodeWithRetainers.prototype.produceDiff): + (WebInspector.HeapSnapshotDataGridNodeWithRetainers.prototype.sort): + (WebInspector.HeapSnapshotDataGridNodeWithRetainers.prototype.signForDelta): + (WebInspector.HeapSnapshotDataGridNodeWithRetainers.prototype.showDeltaAsPercent): + (WebInspector.HeapSnapshotDataGridNodeWithRetainers.prototype.getTotalCount): + (WebInspector.HeapSnapshotDataGridNodeWithRetainers.prototype.getTotalSize): + (WebInspector.HeapSnapshotDataGridNodeWithRetainers.prototype.get countPercent): + (WebInspector.HeapSnapshotDataGridNodeWithRetainers.prototype.get sizePercent): + (WebInspector.HeapSnapshotDataGridNodeWithRetainers.prototype.get countDeltaPercent): + (WebInspector.HeapSnapshotDataGridNodeWithRetainers.prototype.get sizeDeltaPercent): + (WebInspector.HeapSnapshotDataGridNodeWithRetainers.prototype.get data): + (WebInspector.HeapSnapshotDataGridNodeWithRetainers.prototype.createCell): + (WebInspector.HeapSnapshotDataGridNode): + (WebInspector.HeapSnapshotDataGridList): + (WebInspector.HeapSnapshotDataGridList.prototype.appendChild): + (WebInspector.HeapSnapshotDataGridList.prototype.insertChild): + (WebInspector.HeapSnapshotDataGridList.prototype.removeChildren): + (WebInspector.HeapSnapshotDataGridList.prototype.populateChildren): + (WebInspector.HeapSnapshotDataGridList.propertyComparator.comparator): + (WebInspector.HeapSnapshotDataGridList.propertyComparator): + (WebInspector.HeapSnapshotDataGridRetainerNode): + (WebInspector.HeapSnapshotDataGridRetainerNode.prototype.get sizePercent): + (WebInspector.HeapSnapshotDataGridRetainerNode.prototype.get sizeDeltaPercent): + (WebInspector.HeapSnapshotDataGridRetainerNode.prototype._calculateRetainers): + (WebInspector.HeapSnapshotProfileType): + (WebInspector.HeapSnapshotProfileType.prototype.get buttonTooltip): + (WebInspector.HeapSnapshotProfileType.prototype.get buttonStyle): + (WebInspector.HeapSnapshotProfileType.prototype.buttonClicked): + (WebInspector.HeapSnapshotProfileType.prototype.get welcomeMessage): + (WebInspector.HeapSnapshotProfileType.prototype.createSidebarTreeElementForProfile): + (WebInspector.HeapSnapshotProfileType.prototype.createView): + * inspector/front-end/ProfileView.js: + (WebInspector.CPUProfileView): + (WebInspector.CPUProfileType.prototype.createSidebarTreeElementForProfile): + * inspector/front-end/ProfilesPanel.js: + (WebInspector.ProfilesPanel.prototype.addProfileHeader): + (WebInspector.ProfilesPanel.prototype.removeProfileHeader): + (WebInspector.ProfilesPanel.prototype.getProfiles): + (WebInspector.ProfilesPanel.prototype.updateProfile): + (WebInspector.ProfileSidebarTreeElement): + (WebInspector.ProfileSidebarTreeElement.prototype.get mainTitle): + * inspector/front-end/WebKit.qrc: + * inspector/front-end/inspector.css: + (.heap-snapshot-sidebar-tree-item .icon): + (.heap-snapshot-sidebar-tree-item.small .icon): + (.heap-snapshot-view): + (.heap-snapshot-view.visible): + (.heap-snapshot-view .data-grid): + (.heap-snapshot-view .data-grid th.count-column): + (.heap-snapshot-view .data-grid td.count-column): + (.heap-snapshot-view .data-grid th.size-column): + (.heap-snapshot-view .data-grid td.size-column): + (.heap-snapshot-view .data-grid th.countDelta-column): + (.heap-snapshot-view .data-grid td.countDelta-column): + (.heap-snapshot-view .data-grid th.sizeDelta-column): + (.heap-snapshot-view .data-grid td.sizeDelta-column): + (#heap-snapshot-summary-container): + (.heap-snapshot-summary): + (.heap-snapshot-summary canvas.summary-graph): + (.heap-snapshot-summary-label): + * inspector/front-end/inspector.html: + * inspector/front-end/inspector.js: + (WebInspector._createPanels): + +2010-08-25 David Hyatt <hyatt@apple.com> + + Reviewed by Simon Fraser. + + <rdar://problem/8302217> recalcStyles called immediately on each change when updating document-level stylesheets + https://bugs.webkit.org/show_bug.cgi?id=36303 + + Parameterize updateStyleSelector to optionally defer the forced style recalc following the rebuilding of the + sheets used by the CSSStyleSelector. Rename the method to styleSelectorChanged(). Add the capability to do + a forced style recalc to the style recalc timer. + + * css/CSSMutableStyleDeclaration.cpp: + (WebCore::CSSMutableStyleDeclaration::setNeedsStyleRecalc): + * css/CSSStyleSheet.cpp: + (WebCore::CSSStyleSheet::styleSheetChanged): + * css/CSSVariablesDeclaration.cpp: + (WebCore::CSSVariablesDeclaration::setNeedsStyleRecalc): + * dom/Document.cpp: + (WebCore::Document::Document): + (WebCore::Document::scheduleStyleRecalc): + (WebCore::Document::updateStyleIfNeeded): + (WebCore::Document::updateLayoutIgnorePendingStylesheets): + (WebCore::Document::clearPageUserSheet): + (WebCore::Document::clearPageGroupUserSheets): + (WebCore::Document::processHttpEquiv): + (WebCore::Document::setSelectedStylesheetSet): + (WebCore::Document::removePendingSheet): + (WebCore::Document::styleSelectorChanged): + (WebCore::Document::setInPageCache): + * dom/Document.h: + (WebCore::): + * dom/ProcessingInstruction.cpp: + (WebCore::ProcessingInstruction::removedFromDocument): + * dom/StyleElement.cpp: + (WebCore::StyleElement::removedFromDocument): + * dom/XMLDocumentParser.cpp: + (WebCore::XMLDocumentParser::end): + * dom/XMLDocumentParserLibxml2.cpp: + (WebCore::XMLDocumentParser::doEnd): + * html/HTMLDocument.cpp: + (WebCore::HTMLDocument::determineParseMode): + * html/HTMLLinkElement.cpp: + (WebCore::HTMLLinkElement::setDisabledState): + (WebCore::HTMLLinkElement::process): + (WebCore::HTMLLinkElement::removedFromDocument): + * page/Frame.cpp: + (WebCore::Frame::setPrinting): + (WebCore::Frame::reapplyStyles): + * page/FrameView.cpp: + (WebCore::FrameView::layout): + * page/Page.cpp: + (WebCore::Page::setViewMode): + * rendering/RenderBlock.cpp: + (WebCore::RenderBlock::setDesiredColumnCountAndWidth): + * svg/SVGFontFaceElement.cpp: + (WebCore::SVGFontFaceElement::rebuildFontFace): + (WebCore::SVGFontFaceElement::removeFromMappedElementSheet): + +2010-08-24 Vangelis Kokkevis <vangelis@chromium.org> + + Reviewed by Kenneth Russell. + + [chromium] Implementing clipping for composited layers. Two + types of clipping are added: Scissoring for layers that don't + contain any rotations and stencil-buffer based clipping for + all other layers. + https://bugs.webkit.org/show_bug.cgi?id=44573 + + Tests: Compositor layout tests that test clipping such as + compositing/geometry/{clip.html, clipping-foreground.html} now + work properly. + + * platform/graphics/chromium/LayerChromium.cpp: + (WebCore::LayerChromium::SharedValues::SharedValues): + (WebCore::LayerChromium::getDrawRect): + (WebCore::LayerChromium::drawAsMask): + * platform/graphics/chromium/LayerChromium.h: + * platform/graphics/chromium/LayerRendererChromium.cpp: + (WebCore::LayerRendererChromium::drawLayers): + (WebCore::LayerRendererChromium::drawLayerIntoStencilBuffer): + (WebCore::LayerRendererChromium::drawLayersRecursive): + (WebCore::LayerRendererChromium::scissorToRect): + (WebCore::LayerRendererChromium::initializeSharedObjects): + * platform/graphics/chromium/LayerRendererChromium.h: + +2010-08-25 Kenneth Russell <kbr@google.com> + + Reviewed by Dimitri Glazkov. + + Expose Vector3 and associated operations + https://bugs.webkit.org/show_bug.cgi?id=44666 + + No new tests; ran several 3D CSS demos and did full layout test + run. New code paths have also been tested by new calling code + which will be checked in soon. + + * platform/graphics/transforms/TransformationMatrix.cpp: + (WebCore::decompose): + * platform/graphics/transforms/TransformationMatrix.h: + (WebCore::Vector3::Vector3): + (WebCore::Vector3::x): + (WebCore::Vector3::y): + (WebCore::Vector3::z): + (WebCore::Vector3::setX): + (WebCore::Vector3::setY): + (WebCore::Vector3::setZ): + (WebCore::Vector3::set): + (WebCore::Vector3::operator =): + (WebCore::Vector3::operator +): + (WebCore::Vector3::operator -): + (WebCore::Vector3::operator[]): + (WebCore::Vector3::length): + (WebCore::Vector3::lengthSquared): + (WebCore::Vector3::scaleTo): + (WebCore::Vector3::normalize): + (WebCore::Vector3::dot): + (WebCore::Vector3::combine): + (WebCore::Vector3::cross): + +2010-08-26 Mikhail Naganov <mnaganov@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: fix CPU profile header entries doubling on Inspector re-opening. + + https://bugs.webkit.org/show_bug.cgi?id=44685 + + * inspector/front-end/ProfilesPanel.js: + (WebInspector.ProfilesPanel.prototype.show): + +2010-08-26 Eric Carlson <eric.carlson@apple.com> + + Reviewed by Darin Adler and Maciej Stachowiak. + + https://bugs.webkit.org/show_bug.cgi?id=44013 + HTMLMediaElement should delay document load event + + Test: media/video-delay-load-event.html + + * dom/Document.cpp: + (WebCore::Document::Document): Initialize incrementLoadEventDelayCount. + (WebCore::Document::decrementLoadEventDelayCount): New, decrement incrementLoadEventDelayCount + and call loader->checkCompleted() when it reaches zero. + * dom/Document.h: + (WebCore::Document::incrementLoadEventDelayCount): New. + (WebCore::Document::isDelayingLoadEvent): New. + + * html/HTMLMediaElement.cpp: + (WebCore::HTMLMediaElement::~HTMLMediaElement): Stop delaying the load event if necessary. + (WebCore::HTMLMediaElement::willMoveToNewOwnerDocument): Ditto. + (WebCore::HTMLMediaElement::didMoveToNewOwnerDocument): Delay the load event if we don't the + meta data for the movie yet. + (WebCore::HTMLMediaElement::prepareForLoad): Delay the load event. + (WebCore::HTMLMediaElement::selectMediaResource): Don't delay the load event when there are + no more sources to consider. Don't change m_delayingTheLoadEvent directly, call + setShouldDelayLoadEvent() instead. + (WebCore::HTMLMediaElement::waitForSourceChange): Stop delaying the load event. + (WebCore::HTMLMediaElement::noneSupported): Ditto. + (WebCore::HTMLMediaElement::mediaEngineError): Ditto. + (WebCore::HTMLMediaElement::setReadyState): Ditto. + (WebCore::HTMLMediaElement::userCancelledLoad): Ditto. + (WebCore::HTMLMediaElement::setShouldDelayLoadEvent): New, increment/decrement the document's + load event delay count. + * html/HTMLMediaElement.h: + + * loader/FrameLoader.cpp: + (WebCore::FrameLoader::checkCompleted): See if the document wants to delay completion for + elements that don't go through a FrameLoader. + (WebCore::FrameLoader::checkCallImplicitClose): Ditto + * page/Frame.cpp: + +2010-08-26 Dan Bernstein <mitz@apple.com> + + Reviewed by Simon Fraser. + + Fix the same issue as https://bugs.webkit.org/show_bug.cgi?id=41585 + but this time for the -webkit-font-smoothing property. + + Updated fast/css/text-rendering-priority.html to cover all properties that + affect the font. + + * css/CSSPropertyNames.in: Moved text-rendering to the “high priority†section at the top. + * css/CSSStyleSelector.cpp: + (WebCore::CSSStyleSelector::styleForElement): Assert that the font is not dirtied by + applying any of the “low priority†properties, but still handle the case that the assertion + is false. + (WebCore::CSSStyleSelector::applyDeclarations): Updated compile-time assertion. + +2010-08-26 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Xan Lopez. + + [GTK] The GNUmakefile.am files contain a myriad of confusing preprocessor and compiler flag definitions + https://bugs.webkit.org/show_bug.cgi?id=44624 + + Clean up GNUmakefile.am. + + * GNUmakefile.am: Remove some WebKit includes from webcore_cppflags. These + includes are added to the build line by the top-level GNUmakefile.am, since + WebCore isn't build as an intermediate library. + +2010-08-26 Yury Semikhatsky <yurys@chromium.org> + + Unreviewed. Revert r66103 since Qt tests are failing. + + * inspector/Inspector.idl: + * inspector/InspectorController.cpp: + (WebCore::InspectorController::inspectedPageDestroyed): + (WebCore::InspectorController::close): + * inspector/InspectorFrontendClient.h: + * inspector/InspectorFrontendHost.cpp: + * inspector/InspectorFrontendHost.h: + * inspector/InspectorFrontendHost.idl: + * inspector/front-end/InspectorFrontendHostStub.js: + * inspector/front-end/inspector.js: + (WebInspector.inspectedPageDestroyed): + +2010-08-26 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + REGRESSION: Crash occurs at objc_msgSend when closing a window that is displaying the web inspector + https://bugs.webkit.org/show_bug.cgi?id=44230 + + * inspector/Inspector.idl: + * inspector/InspectorController.cpp: + (WebCore::InspectorController::inspectedPageDestroyed): + (WebCore::InspectorController::close): + * inspector/InspectorFrontendClient.h: + * inspector/InspectorFrontendHost.cpp: + (WebCore::InspectorFrontendHost::disconnectFromBackend): don't try to notify InspectorController + that frontend closes if InspectorController triggered the action. + * inspector/InspectorFrontendHost.h: + * inspector/InspectorFrontendHost.idl: + * inspector/front-end/InspectorFrontendHostStub.js: + (.WebInspector.InspectorFrontendHostStub.prototype.disconnectFromBackend): + * inspector/front-end/inspector.js: + (WebInspector.disconnectFromBackend): + +2010-08-26 Ilya Tikhonovsky <loislo@chromium.org> + + Reviewed by Yury Semikhatsky. + + WebInspector: It would be better to have an explicit type check for the all + arguments of InspectorBackend functions on front-end side. + https://bugs.webkit.org/show_bug.cgi?id=44684 + + * inspector/CodeGeneratorInspector.pm: + +2010-08-26 Ilya Tikhonovsky <loislo@chromium.org> + + Reviewed by Yury Semikhatsky. + + WebInspector: It would be better to rename setBool, pushBool and asBool accessors + to setBoolean, pushBoolean and asBoolean for better matching with the results of + JS typeof operator. + https://bugs.webkit.org/show_bug.cgi?id=44680 + + * bindings/js/ScriptProfile.cpp: + (WebCore::buildInspectorObjectFor): + * bindings/v8/ScriptProfile.cpp: + (WebCore::buildInspectorObjectFor): + * inspector/CodeGeneratorInspector.pm: + * inspector/InspectorController.cpp: + (WebCore::InspectorController::buildObjectForCookie): + * inspector/InspectorDOMAgent.cpp: + (WebCore::InspectorDOMAgent::buildObjectForEventListener): + (WebCore::InspectorDOMAgent::populateObjectWithStyleProperties): + (WebCore::InspectorDOMAgent::buildObjectForStyleSheet): + (WebCore::InspectorDOMAgent::buildObjectForRule): + * inspector/InspectorDOMStorageResource.cpp: + (WebCore::InspectorDOMStorageResource::bind): + * inspector/InspectorResource.cpp: + (WebCore::InspectorResource::updateScriptObject): + * inspector/InspectorValues.cpp: + (WebCore::InspectorValue::asBoolean): + (WebCore::InspectorBasicValue::asBoolean): + (WebCore::InspectorBasicValue::asNumber): + (WebCore::InspectorBasicValue::writeJSON): + (WebCore::InspectorObject::getBoolean): + * inspector/InspectorValues.h: + (WebCore::InspectorValue::): + (WebCore::InspectorBasicValue::InspectorBasicValue): + (WebCore::InspectorObject::setBoolean): + (WebCore::InspectorArray::pushBoolean): + * inspector/ScriptBreakpoint.cpp: + (WebCore::ScriptBreakpoint::sourceBreakpointsFromInspectorObject): + (WebCore::ScriptBreakpoint::inspectorObjectFromSourceBreakpoints): + * inspector/TimelineRecordFactory.cpp: + (WebCore::TimelineRecordFactory::createTimerInstallData): + (WebCore::TimelineRecordFactory::createResourceSendRequestData): + (WebCore::TimelineRecordFactory::createResourceFinishData): + +2010-08-26 Girish Ramakrishnan <girish@forwardbias.in> + + Reviewed by Simon Hausmann. + + [Qt] Set the clipRect correctly in windowed and windowless mode. + In Windowed mode, the values are in page coordinates. In Windowless + mode the values are in drawable coordinates. Setting these values is + purely academic since they are not used by Flash. However, there is a + possibility that plugins might infer a 'null' clipRect to mean 'invisible'. + + https://bugs.webkit.org/show_bug.cgi?id=44594 + + * plugins/qt/PluginViewQt.cpp: + (WebCore::PluginView::setNPWindowIfNeeded): + +2010-08-26 Pavel Podivilov <podivilov@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: enable debugger after resources are pushed to front-end + https://bugs.webkit.org/show_bug.cgi?id=44673 + + * inspector/InspectorController.cpp: + (WebCore::InspectorController::connectFrontend): + (WebCore::InspectorController::populateScriptObjects): + +2010-08-26 Nikolas Zimmermann <nzimmermann@rim.com> + + Reviewed by Dirk Schulze. + + text-shadow is not respected in RenderSVGText::repaintRectInLocalCoordinates() + https://bugs.webkit.org/show_bug.cgi?id=44616 + + Centralize code to calculate the shadow extents in ShadowData. + Respect textShadow() when calculating the repaint rect of RenderSVGText. + + Tests: svg/css/composite-shadow-text.svg + transitions/svg-text-shadow-transition.html + + * rendering/RenderObject.cpp: + (WebCore::RenderObject::adjustRectForOutlineAndShadow): + * rendering/RenderSVGRoot.cpp: + (WebCore::RenderSVGRoot::repaintRectInLocalCoordinates): + (WebCore::RenderSVGRoot::computeRectForRepaint): + * rendering/RenderSVGText.cpp: + (WebCore::RenderSVGText::repaintRectInLocalCoordinates): + * rendering/SVGRenderSupport.cpp: + (WebCore::SVGRenderSupport::computeRectForRepaint): + (WebCore::SVGRenderSupport::prepareToRenderSVGContent): + (WebCore::SVGRenderSupport::finishRenderSVGContent): + (WebCore::SVGRenderSupport::intersectRepaintRectWithResources): + * rendering/style/SVGRenderStyle.cpp: + * rendering/style/SVGRenderStyle.h: + * rendering/style/ShadowData.cpp: + (WebCore::calculateShadowExtent): + (WebCore::ShadowData::adjustRectForShadow): + * rendering/style/ShadowData.h: + +2010-08-25 Xan Lopez <xlopez@igalia.com> + + Reviewed by Martin Robinson. + + [GTK] Rework event definition in the DOM bindings + https://bugs.webkit.org/show_bug.cgi?id=44597 + + Define DOM events in the base classes that implement EventTarget, + since theoretically you can dispatch any event to any of those + classes whether it makes sense semantically or not. + + All the existing events in WebKit are not listed anywhere in the + IDL files, so we need to have the list in the generator script. + + * bindings/scripts/CodeGeneratorGObject.pm: + +2010-08-25 Ilya Tikhonovsky <loislo@chromium.org> + + Reviewed by Pavel Feldman. + + WebInspector: as far as we have 'seq' property in the each inspector message + it would be better to remove explicit callId argument from Inspector.idl functions + declarations. + https://bugs.webkit.org/show_bug.cgi?id=44617 + + * WebCore.xcodeproj/project.pbxproj: + * inspector/CodeGeneratorInspector.pm: + * inspector/Inspector.idl: + * inspector/front-end/AuditRules.js: + (WebInspector.AuditRules.UnusedCssRule.prototype.doRun): + (WebInspector.AuditRules.ImageDimensionsRule.prototype.doRun.receivedImages): + * inspector/front-end/BreakpointManager.js: + (WebInspector.BreakpointManager.prototype._setBreakpointOnBackend): + * inspector/front-end/CSSStyleModel.js: + (WebInspector.CSSStyleModel.prototype.getStylesAsync): + (WebInspector.CSSStyleModel.prototype.getComputedStyleAsync): + (WebInspector.CSSStyleModel.prototype.setRuleSelector): + (WebInspector.CSSStyleModel.prototype.addRule): + (WebInspector.CSSStyleModel.prototype.toggleStyleEnabled): + (WebInspector.CSSStyleModel.prototype.setCSSText): + (WebInspector.CSSStyleModel.prototype.applyStyleText): + * inspector/front-end/DOMAgent.js: + (WebInspector.DOMAgent.prototype.getChildNodesAsync): + (WebInspector.DOMAgent.prototype.setAttributeAsync): + (WebInspector.DOMAgent.prototype.removeAttributeAsync): + (WebInspector.DOMAgent.prototype.setTextNodeValueAsync): + (WebInspector.ApplicationCache.getApplicationCachesAsync): + (WebInspector.Cookies.getCookiesAsync): + (WebInspector.EventListeners.getEventListenersForNodeAsync): + * inspector/front-end/DOMStorage.js: + (WebInspector.DOMStorage.prototype.getEntries): + (WebInspector.DOMStorage.prototype.setItem): + (WebInspector.DOMStorage.prototype.removeItem): + * inspector/front-end/Database.js: + (WebInspector.Database.prototype.getTableNames): + (WebInspector.Database.prototype.executeSql): + * inspector/front-end/ElementsPanel.js: + (WebInspector.ElementsPanel.prototype.setDocument): + * inspector/front-end/ElementsTreeOutline.js: + (WebInspector.ElementsTreeElement.prototype._tagNameEditingCommitted): + (): + * inspector/front-end/InjectedScriptAccess.js: + (InjectedScriptAccess._installHandler.InjectedScriptAccess.prototype.methodName): + (InjectedScriptAccess._installHandler): + * inspector/front-end/MetricsSidebarPane.js: + (WebInspector.MetricsSidebarPane.prototype.update): + (WebInspector.MetricsSidebarPane.prototype.editingCommitted): + * inspector/front-end/ProfileView.js: + (WebInspector.CPUProfileView): + * inspector/front-end/ProfilesPanel.js: + * inspector/front-end/ResourcesPanel.js: + (WebInspector.getResourceContent): + * inspector/front-end/ScriptView.js: + (WebInspector.ScriptView.prototype.setupSourceFrameIfNeeded): + * inspector/front-end/ScriptsPanel.js: + (WebInspector.ScriptsPanel.prototype.editScriptSource): + * inspector/front-end/inspector.js: + (WebInspector.doLoadedDone): + +2010-08-26 Kwang Yul Seo <skyul@company100.net> + + Reviewed by Kent Tamura. + + Add ENABLE(INDEXED_DATABASE) guard + https://bugs.webkit.org/show_bug.cgi?id=44659 + + Build fix for ports with index database disabled. + + * storage/IDBKeyPathBackendImpl.cpp: + +2010-08-26 Girish Ramakrishnan <girish@forwardbias.in> + + Reviewed by Ariya Hidayat. + + [Qt] Replace QLibrary("libgdk-x11-2.0.so.0") with QLibrary("libgdk-x11-2.0", 0) + https://bugs.webkit.org/show_bug.cgi?id=44618 + + * plugins/qt/PluginViewQt.cpp: + (WebCore::getPluginDisplay): + +2010-08-26 Adam Barth <abarth@webkit.org> + + Reviewed by Sam Weinig. + + Deploy adoptPtr to WebCore/loader + https://bugs.webkit.org/show_bug.cgi?id=44591 + + This patch covers the easy cases. There are a handful of tougher cases + that I'm leaving to a future patch. I filed one bug about a possible + memory leak and I emailed webkit-dev about some infrastructure we'll + need to tackle some of the harder cases. + + * loader/CrossOriginAccessControl.cpp: + (WebCore::createAllowedCrossOriginResponseHeadersSet): + (WebCore::isOnAccessControlResponseHeaderWhitelist): + * loader/DocLoader.cpp: + (WebCore::DocLoader::requestPreload): + * loader/DocumentLoader.cpp: + (WebCore::DocumentLoader::DocumentLoader): + (WebCore::DocumentLoader::addAllArchiveResources): + (WebCore::DocumentLoader::addArchiveResource): + * loader/DocumentThreadableLoader.cpp: + (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): + (WebCore::DocumentThreadableLoader::didReceiveResponse): + * loader/PingLoader.cpp: + (WebCore::PingLoader::loadImage): + * loader/ProgressTracker.cpp: + (WebCore::ProgressTracker::incrementProgress): + * loader/RedirectScheduler.cpp: + (WebCore::RedirectScheduler::scheduleRedirect): + (WebCore::RedirectScheduler::scheduleLocationChange): + (WebCore::RedirectScheduler::scheduleFormSubmission): + (WebCore::RedirectScheduler::scheduleRefresh): + (WebCore::RedirectScheduler::scheduleHistoryNavigation): + * loader/WorkerThreadableLoader.cpp: + (WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveData): + * loader/icon/IconDatabase.cpp: + (WebCore::readySQLiteStatement): + * loader/icon/IconLoader.cpp: + (WebCore::IconLoader::create): + +2010-08-26 Alejandro G. Castro <alex@igalia.com> + + Reviewed by Dan Bernstein. + + shadowSize parameter is used to pass shadow offset in the + GraphicsContext::setShadow and getShadow functions + https://bugs.webkit.org/show_bug.cgi?id=44603 + + Change the shadowSize parameter ot the functions getShadow and + setShadow in GraphicsContext to shadowOffset which is the current + use of that parameter in the code. + + * platform/graphics/GraphicsContext.cpp: + (WebCore::GraphicsContext::setShadow): + (WebCore::GraphicsContext::clearShadow): + (WebCore::GraphicsContext::getShadow): + * platform/graphics/GraphicsContext.h: + * platform/graphics/GraphicsContextPrivate.h: + * platform/graphics/cairo/FontCairo.cpp: + (WebCore::Font::drawGlyphs): + * platform/graphics/cairo/GraphicsContextCairo.cpp: + (WebCore::GraphicsContext::calculateShadowBufferDimensions): + (WebCore::drawPathShadow): + (WebCore::drawBorderlessRectShadow): + (WebCore::GraphicsContext::setPlatformShadow): + * platform/graphics/cairo/ImageCairo.cpp: + (WebCore::BitmapImage::draw): + * platform/graphics/chromium/FontChromiumWin.cpp: + (WebCore::TransparencyAwareFontPainter::TransparencyAwareGlyphPainter::drawGlyphs): + (WebCore::Font::drawComplexText): + * platform/graphics/gtk/FontGtk.cpp: + (WebCore::Font::drawComplexText): + * platform/graphics/mac/FontMac.mm: + (WebCore::Font::drawGlyphs): + * platform/graphics/qt/ImageQt.cpp: + (WebCore::BitmapImage::draw): + * platform/graphics/qt/StillImageQt.cpp: + (WebCore::StillImage::draw): + * platform/graphics/qt/GraphicsContextQt: + (WebCore::GraphicsContext::setPlatformShadow): + * platform/graphics/skia/SkiaFontWin.cpp: + (WebCore::windowsCanHandleDrawTextShadow): + * platform/graphics/win/FontCGWin.cpp: + (WebCore::drawGDIGlyphs): + (WebCore::Font::drawGlyphs): + * platform/graphics/wince/GraphicsContextWince.cpp: + (WebCore::GraphicsContext::fillRoundedRect): + (WebCore::GraphicsContext::drawText): + 2010-08-25 Sheriff Bot <webkit.review.bot@gmail.com> Unreviewed, rolling out r66074. diff --git a/WebCore/Configurations/FeatureDefines.xcconfig b/WebCore/Configurations/FeatureDefines.xcconfig index f2b4c09..8f8c213 100644 --- a/WebCore/Configurations/FeatureDefines.xcconfig +++ b/WebCore/Configurations/FeatureDefines.xcconfig @@ -71,6 +71,7 @@ ENABLE_FILTERS_macosx = ENABLE_FILTERS; ENABLE_FILE_WRITER = ; ENABLE_FILE_SYSTEM = ; +ENABLE_FULLSCREEN_API = ENABLE_FULLSCREEN_API; ENABLE_GEOLOCATION = ENABLE_GEOLOCATION; ENABLE_ICONDATABASE = $(ENABLE_ICONDATABASE_$(REAL_PLATFORM_NAME)); @@ -120,4 +121,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_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); diff --git a/WebCore/Configurations/Version.xcconfig b/WebCore/Configurations/Version.xcconfig index 09ebfc4..69bde0f 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 = 6; +MINOR_VERSION = 7; TINY_VERSION = 0; FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION); diff --git a/WebCore/DerivedSources.cpp b/WebCore/DerivedSources.cpp index bbab64b..81f4070 100644 --- a/WebCore/DerivedSources.cpp +++ b/WebCore/DerivedSources.cpp @@ -107,8 +107,10 @@ #include "JSFile.cpp" #include "JSFileEntry.cpp" #include "JSFileError.cpp" +#include "JSFileException.cpp" #include "JSFileList.cpp" #include "JSFileReader.cpp" +#include "JSFileReaderSync.cpp" #include "JSFileSystemCallback.cpp" #include "JSFileWriter.cpp" #include "JSFlags.cpp" diff --git a/WebCore/DerivedSources.make b/WebCore/DerivedSources.make index b9f6589..6fd1cde 100644 --- a/WebCore/DerivedSources.make +++ b/WebCore/DerivedSources.make @@ -33,6 +33,7 @@ VPATH = \ $(WebCore)/bindings/objc \ $(WebCore)/css \ $(WebCore)/dom \ + $(WebCore)/fileapi \ $(WebCore)/html \ $(WebCore)/html/canvas \ $(WebCore)/inspector \ @@ -151,9 +152,11 @@ DOM_CLASSES = \ EventTarget \ File \ FileEntry \ + FileException \ FileError \ FileList \ FileReader \ + FileReaderSync \ FileWriter \ FileSystemCallback \ Flags \ @@ -604,8 +607,8 @@ DocTypeStrings.cpp : html/DocTypeStrings.gperf $(WebCore)/make-hash-tools.pl # HTML entity names -HTMLEntityTable.cpp : html/HTMLEntityNames.json $(WebCore)/../WebKitTools/Scripts/create-html-entity-table - python $(WebCore)/../WebKitTools/Scripts/create-html-entity-table -o HTMLEntityTable.cpp $(WebCore)/html/HTMLEntityNames.json +HTMLEntityTable.cpp : html/parser/HTMLEntityNames.in $(WebCore)/html/parser/create-html-entity-table + python $(WebCore)/html/parser/create-html-entity-table -o HTMLEntityTable.cpp $(WebCore)/html/parser/HTMLEntityNames.in # -------- @@ -676,6 +679,10 @@ ifeq ($(OS),MACOS) endif endif +ifeq ($(findstring ENABLE_FULLSCREEN_API,$(FEATURE_DEFINES)), ENABLE_FULLSCREEN_API) + USER_AGENT_STYLE_SHEETS := $(USER_AGENT_STYLE_SHEETS) $(WebCore)/css/fullscreen.css +endif + UserAgentStyleSheets.h : css/make-css-file-arrays.pl $(USER_AGENT_STYLE_SHEETS) perl $< $@ UserAgentStyleSheetsData.cpp $(USER_AGENT_STYLE_SHEETS) @@ -809,7 +816,7 @@ generator_script = perl $(addprefix -I $(WebCore)/, $(sort $(dir $(1)))) $(WebCo # JS bindings generator -IDL_INCLUDES = dom html css page notifications xml svg +IDL_INCLUDES = dom fileapi html css page notifications xml svg IDL_COMMON_ARGS = $(IDL_INCLUDES:%=--include %) --write-dependencies --outputDir . JS_BINDINGS_SCRIPTS = $(GENERATE_SCRIPTS) bindings/scripts/CodeGeneratorJS.pm diff --git a/WebCore/English.lproj/localizedStrings.js b/WebCore/English.lproj/localizedStrings.js Binary files differindex 38d2557..c26c15f 100644 --- a/WebCore/English.lproj/localizedStrings.js +++ b/WebCore/English.lproj/localizedStrings.js diff --git a/WebCore/ForwardingHeaders/wtf/OwnArrayPtrCommon.h b/WebCore/ForwardingHeaders/wtf/OwnArrayPtrCommon.h new file mode 100644 index 0000000..e886c8a --- /dev/null +++ b/WebCore/ForwardingHeaders/wtf/OwnArrayPtrCommon.h @@ -0,0 +1,4 @@ +#ifndef WebCore_FWD_OwnArrayPtrCommon_h +#define WebCore_FWD_OwnArrayPtrCommon_h +#include <JavaScriptCore/OwnArrayPtrCommon.h> +#endif diff --git a/WebCore/ForwardingHeaders/wtf/PassOwnArrayPtr.h b/WebCore/ForwardingHeaders/wtf/PassOwnArrayPtr.h new file mode 100644 index 0000000..8202cae --- /dev/null +++ b/WebCore/ForwardingHeaders/wtf/PassOwnArrayPtr.h @@ -0,0 +1,4 @@ +#ifndef WebCore_FWD_PassOwnArrayPtr_h +#define WebCore_FWD_PassOwnArrayPtr_h +#include <JavaScriptCore/PassOwnArrayPtr.h> +#endif diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am index dac604b..76f8be2 100644 --- a/WebCore/GNUmakefile.am +++ b/WebCore/GNUmakefile.am @@ -5,9 +5,6 @@ WEBCORE_CSS_PROPERTY_NAMES := $(WebCore)/css/CSSPropertyNames.in WEBCORE_CSS_VALUE_KEYWORDS := $(WebCore)/css/CSSValueKeywords.in webcore_cppflags += \ - -I$(srcdir)/WebKit/gtk \ - -I$(srcdir)/WebKit/gtk/WebCoreSupport \ - -I$(srcdir)/WebKit/gtk/webkit \ -I$(srcdir)/WebCore \ -I$(srcdir)/WebCore/accessibility \ -I$(srcdir)/WebCore/bindings/generic \ @@ -21,9 +18,11 @@ webcore_cppflags += \ -I$(srcdir)/WebCore/dom \ -I$(srcdir)/WebCore/dom/default \ -I$(srcdir)/WebCore/editing \ + -I$(srcdir)/WebCore/fileapi \ -I$(srcdir)/WebCore/history \ -I$(srcdir)/WebCore/html \ -I$(srcdir)/WebCore/html/canvas \ + -I$(srcdir)/WebCore/html/parser \ -I$(srcdir)/WebCore/inspector \ -I$(srcdir)/WebCore/loader \ -I$(srcdir)/WebCore/loader/appcache \ @@ -239,8 +238,6 @@ webcore_built_sources += \ DerivedSources/WebCore/JSFileList.h \ DerivedSources/WebCore/JSFileReader.cpp \ DerivedSources/WebCore/JSFileReader.h \ - DerivedSources/WebCore/JSFileWriter.cpp \ - DerivedSources/WebCore/JSFileWriter.h \ DerivedSources/WebCore/JSFloat32Array.cpp \ DerivedSources/WebCore/JSFloat32Array.h \ DerivedSources/WebCore/JSGeolocation.cpp \ @@ -776,6 +773,7 @@ webcore_sources += \ WebCore/bindings/js/ScriptFunctionCall.h \ WebCore/bindings/js/ScriptGCEvent.cpp \ WebCore/bindings/js/ScriptGCEvent.h \ + WebCore/bindings/js/ScriptHeapSnapshot.h \ WebCore/bindings/js/ScriptInstance.h \ WebCore/bindings/js/ScriptObject.cpp \ WebCore/bindings/js/ScriptObject.h \ @@ -1297,6 +1295,29 @@ webcore_sources += \ WebCore/editing/visible_units.cpp \ WebCore/editing/visible_units.h \ WebCore/editing/gtk/SelectionControllerGtk.cpp \ + WebCore/fileapi/Blob.cpp \ + WebCore/fileapi/Blob.h \ + WebCore/fileapi/BlobBuilder.cpp \ + WebCore/fileapi/BlobBuilder.h \ + WebCore/fileapi/BlobURL.cpp \ + WebCore/fileapi/BlobURL.h \ + WebCore/fileapi/File.cpp \ + WebCore/fileapi/File.h \ + WebCore/fileapi/FileError.h \ + WebCore/fileapi/FileException.h \ + WebCore/fileapi/FileList.cpp \ + WebCore/fileapi/FileList.h \ + WebCore/fileapi/FileReader.cpp \ + WebCore/fileapi/FileReader.h \ + WebCore/fileapi/FileReaderSync.cpp \ + WebCore/fileapi/FileReaderSync.h \ + WebCore/fileapi/FileStreamProxy.cpp \ + WebCore/fileapi/FileStreamProxy.h \ + WebCore/fileapi/FileThread.cpp \ + WebCore/fileapi/FileThread.h \ + WebCore/fileapi/FileThreadTask.h \ + WebCore/fileapi/ThreadableBlobRegistry.cpp \ + WebCore/fileapi/ThreadableBlobRegistry.h \ WebCore/history/BackForwardController.cpp \ WebCore/history/BackForwardController.h \ WebCore/history/BackForwardControllerClient.h \ @@ -1314,30 +1335,13 @@ webcore_sources += \ WebCore/history/PageCache.h \ WebCore/html/AsyncImageResizer.cpp \ WebCore/html/AsyncImageResizer.h \ - WebCore/html/Blob.cpp \ - WebCore/html/Blob.h \ - WebCore/html/BlobBuilder.cpp \ - WebCore/html/BlobBuilder.h \ - WebCore/html/BlobURL.cpp \ - WebCore/html/BlobURL.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/CollectionCache.cpp \ WebCore/html/CollectionCache.h \ WebCore/html/CollectionType.h \ - WebCore/html/CSSPreloadScanner.cpp \ - WebCore/html/CSSPreloadScanner.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 \ @@ -1345,40 +1349,8 @@ webcore_sources += \ WebCore/html/DataGridDataSource.h \ WebCore/html/DateComponents.cpp \ WebCore/html/DateComponents.h \ - WebCore/html/DOMDataGridDataSource.cpp \ - WebCore/html/DOMDataGridDataSource.h \ - WebCore/html/DOMFormData.cpp \ - WebCore/html/DOMFormData.h \ - WebCore/html/File.cpp \ - WebCore/html/File.h \ - WebCore/html/FileError.h \ - WebCore/html/FileList.cpp \ - WebCore/html/FileList.h \ - WebCore/html/FileReader.cpp \ - WebCore/html/FileReader.h \ - WebCore/html/FileWriter.cpp \ - WebCore/html/FileWriter.h \ - WebCore/html/FileStreamProxy.cpp \ - WebCore/html/FileStreamProxy.h \ - WebCore/html/FileThread.cpp \ - WebCore/html/FileThread.h \ - WebCore/html/FileThreadTask.h \ WebCore/html/FormDataList.cpp \ WebCore/html/FormDataList.h \ - WebCore/html/HTMLEntityParser.cpp \ - WebCore/html/HTMLEntityParser.h \ - WebCore/html/HTMLTokenizer.cpp \ - WebCore/html/HTMLTokenizer.h \ - WebCore/html/HTMLToken.h \ - WebCore/html/HTMLDocumentParser.cpp \ - WebCore/html/HTMLDocumentParser.h \ - WebCore/html/HTMLPreloadScanner.cpp \ - WebCore/html/HTMLPreloadScanner.h \ - WebCore/html/HTMLScriptRunner.cpp \ - WebCore/html/HTMLScriptRunner.h \ - WebCore/html/HTMLScriptRunnerHost.h \ - WebCore/html/HTMLTreeBuilder.cpp \ - WebCore/html/HTMLTreeBuilder.h \ WebCore/html/HTMLAllCollection.cpp \ WebCore/html/HTMLAllCollection.h \ WebCore/html/HTMLAnchorElement.cpp \ @@ -1403,40 +1375,32 @@ webcore_sources += \ WebCore/html/HTMLCanvasElement.h \ WebCore/html/HTMLCollection.cpp \ WebCore/html/HTMLCollection.h \ - WebCore/html/HTMLDataGridElement.cpp \ - WebCore/html/HTMLDataGridElement.h \ + WebCore/html/HTMLDListElement.cpp \ + WebCore/html/HTMLDListElement.h \ WebCore/html/HTMLDataGridCellElement.cpp \ WebCore/html/HTMLDataGridCellElement.h \ WebCore/html/HTMLDataGridColElement.cpp \ WebCore/html/HTMLDataGridColElement.h \ + WebCore/html/HTMLDataGridElement.cpp \ + WebCore/html/HTMLDataGridElement.h \ WebCore/html/HTMLDataGridRowElement.cpp \ WebCore/html/HTMLDataGridRowElement.h \ WebCore/html/HTMLDataListElement.cpp \ WebCore/html/HTMLDataListElement.h \ - WebCore/html/HTMLDListElement.cpp \ - WebCore/html/HTMLDListElement.h \ WebCore/html/HTMLDirectoryElement.cpp \ WebCore/html/HTMLDirectoryElement.h \ WebCore/html/HTMLDivElement.cpp \ WebCore/html/HTMLDivElement.h \ WebCore/html/HTMLDocument.cpp \ WebCore/html/HTMLDocument.h \ - WebCore/html/HTMLConstructionSite.cpp \ - WebCore/html/HTMLConstructionSite.h \ WebCore/html/HTMLElement.cpp \ WebCore/html/HTMLElement.h \ - WebCore/html/HTMLElementStack.cpp \ - WebCore/html/HTMLElementStack.h \ - WebCore/html/HTMLEntitySearch.cpp \ - WebCore/html/HTMLEntitySearch.h \ WebCore/html/HTMLEmbedElement.cpp \ WebCore/html/HTMLEmbedElement.h \ WebCore/html/HTMLFieldSetElement.cpp \ WebCore/html/HTMLFieldSetElement.h \ WebCore/html/HTMLFontElement.cpp \ WebCore/html/HTMLFontElement.h \ - WebCore/html/HTMLFormattingElementList.cpp \ - WebCore/html/HTMLFormattingElementList.h \ WebCore/html/HTMLFormCollection.cpp \ WebCore/html/HTMLFormCollection.h \ WebCore/html/HTMLFormControlElement.cpp \ @@ -1511,8 +1475,6 @@ webcore_sources += \ WebCore/html/HTMLParserErrorCodes.cpp \ WebCore/html/HTMLParserErrorCodes.h \ WebCore/html/HTMLParserQuirks.h \ - WebCore/html/HTMLParserScheduler.cpp \ - WebCore/html/HTMLParserScheduler.h \ WebCore/html/HTMLPlugInElement.cpp \ WebCore/html/HTMLPlugInElement.h \ WebCore/html/HTMLPlugInImageElement.cpp \ @@ -1553,8 +1515,6 @@ webcore_sources += \ WebCore/html/HTMLUListElement.h \ WebCore/html/HTMLViewSourceDocument.cpp \ WebCore/html/HTMLViewSourceDocument.h \ - WebCore/html/HTMLViewSourceParser.cpp \ - WebCore/html/HTMLViewSourceParser.h \ WebCore/html/ImageData.cpp \ WebCore/html/ImageData.h \ WebCore/html/ImageResizerThread.cpp \ @@ -1565,8 +1525,48 @@ webcore_sources += \ WebCore/html/StepRange.cpp \ WebCore/html/StepRange.h \ WebCore/html/TextMetrics.h \ - WebCore/html/ThreadableBlobRegistry.cpp \ - WebCore/html/ThreadableBlobRegistry.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 \ + WebCore/html/parser/HTMLConstructionSite.h \ + WebCore/html/parser/HTMLDocumentParser.cpp \ + WebCore/html/parser/HTMLDocumentParser.h \ + WebCore/html/parser/HTMLElementStack.cpp \ + WebCore/html/parser/HTMLElementStack.h \ + WebCore/html/parser/HTMLEntityParser.cpp \ + WebCore/html/parser/HTMLEntityParser.h \ + WebCore/html/parser/HTMLEntitySearch.cpp \ + WebCore/html/parser/HTMLEntitySearch.h \ + WebCore/html/parser/HTMLEntityTable.h \ + WebCore/html/parser/HTMLFormattingElementList.cpp \ + WebCore/html/parser/HTMLFormattingElementList.h \ + WebCore/html/parser/HTMLParserScheduler.cpp \ + WebCore/html/parser/HTMLParserScheduler.h \ + WebCore/html/parser/HTMLPreloadScanner.cpp \ + WebCore/html/parser/HTMLPreloadScanner.h \ + WebCore/html/parser/HTMLScriptRunner.cpp \ + WebCore/html/parser/HTMLScriptRunner.h \ + WebCore/html/parser/HTMLScriptRunnerHost.h \ + WebCore/html/parser/HTMLToken.h \ + WebCore/html/parser/HTMLTokenizer.cpp \ + WebCore/html/parser/HTMLTokenizer.h \ + WebCore/html/parser/HTMLTreeBuilder.cpp \ + WebCore/html/parser/HTMLTreeBuilder.h \ + WebCore/html/parser/HTMLViewSourceParser.cpp \ + WebCore/html/parser/HTMLViewSourceParser.h \ WebCore/html/ValidityState.cpp \ WebCore/html/ValidityState.h \ WebCore/html/VoidCallback.h \ @@ -1882,8 +1882,6 @@ webcore_sources += \ WebCore/platform/Arena.h \ WebCore/platform/AsyncFileStream.h \ WebCore/platform/AutodrainedPool.h \ - WebCore/platform/BlobItem.cpp \ - WebCore/platform/BlobItem.h \ WebCore/platform/ContentType.cpp \ WebCore/platform/ContentType.h \ WebCore/platform/ContextMenu.cpp \ @@ -2131,7 +2129,6 @@ webcore_sources += \ WebCore/platform/network/ResourceRequestBase.h \ WebCore/platform/network/ResourceResponseBase.cpp \ WebCore/platform/network/ResourceResponseBase.h \ - WebCore/platform/text/AtomicStringImpl.h \ WebCore/platform/text/Base64.cpp \ WebCore/platform/text/Base64.h \ WebCore/platform/text/BidiContext.cpp \ @@ -2152,8 +2149,6 @@ webcore_sources += \ WebCore/platform/text/StringBuffer.h \ WebCore/platform/text/StringBuilder.cpp \ WebCore/platform/text/StringBuilder.h \ - WebCore/platform/text/StringHash.h \ - WebCore/platform/text/StringImpl.h \ WebCore/platform/text/SuffixTree.h \ WebCore/platform/text/TextBoundaries.h \ WebCore/platform/text/TextBoundaries.cpp \ @@ -2271,8 +2266,10 @@ webcore_sources += \ WebCore/rendering/RenderIFrame.h \ WebCore/rendering/RenderImage.cpp \ WebCore/rendering/RenderImage.h \ - WebCore/rendering/RenderImageGeneratedContent.cpp \ - WebCore/rendering/RenderImageGeneratedContent.h \ + WebCore/rendering/RenderImageResource.cpp \ + WebCore/rendering/RenderImageResource.h \ + WebCore/rendering/RenderImageResourceStyleImage.cpp \ + WebCore/rendering/RenderImageResourceStyleImage.h \ WebCore/rendering/RenderIndicator.cpp \ WebCore/rendering/RenderIndicator.h \ WebCore/rendering/RenderInline.cpp \ @@ -2413,6 +2410,7 @@ webcore_sources += \ WebCore/rendering/style/StyleMarqueeData.h \ WebCore/rendering/style/StyleMultiColData.cpp \ WebCore/rendering/style/StyleMultiColData.h \ + WebCore/rendering/style/StylePendingImage.h \ WebCore/rendering/style/StyleRareInheritedData.cpp \ WebCore/rendering/style/StyleRareInheritedData.h \ WebCore/rendering/style/StyleRareNonInheritedData.cpp \ @@ -2496,7 +2494,7 @@ webcoregtk_sources += \ WebCore/platform/gtk/gtkdrawing.h \ WebCore/platform/gtk/GtkPluginWidget.cpp \ WebCore/platform/gtk/GtkPluginWidget.h \ - WebCore/platform/gtk/GtkVersioning.cpp \ + WebCore/platform/gtk/GtkVersioning.c \ WebCore/platform/gtk/GtkVersioning.h \ WebCore/platform/gtk/KeyEventGtk.cpp \ WebCore/platform/gtk/KURLGtk.cpp \ @@ -2791,7 +2789,6 @@ webcore_sources += \ WebCore/storage/DatabaseTracker.cpp \ WebCore/storage/DatabaseTracker.h \ WebCore/storage/DatabaseTrackerClient.h \ - WebCore/storage/IDBKey.h \ WebCore/storage/OriginQuotaManager.cpp \ WebCore/storage/OriginQuotaManager.h \ WebCore/storage/OriginUsageRecord.cpp \ @@ -2891,47 +2888,50 @@ webcore_sources += \ WebCore/storage/IDBAny.cpp \ WebCore/storage/IDBAny.h \ WebCore/storage/IDBCallbacks.h \ - WebCore/storage/IDBDatabase.cpp \ - WebCore/storage/IDBCursor.h \ - WebCore/storage/IDBCursor.cpp \ WebCore/storage/IDBCursorBackendImpl.cpp \ WebCore/storage/IDBCursorBackendImpl.h \ WebCore/storage/IDBCursorBackendInterface.h \ - WebCore/storage/IDBDatabase.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/IDBFactory.cpp \ - WebCore/storage/IDBFactory.h \ - WebCore/storage/IDBFactoryBackendInterface.cpp \ - WebCore/storage/IDBFactoryBackendInterface.h \ WebCore/storage/IDBFactoryBackendImpl.cpp \ WebCore/storage/IDBFactoryBackendImpl.h - WebCore/storage/IDBIndex.cpp \ - WebCore/storage/IDBIndex.h \ - WebCore/storage/IDBIndexBackendInterface.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/IDBObjectStore.cpp \ - WebCore/storage/IDBObjectStore.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/IDBTransactionBackendInterface.h + WebCore/storage/IDBTransaction.h endif # END ENABLE_INDEXED_DATABASE # ---- @@ -3026,29 +3026,31 @@ webcore_built_sources += \ DerivedSources/WebCore/JSMetadataCallback.h webcore_sources += \ - WebCore/storage/DirectoryEntry.cpp \ - WebCore/storage/DirectoryEntry.h \ - WebCore/storage/DirectoryReader.cpp \ - WebCore/storage/DirectoryReader.h \ - WebCore/storage/DOMFilePath.cpp \ - WebCore/storage/DOMFilePath.h \ - WebCore/storage/DOMFileSystem.cpp \ - WebCore/storage/DOMFileSystem.h \ - WebCore/storage/EntriesCallback.h \ - WebCore/storage/Entry.cpp \ - WebCore/storage/Entry.h \ - WebCore/storage/EntryArray.cpp \ - WebCore/storage/EntryArray.h \ - WebCore/storage/EntryCallback.h \ - WebCore/storage/ErrorCallback.h \ - WebCore/storage/FileEntry.cpp \ - WebCore/storage/FileEntry.h \ - WebCore/storage/FileSystemCallback.h \ - WebCore/storage/FileSystemCallbacks.cpp \ - WebCore/storage/FileSystemCallbacks.h \ - WebCore/storage/Flags.h \ - WebCore/storage/Metadata.h \ - WebCore/storage/MetadataCallback.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/Entry.cpp \ + WebCore/fileapi/Entry.h \ + WebCore/fileapi/EntryArray.cpp \ + WebCore/fileapi/EntryArray.h \ + WebCore/fileapi/EntryCallback.h \ + WebCore/fileapi/ErrorCallback.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 endif # END ENABLE_FILE_SYSTEM @@ -4441,6 +4443,17 @@ endif # END ENABLE_BLOB 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 + +webcore_sources += \ + WebCore/fileapi/AsyncFileWriter.h \ + WebCore/fileapi/FileWriterClient.h \ + WebCore/fileapi/FileWriter.cpp \ + WebCore/fileapi/FileWriter.h + endif # END ENABLE_FILE_WRITER DerivedSources/WebCore/CSSPropertyNames.h: $(WEBCORE_CSS_PROPERTY_NAMES) $(WebCore)/css/makeprop.pl @@ -4461,8 +4474,8 @@ DerivedSources/WebCore/DocTypeStrings.cpp : $(WebCore)/html/DocTypeStrings.gperf $(PERL) $(WebCore)/make-hash-tools.pl $(GENSOURCES_WEBCORE) $(WebCore)/html/DocTypeStrings.gperf # HTML entity names -DerivedSources/WebCore/HTMLEntityTable.cpp : $(WebCore)/html/HTMLEntityNames.json $(WebCore)/../WebKitTools/Scripts/create-html-entity-table - $(PYTHON) $(WebCore)/../WebKitTools/Scripts/create-html-entity-table -o $(GENSOURCES_WEBCORE)/HTMLEntityTable.cpp $(WebCore)/html/HTMLEntityNames.json +DerivedSources/WebCore/HTMLEntityTable.cpp : $(WebCore)/html/parser/HTMLEntityNames.in $(WebCore)/html/parser/create-html-entity-table + $(PYTHON) $(WebCore)/html/parser/create-html-entity-table -o $(GENSOURCES_WEBCORE)/HTMLEntityTable.cpp $(WebCore)/html/parser/HTMLEntityNames.in # color names DerivedSources/WebCore/ColorData.cpp: $(WebCore)/platform/ColorData.gperf $(WebCore)/make-hash-tools.pl @@ -4536,18 +4549,19 @@ IDL_PATH := \ $(WebCore)/bindings/js \ $(WebCore)/css \ $(WebCore)/dom \ + $(WebCore)/fileapi \ $(WebCore)/html \ $(WebCore)/html/canvas \ $(WebCore)/inspector \ $(WebCore)/loader/appcache \ $(WebCore)/notifications \ $(WebCore)/page \ + $(WebCore)/plugins \ $(WebCore)/storage \ $(WebCore)/svg \ - $(WebCore)/xml \ - $(WebCore)/plugins \ $(WebCore)/websockets \ - $(WebCore)/workers + $(WebCore)/workers \ + $(WebCore)/xml vpath %.idl = $(IDL_PATH) @@ -4560,6 +4574,7 @@ DerivedSources/WebCore/JS%.cpp: %.idl $(SCRIPTS_BINDINGS) $(WebCore)/bindings/sc EXTRA_DIST += \ $(shell ls $(srcdir)/WebCore/css/*.idl) \ $(shell ls $(srcdir)/WebCore/dom/*.idl) \ + $(shell ls $(srcdir)/WebCore/fileapi/*.idl) \ $(shell ls $(srcdir)/WebCore/html/canvas/*.idl) \ $(shell ls $(srcdir)/WebCore/html/*.idl) \ $(shell ls $(srcdir)/WebCore/inspector/*.idl) \ @@ -4603,8 +4618,9 @@ EXTRA_DIST += \ WebCore/dom/make_names.pl \ WebCore/html/DocTypeStrings.gperf \ WebCore/html/HTMLAttributeNames.in \ - WebCore/html/HTMLEntityNames.gperf \ WebCore/html/HTMLTagNames.in \ + WebCore/html/parser/create-html-entity-table \ + WebCore/html/parser/HTMLEntityNames.in \ WebCore/icu/LICENSE \ WebCore/inspector/CodeGeneratorInspector.pm \ WebCore/LICENSE-APPLE \ diff --git a/WebCore/WebCore.exp.in b/WebCore/WebCore.exp.in index e1b7c22..e8b4fe7 100644 --- a/WebCore/WebCore.exp.in +++ b/WebCore/WebCore.exp.in @@ -578,11 +578,10 @@ __ZN7WebCore5Cache13getStatisticsEv __ZN7WebCore5Cache13setCapacitiesEjjj __ZN7WebCore5Frame10createViewERKNS_7IntSizeERKNS_5ColorEbS3_bNS_13ScrollbarModeEbS7_b __ZN7WebCore5Frame10findStringERKN3WTF6StringEbbbb -__ZN7WebCore5Frame13reapplyStylesEv __ZN7WebCore5Frame14frameForWidgetEPKNS_6WidgetE __ZN7WebCore5Frame15revealSelectionERKNS_15ScrollAlignmentEb +__ZN7WebCore5Frame19countMatchesForTextERKN3WTF6StringEbjb __ZN7WebCore5Frame20setSelectionFromNoneEv -__ZN7WebCore5Frame21markAllMatchesForTextERKN3WTF6StringEbj __ZN7WebCore5Frame23visiblePositionForPointERKNS_8IntPointE __ZN7WebCore5Frame24computeAndSetTypingStyleEPNS_19CSSStyleDeclarationENS_10EditActionE __ZN7WebCore5Frame25matchLabelsAgainstElementEP7NSArrayPNS_7ElementE @@ -621,6 +620,7 @@ __ZN7WebCore6Editor21applyStyleToSelectionEPNS_19CSSStyleDeclarationENS_10EditAc __ZN7WebCore6Editor21isSelectionMisspelledEv __ZN7WebCore6Editor23setBaseWritingDirectionENS_16WritingDirectionE __ZN7WebCore6Editor24advanceToNextMisspellingEb +__ZN7WebCore6Editor24handleRejectedCorrectionEv __ZN7WebCore6Editor24isSelectionUngrammaticalEv __ZN7WebCore6Editor26decreaseSelectionListLevelEv __ZN7WebCore6Editor26increaseSelectionListLevelEv @@ -676,6 +676,8 @@ __ZN7WebCore8Document24setShouldCreateRenderersEb __ZN7WebCore8Document26pageSizeAndMarginsInPixelsEiRNS_7IntSizeERiS3_S3_S3_ __ZN7WebCore8Document27removeMediaCanStartListenerEPNS_21MediaCanStartListenerE __ZN7WebCore8Document36updateLayoutIgnorePendingStylesheetsEv +__ZN7WebCore8Document25scheduleForcedStyleRecalcEv +__ZN7WebCore8Document20styleSelectorChangedENS_23StyleSelectorUpdateFlagE __ZN7WebCore8Document4headEv __ZN7WebCore8FormData6createEPKvm __ZN7WebCore8FormDataD1Ev @@ -733,7 +735,7 @@ __ZN7WebCore8Settings31setShrinksStandaloneImagesToFitEb __ZN7WebCore8Settings32setAcceleratedCompositingEnabledEb __ZN7WebCore8Settings32setNeedsAdobeFrameReloadingQuirkEb __ZN7WebCore8Settings33setDownloadableBinaryFontsEnabledEb -__ZN7WebCore8Settings33setEnforceCSSMIMETypeInStrictModeEb +__ZN7WebCore8Settings35setEnforceCSSMIMETypeInNoQuirksModeEb __ZN7WebCore8Settings34setLocalFileContentSniffingEnabledEb __ZN7WebCore8Settings35setAllowUniversalAccessFromFileURLsEb __ZN7WebCore8Settings35setExperimentalNotificationsEnabledEb @@ -769,8 +771,8 @@ __ZN7WebCore9FrameView18updateControlTintsEv __ZN7WebCore9FrameView20enterCompositingModeEv __ZN7WebCore9FrameView21flushDeferredRepaintsEv __ZN7WebCore9FrameView22setBaseBackgroundColorENS_5ColorE -__ZN7WebCore9FrameView23layoutIfNeededRecursiveEv __ZN7WebCore9FrameView23updateCanHaveScrollbarsEv +__ZN7WebCore9FrameView37updateLayoutAndStyleIfNeededRecursiveEv __ZN7WebCore9FrameView24forceLayoutForPaginationERKNS_9FloatSizeEfNS_5Frame19AdjustViewSizeOrNotE __ZN7WebCore9FrameView29setShouldUpdateWhileOffscreenEb __ZN7WebCore9FrameView29syncCompositingStateRecursiveEv @@ -849,6 +851,7 @@ __ZNK7WebCore10RenderText9firstRunYEv __ZNK7WebCore10ScrollView12documentViewEv __ZNK7WebCore10ScrollView14scrollbarModesERNS_13ScrollbarModeES2_ __ZNK7WebCore10ScrollView16contentsToWindowERKNS_7IntRectE +__ZNK7WebCore10ScrollView16contentsToWindowERKNS_8IntPointE __ZNK7WebCore10ScrollView18visibleContentRectEb __ZNK7WebCore11CachedImage5imageEv __ZNK7WebCore11FrameLoader10isCompleteEv @@ -1109,6 +1112,7 @@ _wkNoteOpenPanelFiles _wkPopupMenu _wkQTIncludeOnlyModernMediaFileTypes _wkQTMovieDataRate +_wkQTMovieDisableComponent _wkQTMovieGetType _wkQTMovieHasClosedCaptions _wkQTMovieMaxTimeLoaded @@ -1287,7 +1291,6 @@ __ZN3JSC8Bindings8InstanceD2Ev __ZN7WebCore13IdentifierRep7isValidEPS0_ __ZN7WebCore16ScriptController16createRootObjectEPv __ZNK3JSC8Bindings13RuntimeObject12defaultValueEPNS_9ExecStateENS_22PreferredPrimitiveTypeE -__ZNK7WebCore10ScrollView16contentsToWindowERKNS_8IntPointE __ZTVN3JSC13RuntimeMethodE #endif @@ -1475,6 +1478,13 @@ __ZN7WebCore9HTMLNames8audioTagE __ZN7WebCore9HTMLNames8videoTagE #endif +#if ENABLE(FULLSCREEN_API) +__ZN7WebCore8Document33webkitDidExitFullScreenForElementEPNS_7ElementE +__ZN7WebCore8Document34webkitDidEnterFullScreenForElementEPNS_7ElementE +__ZN7WebCore8Document34webkitWillExitFullScreenForElementEPNS_7ElementE +__ZN7WebCore8Document35webkitWillEnterFullScreenForElementEPNS_7ElementE +#endif + #if ENABLE(OFFLINE_WEB_APPLICATIONS) __ZN7WebCore23ApplicationCacheStorage14quotaForOriginEPKNS_14SecurityOriginERx __ZN7WebCore23ApplicationCacheStorage14setMaximumSizeEx diff --git a/WebCore/WebCore.gyp/WebCore.gyp b/WebCore/WebCore.gyp/WebCore.gyp index c625f5f..595034e 100644 --- a/WebCore/WebCore.gyp/WebCore.gyp +++ b/WebCore/WebCore.gyp/WebCore.gyp @@ -119,9 +119,11 @@ '../dom', '../dom/default', '../editing', + '../fileapi', '../history', '../html', '../html/canvas', + '../html/parser', '../inspector', '../loader', '../loader/appcache', @@ -138,6 +140,7 @@ '../platform/graphics', '../platform/graphics/chromium', '../platform/graphics/filters', + '../platform/graphics/gpu', '../platform/graphics/opentype', '../platform/graphics/skia', '../platform/graphics/transforms', @@ -203,11 +206,10 @@ # FIXME: I don't know why these are excluded, either. # Someone (me?) should figure it out and add appropriate comments. '../css/CSSUnknownRule.idl', - - '../dom/DOMStringMap.idl', ], 'conditions': [ + # TODO(maruel): Move it in its own project or generate it anyway? ['enable_svg!=0', { 'bindings_idl_files': [ '<@(webcore_svg_bindings_idl_files)', @@ -215,22 +217,23 @@ }], ['OS=="mac"', { 'webcore_include_dirs+': [ - # platform/graphics/cg and mac needs to come before + # platform/graphics/cg and cocoa need to come before # platform/graphics/chromium so that the Mac build picks up the # version of ImageBufferData.h in the cg directory and - # FontPlatformData.h in the mac directory. The + prepends this + # FontPlatformData.h in the cocoa directory. The + prepends this # directory to the list. # FIXME: This shouldn't need to be prepended. - # FIXME: Eliminate dependency on platform/graphics/mac and - # related directories. - # platform/graphics/cg may need to stick around, though. - '../platform/graphics/mac', + '../platform/graphics/cocoa', '../platform/graphics/cg', ], 'webcore_include_dirs': [ # FIXME: Eliminate dependency on platform/mac and related # directories. + # FIXME: Eliminate dependency on platform/graphics/mac and + # related directories. + # platform/graphics/cg may need to stick around, though. '../loader/archive/cf', + '../platform/graphics/mac', '../platform/mac', '../platform/text/mac', ], @@ -324,15 +327,28 @@ '../html/DocTypeStrings.gperf', '../platform/ColorData.gperf', - # json rule - '../html/HTMLEntityNames.json', - # idl rules '<@(bindings_idl_files)', ], 'actions': [ # Actions to build derived sources. { + 'action_name': 'HTMLEntityTable', + 'inputs': [ + '../html/parser/HTMLEntityNames.in', + ], + 'outputs': [ + '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLEntityTable.cpp' + ], + 'action': [ + 'python', + '../html/parser/create-html-entity-table', + '-o', + '<@(_outputs)', + '<@(_inputs)' + ], + }, + { 'action_name': 'CSSPropertyNames', 'inputs': [ '../css/makeprop.pl', @@ -350,6 +366,7 @@ '<@(_inputs)' ], 'conditions': [ + # TODO(maruel): Move it in its own project or generate it anyway? ['enable_svg!=0', { 'inputs': [ '../css/SVGCSSPropertyNames.in', @@ -375,6 +392,7 @@ '<@(_inputs)' ], 'conditions': [ + # TODO(maruel): Move it in its own project or generate it anyway? ['enable_svg!=0', { 'inputs': [ '../css/SVGCSSValueKeywords.in', @@ -623,26 +641,6 @@ ], 'process_outputs_as_sources': 0, }, - { - 'rule_name': 'json', - 'extension': 'json', - # - # json outputs are generated by WebKitTools/Scripts/create-html-entity-table - # - 'outputs': [ - '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLEntityTable.cpp', - ], - 'inputs': [ - '../../WebKitTools/Scripts/create-html-entity-table', - ], - 'action': [ - 'python', - '../../WebKitTools/Scripts/create-html-entity-table', - '-o', - '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLEntityTable.cpp', - '<(RULE_INPUT_PATH)', - ], - }, # Rule to build generated JavaScript (V8) bindings from .idl source. { 'rule_name': 'binding', @@ -665,6 +663,7 @@ 'generator_include_dirs': [ '--include', '../css', '--include', '../dom', + '--include', '../fileapi', '--include', '../html', '--include', '../notifications', '--include', '../page', @@ -749,7 +748,7 @@ '<(SHARED_INTERMEDIATE_DIR)/webkit/MathMLElementFactory.cpp', '<(SHARED_INTERMEDIATE_DIR)/webkit/MathMLNames.cpp', - # Generated from HTMLEntityNames.json + # Generated from HTMLEntityNames.in '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLEntityTable.cpp', # Additional .cpp files from the webcore_bindings_sources rules. @@ -773,6 +772,7 @@ }], ], }], + # TODO(maruel): Move it in its own project or generate it anyway? ['enable_svg!=0', { 'sources': [ '<(SHARED_INTERMEDIATE_DIR)/webkit/SVGElementFactory.cpp', @@ -809,9 +809,10 @@ ], }, { - 'target_name': 'webcore', - 'type': '<(library)', - 'msvs_guid': '1C16337B-ACF3-4D03-AA90-851C5B5EADA6', + # We'll soon split libwebcore in multiple smaller libraries. + # webcore_prerequisites will be the 'base' target of every sub-target. + 'target_name': 'webcore_prerequisites', + 'type': 'none', 'dependencies': [ 'webcore_bindings', '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:pcre', @@ -827,15 +828,178 @@ '<(chromium_src_dir)/third_party/sqlite/sqlite.gyp:sqlite', '<(chromium_src_dir)/third_party/angle/src/build_angle.gyp:translator_common', ], - 'defines': [ - 'WEBCORE_NAVIGATOR_VENDOR="Google Inc."', + 'export_dependent_settings': [ + 'webcore_bindings', + '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:pcre', + '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf', + '<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl', + '<(chromium_src_dir)/skia/skia.gyp:skia', + '<(chromium_src_dir)/third_party/libjpeg/libjpeg.gyp:libjpeg', + '<(chromium_src_dir)/third_party/libpng/libpng.gyp:libpng', + '<(chromium_src_dir)/third_party/libxml/libxml.gyp:libxml', + '<(chromium_src_dir)/third_party/libxslt/libxslt.gyp:libxslt', + '<(chromium_src_dir)/third_party/npapi/npapi.gyp:npapi', + '<(chromium_src_dir)/third_party/ots/ots.gyp:ots', + '<(chromium_src_dir)/third_party/sqlite/sqlite.gyp:sqlite', + '<(chromium_src_dir)/third_party/angle/src/build_angle.gyp:translator_common', ], - 'include_dirs': [ - '<(INTERMEDIATE_DIR)', - '<@(webcore_include_dirs)', - '<(chromium_src_dir)/gpu', - '<(chromium_src_dir)/third_party/angle/include/GLSLANG', + # 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, + 'direct_dependent_settings': { + 'defines': [ + 'WEBCORE_NAVIGATOR_VENDOR="Google Inc."', + ], + 'include_dirs': [ + '<(INTERMEDIATE_DIR)', + '<@(webcore_include_dirs)', + '<(chromium_src_dir)/gpu', + '<(chromium_src_dir)/third_party/angle/include/GLSLANG', + ], + 'mac_framework_dirs': [ + '$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework/Frameworks', + ], + 'msvs_disabled_warnings': [ + 4138, 4244, 4291, 4305, 4344, 4355, 4521, 4099, + ], + 'scons_line_length' : 1, + 'xcode_settings': { + # Some Mac-specific parts of WebKit won't compile without having this + # prefix header injected. + # FIXME: make this a first-class setting. + 'GCC_PREFIX_HEADER': '../WebCorePrefix.h', + }, + }, + 'conditions': [ + ['javascript_engine=="v8"', { + 'dependencies': [ + '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8', + ], + 'export_dependent_settings': [ + '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8', + ], + 'conditions': [ + ['inside_chromium_build==1 and OS=="win" and component=="shared_library"', { + 'defines': [ + 'USING_V8_SHARED', + ], + }], + ], + }], + ['use_accelerated_compositing==1', { + 'dependencies': [ + '<(chromium_src_dir)/gpu/gpu.gyp:gles2_c_lib', + ], + 'export_dependent_settings': [ + '<(chromium_src_dir)/gpu/gpu.gyp:gles2_c_lib', + ], + }], + ['OS=="linux" or OS=="freebsd"', { + 'dependencies': [ + '<(chromium_src_dir)/build/linux/system.gyp:fontconfig', + '<(chromium_src_dir)/build/linux/system.gyp:gtk', + ], + 'export_dependent_settings': [ + '<(chromium_src_dir)/build/linux/system.gyp:fontconfig', + '<(chromium_src_dir)/build/linux/system.gyp:gtk', + ], + 'cflags': [ + # WebCore does not work with strict aliasing enabled. + # https://bugs.webkit.org/show_bug.cgi?id=25864 + '-fno-strict-aliasing', + ], + }], + ['OS=="linux"', { + 'defines': [ + # Mozilla on Linux effectively uses uname -sm, but when running + # 32-bit x86 code on an x86_64 processor, it uses + # "Linux i686 (x86_64)". Matching that would require making a + # run-time determination. + 'WEBCORE_NAVIGATOR_PLATFORM="Linux i686"', + ], + }], + ['OS=="mac"', { + 'dependencies': [ + 'webkit_system_interface', + ], + 'export_dependent_settings': [ + 'webkit_system_interface', + ], + 'defines': [ + # Match Safari and Mozilla on Mac x86. + 'WEBCORE_NAVIGATOR_PLATFORM="MacIntel"', + + # Chromium's version of WebCore includes the following Objective-C + # classes. The system-provided WebCore framework may also provide + # these classes. Because of the nature of Objective-C binding + # (dynamically at runtime), it's possible for the Chromium-provided + # versions to interfere with the system-provided versions. This may + # happen when a system framework attempts to use WebCore.framework, + # such as when converting an HTML-flavored string to an + # NSAttributedString. The solution is to force Objective-C class + # names that would conflict to use alternate names. + + # FIXME: This list will hopefully shrink but may also grow. + # Periodically run: + # nm libwebcore.a | grep -E '[atsATS] ([+-]\[|\.objc_class_name)' + # and make sure that everything listed there has the alternate + # ChromiumWebCoreObjC name, and that nothing extraneous is listed + # here. If all Objective-C can be eliminated from Chromium's WebCore + # library, these defines should be removed entirely. + 'ScrollbarPrefsObserver=ChromiumWebCoreObjCScrollbarPrefsObserver', + 'WebCoreRenderThemeNotificationObserver=ChromiumWebCoreObjCWebCoreRenderThemeNotificationObserver', + 'WebFontCache=ChromiumWebCoreObjCWebFontCache', + ], + 'include_dirs': [ + '../../WebKitLibraries', + ], + }], + ['OS=="win"', { + 'dependencies': [ + '<(chromium_src_dir)/build/win/system.gyp:cygwin' + ], + 'export_dependent_settings': [ + '<(chromium_src_dir)/build/win/system.gyp:cygwin' + ], + 'defines': [ + # Match Safari and Mozilla on Windows. + 'WEBCORE_NAVIGATOR_PLATFORM="Win32"', + '__PRETTY_FUNCTION__=__FUNCTION__', + ], + # This is needed because Event.h in this directory is blocked + # by a system header on windows. + 'include_dirs++': ['../dom'], + }], + ], + }, + { + 'target_name': 'webcore_svg', + 'type': '<(library)', + 'dependencies': [ + 'webcore_prerequisites', + ], + 'sources': [ + '<@(webcore_files)', + ], + 'sources/': [ + ['exclude', '.*'], + ['include', 'svg/'], + ['include', 'css/svg/'], + ['include', 'rendering/style/SVG'], + ['include', 'rendering/RenderSVG'], + ['include', 'rendering/SVG'], + ['exclude', 'svg/SVGAllInOne\\.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)', @@ -872,6 +1036,13 @@ ['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. @@ -928,21 +1099,6 @@ '../dom/default/PlatformMessagePortChannel.h', ], - 'direct_dependent_settings': { - 'include_dirs': [ - '<@(webcore_include_dirs)', - ], - 'mac_framework_dirs': [ - '$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework/Frameworks', - ], - }, - 'export_dependent_settings': [ - 'webcore_bindings', - '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf', - '<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl', - '<(chromium_src_dir)/skia/skia.gyp:skia', - '<(chromium_src_dir)/third_party/npapi/npapi.gyp:npapi', - ], 'link_settings': { 'mac_bundle_resources': [ '../Resources/aliasCursor.png', @@ -976,60 +1132,8 @@ '../Resources/zoomOutCursor.png', ], }, - 'hard_dependency': 1, - 'mac_framework_dirs': [ - '$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework/Frameworks', - ], - 'msvs_disabled_warnings': [ - 4138, 4244, 4291, 4305, 4344, 4355, 4521, 4099, - ], - 'scons_line_length' : 1, - 'xcode_settings': { - # Some Mac-specific parts of WebKit won't compile without having this - # prefix header injected. - # FIXME: make this a first-class setting. - 'GCC_PREFIX_HEADER': '../WebCorePrefix.h', - }, 'conditions': [ - ['javascript_engine=="v8"', { - 'dependencies': [ - '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8', - ], - 'export_dependent_settings': [ - '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8', - ], - 'conditions': [ - ['inside_chromium_build==1 and OS=="win" and component=="shared_library"', { - 'defines': [ - 'USING_V8_SHARED', - ], - }], - ], - }], - ['enable_svg!=0', { - 'sources/': [ - ['exclude', 'svg/[^/]+\\.cpp$'], - ['include', 'svg/SVGAllInOne\\.cpp$'], - ], - }, { # svg disabled - 'sources/': [ - ['exclude', 'svg/'], - ['exclude', 'css/svg/'], - ['exclude', 'rendering/style/SVG'], - ['exclude', 'rendering/RenderSVG'], - ['exclude', 'rendering/SVG'], - ], - }], - ['use_accelerated_compositing==1', { - 'dependencies': [ - '<(chromium_src_dir)/gpu/gpu.gyp:gles2_c_lib', - ], - }], ['OS=="linux" or OS=="freebsd"', { - 'dependencies': [ - '<(chromium_src_dir)/build/linux/system.gyp:fontconfig', - '<(chromium_src_dir)/build/linux/system.gyp:gtk', - ], 'sources': [ '../platform/graphics/chromium/VDMXParser.cpp', '../platform/graphics/chromium/HarfbuzzSkia.cpp', @@ -1043,50 +1147,15 @@ ['include', 'platform/graphics/chromium/GlyphPageTreeNodeLinux\\.cpp$'], ['include', 'platform/graphics/chromium/SimpleFontDataLinux\\.cpp$'], ], - 'cflags': [ - # WebCore does not work with strict aliasing enabled. - # https://bugs.webkit.org/show_bug.cgi?id=25864 - '-fno-strict-aliasing', - ], - }], - ['OS=="linux"', { - 'defines': [ - # Mozilla on Linux effectively uses uname -sm, but when running - # 32-bit x86 code on an x86_64 processor, it uses - # "Linux i686 (x86_64)". Matching that would require making a - # run-time determination. - 'WEBCORE_NAVIGATOR_PLATFORM="Linux i686"', - ], }], ['OS=="mac"', { + # Necessary for Mac .mm stuff. + 'include_dirs': [ + '../../WebKitLibraries', + ], 'dependencies': [ 'webkit_system_interface', ], - 'defines': [ - # Match Safari and Mozilla on Mac x86. - 'WEBCORE_NAVIGATOR_PLATFORM="MacIntel"', - - # Chromium's version of WebCore includes the following Objective-C - # classes. The system-provided WebCore framework may also provide - # these classes. Because of the nature of Objective-C binding - # (dynamically at runtime), it's possible for the Chromium-provided - # versions to interfere with the system-provided versions. This may - # happen when a system framework attempts to use WebCore.framework, - # such as when converting an HTML-flavored string to an - # NSAttributedString. The solution is to force Objective-C class - # names that would conflict to use alternate names. - - # FIXME: This list will hopefully shrink but may also grow. - # Periodically run: - # nm libwebcore.a | grep -E '[atsATS] ([+-]\[|\.objc_class_name)' - # and make sure that everything listed there has the alternate - # ChromiumWebCoreObjC name, and that nothing extraneous is listed - # here. If all Objective-C can be eliminated from Chromium's WebCore - # library, these defines should be removed entirely. - 'ScrollbarPrefsObserver=ChromiumWebCoreObjCScrollbarPrefsObserver', - 'WebCoreRenderThemeNotificationObserver=ChromiumWebCoreObjCWebCoreRenderThemeNotificationObserver', - 'WebFontCache=ChromiumWebCoreObjCWebFontCache', - ], 'actions': [ { # Allow framework-style #include of @@ -1101,9 +1170,6 @@ 'action': ['cp', '<@(_inputs)', '<@(_outputs)'], }, ], - 'include_dirs': [ - '../../WebKitLibraries', - ], 'sources/': [ # Additional files from the WebCore Mac build that are presently # used in the WebCore Chromium Mac build too. @@ -1208,34 +1274,14 @@ # Again, Skia is not used on Mac. '../platform/chromium/DragImageChromiumSkia.cpp', ], - 'direct_dependent_settings': { - 'include_dirs': [ - '../../WebKitLibraries', - '../../WebKit/mac/WebCoreSupport', - ], - }, }], ['OS=="win"', { - 'dependencies': [ - '<(chromium_src_dir)/build/win/system.gyp:cygwin' - ], 'sources/': [ ['exclude', 'Posix\\.cpp$'], ['include', '/opentype/'], - ['include', '/TransparencyWin\\.cpp$'], ['include', '/SkiaFontWin\\.cpp$'], + ['include', '/TransparencyWin\\.cpp$'], ], - 'defines': [ - # Match Safari and Mozilla on Windows. - 'WEBCORE_NAVIGATOR_PLATFORM="Win32"', - '__PRETTY_FUNCTION__=__FUNCTION__', - ], - # This is needed because Event.h in this directory is blocked - # by a system header on windows. - 'include_dirs++': ['../dom'], - 'direct_dependent_settings': { - 'include_dirs+++': ['../dom'], - }, }], ['OS!="linux" and OS!="freebsd"', { 'sources/': [['exclude', '(Gtk|Linux)\\.cpp$']] @@ -1249,13 +1295,62 @@ ['exclude', '/(Windows|Uniscribe)[^/]*\\.cpp$'] ], }], - ['OS!="win" and remove_webcore_debug_symbols==1', { - 'configurations': { - 'Debug': { - 'cflags!': ['-g'], - } + ], + }, + { + 'target_name': 'webcore', + 'type': 'none', + 'dependencies': [ + 'webcore_remaining', + # Exported. + 'webcore_bindings', + '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf', + '<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl', + '<(chromium_src_dir)/skia/skia.gyp:skia', + '<(chromium_src_dir)/third_party/npapi/npapi.gyp:npapi', + ], + 'export_dependent_settings': [ + 'webcore_bindings', + '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf', + '<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl', + '<(chromium_src_dir)/skia/skia.gyp:skia', + '<(chromium_src_dir)/third_party/npapi/npapi.gyp:npapi', + ], + 'direct_dependent_settings': { + 'include_dirs': [ + '<@(webcore_include_dirs)', + ], + 'mac_framework_dirs': [ + '$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework/Frameworks', + ], + }, + 'conditions': [ + ['javascript_engine=="v8"', { + 'dependencies': [ + '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8', + ], + 'export_dependent_settings': [ + '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8', + ], + }], + ['OS=="mac"', { + 'direct_dependent_settings': { + 'include_dirs': [ + '../../WebKitLibraries', + '../../WebKit/mac/WebCoreSupport', + ], }, }], + ['OS=="win"', { + 'direct_dependent_settings': { + 'include_dirs+++': ['../dom'], + }, + }], + ['enable_svg!=0', { + 'dependencies': [ + 'webcore_svg', + ], + }], ], }, ], # targets diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi index 0f15977..89f4202 100644 --- a/WebCore/WebCore.gypi +++ b/WebCore/WebCore.gypi @@ -85,40 +85,31 @@ 'dom/WebKitAnimationEvent.idl', 'dom/WebKitTransitionEvent.idl', 'dom/WheelEvent.idl', - 'html/Blob.idl', - 'html/BlobBuilder.idl', - 'html/canvas/WebGLActiveInfo.idl', - 'html/canvas/ArrayBufferView.idl', - 'html/canvas/ArrayBuffer.idl', - 'html/canvas/WebGLBuffer.idl', - 'html/canvas/Int8Array.idl', - 'html/canvas/WebGLContextAttributes.idl', - 'html/canvas/Float32Array.idl', - 'html/canvas/WebGLFramebuffer.idl', - 'html/canvas/CanvasGradient.idl', - 'html/canvas/Int32Array.idl', - 'html/canvas/CanvasPattern.idl', - 'html/canvas/CanvasPixelArray.idl', - 'html/canvas/WebGLProgram.idl', - 'html/canvas/WebGLRenderbuffer.idl', - 'html/canvas/CanvasRenderingContext.idl', - 'html/canvas/CanvasRenderingContext2D.idl', - 'html/canvas/WebGLRenderingContext.idl', - 'html/canvas/WebGLShader.idl', - 'html/canvas/Int16Array.idl', - 'html/canvas/WebGLUniformLocation.idl', - 'html/canvas/Uint8Array.idl', - 'html/canvas/Uint32Array.idl', - 'html/canvas/Uint16Array.idl', - 'html/canvas/WebGLTexture.idl', + 'fileapi/Blob.idl', + 'fileapi/BlobBuilder.idl', + 'fileapi/DirectoryEntry.idl', + 'fileapi/DirectoryReader.idl', + 'fileapi/DOMFileSystem.idl', + 'fileapi/EntriesCallback.idl', + 'fileapi/Entry.idl', + 'fileapi/EntryArray.idl', + 'fileapi/EntryCallback.idl', + 'fileapi/ErrorCallback.idl', + 'fileapi/File.idl', + 'fileapi/FileEntry.idl', + 'fileapi/FileError.idl', + 'fileapi/FileException.idl', + 'fileapi/FileList.idl', + 'fileapi/FileReader.idl', + 'fileapi/FileReaderSync.idl', + 'fileapi/FileSystemCallback.idl', + 'fileapi/FileWriter.idl', + 'fileapi/Flags.idl', + 'fileapi/Metadata.idl', + 'fileapi/MetadataCallback.idl', + 'html/DOMFormData.idl', 'html/DataGridColumn.idl', 'html/DataGridColumnList.idl', - 'html/DOMFormData.idl', - 'html/File.idl', - 'html/FileError.idl', - 'html/FileList.idl', - 'html/FileReader.idl', - 'html/FileWriter.idl', 'html/HTMLAllCollection.idl', 'html/HTMLAnchorElement.idl', 'html/HTMLAppletElement.idl', @@ -197,6 +188,30 @@ 'html/TimeRanges.idl', 'html/ValidityState.idl', 'html/VoidCallback.idl', + 'html/canvas/ArrayBuffer.idl', + 'html/canvas/ArrayBufferView.idl', + 'html/canvas/CanvasGradient.idl', + 'html/canvas/CanvasPattern.idl', + 'html/canvas/CanvasPixelArray.idl', + 'html/canvas/CanvasRenderingContext.idl', + 'html/canvas/CanvasRenderingContext2D.idl', + 'html/canvas/Float32Array.idl', + 'html/canvas/Int16Array.idl', + 'html/canvas/Int32Array.idl', + 'html/canvas/Int8Array.idl', + 'html/canvas/Uint16Array.idl', + 'html/canvas/Uint32Array.idl', + 'html/canvas/Uint8Array.idl', + 'html/canvas/WebGLActiveInfo.idl', + 'html/canvas/WebGLBuffer.idl', + 'html/canvas/WebGLContextAttributes.idl', + 'html/canvas/WebGLFramebuffer.idl', + 'html/canvas/WebGLProgram.idl', + 'html/canvas/WebGLRenderbuffer.idl', + 'html/canvas/WebGLRenderingContext.idl', + 'html/canvas/WebGLShader.idl', + 'html/canvas/WebGLTexture.idl', + 'html/canvas/WebGLUniformLocation.idl', 'inspector/InjectedScriptHost.idl', 'inspector/InspectorFrontendHost.idl', 'inspector/JavaScriptCallFrame.idl', @@ -232,17 +247,6 @@ 'storage/Database.idl', 'storage/DatabaseCallback.idl', 'storage/DatabaseSync.idl', - 'storage/DirectoryEntry.idl', - 'storage/DirectoryReader.idl', - 'storage/DOMFileSystem.idl', - 'storage/EntriesCallback.idl', - 'storage/Entry.idl', - 'storage/EntryArray.idl', - 'storage/EntryCallback.idl', - 'storage/ErrorCallback.idl', - 'storage/FileEntry.idl', - 'storage/FileSystemCallback.idl', - 'storage/Flags.idl', 'storage/IDBAny.idl', 'storage/IDBCursor.idl', 'storage/IDBDatabaseError.idl', @@ -258,8 +262,6 @@ 'storage/IDBRequest.idl', 'storage/IDBSuccessEvent.idl', 'storage/IDBTransaction.idl', - 'storage/Metadata.idl', - 'storage/MetadataCallback.idl', 'storage/SQLError.idl', 'storage/SQLException.idl', 'storage/SQLResultSet.idl', @@ -752,6 +754,7 @@ 'bindings/v8/custom/V8DeviceOrientationEventCustom.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', @@ -854,6 +857,8 @@ 'bindings/v8/ScriptFunctionCall.h', 'bindings/v8/ScriptGCEvent.cpp', 'bindings/v8/ScriptGCEvent.h', + 'bindings/v8/ScriptHeapSnapshot.cpp', + 'bindings/v8/ScriptHeapSnapshot.h', 'bindings/v8/ScriptInstance.cpp', 'bindings/v8/ScriptInstance.h', 'bindings/v8/ScriptObject.cpp', @@ -1417,6 +1422,57 @@ 'editing/markup.h', 'editing/visible_units.cpp', 'editing/visible_units.h', + 'fileapi/AsyncFileWriter.h', + 'fileapi/Blob.cpp', + 'fileapi/Blob.h', + 'fileapi/BlobBuilder.cpp', + 'fileapi/BlobBuilder.h', + 'fileapi/BlobURL.cpp', + 'fileapi/BlobURL.h', + 'fileapi/DirectoryEntry.cpp', + 'fileapi/DirectoryEntry.h', + 'fileapi/DirectoryReader.cpp', + 'fileapi/DirectoryReader.h', + 'fileapi/DOMFilePath.cpp', + 'fileapi/DOMFilePath.h', + 'fileapi/DOMFileSystem.cpp', + 'fileapi/DOMFileSystem.h', + 'fileapi/EntriesCallback.h', + 'fileapi/Entry.cpp', + 'fileapi/Entry.h', + 'fileapi/EntryArray.cpp', + 'fileapi/EntryArray.h', + 'fileapi/EntryCallback.h', + 'fileapi/ErrorCallback.h', + 'fileapi/File.cpp', + 'fileapi/File.h', + 'fileapi/FileEntry.cpp', + 'fileapi/FileEntry.h', + 'fileapi/FileError.h', + 'fileapi/FileException.h', + 'fileapi/FileList.cpp', + 'fileapi/FileList.h', + 'fileapi/FileReader.cpp', + 'fileapi/FileReader.h', + 'fileapi/FileReaderSync.cpp', + 'fileapi/FileReaderSync.h', + 'fileapi/FileStreamProxy.cpp', + 'fileapi/FileStreamProxy.h', + 'fileapi/FileSystemCallback.h', + 'fileapi/FileSystemCallbacks.cpp', + 'fileapi/FileSystemCallbacks.h', + 'fileapi/FileThread.cpp', + 'fileapi/FileThread.h', + 'fileapi/FileThreadTask.h', + 'fileapi/FileWriter.cpp', + 'fileapi/FileWriter.h', + 'fileapi/FileWriterClient.h', + 'fileapi/Flags.h', + 'fileapi/LocalFileSystem.h', + 'fileapi/Metadata.h', + 'fileapi/MetadataCallback.h', + 'fileapi/ThreadableBlobRegistry.cpp', + 'fileapi/ThreadableBlobRegistry.h', 'history/mac/HistoryItemMac.mm', 'history/BackForwardController.cpp', 'history/BackForwardController.h', @@ -1436,112 +1492,21 @@ 'history/PageCache.h', 'html/AsyncImageResizer.cpp', 'html/AsyncImageResizer.h', - 'html/Blob.cpp', - 'html/Blob.h', - 'html/BlobBuilder.cpp', - 'html/BlobBuilder.h', - 'html/BlobURL.cpp', - 'html/BlobURL.h', - 'html/canvas/ArrayBufferView.cpp', - 'html/canvas/ArrayBufferView.h', - 'html/canvas/ArrayBuffer.cpp', - 'html/canvas/ArrayBuffer.h', - 'html/canvas/WebGLBuffer.cpp', - 'html/canvas/WebGLBuffer.h', - 'html/canvas/Int8Array.cpp', - 'html/canvas/Int8Array.h', - 'html/canvas/WebGLContextAttributes.cpp', - 'html/canvas/WebGLContextAttributes.h', - 'html/canvas/Float32Array.cpp', - 'html/canvas/Float32Array.h', - 'html/canvas/WebGLFramebuffer.cpp', - 'html/canvas/WebGLFramebuffer.h', - 'html/canvas/WebGLGetInfo.cpp', - 'html/canvas/WebGLGetInfo.h', - 'html/canvas/CanvasContextAttributes.cpp', - 'html/canvas/CanvasContextAttributes.h', - 'html/canvas/CanvasGradient.cpp', - 'html/canvas/CanvasGradient.h', - 'html/canvas/Int32Array.cpp', - 'html/canvas/Int32Array.h', - 'html/canvas/IntegralTypedArrayBase.h', - 'html/canvas/WebGLObject.cpp', - 'html/canvas/WebGLObject.h', - 'html/canvas/CanvasPattern.cpp', - 'html/canvas/CanvasPattern.h', - 'html/canvas/CanvasPixelArray.cpp', - 'html/canvas/CanvasPixelArray.h', - 'html/canvas/WebGLProgram.cpp', - 'html/canvas/WebGLProgram.h', - 'html/canvas/WebGLRenderbuffer.cpp', - 'html/canvas/WebGLRenderbuffer.h', - 'html/canvas/CanvasRenderingContext.cpp', - 'html/canvas/CanvasRenderingContext.h', - 'html/canvas/CanvasRenderingContext2D.cpp', - 'html/canvas/CanvasRenderingContext2D.h', - 'html/canvas/WebGLRenderingContext.cpp', - 'html/canvas/WebGLRenderingContext.h', - 'html/canvas/WebGLShader.cpp', - 'html/canvas/WebGLShader.h', - 'html/canvas/Int16Array.cpp', - 'html/canvas/Int16Array.h', - 'html/canvas/CanvasStyle.cpp', - 'html/canvas/CanvasStyle.h', - 'html/canvas/WebGLTexture.cpp', - 'html/canvas/WebGLTexture.h', - 'html/canvas/TypedArrayBase.h', - 'html/canvas/WebGLUniformLocation.cpp', - 'html/canvas/WebGLUniformLocation.h', - 'html/canvas/Uint8Array.cpp', - 'html/canvas/Uint8Array.h', - 'html/canvas/Uint32Array.cpp', - 'html/canvas/Uint32Array.h', - 'html/canvas/Uint16Array.cpp', - 'html/canvas/Uint16Array.h', - 'html/canvas/CheckedInt.h', 'html/CollectionCache.cpp', 'html/CollectionCache.h', 'html/CollectionType.h', - 'html/CSSPreloadScanner.cpp', - 'html/CSSPreloadScanner.h', - 'html/DataGridColumn.cpp', - 'html/DataGridColumn.h', 'html/DOMDataGridDataSource.cpp', 'html/DOMDataGridDataSource.h', 'html/DOMFormData.cpp', 'html/DOMFormData.h', + 'html/DataGridColumn.cpp', + 'html/DataGridColumn.h', 'html/DataGridColumnList.cpp', 'html/DataGridColumnList.h', 'html/DateComponents.cpp', 'html/DateComponents.h', - 'html/File.cpp', - 'html/File.h', - 'html/FileError.h', - 'html/FileList.cpp', - 'html/FileList.h', - 'html/FileReader.cpp', - 'html/FileReader.h', - 'html/FileWriter.cpp', - 'html/FileWriter.h', - 'html/FileStreamProxy.cpp', - 'html/FileStreamProxy.h', - 'html/FileThread.cpp', - 'html/FileThread.h', - 'html/FileThreadTask.h', 'html/FormDataList.cpp', 'html/FormDataList.h', - 'html/HTMLEntityParser.cpp', - 'html/HTMLEntityParser.h', - 'html/HTMLTokenizer.cpp', - 'html/HTMLTokenizer.h', - 'html/HTMLDocumentParser.cpp', - 'html/HTMLDocumentParser.h', - 'html/HTMLPreloadScanner.cpp', - 'html/HTMLPreloadScanner.h', - 'html/HTMLScriptRunner.cpp', - 'html/HTMLScriptRunner.h', - 'html/HTMLTreeBuilder.cpp', - 'html/HTMLTreeBuilder.h', 'html/HTMLAllCollection.cpp', 'html/HTMLAllCollection.h', 'html/HTMLAnchorElement.cpp', @@ -1568,8 +1533,6 @@ 'html/HTMLCanvasElement.h', 'html/HTMLCollection.cpp', 'html/HTMLCollection.h', - 'html/HTMLConstructionSite.cpp', - 'html/HTMLConstructionSite.h', 'html/HTMLDListElement.cpp', 'html/HTMLDListElement.h', 'html/HTMLDataGridCellElement.cpp', @@ -1590,18 +1553,12 @@ 'html/HTMLDocument.h', 'html/HTMLElement.cpp', 'html/HTMLElement.h', - 'html/HTMLElementStack.cpp', - 'html/HTMLElementStack.h', - 'html/HTMLEntitySearch.cpp', - 'html/HTMLEntitySearch.h', 'html/HTMLEmbedElement.cpp', 'html/HTMLEmbedElement.h', 'html/HTMLFieldSetElement.cpp', 'html/HTMLFieldSetElement.h', 'html/HTMLFontElement.cpp', 'html/HTMLFontElement.h', - 'html/HTMLFormattingElementList.cpp', - 'html/HTMLFormattingElementList.h', 'html/HTMLFormCollection.cpp', 'html/HTMLFormCollection.h', 'html/HTMLFormControlElement.cpp', @@ -1677,8 +1634,6 @@ 'html/HTMLParamElement.h', 'html/HTMLParserErrorCodes.cpp', 'html/HTMLParserErrorCodes.h', - 'html/HTMLParserScheduler.cpp', - 'html/HTMLParserScheduler.h', 'html/HTMLPlugInElement.cpp', 'html/HTMLPlugInElement.h', 'html/HTMLPlugInImageElement.cpp', @@ -1723,8 +1678,6 @@ 'html/HTMLVideoElement.h', 'html/HTMLViewSourceDocument.cpp', 'html/HTMLViewSourceDocument.h', - 'html/HTMLViewSourceParser.cpp', - 'html/HTMLViewSourceParser.h', 'html/ImageData.cpp', 'html/ImageData.h', 'html/ImageResizerThread.cpp', @@ -1735,13 +1688,96 @@ 'html/StepRange.cpp', 'html/StepRange.h', 'html/TextMetrics.h', - 'html/ThreadableBlobRegistry.cpp', - 'html/ThreadableBlobRegistry.h', 'html/TimeRanges.cpp', 'html/TimeRanges.h', 'html/ValidityState.cpp', 'html/ValidityState.h', 'html/VoidCallback.h', + 'html/canvas/ArrayBuffer.cpp', + 'html/canvas/ArrayBuffer.h', + 'html/canvas/ArrayBufferView.cpp', + 'html/canvas/ArrayBufferView.h', + 'html/canvas/CanvasContextAttributes.cpp', + 'html/canvas/CanvasContextAttributes.h', + 'html/canvas/CanvasGradient.cpp', + 'html/canvas/CanvasGradient.h', + 'html/canvas/CanvasPattern.cpp', + 'html/canvas/CanvasPattern.h', + 'html/canvas/CanvasPixelArray.cpp', + 'html/canvas/CanvasPixelArray.h', + 'html/canvas/CanvasRenderingContext.cpp', + 'html/canvas/CanvasRenderingContext.h', + 'html/canvas/CanvasRenderingContext2D.cpp', + 'html/canvas/CanvasRenderingContext2D.h', + 'html/canvas/CanvasStyle.cpp', + 'html/canvas/CanvasStyle.h', + 'html/canvas/CheckedInt.h', + 'html/canvas/Float32Array.cpp', + 'html/canvas/Float32Array.h', + 'html/canvas/Int16Array.cpp', + 'html/canvas/Int16Array.h', + 'html/canvas/Int32Array.cpp', + 'html/canvas/Int32Array.h', + 'html/canvas/Int8Array.cpp', + 'html/canvas/Int8Array.h', + 'html/canvas/IntegralTypedArrayBase.h', + 'html/canvas/TypedArrayBase.h', + 'html/canvas/Uint16Array.cpp', + 'html/canvas/Uint16Array.h', + 'html/canvas/Uint32Array.cpp', + 'html/canvas/Uint32Array.h', + 'html/canvas/Uint8Array.cpp', + 'html/canvas/Uint8Array.h', + 'html/canvas/WebGLBuffer.cpp', + 'html/canvas/WebGLBuffer.h', + 'html/canvas/WebGLContextAttributes.cpp', + 'html/canvas/WebGLContextAttributes.h', + 'html/canvas/WebGLFramebuffer.cpp', + 'html/canvas/WebGLFramebuffer.h', + 'html/canvas/WebGLGetInfo.cpp', + 'html/canvas/WebGLGetInfo.h', + 'html/canvas/WebGLObject.cpp', + 'html/canvas/WebGLObject.h', + 'html/canvas/WebGLProgram.cpp', + 'html/canvas/WebGLProgram.h', + 'html/canvas/WebGLRenderbuffer.cpp', + 'html/canvas/WebGLRenderbuffer.h', + 'html/canvas/WebGLRenderingContext.cpp', + 'html/canvas/WebGLRenderingContext.h', + 'html/canvas/WebGLShader.cpp', + 'html/canvas/WebGLShader.h', + 'html/canvas/WebGLTexture.cpp', + 'html/canvas/WebGLTexture.h', + 'html/canvas/WebGLUniformLocation.cpp', + 'html/canvas/WebGLUniformLocation.h', + 'html/parser/CSSPreloadScanner.cpp', + 'html/parser/CSSPreloadScanner.h', + 'html/parser/HTMLConstructionSite.cpp', + 'html/parser/HTMLConstructionSite.h', + 'html/parser/HTMLDocumentParser.cpp', + 'html/parser/HTMLDocumentParser.h', + 'html/parser/HTMLElementStack.cpp', + 'html/parser/HTMLElementStack.h', + 'html/parser/HTMLEntityParser.cpp', + 'html/parser/HTMLEntityParser.h', + 'html/parser/HTMLEntitySearch.cpp', + 'html/parser/HTMLEntitySearch.h', + 'html/parser/HTMLFormattingElementList.cpp', + 'html/parser/HTMLFormattingElementList.h', + 'html/parser/HTMLParserScheduler.cpp', + 'html/parser/HTMLParserScheduler.h', + 'html/parser/HTMLPreloadScanner.cpp', + 'html/parser/HTMLPreloadScanner.h', + 'html/parser/HTMLScriptRunner.cpp', + 'html/parser/HTMLScriptRunner.h', + 'html/parser/HTMLScriptRunnerHost.h', + 'html/parser/HTMLToken.h', + 'html/parser/HTMLTokenizer.cpp', + 'html/parser/HTMLTokenizer.h', + 'html/parser/HTMLTreeBuilder.cpp', + 'html/parser/HTMLTreeBuilder.h', + 'html/parser/HTMLViewSourceParser.cpp', + 'html/parser/HTMLViewSourceParser.h', 'inspector/InspectorClient.h', 'inspector/ConsoleMessage.cpp', 'inspector/ConsoleMessage.h', @@ -2139,6 +2175,8 @@ 'platform/chromium/ClipboardChromiumLinux.cpp', 'platform/chromium/ClipboardChromiumMac.cpp', 'platform/chromium/ClipboardChromiumWin.cpp', + 'platform/chromium/ClipboardMimeTypes.cpp', + 'platform/chromium/ClipboardMimeTypes.h', 'platform/chromium/ClipboardUtilitiesChromium.cpp', 'platform/chromium/ClipboardUtilitiesChromium.h', 'platform/chromium/ContextMenuChromium.cpp', @@ -2176,6 +2214,8 @@ 'platform/chromium/PopupMenuChromium.cpp', 'platform/chromium/PopupMenuChromium.h', 'platform/chromium/PopupMenuPrivate.h', + 'platform/chromium/ReadableDataObject.cpp', + 'platform/chromium/ReadableDataObject.h', 'platform/chromium/SSLKeyGeneratorChromium.cpp', 'platform/chromium/ScrollbarThemeChromium.cpp', 'platform/chromium/ScrollbarThemeChromium.h', @@ -2196,6 +2236,8 @@ 'platform/chromium/WidgetChromium.cpp', 'platform/chromium/WindowsVersion.cpp', 'platform/chromium/WindowsVersion.h', + 'platform/chromium/WritableDataObject.cpp', + 'platform/chromium/WritableDataObject.h', 'platform/graphics/cairo/CairoPath.h', 'platform/graphics/cairo/FontCairo.cpp', 'platform/graphics/cairo/GradientCairo.cpp', @@ -2234,6 +2276,8 @@ 'platform/graphics/chromium/CanvasLayerChromium.h', 'platform/graphics/chromium/ContentLayerChromium.cpp', 'platform/graphics/chromium/ContentLayerChromium.h', + 'platform/graphics/chromium/CrossProcessFontLoading.h', + 'platform/graphics/chromium/CrossProcessFontLoading.mm', 'platform/graphics/chromium/FontCacheChromiumWin.cpp', 'platform/graphics/chromium/FontCacheLinux.cpp', 'platform/graphics/chromium/FontChromiumWin.cpp', @@ -2241,7 +2285,6 @@ 'platform/graphics/chromium/FontCustomPlatformData.h', 'platform/graphics/chromium/FontLinux.cpp', 'platform/graphics/chromium/FontPlatformData.h', - 'platform/graphics/chromium/FontPlatformDataChromiumMac.mm', 'platform/graphics/chromium/FontPlatformDataChromiumWin.cpp', 'platform/graphics/chromium/FontPlatformDataChromiumWin.h', 'platform/graphics/chromium/FontPlatformDataLinux.cpp', @@ -2250,8 +2293,6 @@ 'platform/graphics/chromium/FontUtilsChromiumWin.h', 'platform/graphics/chromium/GLES2Canvas.cpp', 'platform/graphics/chromium/GLES2Canvas.h', - 'platform/graphics/chromium/GLES2Texture.cpp', - 'platform/graphics/chromium/GLES2Texture.h', 'platform/graphics/chromium/GlyphPageTreeNodeChromiumWin.cpp', 'platform/graphics/chromium/GlyphPageTreeNodeLinux.cpp', 'platform/graphics/chromium/GraphicsLayerChromium.cpp', @@ -2271,8 +2312,6 @@ 'platform/graphics/chromium/PlatformIcon.h', 'platform/graphics/chromium/SimpleFontDataChromiumWin.cpp', 'platform/graphics/chromium/SimpleFontDataLinux.cpp', - 'platform/graphics/chromium/TilingData.h', - 'platform/graphics/chromium/TilingData.cpp', 'platform/graphics/chromium/TransparencyWin.cpp', 'platform/graphics/chromium/TransparencyWin.h', 'platform/graphics/chromium/UniscribeHelper.cpp', @@ -2281,6 +2320,8 @@ 'platform/graphics/chromium/UniscribeHelperTextRun.h', 'platform/graphics/chromium/VideoLayerChromium.cpp', 'platform/graphics/chromium/VideoLayerChromium.h', + 'platform/graphics/cocoa/FontPlatformData.h', + 'platform/graphics/cocoa/FontPlatformDataCocoa.mm', 'platform/graphics/filters/FEBlend.cpp', 'platform/graphics/filters/FEBlend.h', 'platform/graphics/filters/FEColorMatrix.cpp', @@ -2300,6 +2341,16 @@ 'platform/graphics/filters/SourceAlpha.h', 'platform/graphics/filters/SourceGraphic.cpp', 'platform/graphics/filters/SourceGraphic.h', + 'platform/graphics/gpu/Shader.cpp', + 'platform/graphics/gpu/Shader.h', + 'platform/graphics/gpu/SolidFillShader.cpp', + 'platform/graphics/gpu/SolidFillShader.h', + 'platform/graphics/gpu/TexShader.cpp', + 'platform/graphics/gpu/TexShader.h', + 'platform/graphics/gpu/Texture.cpp', + 'platform/graphics/gpu/Texture.h', + 'platform/graphics/gpu/TilingData.h', + 'platform/graphics/gpu/TilingData.cpp', 'platform/graphics/gtk/ColorGtk.cpp', 'platform/graphics/gtk/FontCacheGtk.cpp', 'platform/graphics/gtk/FontCustomPlatformData.cpp', @@ -2335,7 +2386,6 @@ 'platform/graphics/mac/FontCustomPlatformData.cpp', 'platform/graphics/mac/FontCustomPlatformData.h', 'platform/graphics/mac/FontMac.mm', - 'platform/graphics/mac/FontPlatformData.h', 'platform/graphics/mac/GlyphPageTreeNodeMac.cpp', 'platform/graphics/mac/GraphicsContextMac.mm', 'platform/graphics/mac/GraphicsLayerCA.h', @@ -3038,9 +3088,10 @@ 'platform/Arena.cpp', 'platform/Arena.h', 'platform/AsyncFileStream.h', + 'platform/AsyncFileSystem.cpp', + 'platform/AsyncFileSystem.h', + 'platform/AsyncFileSystemCallbacks.h', 'platform/AutodrainedPool.h', - 'platform/BlobItem.cpp', - 'platform/BlobItem.h', 'platform/ContentType.cpp', 'platform/ContentType.h', 'platform/ContextMenu.cpp', @@ -3236,6 +3287,7 @@ 'rendering/style/StyleMarqueeData.h', 'rendering/style/StyleMultiColData.cpp', 'rendering/style/StyleMultiColData.h', + 'rendering/style/StylePendingImage.h', 'rendering/style/StyleRareInheritedData.cpp', 'rendering/style/StyleRareInheritedData.h', 'rendering/style/StyleRareNonInheritedData.cpp', @@ -3317,8 +3369,10 @@ 'rendering/RenderIFrame.h', 'rendering/RenderImage.cpp', 'rendering/RenderImage.h', - 'rendering/RenderImageGeneratedContent.cpp', - 'rendering/RenderImageGeneratedContent.h', + 'rendering/RenderImageResource.cpp', + 'rendering/RenderImageResource.h', + 'rendering/RenderImageResourceStyleImage.cpp', + 'rendering/RenderImageResourceStyleImage.h', 'rendering/RenderIndicator.cpp', 'rendering/RenderIndicator.h', 'rendering/RenderInline.cpp', @@ -3550,27 +3604,6 @@ 'storage/DatabaseTracker.cpp', 'storage/DatabaseTracker.h', 'storage/DatabaseTrackerClient.h', - 'storage/DirectoryEntry.cpp', - 'storage/DirectoryEntry.h', - 'storage/DirectoryReader.cpp', - 'storage/DirectoryReader.h', - 'storage/DOMFilePath.cpp', - 'storage/DOMFilePath.h', - 'storage/DOMFileSystem.cpp', - 'storage/DOMFileSystem.h', - 'storage/EntriesCallback.h', - 'storage/Entry.cpp', - 'storage/Entry.h', - 'storage/EntryArray.cpp', - 'storage/EntryArray.h', - 'storage/EntryCallback.h', - 'storage/ErrorCallback.h', - 'storage/FileEntry.cpp', - 'storage/FileEntry.h', - 'storage/FileSystemCallback.h', - 'storage/FileSystemCallbacks.cpp', - 'storage/FileSystemCallbacks.h', - 'storage/Flags.h', 'storage/IDBAbortEvent.cpp', 'storage/IDBAbortEvent.h', 'storage/IDBAny.cpp', @@ -3635,8 +3668,6 @@ 'storage/LocalStorageTask.h', 'storage/LocalStorageThread.cpp', 'storage/LocalStorageThread.h', - 'storage/Metadata.h', - 'storage/MetadataCallback.h', 'storage/OriginQuotaManager.cpp', 'storage/OriginQuotaManager.h', 'storage/OriginUsageRecord.cpp', @@ -4144,6 +4175,7 @@ 'inspector/front-end/AbstractTimelinePanel.js', 'inspector/front-end/ApplicationCacheItemsView.js', 'inspector/front-end/AuditCategories.js', + 'inspector/front-end/AuditFormatters.js', 'inspector/front-end/AuditLauncherView.js', 'inspector/front-end/AuditResultView.js', 'inspector/front-end/AuditRules.js', @@ -4175,11 +4207,14 @@ 'inspector/front-end/ElementsTreeOutline.js', 'inspector/front-end/EventListenersSidebarPane.js', 'inspector/front-end/ExtensionAPI.js', + 'inspector/front-end/ExtensionAuditCategory.js', + 'inspector/front-end/ExtensionCommon.js', 'inspector/front-end/ExtensionPanel.js', 'inspector/front-end/ExtensionRegistryStub.js', 'inspector/front-end/ExtensionServer.js', 'inspector/front-end/FontView.js', 'inspector/front-end/HAREntry.js', + 'inspector/front-end/HeapSnapshotView.js', 'inspector/front-end/HelpScreen.js', 'inspector/front-end/ImageView.js', 'inspector/front-end/InspectorFrontendHostStub.js', diff --git a/WebCore/WebCore.pri b/WebCore/WebCore.pri index 477e1ba..a4c69b1 100644 --- a/WebCore/WebCore.pri +++ b/WebCore/WebCore.pri @@ -29,7 +29,7 @@ XML_NAMES = $$PWD/xml/xmlattrs.in XMLNS_NAMES = $$PWD/xml/xmlnsattrs.in -HTML_ENTITIES = $$PWD/html/HTMLEntityNames.json +HTML_ENTITIES = $$PWD/html/parser/HTMLEntityNames.in COLORDATA_GPERF = $$PWD/platform/ColorData.gperf @@ -147,8 +147,26 @@ IDL_BINDINGS += \ dom/WebKitAnimationEvent.idl \ dom/WebKitTransitionEvent.idl \ dom/WheelEvent.idl \ - html/Blob.idl \ - html/BlobBuilder.idl \ + fileapi/Blob.idl \ + fileapi/BlobBuilder.idl \ + fileapi/DirectoryEntry.idl \ + fileapi/DirectoryReader.idl \ + fileapi/DOMFileSystem.idl \ + fileapi/EntriesCallback.idl \ + fileapi/Entry.idl \ + fileapi/EntryArray.idl \ + fileapi/EntryCallback.idl \ + fileapi/ErrorCallback.idl \ + fileapi/File.idl \ + fileapi/FileList.idl \ + fileapi/FileReader.idl \ + fileapi/FileWriter.idl \ + fileapi/FileEntry.idl \ + fileapi/FileError.idl \ + fileapi/FileSystemCallback.idl \ + fileapi/Flags.idl \ + fileapi/Metadata.idl \ + fileapi/MetadataCallback.idl \ html/canvas/ArrayBufferView.idl \ html/canvas/ArrayBuffer.idl \ html/canvas/Int8Array.idl \ @@ -175,11 +193,6 @@ IDL_BINDINGS += \ html/DataGridColumn.idl \ html/DataGridColumnList.idl \ html/DOMFormData.idl \ - html/File.idl \ - html/FileError.idl \ - html/FileList.idl \ - html/FileReader.idl \ - html/FileWriter.idl \ html/HTMLAllCollection.idl \ html/HTMLAudioElement.idl \ html/HTMLAnchorElement.idl \ @@ -292,17 +305,6 @@ IDL_BINDINGS += \ storage/Database.idl \ storage/DatabaseCallback.idl \ storage/DatabaseSync.idl \ - storage/DirectoryEntry.idl \ - storage/DirectoryReader.idl \ - storage/DOMFileSystem.idl \ - storage/EntriesCallback.idl \ - storage/Entry.idl \ - storage/EntryArray.idl \ - storage/EntryCallback.idl \ - storage/ErrorCallback.idl \ - storage/FileEntry.idl \ - storage/FileSystemCallback.idl \ - storage/Flags.idl \ storage/IDBAny.idl \ storage/IDBCursor.idl \ storage/IDBDatabaseError.idl \ @@ -318,8 +320,6 @@ IDL_BINDINGS += \ storage/IDBRequest.idl \ storage/IDBSuccessEvent.idl \ storage/IDBTransaction.idl \ - storage/Metadata.idl \ - storage/MetadataCallback.idl \ storage/Storage.idl \ storage/StorageEvent.idl \ storage/SQLError.idl \ @@ -546,7 +546,7 @@ addExtraCompiler(cssvalues) 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/html --include $$PWD/xml --include $$PWD/svg --outputDir $$WC_GENERATED_SOURCES_DIR --preprocessor \"$${QMAKE_MOC} -E\" ${QMAKE_FILE_NAME} +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 \ @@ -614,10 +614,10 @@ addExtraCompiler(xmlnames) # GENERATOR 8-A: entities.output = $${WC_GENERATED_SOURCES_DIR}/HTMLEntityTable.cpp entities.input = HTML_ENTITIES -entities.wkScript = $$PWD/../WebKitTools/Scripts/create-html-entity-table +entities.wkScript = $$PWD/html/parser/create-html-entity-table entities.commands = python $$entities.wkScript -o $${WC_GENERATED_SOURCES_DIR}/HTMLEntityTable.cpp $$HTML_ENTITIES entities.clean = ${QMAKE_FILE_OUT} -entities.depends = $$PWD/../WebKitTools/Scripts/create-html-entity-table +entities.depends = $$PWD/html/parser/create-html-entity-table addExtraCompiler(entities) # GENERATOR 8-B: diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro index d1ff8b2..3f23cdd 100644 --- a/WebCore/WebCore.pro +++ b/WebCore/WebCore.pro @@ -191,9 +191,11 @@ WEBCORE_INCLUDEPATH = \ $$PWD/dom \ $$PWD/dom/default \ $$PWD/editing \ + $$PWD/fileapi \ $$PWD/history \ $$PWD/html \ $$PWD/html/canvas \ + $$PWD/html/parser \ $$PWD/inspector \ $$PWD/loader \ $$PWD/loader/appcache \ @@ -618,6 +620,17 @@ SOURCES += \ editing/VisibleSelection.cpp \ editing/visible_units.cpp \ editing/WrapContentsInDummySpanCommand.cpp \ + fileapi/Blob.cpp \ + fileapi/BlobBuilder.cpp \ + fileapi/BlobURL.cpp \ + fileapi/File.cpp \ + fileapi/FileList.cpp \ + fileapi/FileReader.cpp \ + fileapi/FileReaderSync.cpp \ + fileapi/FileStreamProxy.cpp \ + fileapi/FileThread.cpp \ + fileapi/FileWriter.cpp \ + fileapi/ThreadableBlobRegistry.cpp \ history/BackForwardController.cpp \ history/BackForwardListImpl.cpp \ history/CachedFrame.cpp \ @@ -626,74 +639,48 @@ SOURCES += \ history/qt/HistoryItemQt.cpp \ history/PageCache.cpp \ html/AsyncImageResizer.cpp \ - html/Blob.cpp \ - html/BlobBuilder.cpp \ - html/BlobURL.cpp \ - html/canvas/CanvasGradient.cpp \ - html/canvas/CanvasPattern.cpp \ - html/canvas/CanvasPixelArray.cpp \ - html/canvas/CanvasRenderingContext.cpp \ - html/canvas/CanvasRenderingContext2D.cpp \ - html/canvas/CanvasStyle.cpp \ html/CollectionCache.cpp \ - html/CSSPreloadScanner.cpp \ + html/DOMDataGridDataSource.cpp \ + html/DOMFormData.cpp \ html/DataGridColumn.cpp \ html/DataGridColumnList.cpp \ html/DateComponents.cpp \ - html/DOMDataGridDataSource.cpp \ - html/DOMFormData.cpp \ - html/File.cpp \ - html/FileList.cpp \ - html/FileReader.cpp \ - html/FileStreamProxy.cpp \ - html/FileThread.cpp \ - html/FileWriter.cpp \ html/FormDataList.cpp \ - html/HTMLEntityParser.cpp \ - html/HTMLTokenizer.cpp \ - html/HTMLDocumentParser.cpp \ - html/HTMLPreloadScanner.cpp \ - html/HTMLScriptRunner.cpp \ - html/HTMLTreeBuilder.cpp \ html/HTMLAllCollection.cpp \ html/HTMLAnchorElement.cpp \ html/HTMLAppletElement.cpp \ html/HTMLAreaElement.cpp \ + html/HTMLBRElement.cpp \ html/HTMLBaseElement.cpp \ html/HTMLBaseFontElement.cpp \ html/HTMLBlockquoteElement.cpp \ html/HTMLBodyElement.cpp \ - html/HTMLBRElement.cpp \ html/HTMLButtonElement.cpp \ html/HTMLCanvasElement.cpp \ html/HTMLCollection.cpp \ - html/HTMLConstructionSite.cpp \ - html/HTMLDataGridElement.cpp \ + html/HTMLDListElement.cpp \ html/HTMLDataGridCellElement.cpp \ html/HTMLDataGridColElement.cpp \ + html/HTMLDataGridElement.cpp \ html/HTMLDataGridRowElement.cpp \ html/HTMLDataListElement.cpp \ html/HTMLDirectoryElement.cpp \ html/HTMLDivElement.cpp \ - html/HTMLDListElement.cpp \ html/HTMLDocument.cpp \ html/HTMLElement.cpp \ - html/HTMLElementStack.cpp \ - html/HTMLEntitySearch.cpp \ html/HTMLEmbedElement.cpp \ html/HTMLFieldSetElement.cpp \ html/HTMLFontElement.cpp \ - html/HTMLFormattingElementList.cpp \ html/HTMLFormCollection.cpp \ + html/HTMLFormControlElement.cpp \ html/HTMLFormElement.cpp \ - html/HTMLFrameElementBase.cpp \ html/HTMLFrameElement.cpp \ + html/HTMLFrameElementBase.cpp \ html/HTMLFrameOwnerElement.cpp \ html/HTMLFrameSetElement.cpp \ - html/HTMLFormControlElement.cpp \ + html/HTMLHRElement.cpp \ html/HTMLHeadElement.cpp \ html/HTMLHeadingElement.cpp \ - html/HTMLHRElement.cpp \ html/HTMLHtmlElement.cpp \ html/HTMLIFrameElement.cpp \ html/HTMLImageElement.cpp \ @@ -701,9 +688,9 @@ SOURCES += \ html/HTMLInputElement.cpp \ html/HTMLIsIndexElement.cpp \ html/HTMLKeygenElement.cpp \ + html/HTMLLIElement.cpp \ html/HTMLLabelElement.cpp \ html/HTMLLegendElement.cpp \ - html/HTMLLIElement.cpp \ html/HTMLLinkElement.cpp \ html/HTMLMapElement.cpp \ html/HTMLMarqueeElement.cpp \ @@ -712,15 +699,14 @@ SOURCES += \ html/HTMLMeterElement.cpp \ html/HTMLModElement.cpp \ html/HTMLNameCollection.cpp \ - html/HTMLObjectElement.cpp \ html/HTMLOListElement.cpp \ + html/HTMLObjectElement.cpp \ html/HTMLOptGroupElement.cpp \ html/HTMLOptionElement.cpp \ html/HTMLOptionsCollection.cpp \ html/HTMLParagraphElement.cpp \ html/HTMLParamElement.cpp \ html/HTMLParserErrorCodes.cpp \ - html/HTMLParserScheduler.cpp \ html/HTMLPlugInElement.cpp \ html/HTMLPlugInImageElement.cpp \ html/HTMLPreElement.cpp \ @@ -741,13 +727,30 @@ SOURCES += \ html/HTMLTitleElement.cpp \ html/HTMLUListElement.cpp \ html/HTMLViewSourceDocument.cpp \ - html/HTMLViewSourceParser.cpp \ html/ImageData.cpp \ html/ImageResizerThread.cpp \ html/LabelsNodeList.cpp \ - html/ThreadableBlobRegistry.cpp \ html/StepRange.cpp \ html/ValidityState.cpp \ + html/canvas/CanvasGradient.cpp \ + html/canvas/CanvasPattern.cpp \ + html/canvas/CanvasPixelArray.cpp \ + html/canvas/CanvasRenderingContext.cpp \ + html/canvas/CanvasRenderingContext2D.cpp \ + html/canvas/CanvasStyle.cpp \ + html/parser/CSSPreloadScanner.cpp \ + html/parser/HTMLConstructionSite.cpp \ + html/parser/HTMLDocumentParser.cpp \ + html/parser/HTMLElementStack.cpp \ + html/parser/HTMLEntityParser.cpp \ + html/parser/HTMLEntitySearch.cpp \ + html/parser/HTMLFormattingElementList.cpp \ + html/parser/HTMLParserScheduler.cpp \ + html/parser/HTMLPreloadScanner.cpp \ + html/parser/HTMLScriptRunner.cpp \ + html/parser/HTMLTokenizer.cpp \ + html/parser/HTMLTreeBuilder.cpp \ + html/parser/HTMLViewSourceParser.cpp \ inspector/ConsoleMessage.cpp \ inspector/InjectedScript.cpp \ inspector/InjectedScriptHost.cpp \ @@ -874,7 +877,6 @@ SOURCES += \ platform/animation/Animation.cpp \ platform/animation/AnimationList.cpp \ platform/Arena.cpp \ - platform/BlobItem.cpp \ platform/text/Base64.cpp \ platform/text/BidiContext.cpp \ platform/text/Hyphenation.cpp \ @@ -1013,7 +1015,8 @@ SOURCES += \ rendering/RenderHTMLCanvas.cpp \ rendering/RenderIFrame.cpp \ rendering/RenderImage.cpp \ - rendering/RenderImageGeneratedContent.cpp \ + rendering/RenderImageResource.cpp \ + rendering/RenderImageResourceStyleImage.cpp \ rendering/RenderIndicator.cpp \ rendering/RenderInline.cpp \ rendering/RenderLayer.cpp \ @@ -1156,6 +1159,7 @@ HEADERS += \ 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 \ @@ -1395,6 +1399,21 @@ HEADERS += \ editing/VisibleSelection.h \ editing/visible_units.h \ editing/WrapContentsInDummySpanCommand.h \ + fileapi/AsyncFileWriter.h \ + fileapi/Blob.h \ + fileapi/BlobBuilder.h \ + fileapi/BlobURL.h \ + fileapi/File.h \ + fileapi/FileError.h \ + fileapi/FileException.h \ + fileapi/FileList.h \ + fileapi/FileReader.h \ + fileapi/FileReaderSync.h \ + fileapi/FileStreamProxy.h \ + fileapi/FileThread.h \ + fileapi/FileThreadTask.h \ + fileapi/FileWriter.h \ + fileapi/FileWriterClient.h \ history/BackForwardController.h \ history/BackForwardControllerClient.h \ history/BackForwardListImpl.h \ @@ -1404,9 +1423,6 @@ HEADERS += \ history/HistoryItem.h \ history/PageCache.h \ html/AsyncImageResizer.h \ - html/Blob.h \ - html/BlobBuilder.h \ - html/BlobURL.h \ html/canvas/CanvasGradient.h \ html/canvas/CanvasPattern.h \ html/canvas/CanvasPixelArray.h \ @@ -1419,14 +1435,6 @@ HEADERS += \ html/DateComponents.h \ html/DOMDataGridDataSource.h \ html/DOMFormData.h \ - html/File.h \ - html/FileError.h \ - html/FileList.h \ - html/FileReader.h \ - html/FileStreamProxy.h \ - html/FileThread.h \ - html/FileThreadTask.h \ - html/FileWriter.h \ html/FormDataList.h \ html/HTMLAllCollection.h \ html/HTMLAnchorElement.h \ @@ -1513,13 +1521,28 @@ HEADERS += \ html/HTMLUListElement.h \ html/HTMLVideoElement.h \ html/HTMLViewSourceDocument.h \ - html/HTMLViewSourceParser.h \ html/ImageData.h \ html/ImageResizerThread.h \ html/LabelsNodeList.h \ html/StepRange.h \ html/TimeRanges.h \ html/ValidityState.h \ + html/parser/CSSPreloadScanner.h \ + html/parser/HTMLConstructionSite.h \ + html/parser/HTMLDocumentParser.h \ + html/parser/HTMLElementStack.h \ + html/parser/HTMLEntityParser.h \ + html/parser/HTMLEntitySearch.h \ + html/parser/HTMLEntityTable.h \ + html/parser/HTMLFormattingElementList.h \ + html/parser/HTMLParserScheduler.h \ + html/parser/HTMLPreloadScanner.h \ + html/parser/HTMLScriptRunner.h \ + html/parser/HTMLScriptRunnerHost.h \ + html/parser/HTMLToken.h \ + html/parser/HTMLTokenizer.h \ + html/parser/HTMLTreeBuilder.h \ + html/parser/HTMLViewSourceParser.h \ inspector/ConsoleMessage.h \ inspector/InjectedScript.h \ inspector/InjectedScriptHost.h \ @@ -1658,7 +1681,6 @@ HEADERS += \ platform/animation/AnimationList.h \ platform/Arena.h \ platform/AsyncFileStream.h \ - platform/BlobItem.h \ platform/ContentType.h \ platform/ContextMenu.h \ platform/CrossThreadCopier.h \ @@ -1840,7 +1862,8 @@ HEADERS += \ rendering/RenderFrameSet.h \ rendering/RenderHTMLCanvas.h \ rendering/RenderIFrame.h \ - rendering/RenderImageGeneratedContent.h \ + rendering/RenderImageResource.h \ + rendering/RenderImageResourceStyleImage.h \ rendering/RenderImage.h \ rendering/RenderIndicator.h \ rendering/RenderInline.h \ @@ -2196,6 +2219,7 @@ HEADERS += \ $$PWD/../WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h \ $$PWD/../WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h \ $$PWD/../WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.h \ + $$PWD/../WebKit/qt/WebCoreSupport/GeolocationPermissionClientQt.h \ $$PWD/../WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h \ $$PWD/../WebKit/qt/WebCoreSupport/PageClientQt.h \ $$PWD/../WebKit/qt/WebCoreSupport/QtPlatformPlugin.h \ @@ -2288,6 +2312,7 @@ SOURCES += \ ../WebKit/qt/WebCoreSupport/EditCommandQt.cpp \ ../WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp \ ../WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.cpp \ + ../WebKit/qt/WebCoreSupport/GeolocationPermissionClientQt.cpp \ ../WebKit/qt/WebCoreSupport/InspectorClientQt.cpp \ ../WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp \ ../WebKit/qt/WebCoreSupport/PageClientQt.cpp \ @@ -2387,6 +2412,7 @@ contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=1) { HEADERS += \ plugins/qt/PluginContainerQt.h DEFINES += XP_UNIX + DEFINES += ENABLE_NETSCAPE_PLUGIN_METADATA_CACHE=1 } } @@ -2581,31 +2607,37 @@ contains(DEFINES, ENABLE_DOM_STORAGE=1) { contains(DEFINES, ENABLE_FILE_SYSTEM=1) { HEADERS += \ - storage/DirectoryEntry.h \ - storage/DirectoryReader.h \ - storage/DOMFilePath.h \ - storage/DOMFileSystem.h \ - storage/EntriesCallback.h \ - storage/Entry.h \ - storage/EntryArray.h \ - storage/EntryCallback.h \ - storage/ErrorCallback.h \ - storage/FileEntry.h \ - storage/FileSystemCallback.h \ - storage/FileSystemCallbacks.h \ - storage/Flags.h \ - storage/Metadata.h \ - storage/MetadataCallback.h + fileapi/DirectoryEntry.h \ + fileapi/DirectoryReader.h \ + fileapi/DOMFilePath.h \ + fileapi/DOMFileSystem.h \ + fileapi/EntriesCallback.h \ + fileapi/Entry.h \ + fileapi/EntryArray.h \ + fileapi/EntryCallback.h \ + fileapi/ErrorCallback.h \ + fileapi/FileEntry.h \ + fileapi/FileSystemCallback.h \ + fileapi/FileSystemCallbacks.h \ + fileapi/FileWriterCallback.h \ + fileapi/Flags.h \ + fileapi/LocalFileSystem.h \ + fileapi/Metadata.h \ + fileapi/MetadataCallback.h \ + platform/AsyncFileSystem.h \ + platform/AsyncFileSystemCallbacks.h SOURCES += \ - storage/DirectoryEntry.cpp \ - storage/DirectoryReader.cpp \ - storage/DOMFilePath.cpp \ - storage/DOMFileSystem.cpp \ - storage/Entry.cpp \ - storage/EntryArray.cpp \ - storage/FileEntry.cpp \ - storage/FileSystemCallbacks.cpp + fileapi/DirectoryEntry.cpp \ + fileapi/DirectoryReader.cpp \ + fileapi/DOMFilePath.cpp \ + fileapi/DOMFileSystem.cpp \ + fileapi/Entry.cpp \ + fileapi/EntryArray.cpp \ + fileapi/FileEntry.cpp \ + fileapi/FileSystemCallbacks.cpp \ + fileapi/LocalFileSystem.cpp \ + platform/AsyncFileSystem.cpp } contains(DEFINES, ENABLE_ICONDATABASE=1) { diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj index a049866..ceb4fe8 100644 --- a/WebCore/WebCore.vcproj/WebCore.vcproj +++ b/WebCore/WebCore.vcproj/WebCore.vcproj @@ -4877,6 +4877,14 @@ >
</File>
<File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSFileException.cpp"
+ >
+ </File>
+ <File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSFileException.h"
+ >
+ </File>
+ <File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSFileList.cpp"
>
<FileConfiguration
@@ -4989,6 +4997,14 @@ >
</File>
<File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSFileReaderSync.cpp"
+ >
+ </File>
+ <File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSFileReaderSync.h"
+ >
+ </File>
+ <File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSFileSystemCallback.cpp"
>
<FileConfiguration
@@ -24001,15 +24017,19 @@ >
</File>
<File
- RelativePath="..\platform\AutodrainedPool.h"
+ RelativePath="..\platform\AsyncFileSystem.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\AsyncFileSystem.h"
>
</File>
<File
- RelativePath="..\platform\BlobItem.cpp"
+ RelativePath="..\platform\AsyncFileSystemCallbacks.h"
>
</File>
<File
- RelativePath="..\platform\BlobItem.h"
+ RelativePath="..\platform\AutodrainedPool.h"
>
</File>
<File
@@ -29997,11 +30017,19 @@ >
</File>
<File
- RelativePath="..\rendering\RenderImageGeneratedContent.cpp"
+ RelativePath="..\rendering\RenderImageResource.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\rendering\RenderImageResource.h"
+ >
+ </File>
+ <File
+ RelativePath="..\rendering\RenderImageResourceStyleImage.cpp"
>
</File>
<File
- RelativePath="..\rendering\RenderImageGeneratedContent.h"
+ RelativePath="..\rendering\RenderImageResourceStyleImage.h"
>
</File>
<File
@@ -33002,6 +33030,10 @@ >
</File>
<File
+ RelativePath="..\rendering\style\StylePendingImage.h"
+ >
+ </File>
+ <File
RelativePath="..\rendering\style\StyleRareInheritedData.cpp"
>
</File>
@@ -37073,211 +37105,331 @@ Name="html"
>
<File
- RelativePath="..\html\AsyncImageResizer.cpp"
+ RelativePath="..\fileapi\AsyncFileWriter.h"
>
</File>
<File
- RelativePath="..\html\AsyncImageResizer.h"
+ RelativePath="..\fileapi\Blob.cpp"
>
</File>
<File
- RelativePath="..\html\Blob.cpp"
+ RelativePath="..\fileapi\Blob.h"
>
</File>
<File
- RelativePath="..\html\Blob.h"
+ RelativePath="..\fileapi\BlobBuilder.cpp"
>
</File>
<File
- RelativePath="..\html\BlobBuilder.cpp"
+ RelativePath="..\fileapi\BlobBuilder.h"
>
</File>
<File
- RelativePath="..\html\BlobBuilder.h"
+ RelativePath="..\fileapi\BlobURL.cpp"
>
</File>
<File
- RelativePath="..\html\BlobURL.cpp"
+ RelativePath="..\fileapi\BlobURL.h"
>
</File>
<File
- RelativePath="..\html\BlobURL.h"
+ RelativePath="..\fileapi\DirectoryEntry.cpp"
>
</File>
<File
- RelativePath="..\html\canvas\CanvasGradient.cpp"
+ RelativePath="..\fileapi\DirectoryEntry.h"
>
</File>
<File
- RelativePath="..\html\canvas\CanvasGradient.h"
+ RelativePath="..\fileapi\DirectoryReader.cpp"
>
</File>
<File
- RelativePath="..\html\canvas\CanvasPattern.cpp"
+ RelativePath="..\fileapi\DirectoryReader.h"
>
</File>
<File
- RelativePath="..\html\canvas\CanvasPattern.h"
+ RelativePath="..\fileapi\DOMFilePath.cpp"
>
</File>
<File
- RelativePath="..\html\canvas\CanvasPixelArray.cpp"
+ RelativePath="..\fileapi\DOMFilePath.h"
>
</File>
<File
- RelativePath="..\html\canvas\CanvasPixelArray.h"
+ RelativePath="..\fileapi\DOMFileSystem.cpp"
>
</File>
<File
- RelativePath="..\html\canvas\CanvasRenderingContext.cpp"
+ RelativePath="..\fileapi\DOMFileSystem.h"
>
</File>
<File
- RelativePath="..\html\canvas\CanvasRenderingContext.h"
+ RelativePath="..\fileapi\EntriesCallback.h"
>
</File>
<File
- RelativePath="..\html\canvas\CanvasRenderingContext2D.cpp"
+ RelativePath="..\fileapi\Entry.cpp"
>
</File>
<File
- RelativePath="..\html\canvas\CanvasRenderingContext2D.h"
+ RelativePath="..\fileapi\Entry.h"
>
</File>
<File
- RelativePath="..\html\canvas\CanvasStyle.cpp"
+ RelativePath="..\fileapi\EntryArray.cpp"
>
</File>
<File
- RelativePath="..\html\canvas\CanvasStyle.h"
+ RelativePath="..\fileapi\EntryArray.h"
>
</File>
<File
- RelativePath="..\html\CollectionCache.cpp"
+ RelativePath="..\fileapi\EntryCallback.h"
>
- <FileConfiguration
- Name="Release_PGO|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- WholeProgramOptimization="true"
- />
- </FileConfiguration>
</File>
<File
- RelativePath="..\html\CollectionCache.h"
+ RelativePath="..\fileapi\ErrorCallback.h"
>
</File>
<File
- RelativePath="..\html\CollectionType.h"
+ RelativePath="..\fileapi\File.cpp"
>
</File>
<File
- RelativePath="..\html\CSSPreloadScanner.cpp"
+ RelativePath="..\fileapi\File.h"
>
</File>
<File
- RelativePath="..\html\CSSPreloadScanner.h"
+ RelativePath="..\fileapi\FileEntry.cpp"
>
</File>
<File
- RelativePath="..\html\DataGridColumn.cpp"
+ RelativePath="..\fileapi\FileEntry.h"
>
</File>
<File
- RelativePath="..\html\DataGridColumn.h"
+ RelativePath="..\fileapi\FileError.h"
>
</File>
<File
- RelativePath="..\html\DataGridColumnList.cpp"
+ RelativePath="..\fileapi\FileException.h"
>
</File>
<File
- RelativePath="..\html\DataGridColumnList.h"
+ RelativePath="..\fileapi\FileList.cpp"
>
</File>
<File
- RelativePath="..\html\DataGridDataSource.h"
+ RelativePath="..\fileapi\FileList.h"
>
</File>
<File
- RelativePath="..\html\DateComponents.cpp"
+ RelativePath="..\fileapi\FileReader.cpp"
>
</File>
<File
- RelativePath="..\html\DateComponents.h"
+ RelativePath="..\fileapi\FileReader.h"
>
</File>
<File
- RelativePath="..\html\DOMDataGridDataSource.cpp"
+ RelativePath="..\fileapi\FileReaderSync.cpp"
>
</File>
<File
- RelativePath="..\html\DOMDataGridDataSource.h"
+ RelativePath="..\fileapi\FileReaderSync.h"
>
</File>
<File
- RelativePath="..\html\DOMFormData.cpp"
+ RelativePath="..\fileapi\FileStreamProxy.cpp"
>
</File>
<File
- RelativePath="..\html\DOMFormData.h"
+ RelativePath="..\fileapi\FileStreamProxy.h"
+ >
+ </File>
+ <File
+ RelativePath="..\fileapi\FileSystemCallback.h"
+ >
+ </File>
+ <File
+ RelativePath="..\fileapi\FileSystemCallbacks.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\fileapi\FileSystemCallbacks.h"
+ >
+ </File>
+ <File
+ RelativePath="..\fileapi\FileThread.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\fileapi\FileThread.h"
+ >
+ </File>
+ <File
+ RelativePath="..\fileapi\FileThreadTask.h"
+ >
+ </File>
+ <File
+ RelativePath="..\fileapi\FileWriter.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\fileapi\FileWriter.h"
+ >
+ </File>
+ <File
+ RelativePath="..\fileapi\FileWriterClient.h"
+ >
+ </File>
+ <File
+ RelativePath="..\fileapi\Flags.h"
+ >
+ </File>
+ <File
+ RelativePath="..\fileapi\LocalFileSystem.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\fileapi\LocalFileSystem.h"
+ >
+ </File>
+ <File
+ RelativePath="..\fileapi\Metadata.h"
+ >
+ </File>
+ <File
+ RelativePath="..\fileapi\MetadataCallback.h"
+ >
+ </File>
+ <File
+ RelativePath="..\fileapi\ThreadableBlobRegistry.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\fileapi\ThreadableBlobRegistry.h"
+ >
+ </File>
+ <File
+ RelativePath="..\html\AsyncImageResizer.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\AsyncImageResizer.h"
+ >
+ </File>
+ <File
+ RelativePath="..\html\canvas\CanvasGradient.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\canvas\CanvasGradient.h"
+ >
+ </File>
+ <File
+ RelativePath="..\html\canvas\CanvasPattern.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\canvas\CanvasPattern.h"
+ >
+ </File>
+ <File
+ RelativePath="..\html\canvas\CanvasPixelArray.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\canvas\CanvasPixelArray.h"
+ >
+ </File>
+ <File
+ RelativePath="..\html\canvas\CanvasRenderingContext.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\canvas\CanvasRenderingContext.h"
+ >
+ </File>
+ <File
+ RelativePath="..\html\canvas\CanvasRenderingContext2D.cpp"
>
</File>
<File
- RelativePath="..\html\File.cpp"
+ RelativePath="..\html\canvas\CanvasRenderingContext2D.h"
>
</File>
<File
- RelativePath="..\html\File.h"
+ RelativePath="..\html\canvas\CanvasStyle.cpp"
>
</File>
<File
- RelativePath="..\html\FileError.h"
+ RelativePath="..\html\canvas\CanvasStyle.h"
>
</File>
<File
- RelativePath="..\html\FileList.cpp"
+ RelativePath="..\html\CollectionCache.cpp"
>
+ <FileConfiguration
+ Name="Release_PGO|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ WholeProgramOptimization="true"
+ />
+ </FileConfiguration>
</File>
<File
- RelativePath="..\html\FileList.h"
+ RelativePath="..\html\CollectionCache.h"
>
</File>
<File
- RelativePath="..\html\FileReader.cpp"
+ RelativePath="..\html\CollectionType.h"
>
</File>
<File
- RelativePath="..\html\FileReader.h"
+ RelativePath="..\html\DataGridColumn.cpp"
>
</File>
<File
- RelativePath="..\html\FileStreamProxy.cpp"
+ RelativePath="..\html\DataGridColumn.h"
>
</File>
<File
- RelativePath="..\html\FileStreamProxy.h"
+ RelativePath="..\html\DataGridColumnList.cpp"
>
</File>
<File
- RelativePath="..\html\FileThread.cpp"
+ RelativePath="..\html\DataGridColumnList.h"
>
</File>
<File
- RelativePath="..\html\FileThread.h"
+ RelativePath="..\html\DataGridDataSource.h"
>
</File>
<File
- RelativePath="..\html\FileThreadTask.h"
+ RelativePath="..\html\DateComponents.cpp"
>
</File>
<File
- RelativePath="..\html\FileWriter.cpp"
+ RelativePath="..\html\DateComponents.h"
>
</File>
<File
- RelativePath="..\html\FileWriter.h"
+ RelativePath="..\html\DOMDataGridDataSource.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\DOMDataGridDataSource.h"
+ >
+ </File>
+ <File
+ RelativePath="..\html\DOMFormData.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\DOMFormData.h"
>
</File>
<File
@@ -37921,14 +38073,6 @@ >
</File>
<File
- RelativePath="..\html\HTMLConstructionSite.cpp"
- >
- </File>
- <File
- RelativePath="..\html\HTMLConstructionSite.h"
- >
- </File>
- <File
RelativePath="..\html\HTMLDataGridCellElement.cpp"
>
<FileConfiguration
@@ -38385,14 +38529,6 @@ >
</File>
<File
- RelativePath="..\html\HTMLDocumentParser.cpp"
- >
- </File>
- <File
- RelativePath="..\html\HTMLDocumentParser.h"
- >
- </File>
- <File
RelativePath="..\html\HTMLElement.cpp"
>
<FileConfiguration
@@ -38453,14 +38589,6 @@ >
</File>
<File
- RelativePath="..\html\HTMLElementStack.cpp"
- >
- </File>
- <File
- RelativePath="..\html\HTMLElementStack.h"
- >
- </File>
- <File
RelativePath="..\html\HTMLEmbedElement.cpp"
>
<FileConfiguration
@@ -38517,22 +38645,6 @@ >
</File>
<File
- RelativePath="..\html\HTMLEntityParser.cpp"
- >
- </File>
- <File
- RelativePath="..\html\HTMLEntityParser.h"
- >
- </File>
- <File
- RelativePath="..\html\HTMLEntitySearch.cpp"
- >
- </File>
- <File
- RelativePath="..\html\HTMLEntitySearch.h"
- >
- </File>
- <File
RelativePath="..\html\HTMLFieldSetElement.cpp"
>
<FileConfiguration
@@ -38645,14 +38757,6 @@ >
</File>
<File
- RelativePath="..\html\HTMLFormattingElementList.cpp"
- >
- </File>
- <File
- RelativePath="..\html\HTMLFormattingElementList.h"
- >
- </File>
- <File
RelativePath="..\html\HTMLFormCollection.cpp"
>
</File>
@@ -40553,14 +40657,6 @@ >
</File>
<File
- RelativePath="..\html\HTMLParserScheduler.cpp"
- >
- </File>
- <File
- RelativePath="..\html\HTMLParserScheduler.h"
- >
- </File>
- <File
RelativePath="..\html\HTMLPlugInElement.cpp"
>
<FileConfiguration
@@ -40729,14 +40825,6 @@ >
</File>
<File
- RelativePath="..\html\HTMLPreloadScanner.cpp"
- >
- </File>
- <File
- RelativePath="..\html\HTMLPreloadScanner.h"
- >
- </File>
- <File
RelativePath="..\html\HTMLProgressElement.cpp"
>
<FileConfiguration
@@ -40905,14 +40993,6 @@ >
</File>
<File
- RelativePath="..\html\HTMLScriptRunner.cpp"
- >
- </File>
- <File
- RelativePath="..\html\HTMLScriptRunner.h"
- >
- </File>
- <File
RelativePath="..\html\HTMLSelectElement.cpp"
>
<FileConfiguration
@@ -41593,22 +41673,6 @@ >
</File>
<File
- RelativePath="..\html\HTMLTokenizer.cpp"
- >
- </File>
- <File
- RelativePath="..\html\HTMLTokenizer.h"
- >
- </File>
- <File
- RelativePath="..\html\HTMLTreeBuilder.cpp"
- >
- </File>
- <File
- RelativePath="..\html\HTMLTreeBuilder.h"
- >
- </File>
- <File
RelativePath="..\html\HTMLUListElement.cpp"
>
<FileConfiguration
@@ -41729,14 +41793,6 @@ >
</File>
<File
- RelativePath="..\html\HTMLViewSourceParser.cpp"
- >
- </File>
- <File
- RelativePath="..\html\HTMLViewSourceParser.h"
- >
- </File>
- <File
RelativePath="..\html\ImageData.cpp"
>
</File>
@@ -41764,6 +41820,122 @@ RelativePath="..\html\MediaError.h"
>
</File>
+ <Filter
+ Name="parser"
+ >
+ <File
+ RelativePath="..\html\parser\CSSPreloadScanner.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\parser\CSSPreloadScanner.h"
+ >
+ </File>
+ <File
+ RelativePath="..\html\parser\HTMLConstructionSite.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\parser\HTMLConstructionSite.h"
+ >
+ </File>
+ <File
+ RelativePath="..\html\parser\HTMLDocumentParser.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\parser\HTMLDocumentParser.h"
+ >
+ </File>
+ <File
+ RelativePath="..\html\parser\HTMLEntityParser.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\parser\HTMLEntityParser.h"
+ >
+ </File>
+ <File
+ RelativePath="..\html\parser\HTMLElementStack.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\parser\HTMLElementStack.h"
+ >
+ </File>
+ <File
+ RelativePath="..\html\parser\HTMLEntitySearch.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\parser\HTMLEntitySearch.h"
+ >
+ </File>
+ <File
+ RelativePath="..\html\parser\HTMLFormattingElementList.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\parser\HTMLFormattingElementList.h"
+ >
+ </File>
+ <File
+ RelativePath="..\html\parser\HTMLParserScheduler.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\parser\HTMLParserScheduler.h"
+ >
+ </File>
+ <File
+ RelativePath="..\html\parser\HTMLPreloadScanner.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\parser\HTMLPreloadScanner.h"
+ >
+ </File>
+ <File
+ RelativePath="..\html\parser\HTMLScriptRunner.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\parser\HTMLScriptRunner.h"
+ >
+ </File>
+ <File
+ RelativePath="..\html\parser\HTMLScriptRunnerHost.h"
+ >
+ </File>
+ <File
+ RelativePath="..\html\parser\HTMLToken.h"
+ >
+ </File>
+ <File
+ RelativePath="..\html\parser\HTMLTokenizer.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\parser\HTMLTokenizer.h"
+ >
+ </File>
+ <File
+ RelativePath="..\html\parser\HTMLTreeBuilder.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\parser\HTMLTreeBuilder.h"
+ >
+ </File>
+ <File
+ RelativePath="..\html\parser\HTMLViewSourceParser.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\parser\HTMLViewSourceParser.h"
+ >
+ </File>
+ </Filter>
<File
RelativePath="..\html\StepRange.cpp"
>
@@ -41773,14 +41945,6 @@ >
</File>
<File
- RelativePath="..\html\ThreadableBlobRegistry.cpp"
- >
- </File>
- <File
- RelativePath="..\html\ThreadableBlobRegistry.h"
- >
- </File>
- <File
RelativePath="..\html\TimeRanges.cpp"
>
</File>
@@ -49256,6 +49420,10 @@ >
</File>
<File
+ RelativePath="..\bindings\js\ScriptHeapSnapshot.h"
+ >
+ </File>
+ <File
RelativePath="..\bindings\js\ScriptInstance.h"
>
</File>
@@ -51189,90 +51357,6 @@ >
</File>
<File
- RelativePath="..\storage\DirectoryEntry.cpp"
- >
- </File>
- <File
- RelativePath="..\storage\DirectoryEntry.h"
- >
- </File>
- <File
- RelativePath="..\storage\DirectoryReader.cpp"
- >
- </File>
- <File
- RelativePath="..\storage\DirectoryReader.h"
- >
- </File>
- <File
- RelativePath="..\storage\DOMFilePath.cpp"
- >
- </File>
- <File
- RelativePath="..\storage\DOMFilePath.h"
- >
- </File>
- <File
- RelativePath="..\storage\DOMFileSystem.cpp"
- >
- </File>
- <File
- RelativePath="..\storage\DOMFileSystem.h"
- >
- </File>
- <File
- RelativePath="..\storage\EntriesCallback.h"
- >
- </File>
- <File
- RelativePath="..\storage\Entry.cpp"
- >
- </File>
- <File
- RelativePath="..\storage\Entry.h"
- >
- </File>
- <File
- RelativePath="..\storage\EntryArray.cpp"
- >
- </File>
- <File
- RelativePath="..\storage\EntryArray.h"
- >
- </File>
- <File
- RelativePath="..\storage\EntryCallback.h"
- >
- </File>
- <File
- RelativePath="..\storage\ErrorCallback.h"
- >
- </File>
- <File
- RelativePath="..\storage\FileEntry.cpp"
- >
- </File>
- <File
- RelativePath="..\storage\FileEntry.h"
- >
- </File>
- <File
- RelativePath="..\storage\FileSystemCallback.h"
- >
- </File>
- <File
- RelativePath="..\storage\FileSystemCallbacks.cpp"
- >
- </File>
- <File
- RelativePath="..\storage\FileSystemCallbacks.h"
- >
- </File>
- <File
- RelativePath="..\storage\Flags.h"
- >
- </File>
- <File
RelativePath="..\storage\IDBAny.cpp"
>
</File>
@@ -51469,14 +51553,6 @@ >
</File>
<File
- RelativePath="..\storage\Metadata.h"
- >
- </File>
- <File
- RelativePath="..\storage\MetadataCallback.h"
- >
- </File>
- <File
RelativePath="..\storage\OriginQuotaManager.cpp"
>
</File>
@@ -52008,6 +52084,10 @@ >
</File>
<File
+ RelativePath="..\inspector\front-end\AuditFormatters.js"
+ >
+ </File>
+ <File
RelativePath="..\inspector\front-end\AuditLauncherView.js"
>
</File>
@@ -52128,6 +52208,14 @@ >
</File>
<File
+ RelativePath="..\inspector\front-end\ExtensionAuditCategory.js"
+ >
+ </File>
+ <File
+ RelativePath="..\inspector\front-end\ExtensionCommon.js"
+ >
+ </File>
+ <File
RelativePath="..\inspector\front-end\ExtensionPanel.js"
>
</File>
@@ -52188,6 +52276,10 @@ >
</File>
<File
+ RelativePath="..\inspector\front-end\HeapSnapshotView.js"
+ >
+ </File>
+ <File
RelativePath="..\inspector\front-end\MetricsSidebarPane.js"
>
</File>
diff --git a/WebCore/WebCore.vcproj/WebCoreCommon.vsprops b/WebCore/WebCore.vcproj/WebCoreCommon.vsprops index 579a610..c98e13b 100644 --- a/WebCore/WebCore.vcproj/WebCoreCommon.vsprops +++ b/WebCore/WebCore.vcproj/WebCoreCommon.vsprops @@ -7,7 +7,7 @@ >
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""$(ProjectDir)..";"$(ProjectDir)..\accessibility";"$(ProjectDir)..\accessibility\win";"$(ProjectDir)..\bridge";"$(ProjectDir)..\bridge\c";"$(ProjectDir)..\bridge\jsc";"$(ProjectDir)..\css";"$(ProjectDir)..\editing";"$(ProjectDir)..\rendering";"$(ProjectDir)..\rendering\style";"$(ProjectDir)..\bindings";"$(ProjectDir)..\bindings\generic";"$(ProjectDir)..\bindings\js";"$(ProjectDir)..\dom";"$(ProjectDir)..\dom\default";"$(ProjectDir)..\history";"$(ProjectDir)..\html";"$(ProjectDir)..\html\canvas";"$(ProjectDir)..\inspector";"$(ProjectDir)..\loader";"$(ProjectDir)..\loader\appcache";"$(ProjectDir)..\loader\archive";"$(ProjectDir)..\loader\archive\cf";"$(ProjectDir)..\loader\icon";"$(ProjectDir)..\mathml";"$(ProjectDir)..\notifications";"$(ProjectDir)..\page";"$(ProjectDir)..\page\animation";"$(ProjectDir)..\page\win";"$(ProjectDir)..\platform";"$(ProjectDir)..\platform\animation";"$(ProjectDir)..\platform\mock";"$(ProjectDir)..\platform\sql";"$(ProjectDir)..\platform\win";"$(ProjectDir)..\platform\network";"$(ProjectDir)..\platform\network\win";"$(ProjectDir)..\platform\cf";"$(ProjectDir)..\platform\graphics";"$(ProjectDir)..\platform\graphics\filters";"$(ProjectDir)..\platform\graphics\opentype";"$(ProjectDir)..\platform\graphics\transforms";"$(ProjectDir)..\platform\text";"$(ProjectDir)..\platform\text\transcoder";"$(ProjectDir)..\platform\graphics\win";"$(ProjectDir)..\xml";"$(WebKitOutputDir)\obj\WebCore\DerivedSources";"$(ProjectDir)..\plugins";"$(ProjectDir)..\plugins\win";"$(ProjectDir)..\svg\animation";"$(ProjectDir)..\svg\graphics";"$(ProjectDir)..\svg\graphics\filters";"$(ProjectDir)..\svg";"$(ProjectDir)..\wml";"$(ProjectDir)..\storage";"$(ProjectDir)..\websockets";"$(ProjectDir)..\workers";"$(WebKitOutputDir)\include";"$(WebKitOutputDir)\include\private";"$(WebKitOutputDir)\include\JavaScriptCore";"$(WebKitOutputDir)\include\private\JavaScriptCore";"$(ProjectDir)..\ForwardingHeaders";"$(WebKitLibrariesDir)\include";"$(WebKitLibrariesDir)\include\private";"$(WebKitLibrariesDir)\include\private\JavaScriptCore";"$(WebKitLibrariesDir)\include\pthreads";"$(WebKitLibrariesDir)\include\sqlite";"$(WebKitLibrariesDir)\include\JavaScriptCore";"$(WebKitLibrariesDir)\include\zlib""
+ AdditionalIncludeDirectories=""$(ProjectDir)..";"$(ProjectDir)..\accessibility";"$(ProjectDir)..\accessibility\win";"$(ProjectDir)..\bridge";"$(ProjectDir)..\bridge\c";"$(ProjectDir)..\bridge\jsc";"$(ProjectDir)..\css";"$(ProjectDir)..\editing";"$(ProjectDir)..\fileapi";"$(ProjectDir)..\rendering";"$(ProjectDir)..\rendering\style";"$(ProjectDir)..\bindings";"$(ProjectDir)..\bindings\generic";"$(ProjectDir)..\bindings\js";"$(ProjectDir)..\dom";"$(ProjectDir)..\dom\default";"$(ProjectDir)..\history";"$(ProjectDir)..\html";"$(ProjectDir)..\html\canvas";"$(ProjectDir)..\html\parser";"$(ProjectDir)..\inspector";"$(ProjectDir)..\loader";"$(ProjectDir)..\loader\appcache";"$(ProjectDir)..\loader\archive";"$(ProjectDir)..\loader\archive\cf";"$(ProjectDir)..\loader\icon";"$(ProjectDir)..\mathml";"$(ProjectDir)..\notifications";"$(ProjectDir)..\page";"$(ProjectDir)..\page\animation";"$(ProjectDir)..\page\win";"$(ProjectDir)..\platform";"$(ProjectDir)..\platform\animation";"$(ProjectDir)..\platform\mock";"$(ProjectDir)..\platform\sql";"$(ProjectDir)..\platform\win";"$(ProjectDir)..\platform\network";"$(ProjectDir)..\platform\network\win";"$(ProjectDir)..\platform\cf";"$(ProjectDir)..\platform\graphics";"$(ProjectDir)..\platform\graphics\filters";"$(ProjectDir)..\platform\graphics\opentype";"$(ProjectDir)..\platform\graphics\transforms";"$(ProjectDir)..\platform\text";"$(ProjectDir)..\platform\text\transcoder";"$(ProjectDir)..\platform\graphics\win";"$(ProjectDir)..\xml";"$(WebKitOutputDir)\obj\WebCore\DerivedSources";"$(ProjectDir)..\plugins";"$(ProjectDir)..\plugins\win";"$(ProjectDir)..\svg\animation";"$(ProjectDir)..\svg\graphics";"$(ProjectDir)..\svg\graphics\filters";"$(ProjectDir)..\svg";"$(ProjectDir)..\wml";"$(ProjectDir)..\storage";"$(ProjectDir)..\websockets";"$(ProjectDir)..\workers";"$(WebKitOutputDir)\include";"$(WebKitOutputDir)\include\private";"$(WebKitOutputDir)\include\JavaScriptCore";"$(WebKitOutputDir)\include\private\JavaScriptCore";"$(ProjectDir)..\ForwardingHeaders";"$(WebKitLibrariesDir)\include";"$(WebKitLibrariesDir)\include\private";"$(WebKitLibrariesDir)\include\private\JavaScriptCore";"$(WebKitLibrariesDir)\include\pthreads";"$(WebKitLibrariesDir)\include\sqlite";"$(WebKitLibrariesDir)\include\JavaScriptCore";"$(WebKitLibrariesDir)\include\zlib""
PreprocessorDefinitions="__WIN32__;DISABLE_3D_RENDERING;WEBCORE_CONTEXT_MENUS"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="WebCorePrefix.h"
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj index d7633e3..c8b88ec 100644 --- a/WebCore/WebCore.xcodeproj/project.pbxproj +++ b/WebCore/WebCore.xcodeproj/project.pbxproj @@ -120,6 +120,8 @@ 085B05C311FAE16C004D65F6 /* SVGResourcesCycleSolver.h in Headers */ = {isa = PBXBuildFile; fileRef = 085B05C111FAE16C004D65F6 /* SVGResourcesCycleSolver.h */; }; 085B92BA0EFDE73D00E6123C /* FormDataBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 085B92B80EFDE73D00E6123C /* FormDataBuilder.cpp */; }; 085B92BB0EFDE73D00E6123C /* FormDataBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 085B92B90EFDE73D00E6123C /* FormDataBuilder.h */; settings = {ATTRIBUTES = (); }; }; + 08641D4712142F7D008DE9F6 /* RenderImageResourceStyleImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08641D4512142F7D008DE9F6 /* RenderImageResourceStyleImage.cpp */; }; + 08641D4812142F7D008DE9F6 /* RenderImageResourceStyleImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 08641D4612142F7D008DE9F6 /* RenderImageResourceStyleImage.h */; settings = {ATTRIBUTES = (Private, ); }; }; 0865CCE60EDDF51B00DF9EC3 /* WMLNoopElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0865CCE40EDDF51B00DF9EC3 /* WMLNoopElement.cpp */; }; 0865CCE70EDDF51B00DF9EC3 /* WMLNoopElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 0865CCE50EDDF51B00DF9EC3 /* WMLNoopElement.h */; }; 086A400611F6D6B7002CEC53 /* RenderSVGResourceContainer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 086A400511F6D6B7002CEC53 /* RenderSVGResourceContainer.cpp */; }; @@ -203,6 +205,8 @@ 08E6A2E90EEE035200AC1206 /* WMLPostfieldElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 08E6A2E70EEE035200AC1206 /* WMLPostfieldElement.h */; }; 08E6E0F10EFF42BA00029FBF /* WMLFieldSetElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08E6E0EF0EFF42BA00029FBF /* WMLFieldSetElement.cpp */; }; 08E6E0F20EFF42BA00029FBF /* WMLFieldSetElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 08E6E0F00EFF42BA00029FBF /* WMLFieldSetElement.h */; }; + 08F2F0091213E61700DCEC48 /* RenderImageResource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08F2F0071213E61700DCEC48 /* RenderImageResource.cpp */; }; + 08F2F00A1213E61700DCEC48 /* RenderImageResource.h in Headers */ = {isa = PBXBuildFile; fileRef = 08F2F0081213E61700DCEC48 /* RenderImageResource.h */; settings = {ATTRIBUTES = (Private, ); }; }; 0A4844990CA44CB200B7BD48 /* SoftLinking.h in Headers */ = {isa = PBXBuildFile; fileRef = 0A4844980CA44CB200B7BD48 /* SoftLinking.h */; settings = {ATTRIBUTES = (Private, ); }; }; 0AFDAC3D10F5448C00E1F3D2 /* PluginViewBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0AFDAC3C10F5448C00E1F3D2 /* PluginViewBase.h */; settings = {ATTRIBUTES = (Private, ); }; }; 0B8C56D40F28627F000502E1 /* HTTPHeaderMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0B8C56D30F28627F000502E1 /* HTTPHeaderMap.cpp */; }; @@ -674,7 +678,6 @@ 2E2D99EC10E2BD3900496337 /* DOMBlobInternal.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 2E2D99E910E2BC3800496337 /* DOMBlobInternal.h */; }; 2E3BBF071162DA1100B9409A /* UUID.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E3BBF051162DA1100B9409A /* UUID.cpp */; }; 2E3BBF081162DA1100B9409A /* UUID.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E3BBF061162DA1100B9409A /* UUID.h */; }; - 2E3BC0BD117D3A4F00B9409A /* FileError.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E3BC0BB117D3A4F00B9409A /* FileError.h */; }; 2E3BC0CA117D3E0800B9409A /* JSFileError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E3BC0C8117D3E0800B9409A /* JSFileError.cpp */; }; 2E3BC0CB117D3E0800B9409A /* JSFileError.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E3BC0C9117D3E0800B9409A /* JSFileError.h */; }; 2E3BC108117D479800B9409A /* DOMFileError.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E3BC106117D479800B9409A /* DOMFileError.h */; }; @@ -699,11 +702,7 @@ 2E4346590F546A9900B0F1BA /* CrossThreadCopier.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E4346570F546A9900B0F1BA /* CrossThreadCopier.h */; }; 2E94F43B119207DA00B7F75D /* JSFileReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E94F439119207DA00B7F75D /* JSFileReader.cpp */; }; 2E94F43C119207DA00B7F75D /* JSFileReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E94F43A119207DA00B7F75D /* JSFileReader.h */; }; - 2E94F4501192096400B7F75D /* FileReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E94F3CB118B908E00B7F75D /* FileReader.cpp */; }; - 2E94F4511192096A00B7F75D /* FileReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E94F3CC118B908E00B7F75D /* FileReader.h */; }; 2EA768040FE7126400AB9C8A /* WorkerScriptLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EA768030FE7126400AB9C8A /* WorkerScriptLoaderClient.h */; }; - 2EAFAF0E10E2AF2D007ED3D6 /* Blob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2EAFAF0B10E2AF2D007ED3D6 /* Blob.cpp */; }; - 2EAFAF0F10E2AF2D007ED3D6 /* Blob.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EAFAF0C10E2AF2D007ED3D6 /* Blob.h */; }; 2EB4BCD2121F03E300EC4885 /* BlobResourceHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2EB4BCD0121F03E300EC4885 /* BlobResourceHandle.cpp */; }; 2EB4BCD3121F03E300EC4885 /* BlobResourceHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EB4BCD1121F03E300EC4885 /* BlobResourceHandle.h */; }; 2ECF7ADC10162B3800427DE7 /* JSErrorEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2ECF7ADA10162B3800427DE7 /* JSErrorEvent.cpp */; }; @@ -718,10 +717,9 @@ 2EDEF1F6121B0EFC00726DB2 /* BlobRegistryImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2EDEF1F0121B0EFC00726DB2 /* BlobRegistryImpl.cpp */; }; 2EDEF1F7121B0EFC00726DB2 /* BlobRegistryImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EDEF1F1121B0EFC00726DB2 /* BlobRegistryImpl.h */; }; 2EDEF1F8121B0EFC00726DB2 /* BlobStorageData.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EDEF1F2121B0EFC00726DB2 /* BlobStorageData.h */; }; - 2EED575512109ED0007656BB /* BlobURL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2EED575012109ED0007656BB /* BlobURL.cpp */; }; - 2EED575612109ED0007656BB /* BlobURL.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EED575112109ED0007656BB /* BlobURL.h */; }; - 2EED57FD1214A9C2007656BB /* ThreadableBlobRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2EED57FB1214A9C2007656BB /* ThreadableBlobRegistry.cpp */; }; - 2EED57FE1214A9C2007656BB /* ThreadableBlobRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EED57FC1214A9C2007656BB /* ThreadableBlobRegistry.h */; }; + 2EDF369C122C94B4002F7D4E /* FileReaderSync.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2EDF369A122C94B4002F7D4E /* FileReaderSync.cpp */; }; + 2EDF369D122C94B4002F7D4E /* FileReaderSync.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EDF369B122C94B4002F7D4E /* FileReaderSync.h */; }; + 2EDF369F122C94C8002F7D4E /* FileException.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EDF369E122C94C8002F7D4E /* FileException.h */; }; 2EF1BFEA121C9F4200C27627 /* FileStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2EF1BFE8121C9F4200C27627 /* FileStream.cpp */; }; 2EF1BFEB121C9F4200C27627 /* FileStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EF1BFE9121C9F4200C27627 /* FileStream.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2EF1BFF7121CB0BD00C27627 /* AsyncFileStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EF1BFF6121CB0BD00C27627 /* AsyncFileStream.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -898,14 +896,15 @@ 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 */; }; - 46A26905121B6B4300C41F3A /* FileWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A26902121B6B4300C41F3A /* FileWriter.cpp */; }; - 46A26906121B6B4300C41F3A /* FileWriter.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A26903121B6B4300C41F3A /* FileWriter.h */; }; 46BD16E30B279473001F0839 /* noneCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 46BD16E20B279473001F0839 /* noneCursor.png */; }; 46D4F2490AF97E810035385A /* cellCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 46D4F2460AF97E810035385A /* cellCursor.png */; }; 46D4F24A0AF97E810035385A /* contextMenuCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 46D4F2470AF97E810035385A /* contextMenuCursor.png */; }; 46D4F24B0AF97E810035385A /* verticalTextCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 46D4F2480AF97E810035385A /* verticalTextCursor.png */; }; + 46DA844D1224A0710060D006 /* JSFileWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46DA844B1224A0710060D006 /* JSFileWriter.cpp */; }; + 46DA844E1224A0710060D006 /* JSFileWriter.h in Headers */ = {isa = PBXBuildFile; fileRef = 46DA844C1224A0710060D006 /* JSFileWriter.h */; }; 46F9D5DD0B0D60170028EE36 /* aliasCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 46F9D5DA0B0D60170028EE36 /* aliasCursor.png */; }; 46F9D5DE0B0D60170028EE36 /* noDropCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 46F9D5DB0B0D60170028EE36 /* noDropCursor.png */; }; 46F9D5DF0B0D60170028EE36 /* progressCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 46F9D5DC0B0D60170028EE36 /* progressCursor.png */; }; @@ -2382,68 +2381,68 @@ 85FF315A0AAFBFCB00374F38 /* DOMKeyboardEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 85FF31580AAFBFCB00374F38 /* DOMKeyboardEvent.h */; }; 85FF315B0AAFBFCB00374F38 /* DOMKeyboardEvent.mm in Sources */ = {isa = PBXBuildFile; fileRef = 85FF31590AAFBFCB00374F38 /* DOMKeyboardEvent.mm */; }; 86243D0111BC31F700CC006A /* JSArrayBufferViewHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 86243D0011BC31F700CC006A /* JSArrayBufferViewHelper.h */; }; - 8947A82912222C4700D95F2D /* JSMetadata.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8947A82512222C4700D95F2D /* JSMetadata.cpp */; }; - 8947A82A12222C4700D95F2D /* JSMetadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 8947A82612222C4700D95F2D /* JSMetadata.h */; }; - 8947A82B12222C4700D95F2D /* JSMetadataCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8947A82712222C4700D95F2D /* JSMetadataCallback.cpp */; }; - 8947A82C12222C4700D95F2D /* JSMetadataCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 8947A82812222C4700D95F2D /* JSMetadataCallback.h */; }; - 8947A83C122234F400D95F2D /* Metadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 897A2D73120001440082740C /* Metadata.h */; }; - 8947A83D122234F900D95F2D /* MetadataCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 897A2D75120001440082740C /* MetadataCallback.h */; }; - 8952535211641B3400CABF00 /* FileThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8952535011641B3400CABF00 /* FileThread.cpp */; }; - 8952535311641B3400CABF00 /* FileThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 8952535111641B3400CABF00 /* FileThread.h */; }; - 895253DC116C4EF500CABF00 /* FileStreamProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 895253DA116C4EF500CABF00 /* FileStreamProxy.cpp */; }; - 895253DD116C4EF500CABF00 /* FileStreamProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 895253DB116C4EF500CABF00 /* FileStreamProxy.h */; }; - 895253DF116C4F0600CABF00 /* FileThreadTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 895253DE116C4F0600CABF00 /* FileThreadTask.h */; }; - 89686C9F122244A00076EAA4 /* DOMFilePath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 89686C9D122244A00076EAA4 /* DOMFilePath.cpp */; }; - 89686CA0122244A00076EAA4 /* DOMFilePath.h in Headers */ = {isa = PBXBuildFile; fileRef = 89686C9E122244A00076EAA4 /* DOMFilePath.h */; }; - 8988E10E11A3508B00DB732E /* BlobItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8988E10C11A3508B00DB732E /* BlobItem.cpp */; }; - 8988E10F11A3508B00DB732E /* BlobItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 8988E10D11A3508B00DB732E /* BlobItem.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 899ABC261215E4A300F9F219 /* DirectoryEntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 899ABC201215E4A300F9F219 /* DirectoryEntry.cpp */; }; - 899ABC271215E4A300F9F219 /* DirectoryEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 899ABC211215E4A300F9F219 /* DirectoryEntry.h */; }; - 899ABC291215E4A300F9F219 /* DirectoryReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 899ABC231215E4A300F9F219 /* DirectoryReader.cpp */; }; - 899ABC2A1215E4A300F9F219 /* DirectoryReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 899ABC241215E4A300F9F219 /* DirectoryReader.h */; }; - 899ABC341215E4BE00F9F219 /* EntriesCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 899ABC2C1215E4BE00F9F219 /* EntriesCallback.h */; }; - 899ABC361215E4BE00F9F219 /* EntryArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 899ABC2E1215E4BE00F9F219 /* EntryArray.cpp */; }; - 899ABC371215E4BE00F9F219 /* EntryArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 899ABC2F1215E4BE00F9F219 /* EntryArray.h */; }; - 899ABC391215E4BE00F9F219 /* FileEntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 899ABC311215E4BE00F9F219 /* FileEntry.cpp */; }; - 899ABC3A1215E4BE00F9F219 /* FileEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 899ABC321215E4BE00F9F219 /* FileEntry.h */; }; - 899ABC5D1215EB2A00F9F219 /* JSDirectoryEntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 899ABC551215EB2A00F9F219 /* JSDirectoryEntry.cpp */; }; - 899ABC5E1215EB2A00F9F219 /* JSDirectoryEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 899ABC561215EB2A00F9F219 /* JSDirectoryEntry.h */; }; - 899ABC5F1215EB2A00F9F219 /* JSEntriesCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 899ABC571215EB2A00F9F219 /* JSEntriesCallback.cpp */; }; - 899ABC601215EB2A00F9F219 /* JSEntriesCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 899ABC581215EB2A00F9F219 /* JSEntriesCallback.h */; }; - 899ABC611215EB2A00F9F219 /* JSEntryArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 899ABC591215EB2A00F9F219 /* JSEntryArray.cpp */; }; - 899ABC621215EB2A00F9F219 /* JSEntryArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 899ABC5A1215EB2A00F9F219 /* JSEntryArray.h */; }; - 899ABC631215EB2A00F9F219 /* JSFileEntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 899ABC5B1215EB2A00F9F219 /* JSFileEntry.cpp */; }; - 899ABC641215EB2A00F9F219 /* JSFileEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 899ABC5C1215EB2A00F9F219 /* JSFileEntry.h */; }; - 899ABC6D1215ECEF00F9F219 /* JSDirectoryReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 899ABC6B1215ECEF00F9F219 /* JSDirectoryReader.cpp */; }; - 899ABC6E1215ECEF00F9F219 /* JSDirectoryReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 899ABC6C1215ECEF00F9F219 /* JSDirectoryReader.h */; }; - 899ABC791215F03100F9F219 /* JSDOMFileSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 897A2D8D1200035F0082740C /* JSDOMFileSystem.cpp */; }; - 899ABC7A1215F03100F9F219 /* JSDOMFileSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 897A2D8E1200035F0082740C /* JSDOMFileSystem.h */; }; - 899ABC7B1215F03300F9F219 /* JSEntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 897A2D4911FF6C900082740C /* JSEntry.cpp */; }; - 899ABC7C1215F03300F9F219 /* JSEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 897A2D4A11FF6C900082740C /* JSEntry.h */; }; - 899ABC7D1215F03600F9F219 /* JSEntryCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 897A2D4B11FF6C900082740C /* JSEntryCallback.cpp */; }; - 899ABC7E1215F03700F9F219 /* JSEntryCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 897A2D4C11FF6C900082740C /* JSEntryCallback.h */; }; - 899ABC7F1215F03800F9F219 /* JSErrorCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 897A2D4D11FF6C900082740C /* JSErrorCallback.cpp */; }; - 899ABC801215F03800F9F219 /* JSErrorCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 897A2D4E11FF6C900082740C /* JSErrorCallback.h */; }; - 899ABC811215F03B00F9F219 /* JSFlags.h in Headers */ = {isa = PBXBuildFile; fileRef = 897A2D92120003760082740C /* JSFlags.h */; }; - 899ABC821215F03B00F9F219 /* JSFlags.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 897A2D91120003760082740C /* JSFlags.cpp */; }; - 899ABC831215F03C00F9F219 /* JSFileSystemCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 897A2D5611FF6CA40082740C /* JSFileSystemCallback.h */; }; - 899ABC841215F03D00F9F219 /* JSFileSystemCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 897A2D5511FF6CA40082740C /* JSFileSystemCallback.cpp */; }; - 899ABC861215F0D800F9F219 /* DOMFileSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 897A2D1911FF58A50082740C /* DOMFileSystem.cpp */; }; - 899ABC871215F0DF00F9F219 /* DOMFileSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 897A2D1A11FF58A50082740C /* DOMFileSystem.h */; }; - 899ABC961215F9DA00F9F219 /* ErrorCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 897A2D2011FF58A50082740C /* ErrorCallback.h */; }; - 899ABC971215F9DF00F9F219 /* EntryCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 897A2D1E11FF58A50082740C /* EntryCallback.h */; }; - 899ABCAA1215FA5500F9F219 /* FileSystemCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 897A2D2111FF58A50082740C /* FileSystemCallback.h */; }; - 899ABCAB1215FA5A00F9F219 /* Flags.h in Headers */ = {isa = PBXBuildFile; fileRef = 897A2D60120001220082740C /* Flags.h */; }; - 899ABCB91215FAB500F9F219 /* Entry.h in Headers */ = {isa = PBXBuildFile; fileRef = 897A2D1D11FF58A50082740C /* Entry.h */; }; - 899ABCBA1215FAB800F9F219 /* Entry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 897A2D1C11FF58A50082740C /* Entry.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 */; }; + 89878555122CA064003AABDA /* DirectoryReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 8987853C122CA064003AABDA /* DirectoryReader.h */; }; + 89878556122CA064003AABDA /* DOMFilePath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8987853D122CA064003AABDA /* DOMFilePath.cpp */; }; + 89878557122CA064003AABDA /* DOMFilePath.h in Headers */ = {isa = PBXBuildFile; fileRef = 8987853E122CA064003AABDA /* DOMFilePath.h */; }; + 89878558122CA064003AABDA /* DOMFileSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8987853F122CA064003AABDA /* DOMFileSystem.cpp */; }; + 89878559122CA064003AABDA /* DOMFileSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 89878540122CA064003AABDA /* DOMFileSystem.h */; }; + 8987855A122CA064003AABDA /* EntriesCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 89878541122CA064003AABDA /* EntriesCallback.h */; }; + 8987855B122CA064003AABDA /* Entry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 89878542122CA064003AABDA /* Entry.cpp */; }; + 8987855C122CA064003AABDA /* Entry.h in Headers */ = {isa = PBXBuildFile; fileRef = 89878543122CA064003AABDA /* Entry.h */; }; + 8987855D122CA064003AABDA /* EntryArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 89878544122CA064003AABDA /* EntryArray.cpp */; }; + 8987855E122CA064003AABDA /* EntryArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 89878545122CA064003AABDA /* EntryArray.h */; }; + 8987855F122CA064003AABDA /* EntryCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 89878546122CA064003AABDA /* EntryCallback.h */; }; + 89878560122CA064003AABDA /* ErrorCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 89878547122CA064003AABDA /* ErrorCallback.h */; }; + 89878561122CA064003AABDA /* FileEntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 89878548122CA064003AABDA /* FileEntry.cpp */; }; + 89878562122CA064003AABDA /* FileEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 89878549122CA064003AABDA /* FileEntry.h */; }; + 89878563122CA064003AABDA /* FileSystemCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 8987854A122CA064003AABDA /* FileSystemCallback.h */; }; + 89878564122CA064003AABDA /* FileSystemCallbacks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8987854B122CA064003AABDA /* FileSystemCallbacks.cpp */; }; + 89878565122CA064003AABDA /* FileSystemCallbacks.h in Headers */ = {isa = PBXBuildFile; fileRef = 8987854C122CA064003AABDA /* FileSystemCallbacks.h */; }; + 89878566122CA064003AABDA /* Flags.h in Headers */ = {isa = PBXBuildFile; fileRef = 8987854D122CA064003AABDA /* Flags.h */; }; + 89878567122CA064003AABDA /* LocalFileSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8987854E122CA064003AABDA /* LocalFileSystem.cpp */; }; + 89878568122CA064003AABDA /* LocalFileSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 8987854F122CA064003AABDA /* LocalFileSystem.h */; }; + 89878569122CA064003AABDA /* Metadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 89878550122CA064003AABDA /* Metadata.h */; }; + 8987856A122CA064003AABDA /* MetadataCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 89878551122CA064003AABDA /* MetadataCallback.h */; }; + 8987858A122CA26A003AABDA /* JSDirectoryEntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 89878586122CA26A003AABDA /* JSDirectoryEntry.cpp */; }; + 8987858B122CA26A003AABDA /* JSDirectoryEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 89878587122CA26A003AABDA /* JSDirectoryEntry.h */; }; + 8987858C122CA26A003AABDA /* JSDirectoryReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 89878588122CA26A003AABDA /* JSDirectoryReader.cpp */; }; + 8987858D122CA26A003AABDA /* JSDirectoryReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 89878589122CA26A003AABDA /* JSDirectoryReader.h */; }; + 898785A4122CA2A7003AABDA /* JSDOMFileSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8987858E122CA2A7003AABDA /* JSDOMFileSystem.cpp */; }; + 898785A5122CA2A7003AABDA /* JSDOMFileSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 8987858F122CA2A7003AABDA /* JSDOMFileSystem.h */; }; + 898785A6122CA2A7003AABDA /* JSEntriesCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 89878590122CA2A7003AABDA /* JSEntriesCallback.cpp */; }; + 898785A7122CA2A7003AABDA /* JSEntriesCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 89878591122CA2A7003AABDA /* JSEntriesCallback.h */; }; + 898785A8122CA2A7003AABDA /* JSEntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 89878592122CA2A7003AABDA /* JSEntry.cpp */; }; + 898785A9122CA2A7003AABDA /* JSEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 89878593122CA2A7003AABDA /* JSEntry.h */; }; + 898785AA122CA2A7003AABDA /* JSEntryArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 89878594122CA2A7003AABDA /* JSEntryArray.cpp */; }; + 898785AB122CA2A7003AABDA /* JSEntryArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 89878595122CA2A7003AABDA /* JSEntryArray.h */; }; + 898785AC122CA2A7003AABDA /* JSEntryCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 89878596122CA2A7003AABDA /* JSEntryCallback.cpp */; }; + 898785AD122CA2A7003AABDA /* JSEntryCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 89878597122CA2A7003AABDA /* JSEntryCallback.h */; }; + 898785AE122CA2A7003AABDA /* JSErrorCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 89878598122CA2A7003AABDA /* JSErrorCallback.cpp */; }; + 898785AF122CA2A7003AABDA /* JSErrorCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 89878599122CA2A7003AABDA /* JSErrorCallback.h */; }; + 898785B0122CA2A7003AABDA /* JSFileEntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8987859A122CA2A7003AABDA /* JSFileEntry.cpp */; }; + 898785B1122CA2A7003AABDA /* JSFileEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 8987859B122CA2A7003AABDA /* JSFileEntry.h */; }; + 898785B2122CA2A7003AABDA /* JSFileSystemCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8987859C122CA2A7003AABDA /* JSFileSystemCallback.cpp */; }; + 898785B3122CA2A7003AABDA /* JSFileSystemCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 8987859D122CA2A7003AABDA /* JSFileSystemCallback.h */; }; + 898785B4122CA2A7003AABDA /* JSFlags.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8987859E122CA2A7003AABDA /* JSFlags.cpp */; }; + 898785B5122CA2A7003AABDA /* JSFlags.h in Headers */ = {isa = PBXBuildFile; fileRef = 8987859F122CA2A7003AABDA /* JSFlags.h */; }; + 898785B6122CA2A7003AABDA /* JSMetadata.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 898785A0122CA2A7003AABDA /* JSMetadata.cpp */; }; + 898785B7122CA2A7003AABDA /* JSMetadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 898785A1122CA2A7003AABDA /* JSMetadata.h */; }; + 898785B8122CA2A7003AABDA /* JSMetadataCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 898785A2122CA2A7003AABDA /* JSMetadataCallback.cpp */; }; + 898785B9122CA2A7003AABDA /* JSMetadataCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 898785A3122CA2A7003AABDA /* JSMetadataCallback.h */; }; + 898785F0122E1E87003AABDA /* JSFileException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 898785EE122E1E87003AABDA /* JSFileException.cpp */; }; + 898785F1122E1E87003AABDA /* JSFileException.h in Headers */ = {isa = PBXBuildFile; fileRef = 898785EF122E1E87003AABDA /* JSFileException.h */; }; + 898785F4122E1EAC003AABDA /* JSFileReaderSync.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 898785F2122E1EAC003AABDA /* JSFileReaderSync.cpp */; }; + 898785F5122E1EAC003AABDA /* JSFileReaderSync.h in Headers */ = {isa = PBXBuildFile; fileRef = 898785F3122E1EAC003AABDA /* JSFileReaderSync.h */; }; 89B5EAA111E8003D00F2367E /* LineEnding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 89B5EA9F11E8003D00F2367E /* LineEnding.cpp */; }; 89B5EAA211E8003D00F2367E /* LineEnding.h in Headers */ = {isa = PBXBuildFile; fileRef = 89B5EAA011E8003D00F2367E /* LineEnding.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 89BED5EB11BE11CE00448492 /* BlobBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 89BED5E911BE11CE00448492 /* BlobBuilder.cpp */; }; - 89BED5EC11BE11CE00448492 /* BlobBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 89BED5EA11BE11CE00448492 /* BlobBuilder.h */; }; - 89C0DD7A121F0C69009E17CA /* FileSystemCallbacks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 89C0DD78121F0C69009E17CA /* FileSystemCallbacks.cpp */; }; - 89C0DD7B121F0C69009E17CA /* FileSystemCallbacks.h in Headers */ = {isa = PBXBuildFile; fileRef = 89C0DD79121F0C69009E17CA /* FileSystemCallbacks.h */; }; 89CD029311C85B870070B791 /* JSBlobBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 89CD029111C85B870070B791 /* JSBlobBuilder.cpp */; }; 89CD029411C85B870070B791 /* JSBlobBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 89CD029211C85B870070B791 /* JSBlobBuilder.h */; }; + 89D08D9F12228451001241DF /* AsyncFileSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 89D08D9C12228451001241DF /* AsyncFileSystem.cpp */; }; + 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, ); }; }; 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 */; }; @@ -2732,12 +2731,58 @@ 973889A1116EA9DC00ADF313 /* DocumentWriter.h in Headers */ = {isa = PBXBuildFile; fileRef = 9738899F116EA9DC00ADF313 /* DocumentWriter.h */; settings = {ATTRIBUTES = (Private, ); }; }; 973E325610883B7C005BC493 /* ResourceLoadNotifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 973E325410883B7C005BC493 /* ResourceLoadNotifier.cpp */; }; 973E325710883B7C005BC493 /* ResourceLoadNotifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 973E325510883B7C005BC493 /* ResourceLoadNotifier.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 976E2BA711CAE4DE006C56A0 /* CSSPreloadScanner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 976E2BA511CAE4DE006C56A0 /* CSSPreloadScanner.cpp */; }; - 976E2BA811CAE4DE006C56A0 /* CSSPreloadScanner.h in Headers */ = {isa = PBXBuildFile; fileRef = 976E2BA611CAE4DE006C56A0 /* CSSPreloadScanner.h */; }; - 976E896011C0CA3A00EA9CA9 /* HTMLEntityParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 976E895E11C0CA3A00EA9CA9 /* HTMLEntityParser.cpp */; }; - 976E896111C0CA3A00EA9CA9 /* HTMLEntityParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 976E895F11C0CA3A00EA9CA9 /* HTMLEntityParser.h */; }; - 978B6FC912128821001595EF /* HTMLViewSourceParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 978B6FC712128821001595EF /* HTMLViewSourceParser.cpp */; }; - 978B6FCA12128821001595EF /* HTMLViewSourceParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 978B6FC812128821001595EF /* HTMLViewSourceParser.h */; }; + 976D6C77122B8A3D001FD1F7 /* AsyncFileWriter.h in Headers */ = {isa = PBXBuildFile; fileRef = 976D6C58122B8A3D001FD1F7 /* AsyncFileWriter.h */; }; + 976D6C78122B8A3D001FD1F7 /* Blob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 976D6C59122B8A3D001FD1F7 /* Blob.cpp */; }; + 976D6C79122B8A3D001FD1F7 /* Blob.h in Headers */ = {isa = PBXBuildFile; fileRef = 976D6C5A122B8A3D001FD1F7 /* Blob.h */; }; + 976D6C7B122B8A3D001FD1F7 /* BlobBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 976D6C5C122B8A3D001FD1F7 /* BlobBuilder.cpp */; }; + 976D6C7C122B8A3D001FD1F7 /* BlobBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 976D6C5D122B8A3D001FD1F7 /* BlobBuilder.h */; }; + 976D6C7E122B8A3D001FD1F7 /* BlobURL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 976D6C5F122B8A3D001FD1F7 /* BlobURL.cpp */; }; + 976D6C7F122B8A3D001FD1F7 /* BlobURL.h in Headers */ = {isa = PBXBuildFile; fileRef = 976D6C60122B8A3D001FD1F7 /* BlobURL.h */; }; + 976D6C80122B8A3D001FD1F7 /* File.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 976D6C61122B8A3D001FD1F7 /* File.cpp */; }; + 976D6C81122B8A3D001FD1F7 /* File.h in Headers */ = {isa = PBXBuildFile; fileRef = 976D6C62122B8A3D001FD1F7 /* File.h */; }; + 976D6C83122B8A3D001FD1F7 /* FileError.h in Headers */ = {isa = PBXBuildFile; fileRef = 976D6C64122B8A3D001FD1F7 /* FileError.h */; }; + 976D6C85122B8A3D001FD1F7 /* FileList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 976D6C66122B8A3D001FD1F7 /* FileList.cpp */; }; + 976D6C86122B8A3D001FD1F7 /* FileList.h in Headers */ = {isa = PBXBuildFile; fileRef = 976D6C67122B8A3D001FD1F7 /* FileList.h */; }; + 976D6C88122B8A3D001FD1F7 /* FileReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 976D6C69122B8A3D001FD1F7 /* FileReader.cpp */; }; + 976D6C89122B8A3D001FD1F7 /* FileReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 976D6C6A122B8A3D001FD1F7 /* FileReader.h */; }; + 976D6C8B122B8A3D001FD1F7 /* FileStreamProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 976D6C6C122B8A3D001FD1F7 /* FileStreamProxy.cpp */; }; + 976D6C8C122B8A3D001FD1F7 /* FileStreamProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 976D6C6D122B8A3D001FD1F7 /* FileStreamProxy.h */; }; + 976D6C8D122B8A3D001FD1F7 /* FileThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 976D6C6E122B8A3D001FD1F7 /* FileThread.cpp */; }; + 976D6C8E122B8A3D001FD1F7 /* FileThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 976D6C6F122B8A3D001FD1F7 /* FileThread.h */; }; + 976D6C8F122B8A3D001FD1F7 /* FileThreadTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 976D6C70122B8A3D001FD1F7 /* FileThreadTask.h */; }; + 976D6C90122B8A3D001FD1F7 /* FileWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 976D6C71122B8A3D001FD1F7 /* FileWriter.cpp */; }; + 976D6C91122B8A3D001FD1F7 /* FileWriter.h in Headers */ = {isa = PBXBuildFile; fileRef = 976D6C72122B8A3D001FD1F7 /* FileWriter.h */; }; + 976D6C93122B8A3D001FD1F7 /* FileWriterClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 976D6C74122B8A3D001FD1F7 /* FileWriterClient.h */; }; + 976D6C94122B8A3D001FD1F7 /* ThreadableBlobRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 976D6C75122B8A3D001FD1F7 /* ThreadableBlobRegistry.cpp */; }; + 976D6C95122B8A3D001FD1F7 /* ThreadableBlobRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 976D6C76122B8A3D001FD1F7 /* ThreadableBlobRegistry.h */; }; + 977B37231228721700B81FF8 /* HTMLElementStack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 977B371F1228721700B81FF8 /* HTMLElementStack.cpp */; }; + 977B37241228721700B81FF8 /* HTMLElementStack.h in Headers */ = {isa = PBXBuildFile; fileRef = 977B37201228721700B81FF8 /* HTMLElementStack.h */; }; + 977B37251228721700B81FF8 /* HTMLTreeBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 977B37211228721700B81FF8 /* HTMLTreeBuilder.cpp */; }; + 977B37261228721700B81FF8 /* HTMLTreeBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 977B37221228721700B81FF8 /* HTMLTreeBuilder.h */; }; + 977B3862122883E900B81FF8 /* CSSPreloadScanner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 977B3849122883E900B81FF8 /* CSSPreloadScanner.cpp */; }; + 977B3863122883E900B81FF8 /* CSSPreloadScanner.h in Headers */ = {isa = PBXBuildFile; fileRef = 977B384A122883E900B81FF8 /* CSSPreloadScanner.h */; }; + 977B3864122883E900B81FF8 /* HTMLConstructionSite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 977B384B122883E900B81FF8 /* HTMLConstructionSite.cpp */; }; + 977B3865122883E900B81FF8 /* HTMLConstructionSite.h in Headers */ = {isa = PBXBuildFile; fileRef = 977B384C122883E900B81FF8 /* HTMLConstructionSite.h */; }; + 977B3866122883E900B81FF8 /* HTMLDocumentParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 977B384D122883E900B81FF8 /* HTMLDocumentParser.cpp */; }; + 977B3867122883E900B81FF8 /* HTMLDocumentParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 977B384E122883E900B81FF8 /* HTMLDocumentParser.h */; }; + 977B3869122883E900B81FF8 /* HTMLEntityParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 977B3850122883E900B81FF8 /* HTMLEntityParser.cpp */; }; + 977B386A122883E900B81FF8 /* HTMLEntityParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 977B3851122883E900B81FF8 /* HTMLEntityParser.h */; }; + 977B386B122883E900B81FF8 /* HTMLEntitySearch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 977B3852122883E900B81FF8 /* HTMLEntitySearch.cpp */; }; + 977B386C122883E900B81FF8 /* HTMLEntitySearch.h in Headers */ = {isa = PBXBuildFile; fileRef = 977B3853122883E900B81FF8 /* HTMLEntitySearch.h */; }; + 977B386D122883E900B81FF8 /* HTMLEntityTable.h in Headers */ = {isa = PBXBuildFile; fileRef = 977B3854122883E900B81FF8 /* HTMLEntityTable.h */; }; + 977B386E122883E900B81FF8 /* HTMLFormattingElementList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 977B3855122883E900B81FF8 /* HTMLFormattingElementList.cpp */; }; + 977B386F122883E900B81FF8 /* HTMLFormattingElementList.h in Headers */ = {isa = PBXBuildFile; fileRef = 977B3856122883E900B81FF8 /* HTMLFormattingElementList.h */; }; + 977B3870122883E900B81FF8 /* HTMLParserScheduler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 977B3857122883E900B81FF8 /* HTMLParserScheduler.cpp */; }; + 977B3871122883E900B81FF8 /* HTMLParserScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = 977B3858122883E900B81FF8 /* HTMLParserScheduler.h */; }; + 977B3872122883E900B81FF8 /* HTMLPreloadScanner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 977B3859122883E900B81FF8 /* HTMLPreloadScanner.cpp */; }; + 977B3873122883E900B81FF8 /* HTMLPreloadScanner.h in Headers */ = {isa = PBXBuildFile; fileRef = 977B385A122883E900B81FF8 /* HTMLPreloadScanner.h */; }; + 977B3874122883E900B81FF8 /* HTMLScriptRunner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 977B385B122883E900B81FF8 /* HTMLScriptRunner.cpp */; }; + 977B3875122883E900B81FF8 /* HTMLScriptRunner.h in Headers */ = {isa = PBXBuildFile; fileRef = 977B385C122883E900B81FF8 /* HTMLScriptRunner.h */; }; + 977B3876122883E900B81FF8 /* HTMLScriptRunnerHost.h in Headers */ = {isa = PBXBuildFile; fileRef = 977B385D122883E900B81FF8 /* HTMLScriptRunnerHost.h */; }; + 977B3877122883E900B81FF8 /* HTMLTokenizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 977B385E122883E900B81FF8 /* HTMLTokenizer.cpp */; }; + 977B3878122883E900B81FF8 /* HTMLTokenizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 977B385F122883E900B81FF8 /* HTMLTokenizer.h */; }; + 977B3879122883E900B81FF8 /* HTMLViewSourceParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 977B3860122883E900B81FF8 /* HTMLViewSourceParser.cpp */; }; + 977B387A122883E900B81FF8 /* HTMLViewSourceParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 977B3861122883E900B81FF8 /* HTMLViewSourceParser.h */; }; 979F43D31075E44A0000F83B /* RedirectScheduler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 979F43D11075E44A0000F83B /* RedirectScheduler.cpp */; }; 979F43D41075E44A0000F83B /* RedirectScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = 979F43D21075E44A0000F83B /* RedirectScheduler.h */; settings = {ATTRIBUTES = (Private, ); }; }; 97C078501165D5BE003A32EF /* SuffixTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 97C0784F1165D5BE003A32EF /* SuffixTree.h */; }; @@ -2745,16 +2790,10 @@ 97DCE20210807C750057D394 /* HistoryController.h in Headers */ = {isa = PBXBuildFile; fileRef = 97DCE20010807C750057D394 /* HistoryController.h */; settings = {ATTRIBUTES = (Private, ); }; }; 97DD4D860FDF4D6E00ECF9A4 /* XSSAuditor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97DD4D840FDF4D6D00ECF9A4 /* XSSAuditor.cpp */; }; 97DD4D870FDF4D6E00ECF9A4 /* XSSAuditor.h in Headers */ = {isa = PBXBuildFile; fileRef = 97DD4D850FDF4D6E00ECF9A4 /* XSSAuditor.h */; }; - 97E7936511C6030900E649BC /* HTMLPreloadScanner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97E7936311C6030900E649BC /* HTMLPreloadScanner.cpp */; }; - 97E7936611C6030900E649BC /* HTMLPreloadScanner.h in Headers */ = {isa = PBXBuildFile; fileRef = 97E7936411C6030900E649BC /* HTMLPreloadScanner.h */; }; - 97E8B35611A23CE200169409 /* HTMLTokenizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97E8B35411A23CE200169409 /* HTMLTokenizer.cpp */; }; - 97E8B35711A23CE200169409 /* HTMLTokenizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 97E8B35511A23CE200169409 /* HTMLTokenizer.h */; }; - 97E8B3C311A2890800169409 /* HTMLToken.h in Headers */ = {isa = PBXBuildFile; fileRef = 97E8B3C211A2890800169409 /* HTMLToken.h */; }; - 97EF561011E40783007E026F /* HTMLConstructionSite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97EF560E11E40783007E026F /* HTMLConstructionSite.cpp */; }; - 97EF561111E40783007E026F /* HTMLConstructionSite.h in Headers */ = {isa = PBXBuildFile; fileRef = 97EF560F11E40783007E026F /* HTMLConstructionSite.h */; }; 97EF7DFE107E55B700D7C49C /* ScriptControllerBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97EF7DFD107E55B700D7C49C /* ScriptControllerBase.cpp */; }; 9F0D6B2E121BFEBA006C0288 /* InspectorProfilerAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9F0D6B2C121BFEBA006C0288 /* InspectorProfilerAgent.cpp */; }; 9F0D6B2F121BFEBA006C0288 /* InspectorProfilerAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F0D6B2D121BFEBA006C0288 /* InspectorProfilerAgent.h */; }; + 9F3B947E12241758005304E7 /* ScriptHeapSnapshot.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F3B947D12241758005304E7 /* ScriptHeapSnapshot.h */; }; 9F6FC1961122E82A00E80196 /* ScriptDebugServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9F6FC1941122E82A00E80196 /* ScriptDebugServer.cpp */; }; 9F6FC1971122E82A00E80196 /* ScriptDebugServer.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F6FC1951122E82A00E80196 /* ScriptDebugServer.h */; settings = {ATTRIBUTES = (Private, ); }; }; 9F72304F11184B4100AD0126 /* ScriptProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F72304C11184B4100AD0126 /* ScriptProfile.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -3123,8 +3162,6 @@ A833C80C0A2CF25600D57664 /* XMLNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A833C80A0A2CF25600D57664 /* XMLNames.cpp */; }; A833C80D0A2CF25600D57664 /* XMLNames.h in Headers */ = {isa = PBXBuildFile; fileRef = A833C80B0A2CF25600D57664 /* XMLNames.h */; }; A833C8520A2CF52800D57664 /* SVGElementFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 656581E609D1508D000E61D7 /* SVGElementFactory.cpp */; }; - A83B3AF011ADEFF500458809 /* HTMLScriptRunner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A83B3AEE11ADEFF500458809 /* HTMLScriptRunner.cpp */; }; - A83B3AF111ADEFF500458809 /* HTMLScriptRunner.h in Headers */ = {isa = PBXBuildFile; fileRef = A83B3AEF11ADEFF500458809 /* HTMLScriptRunner.h */; }; A83B78FC0CCAFF15000B0825 /* JSSVGFontFaceUriElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A83B78F20CCAFF15000B0825 /* JSSVGFontFaceUriElement.h */; }; A83B78FD0CCAFF15000B0825 /* JSSVGFontFaceUriElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A83B78F30CCAFF15000B0825 /* JSSVGFontFaceUriElement.cpp */; }; A83B78FE0CCAFF15000B0825 /* JSSVGFontFaceSrcElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A83B78F40CCAFF15000B0825 /* JSSVGFontFaceSrcElement.h */; }; @@ -3164,8 +3201,6 @@ A86629D209DA2B48009633A5 /* JSMouseEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A86629CC09DA2B47009633A5 /* JSMouseEvent.cpp */; }; A86629D309DA2B48009633A5 /* JSKeyboardEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = A86629CD09DA2B47009633A5 /* JSKeyboardEvent.h */; }; A86629D409DA2B48009633A5 /* JSKeyboardEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A86629CE09DA2B47009633A5 /* JSKeyboardEvent.cpp */; }; - A871038A11A2947000DBD50E /* HTMLDocumentParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A871038811A2947000DBD50E /* HTMLDocumentParser.cpp */; }; - A871038B11A2947000DBD50E /* HTMLDocumentParser.h in Headers */ = {isa = PBXBuildFile; fileRef = A871038911A2947000DBD50E /* HTMLDocumentParser.h */; }; A871D4560A127CBC00B12A68 /* HTMLPlugInElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A871D44C0A127CBC00B12A68 /* HTMLPlugInElement.h */; settings = {ATTRIBUTES = (Private, ); }; }; A871D4570A127CBC00B12A68 /* HTMLPlugInElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A871D44D0A127CBC00B12A68 /* HTMLPlugInElement.cpp */; }; A871D4580A127CBC00B12A68 /* HTMLParamElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A871D44E0A127CBC00B12A68 /* HTMLParamElement.h */; }; @@ -3224,9 +3259,6 @@ A871DFE30A15376B00B12A68 /* RenderReplaced.h in Headers */ = {isa = PBXBuildFile; fileRef = A871DFDF0A15376B00B12A68 /* RenderReplaced.h */; settings = {ATTRIBUTES = (Private, ); }; }; A871DFE40A15376B00B12A68 /* RenderWidget.h in Headers */ = {isa = PBXBuildFile; fileRef = A871DFE00A15376B00B12A68 /* RenderWidget.h */; settings = {ATTRIBUTES = (Private, ); }; }; A871DFE50A15376B00B12A68 /* RenderWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A871DFE10A15376B00B12A68 /* RenderWidget.cpp */; }; - A879C62511A9D1F70059237A /* HTMLTreeBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A879C62311A9D1F70059237A /* HTMLTreeBuilder.cpp */; }; - A879C62611A9D1F70059237A /* HTMLTreeBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = A879C62411A9D1F70059237A /* HTMLTreeBuilder.h */; }; - A87F163511AE841300CBB2E5 /* HTMLScriptRunnerHost.h in Headers */ = {isa = PBXBuildFile; fileRef = A87F163411AE841300CBB2E5 /* HTMLScriptRunnerHost.h */; }; A883DF270F3D045D00F19BF6 /* VisibleSelection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A883DF250F3D045D00F19BF6 /* VisibleSelection.cpp */; }; A883DF280F3D045D00F19BF6 /* VisibleSelection.h in Headers */ = {isa = PBXBuildFile; fileRef = A883DF260F3D045D00F19BF6 /* VisibleSelection.h */; settings = {ATTRIBUTES = (Private, ); }; }; A88AD52F09524B92001DD196 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A85D7A2F0879EBA9006A9172 /* QuartzCore.framework */; }; @@ -3237,14 +3269,8 @@ A89943290B42338800D7C802 /* BitmapImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A89943270B42338700D7C802 /* BitmapImage.cpp */; }; A89CCC520F44E98100B5DA10 /* ReplaceNodeWithSpanCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A89CCC500F44E98100B5DA10 /* ReplaceNodeWithSpanCommand.cpp */; }; A89CCC530F44E98100B5DA10 /* ReplaceNodeWithSpanCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = A89CCC510F44E98100B5DA10 /* ReplaceNodeWithSpanCommand.h */; }; - A8A563B411DB3D10003AC2F0 /* HTMLElementStack.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A563B211DB3D10003AC2F0 /* HTMLElementStack.h */; }; - A8A563B511DB3D10003AC2F0 /* HTMLElementStack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A563B311DB3D10003AC2F0 /* HTMLElementStack.cpp */; }; - A8A564A511DC0E59003AC2F0 /* HTMLFormattingElementList.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A564A311DC0E59003AC2F0 /* HTMLFormattingElementList.h */; }; - A8A564A611DC0E59003AC2F0 /* HTMLFormattingElementList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A564A411DC0E59003AC2F0 /* HTMLFormattingElementList.cpp */; }; A8A909AC0CBCD6B50029B807 /* RenderSVGTransformableContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A909AA0CBCD6B50029B807 /* RenderSVGTransformableContainer.h */; }; A8A909AD0CBCD6B50029B807 /* RenderSVGTransformableContainer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A909AB0CBCD6B50029B807 /* RenderSVGTransformableContainer.cpp */; }; - A8BC044E1214EB2A00B5F122 /* HTMLEntitySearch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 970C4FDF1211266200C3D393 /* HTMLEntitySearch.cpp */; }; - A8BC044F1214EB2B00B5F122 /* HTMLEntitySearch.h in Headers */ = {isa = PBXBuildFile; fileRef = 970C4FE01211266200C3D393 /* HTMLEntitySearch.h */; }; A8BC04921214F69600B5F122 /* HTMLEntityTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8BC04911214F69600B5F122 /* HTMLEntityTable.cpp */; }; A8BCFD05120A046100B5F122 /* SVGPathSeg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8BCFD04120A046100B5F122 /* SVGPathSeg.cpp */; }; A8C2280E11D4A59700D5A7D3 /* DocumentParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C2280D11D4A59700D5A7D3 /* DocumentParser.cpp */; }; @@ -3480,8 +3506,6 @@ A8E545BD0CA9D1C20097D09B /* DOMSVGAnimatedAngleInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = A8E544BF0CA9D1C20097D09B /* DOMSVGAnimatedAngleInternal.h */; }; A8E545BF0CA9D1C20097D09B /* DOMSVGTextElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A8E544C10CA9D1C20097D09B /* DOMSVGTextElement.h */; }; A8E545C10CA9D1C20097D09B /* DOMSVGDescElementInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = A8E544C30CA9D1C20097D09B /* DOMSVGDescElementInternal.h */; }; - A8E6A78111D1661B00311F4A /* HTMLParserScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = A8E6A77F11D1661B00311F4A /* HTMLParserScheduler.h */; }; - A8E6A78211D1661B00311F4A /* HTMLParserScheduler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8E6A78011D1661B00311F4A /* HTMLParserScheduler.cpp */; }; A8EA73C30A1900E300A8EF5F /* RenderFieldset.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8EA73AF0A1900E300A8EF5F /* RenderFieldset.cpp */; }; A8EA73C40A1900E300A8EF5F /* RenderFieldset.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA73B00A1900E300A8EF5F /* RenderFieldset.h */; }; A8EA79F10A1916DF00A8EF5F /* HTMLOListElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA79E50A1916DF00A8EF5F /* HTMLOListElement.h */; }; @@ -4112,8 +4136,6 @@ B2AFFC7E0D00A5C10030074D /* FontCustomPlatformData.h in Headers */ = {isa = PBXBuildFile; fileRef = B2AFFC760D00A5C10030074D /* FontCustomPlatformData.h */; }; B2AFFC7F0D00A5C10030074D /* SimpleFontDataMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = B2AFFC770D00A5C10030074D /* SimpleFontDataMac.mm */; }; B2AFFC800D00A5C10030074D /* FontMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = B2AFFC780D00A5C10030074D /* FontMac.mm */; }; - B2AFFC810D00A5C10030074D /* FontPlatformData.h in Headers */ = {isa = PBXBuildFile; fileRef = B2AFFC790D00A5C10030074D /* FontPlatformData.h */; settings = {ATTRIBUTES = (Private, ); }; }; - B2AFFC820D00A5C10030074D /* FontPlatformDataMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = B2AFFC7A0D00A5C10030074D /* FontPlatformDataMac.mm */; }; B2AFFC830D00A5C10030074D /* GlyphPageTreeNodeMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2AFFC7B0D00A5C10030074D /* GlyphPageTreeNodeMac.cpp */; }; B2AFFC930D00A5DF0030074D /* ShapeArabic.c in Sources */ = {isa = PBXBuildFile; fileRef = B2AFFC880D00A5DF0030074D /* ShapeArabic.c */; }; B2AFFC940D00A5DF0030074D /* ShapeArabic.h in Headers */ = {isa = PBXBuildFile; fileRef = B2AFFC890D00A5DF0030074D /* ShapeArabic.h */; }; @@ -4434,6 +4456,8 @@ B523CF0B1182675400EBB29C /* DatabaseSync.h in Headers */ = {isa = PBXBuildFile; fileRef = B523CF041182675400EBB29C /* DatabaseSync.h */; }; B525A96511CA2340003A23A8 /* JSSQLException.h in Headers */ = {isa = PBXBuildFile; fileRef = B525A96311CA2340003A23A8 /* JSSQLException.h */; }; B525A96611CA2340003A23A8 /* JSSQLException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B525A96411CA2340003A23A8 /* JSSQLException.cpp */; }; + B5320D6B122A24E9002D1440 /* FontPlatformData.h in Headers */ = {isa = PBXBuildFile; fileRef = B5320D69122A24E9002D1440 /* FontPlatformData.h */; settings = {ATTRIBUTES = (Private, ); }; }; + B5320D6C122A24E9002D1440 /* FontPlatformDataCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = B5320D6A122A24E9002D1440 /* FontPlatformDataCocoa.mm */; }; B550B52511DC68A800923885 /* SQLStatementSync.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B550B52111DC68A800923885 /* SQLStatementSync.cpp */; }; B550B52611DC68A800923885 /* SQLStatementSync.h in Headers */ = {isa = PBXBuildFile; fileRef = B550B52211DC68A800923885 /* SQLStatementSync.h */; }; B55D5AA4119131FC00BCC315 /* JSSQLTransactionSyncCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = B55D5AA2119131FC00BCC315 /* JSSQLTransactionSyncCallback.h */; }; @@ -4663,7 +4687,7 @@ BC5EB8C40E82031B00B25965 /* ShadowData.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5EB8C20E82031B00B25965 /* ShadowData.h */; settings = {ATTRIBUTES = (Private, ); }; }; BC5EB9500E82056B00B25965 /* CounterDirectives.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC5EB94E0E82056B00B25965 /* CounterDirectives.cpp */; }; BC5EB9510E82056B00B25965 /* CounterDirectives.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5EB94F0E82056B00B25965 /* CounterDirectives.h */; settings = {ATTRIBUTES = (Private, ); }; }; - BC5EB9790E82069200B25965 /* CounterContent.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5EB9780E82069200B25965 /* CounterContent.h */; }; + BC5EB9790E82069200B25965 /* CounterContent.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5EB9780E82069200B25965 /* CounterContent.h */; settings = {ATTRIBUTES = (Private, ); }; }; BC5EB9800E82072500B25965 /* ContentData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC5EB97E0E82072500B25965 /* ContentData.cpp */; }; BC5EB9810E82072500B25965 /* ContentData.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5EB97F0E82072500B25965 /* ContentData.h */; settings = {ATTRIBUTES = (Private, ); }; }; BC5EBA100E823E4700B25965 /* KeyframeList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC5EBA0E0E823E4700B25965 /* KeyframeList.cpp */; }; @@ -4853,8 +4877,6 @@ BCB16C2D0979C3BD00467741 /* loader.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB16C140979C3BD00467741 /* loader.h */; settings = {ATTRIBUTES = (Private, ); }; }; BCB16C2E0979C3BD00467741 /* Request.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB16C150979C3BD00467741 /* Request.cpp */; }; BCB16C2F0979C3BD00467741 /* Request.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB16C160979C3BD00467741 /* Request.h */; }; - BCB4F8900DB28DD60039139B /* RenderImageGeneratedContent.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB4F88F0DB28DD60039139B /* RenderImageGeneratedContent.h */; }; - BCB4F8930DB28E530039139B /* RenderImageGeneratedContent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB4F8920DB28E530039139B /* RenderImageGeneratedContent.cpp */; }; BCB773610C17853D00132BA4 /* JSNodeFilterCondition.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB7735E0C17853D00132BA4 /* JSNodeFilterCondition.cpp */; }; BCB773620C17853D00132BA4 /* JSNodeFilterCondition.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB7735F0C17853D00132BA4 /* JSNodeFilterCondition.h */; }; BCB773630C17853D00132BA4 /* JSNodeFilterCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB773600C17853D00132BA4 /* JSNodeFilterCustom.cpp */; }; @@ -4908,10 +4930,6 @@ BCD9C2C10C17B69E005C90A2 /* JSNamedNodeMap.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD9C2BD0C17B69E005C90A2 /* JSNamedNodeMap.h */; }; BCD9C2C20C17B69E005C90A2 /* JSNodeList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD9C2BE0C17B69E005C90A2 /* JSNodeList.cpp */; }; BCD9C2C30C17B69E005C90A2 /* JSNodeList.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD9C2BF0C17B69E005C90A2 /* JSNodeList.h */; }; - BCDBB8AC0E088CA500C60FF6 /* FileList.h in Headers */ = {isa = PBXBuildFile; fileRef = BCDBB8AA0E088CA500C60FF6 /* FileList.h */; }; - BCDBB8AD0E088CA500C60FF6 /* FileList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCDBB8AB0E088CA500C60FF6 /* FileList.cpp */; }; - BCDBB8CD0E08958400C60FF6 /* File.h in Headers */ = {isa = PBXBuildFile; fileRef = BCDBB8CB0E08958400C60FF6 /* File.h */; }; - BCDBB8CE0E08958400C60FF6 /* File.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCDBB8CC0E08958400C60FF6 /* File.cpp */; }; BCDF317B11F8D683003C5BF8 /* UserTypingGestureIndicator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCDF317911F8D683003C5BF8 /* UserTypingGestureIndicator.cpp */; }; BCDF317C11F8D683003C5BF8 /* UserTypingGestureIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = BCDF317A11F8D683003C5BF8 /* UserTypingGestureIndicator.h */; settings = {ATTRIBUTES = (Private, ); }; }; BCDFD48E0E305290009D10AD /* XMLHttpRequestUpload.h in Headers */ = {isa = PBXBuildFile; fileRef = BCDFD48C0E305290009D10AD /* XMLHttpRequestUpload.h */; }; @@ -5910,6 +5928,8 @@ 085B05C111FAE16C004D65F6 /* SVGResourcesCycleSolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGResourcesCycleSolver.h; sourceTree = "<group>"; }; 085B92B80EFDE73D00E6123C /* FormDataBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FormDataBuilder.cpp; sourceTree = "<group>"; }; 085B92B90EFDE73D00E6123C /* FormDataBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FormDataBuilder.h; sourceTree = "<group>"; }; + 08641D4512142F7D008DE9F6 /* RenderImageResourceStyleImage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderImageResourceStyleImage.cpp; sourceTree = "<group>"; }; + 08641D4612142F7D008DE9F6 /* RenderImageResourceStyleImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderImageResourceStyleImage.h; sourceTree = "<group>"; }; 0865CCE40EDDF51B00DF9EC3 /* WMLNoopElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLNoopElement.cpp; sourceTree = "<group>"; }; 0865CCE50EDDF51B00DF9EC3 /* WMLNoopElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLNoopElement.h; sourceTree = "<group>"; }; 086A400511F6D6B7002CEC53 /* RenderSVGResourceContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGResourceContainer.cpp; sourceTree = "<group>"; }; @@ -5980,6 +6000,8 @@ 08E6A2E70EEE035200AC1206 /* WMLPostfieldElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLPostfieldElement.h; sourceTree = "<group>"; }; 08E6E0EF0EFF42BA00029FBF /* WMLFieldSetElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLFieldSetElement.cpp; sourceTree = "<group>"; }; 08E6E0F00EFF42BA00029FBF /* WMLFieldSetElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLFieldSetElement.h; sourceTree = "<group>"; }; + 08F2F0071213E61700DCEC48 /* RenderImageResource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderImageResource.cpp; sourceTree = "<group>"; }; + 08F2F0081213E61700DCEC48 /* RenderImageResource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderImageResource.h; sourceTree = "<group>"; }; 08FB84B00ECE373300DC064E /* WMLElementFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLElementFactory.cpp; sourceTree = "<group>"; }; 08FB84B10ECE373300DC064E /* WMLElementFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLElementFactory.h; sourceTree = "<group>"; }; 0A4844980CA44CB200B7BD48 /* SoftLinking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SoftLinking.h; sourceTree = "<group>"; }; @@ -6495,8 +6517,6 @@ 2E2D99E910E2BC3800496337 /* DOMBlobInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMBlobInternal.h; sourceTree = "<group>"; }; 2E3BBF051162DA1100B9409A /* UUID.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UUID.cpp; sourceTree = "<group>"; }; 2E3BBF061162DA1100B9409A /* UUID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UUID.h; sourceTree = "<group>"; }; - 2E3BC0BB117D3A4F00B9409A /* FileError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileError.h; sourceTree = "<group>"; }; - 2E3BC0BC117D3A4F00B9409A /* FileError.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FileError.idl; sourceTree = "<group>"; }; 2E3BC0C8117D3E0800B9409A /* JSFileError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFileError.cpp; sourceTree = "<group>"; }; 2E3BC0C9117D3E0800B9409A /* JSFileError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFileError.h; sourceTree = "<group>"; }; 2E3BC106117D479800B9409A /* DOMFileError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMFileError.h; sourceTree = "<group>"; }; @@ -6522,15 +6542,9 @@ 2E4346430F546A8200B0F1BA /* WorkerThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WorkerThread.h; path = workers/WorkerThread.h; sourceTree = "<group>"; }; 2E4346560F546A9900B0F1BA /* CrossThreadCopier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CrossThreadCopier.cpp; sourceTree = "<group>"; }; 2E4346570F546A9900B0F1BA /* CrossThreadCopier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CrossThreadCopier.h; sourceTree = "<group>"; }; - 2E94F3CB118B908E00B7F75D /* FileReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileReader.cpp; sourceTree = "<group>"; }; - 2E94F3CC118B908E00B7F75D /* FileReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileReader.h; sourceTree = "<group>"; }; - 2E94F427119205B300B7F75D /* FileReader.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FileReader.idl; sourceTree = "<group>"; }; 2E94F439119207DA00B7F75D /* JSFileReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFileReader.cpp; sourceTree = "<group>"; }; 2E94F43A119207DA00B7F75D /* JSFileReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFileReader.h; sourceTree = "<group>"; }; 2EA768030FE7126400AB9C8A /* WorkerScriptLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WorkerScriptLoaderClient.h; path = workers/WorkerScriptLoaderClient.h; sourceTree = "<group>"; }; - 2EAFAF0B10E2AF2D007ED3D6 /* Blob.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Blob.cpp; sourceTree = "<group>"; }; - 2EAFAF0C10E2AF2D007ED3D6 /* Blob.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Blob.h; sourceTree = "<group>"; }; - 2EAFAF0D10E2AF2D007ED3D6 /* Blob.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Blob.idl; sourceTree = "<group>"; }; 2EB4BCD0121F03E300EC4885 /* BlobResourceHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BlobResourceHandle.cpp; sourceTree = "<group>"; }; 2EB4BCD1121F03E300EC4885 /* BlobResourceHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlobResourceHandle.h; sourceTree = "<group>"; }; 2ECF7ADA10162B3800427DE7 /* JSErrorEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSErrorEvent.cpp; sourceTree = "<group>"; }; @@ -6546,10 +6560,9 @@ 2EDEF1F0121B0EFC00726DB2 /* BlobRegistryImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BlobRegistryImpl.cpp; sourceTree = "<group>"; }; 2EDEF1F1121B0EFC00726DB2 /* BlobRegistryImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlobRegistryImpl.h; sourceTree = "<group>"; }; 2EDEF1F2121B0EFC00726DB2 /* BlobStorageData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlobStorageData.h; sourceTree = "<group>"; }; - 2EED575012109ED0007656BB /* BlobURL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BlobURL.cpp; sourceTree = "<group>"; }; - 2EED575112109ED0007656BB /* BlobURL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlobURL.h; sourceTree = "<group>"; }; - 2EED57FB1214A9C2007656BB /* ThreadableBlobRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadableBlobRegistry.cpp; sourceTree = "<group>"; }; - 2EED57FC1214A9C2007656BB /* ThreadableBlobRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadableBlobRegistry.h; sourceTree = "<group>"; }; + 2EDF369A122C94B4002F7D4E /* FileReaderSync.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileReaderSync.cpp; path = fileapi/FileReaderSync.cpp; sourceTree = "<group>"; }; + 2EDF369B122C94B4002F7D4E /* FileReaderSync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileReaderSync.h; path = fileapi/FileReaderSync.h; sourceTree = "<group>"; }; + 2EDF369E122C94C8002F7D4E /* FileException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileException.h; path = fileapi/FileException.h; sourceTree = "<group>"; }; 2EF1BFE8121C9F4200C27627 /* FileStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileStream.cpp; sourceTree = "<group>"; }; 2EF1BFE9121C9F4200C27627 /* FileStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileStream.h; sourceTree = "<group>"; }; 2EF1BFF6121CB0BD00C27627 /* AsyncFileStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AsyncFileStream.h; sourceTree = "<group>"; }; @@ -6742,15 +6755,15 @@ 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>"; }; - 46A26902121B6B4300C41F3A /* FileWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileWriter.cpp; sourceTree = "<group>"; }; - 46A26903121B6B4300C41F3A /* FileWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileWriter.h; sourceTree = "<group>"; }; - 46A26904121B6B4300C41F3A /* FileWriter.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FileWriter.idl; sourceTree = "<group>"; }; 46BD16E20B279473001F0839 /* noneCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = noneCursor.png; sourceTree = "<group>"; }; 46D4F2460AF97E810035385A /* cellCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cellCursor.png; sourceTree = "<group>"; }; 46D4F2470AF97E810035385A /* contextMenuCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = contextMenuCursor.png; sourceTree = "<group>"; }; 46D4F2480AF97E810035385A /* verticalTextCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = verticalTextCursor.png; sourceTree = "<group>"; }; + 46DA844B1224A0710060D006 /* JSFileWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFileWriter.cpp; sourceTree = "<group>"; }; + 46DA844C1224A0710060D006 /* JSFileWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFileWriter.h; sourceTree = "<group>"; }; 46F9D5DA0B0D60170028EE36 /* aliasCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = aliasCursor.png; sourceTree = "<group>"; }; 46F9D5DB0B0D60170028EE36 /* noDropCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = noDropCursor.png; sourceTree = "<group>"; }; 46F9D5DC0B0D60170028EE36 /* progressCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = progressCursor.png; sourceTree = "<group>"; }; @@ -8246,82 +8259,68 @@ 85FF31580AAFBFCB00374F38 /* DOMKeyboardEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMKeyboardEvent.h; sourceTree = "<group>"; }; 85FF31590AAFBFCB00374F38 /* DOMKeyboardEvent.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMKeyboardEvent.mm; sourceTree = "<group>"; }; 86243D0011BC31F700CC006A /* JSArrayBufferViewHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSArrayBufferViewHelper.h; sourceTree = "<group>"; }; - 8947A82512222C4700D95F2D /* JSMetadata.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMetadata.cpp; sourceTree = "<group>"; }; - 8947A82612222C4700D95F2D /* JSMetadata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMetadata.h; sourceTree = "<group>"; }; - 8947A82712222C4700D95F2D /* JSMetadataCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMetadataCallback.cpp; sourceTree = "<group>"; }; - 8947A82812222C4700D95F2D /* JSMetadataCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMetadataCallback.h; sourceTree = "<group>"; }; - 8952535011641B3400CABF00 /* FileThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileThread.cpp; sourceTree = "<group>"; }; - 8952535111641B3400CABF00 /* FileThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileThread.h; sourceTree = "<group>"; }; - 895253DA116C4EF500CABF00 /* FileStreamProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileStreamProxy.cpp; sourceTree = "<group>"; }; - 895253DB116C4EF500CABF00 /* FileStreamProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileStreamProxy.h; sourceTree = "<group>"; }; - 895253DE116C4F0600CABF00 /* FileThreadTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileThreadTask.h; sourceTree = "<group>"; }; - 89686C9D122244A00076EAA4 /* DOMFilePath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMFilePath.cpp; sourceTree = "<group>"; }; - 89686C9E122244A00076EAA4 /* DOMFilePath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMFilePath.h; sourceTree = "<group>"; }; - 897A2D1911FF58A50082740C /* DOMFileSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMFileSystem.cpp; sourceTree = "<group>"; }; - 897A2D1A11FF58A50082740C /* DOMFileSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMFileSystem.h; sourceTree = "<group>"; }; - 897A2D1B11FF58A50082740C /* DOMFileSystem.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMFileSystem.idl; sourceTree = "<group>"; }; - 897A2D1C11FF58A50082740C /* Entry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Entry.cpp; sourceTree = "<group>"; }; - 897A2D1D11FF58A50082740C /* Entry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Entry.h; sourceTree = "<group>"; }; - 897A2D1E11FF58A50082740C /* EntryCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EntryCallback.h; sourceTree = "<group>"; }; - 897A2D1F11FF58A50082740C /* EntryCallback.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = EntryCallback.idl; sourceTree = "<group>"; }; - 897A2D2011FF58A50082740C /* ErrorCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ErrorCallback.h; sourceTree = "<group>"; }; - 897A2D2111FF58A50082740C /* FileSystemCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileSystemCallback.h; sourceTree = "<group>"; }; - 897A2D3B11FF63860082740C /* Entry.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Entry.idl; sourceTree = "<group>"; }; - 897A2D4911FF6C900082740C /* JSEntry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEntry.cpp; sourceTree = "<group>"; }; - 897A2D4A11FF6C900082740C /* JSEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEntry.h; sourceTree = "<group>"; }; - 897A2D4B11FF6C900082740C /* JSEntryCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEntryCallback.cpp; sourceTree = "<group>"; }; - 897A2D4C11FF6C900082740C /* JSEntryCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEntryCallback.h; sourceTree = "<group>"; }; - 897A2D4D11FF6C900082740C /* JSErrorCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSErrorCallback.cpp; sourceTree = "<group>"; }; - 897A2D4E11FF6C900082740C /* JSErrorCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSErrorCallback.h; sourceTree = "<group>"; }; - 897A2D5511FF6CA40082740C /* JSFileSystemCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFileSystemCallback.cpp; sourceTree = "<group>"; }; - 897A2D5611FF6CA40082740C /* JSFileSystemCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFileSystemCallback.h; sourceTree = "<group>"; }; - 897A2D5D120000FF0082740C /* ErrorCallback.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ErrorCallback.idl; sourceTree = "<group>"; }; - 897A2D5F120001220082740C /* FileSystemCallback.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FileSystemCallback.idl; sourceTree = "<group>"; }; - 897A2D60120001220082740C /* Flags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Flags.h; sourceTree = "<group>"; }; - 897A2D61120001220082740C /* Flags.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Flags.idl; sourceTree = "<group>"; }; - 897A2D73120001440082740C /* Metadata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Metadata.h; sourceTree = "<group>"; }; - 897A2D74120001440082740C /* Metadata.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Metadata.idl; sourceTree = "<group>"; }; - 897A2D75120001440082740C /* MetadataCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MetadataCallback.h; sourceTree = "<group>"; }; - 897A2D76120001440082740C /* MetadataCallback.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MetadataCallback.idl; sourceTree = "<group>"; }; - 897A2D8D1200035F0082740C /* JSDOMFileSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMFileSystem.cpp; sourceTree = "<group>"; }; - 897A2D8E1200035F0082740C /* JSDOMFileSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMFileSystem.h; sourceTree = "<group>"; }; - 897A2D91120003760082740C /* JSFlags.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFlags.cpp; sourceTree = "<group>"; }; - 897A2D92120003760082740C /* JSFlags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFlags.h; sourceTree = "<group>"; }; - 8988E10C11A3508B00DB732E /* BlobItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BlobItem.cpp; sourceTree = "<group>"; }; - 8988E10D11A3508B00DB732E /* BlobItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlobItem.h; sourceTree = "<group>"; }; - 899ABC201215E4A300F9F219 /* DirectoryEntry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DirectoryEntry.cpp; sourceTree = "<group>"; }; - 899ABC211215E4A300F9F219 /* DirectoryEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DirectoryEntry.h; sourceTree = "<group>"; }; - 899ABC221215E4A300F9F219 /* DirectoryEntry.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DirectoryEntry.idl; sourceTree = "<group>"; }; - 899ABC231215E4A300F9F219 /* DirectoryReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DirectoryReader.cpp; sourceTree = "<group>"; }; - 899ABC241215E4A300F9F219 /* DirectoryReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DirectoryReader.h; sourceTree = "<group>"; }; - 899ABC251215E4A300F9F219 /* DirectoryReader.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DirectoryReader.idl; sourceTree = "<group>"; }; - 899ABC2C1215E4BE00F9F219 /* EntriesCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EntriesCallback.h; sourceTree = "<group>"; }; - 899ABC2D1215E4BE00F9F219 /* EntriesCallback.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = EntriesCallback.idl; sourceTree = "<group>"; }; - 899ABC2E1215E4BE00F9F219 /* EntryArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EntryArray.cpp; sourceTree = "<group>"; }; - 899ABC2F1215E4BE00F9F219 /* EntryArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EntryArray.h; sourceTree = "<group>"; }; - 899ABC301215E4BE00F9F219 /* EntryArray.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = EntryArray.idl; sourceTree = "<group>"; }; - 899ABC311215E4BE00F9F219 /* FileEntry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileEntry.cpp; sourceTree = "<group>"; }; - 899ABC321215E4BE00F9F219 /* FileEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileEntry.h; sourceTree = "<group>"; }; - 899ABC331215E4BE00F9F219 /* FileEntry.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FileEntry.idl; sourceTree = "<group>"; }; - 899ABC551215EB2A00F9F219 /* JSDirectoryEntry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDirectoryEntry.cpp; sourceTree = "<group>"; }; - 899ABC561215EB2A00F9F219 /* JSDirectoryEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDirectoryEntry.h; sourceTree = "<group>"; }; - 899ABC571215EB2A00F9F219 /* JSEntriesCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEntriesCallback.cpp; sourceTree = "<group>"; }; - 899ABC581215EB2A00F9F219 /* JSEntriesCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEntriesCallback.h; sourceTree = "<group>"; }; - 899ABC591215EB2A00F9F219 /* JSEntryArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEntryArray.cpp; sourceTree = "<group>"; }; - 899ABC5A1215EB2A00F9F219 /* JSEntryArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEntryArray.h; sourceTree = "<group>"; }; - 899ABC5B1215EB2A00F9F219 /* JSFileEntry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFileEntry.cpp; sourceTree = "<group>"; }; - 899ABC5C1215EB2A00F9F219 /* JSFileEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFileEntry.h; sourceTree = "<group>"; }; - 899ABC6B1215ECEF00F9F219 /* JSDirectoryReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDirectoryReader.cpp; sourceTree = "<group>"; }; - 899ABC6C1215ECEF00F9F219 /* JSDirectoryReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDirectoryReader.h; 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>"; }; + 8987853C122CA064003AABDA /* DirectoryReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DirectoryReader.h; path = fileapi/DirectoryReader.h; sourceTree = "<group>"; }; + 8987853D122CA064003AABDA /* DOMFilePath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DOMFilePath.cpp; path = fileapi/DOMFilePath.cpp; sourceTree = "<group>"; }; + 8987853E122CA064003AABDA /* DOMFilePath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DOMFilePath.h; path = fileapi/DOMFilePath.h; sourceTree = "<group>"; }; + 8987853F122CA064003AABDA /* DOMFileSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DOMFileSystem.cpp; path = fileapi/DOMFileSystem.cpp; sourceTree = "<group>"; }; + 89878540122CA064003AABDA /* DOMFileSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DOMFileSystem.h; path = fileapi/DOMFileSystem.h; sourceTree = "<group>"; }; + 89878541122CA064003AABDA /* EntriesCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EntriesCallback.h; path = fileapi/EntriesCallback.h; sourceTree = "<group>"; }; + 89878542122CA064003AABDA /* Entry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Entry.cpp; path = fileapi/Entry.cpp; sourceTree = "<group>"; }; + 89878543122CA064003AABDA /* Entry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Entry.h; path = fileapi/Entry.h; sourceTree = "<group>"; }; + 89878544122CA064003AABDA /* EntryArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EntryArray.cpp; path = fileapi/EntryArray.cpp; sourceTree = "<group>"; }; + 89878545122CA064003AABDA /* EntryArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EntryArray.h; path = fileapi/EntryArray.h; sourceTree = "<group>"; }; + 89878546122CA064003AABDA /* EntryCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EntryCallback.h; path = fileapi/EntryCallback.h; sourceTree = "<group>"; }; + 89878547122CA064003AABDA /* ErrorCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ErrorCallback.h; path = fileapi/ErrorCallback.h; sourceTree = "<group>"; }; + 89878548122CA064003AABDA /* FileEntry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileEntry.cpp; path = fileapi/FileEntry.cpp; sourceTree = "<group>"; }; + 89878549122CA064003AABDA /* FileEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileEntry.h; path = fileapi/FileEntry.h; sourceTree = "<group>"; }; + 8987854A122CA064003AABDA /* FileSystemCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileSystemCallback.h; path = fileapi/FileSystemCallback.h; sourceTree = "<group>"; }; + 8987854B122CA064003AABDA /* FileSystemCallbacks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileSystemCallbacks.cpp; path = fileapi/FileSystemCallbacks.cpp; sourceTree = "<group>"; }; + 8987854C122CA064003AABDA /* FileSystemCallbacks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileSystemCallbacks.h; path = fileapi/FileSystemCallbacks.h; sourceTree = "<group>"; }; + 8987854D122CA064003AABDA /* Flags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Flags.h; path = fileapi/Flags.h; sourceTree = "<group>"; }; + 8987854E122CA064003AABDA /* LocalFileSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LocalFileSystem.cpp; path = fileapi/LocalFileSystem.cpp; sourceTree = "<group>"; }; + 8987854F122CA064003AABDA /* LocalFileSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LocalFileSystem.h; path = fileapi/LocalFileSystem.h; sourceTree = "<group>"; }; + 89878550122CA064003AABDA /* Metadata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Metadata.h; path = fileapi/Metadata.h; sourceTree = "<group>"; }; + 89878551122CA064003AABDA /* MetadataCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MetadataCallback.h; path = fileapi/MetadataCallback.h; sourceTree = "<group>"; }; + 89878586122CA26A003AABDA /* JSDirectoryEntry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDirectoryEntry.cpp; sourceTree = "<group>"; }; + 89878587122CA26A003AABDA /* JSDirectoryEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDirectoryEntry.h; sourceTree = "<group>"; }; + 89878588122CA26A003AABDA /* JSDirectoryReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDirectoryReader.cpp; sourceTree = "<group>"; }; + 89878589122CA26A003AABDA /* JSDirectoryReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDirectoryReader.h; sourceTree = "<group>"; }; + 8987858E122CA2A7003AABDA /* JSDOMFileSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMFileSystem.cpp; sourceTree = "<group>"; }; + 8987858F122CA2A7003AABDA /* JSDOMFileSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMFileSystem.h; sourceTree = "<group>"; }; + 89878590122CA2A7003AABDA /* JSEntriesCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEntriesCallback.cpp; sourceTree = "<group>"; }; + 89878591122CA2A7003AABDA /* JSEntriesCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEntriesCallback.h; sourceTree = "<group>"; }; + 89878592122CA2A7003AABDA /* JSEntry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEntry.cpp; sourceTree = "<group>"; }; + 89878593122CA2A7003AABDA /* JSEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEntry.h; sourceTree = "<group>"; }; + 89878594122CA2A7003AABDA /* JSEntryArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEntryArray.cpp; sourceTree = "<group>"; }; + 89878595122CA2A7003AABDA /* JSEntryArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEntryArray.h; sourceTree = "<group>"; }; + 89878596122CA2A7003AABDA /* JSEntryCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEntryCallback.cpp; sourceTree = "<group>"; }; + 89878597122CA2A7003AABDA /* JSEntryCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEntryCallback.h; sourceTree = "<group>"; }; + 89878598122CA2A7003AABDA /* JSErrorCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSErrorCallback.cpp; sourceTree = "<group>"; }; + 89878599122CA2A7003AABDA /* JSErrorCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSErrorCallback.h; sourceTree = "<group>"; }; + 8987859A122CA2A7003AABDA /* JSFileEntry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFileEntry.cpp; sourceTree = "<group>"; }; + 8987859B122CA2A7003AABDA /* JSFileEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFileEntry.h; sourceTree = "<group>"; }; + 8987859C122CA2A7003AABDA /* JSFileSystemCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFileSystemCallback.cpp; sourceTree = "<group>"; }; + 8987859D122CA2A7003AABDA /* JSFileSystemCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFileSystemCallback.h; sourceTree = "<group>"; }; + 8987859E122CA2A7003AABDA /* JSFlags.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFlags.cpp; sourceTree = "<group>"; }; + 8987859F122CA2A7003AABDA /* JSFlags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFlags.h; sourceTree = "<group>"; }; + 898785A0122CA2A7003AABDA /* JSMetadata.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMetadata.cpp; sourceTree = "<group>"; }; + 898785A1122CA2A7003AABDA /* JSMetadata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMetadata.h; sourceTree = "<group>"; }; + 898785A2122CA2A7003AABDA /* JSMetadataCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMetadataCallback.cpp; sourceTree = "<group>"; }; + 898785A3122CA2A7003AABDA /* JSMetadataCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMetadataCallback.h; sourceTree = "<group>"; }; + 898785EE122E1E87003AABDA /* JSFileException.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFileException.cpp; sourceTree = "<group>"; }; + 898785EF122E1E87003AABDA /* JSFileException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFileException.h; sourceTree = "<group>"; }; + 898785F2122E1EAC003AABDA /* JSFileReaderSync.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFileReaderSync.cpp; sourceTree = "<group>"; }; + 898785F3122E1EAC003AABDA /* JSFileReaderSync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFileReaderSync.h; sourceTree = "<group>"; }; 89B5EA9F11E8003D00F2367E /* LineEnding.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LineEnding.cpp; sourceTree = "<group>"; }; 89B5EAA011E8003D00F2367E /* LineEnding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineEnding.h; sourceTree = "<group>"; }; - 89BED5E911BE11CE00448492 /* BlobBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BlobBuilder.cpp; sourceTree = "<group>"; }; - 89BED5EA11BE11CE00448492 /* BlobBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlobBuilder.h; sourceTree = "<group>"; }; - 89C0DD78121F0C69009E17CA /* FileSystemCallbacks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileSystemCallbacks.cpp; sourceTree = "<group>"; }; - 89C0DD79121F0C69009E17CA /* FileSystemCallbacks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileSystemCallbacks.h; sourceTree = "<group>"; }; - 89CD027911C859A80070B791 /* BlobBuilder.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = BlobBuilder.idl; sourceTree = "<group>"; }; 89CD029111C85B870070B791 /* JSBlobBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSBlobBuilder.cpp; sourceTree = "<group>"; }; 89CD029211C85B870070B791 /* JSBlobBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBlobBuilder.h; sourceTree = "<group>"; }; + 89D08D9C12228451001241DF /* AsyncFileSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AsyncFileSystem.cpp; sourceTree = "<group>"; }; + 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>"; }; 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>"; }; @@ -8591,38 +8590,76 @@ 97059974107D975200A50A7C /* PolicyCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolicyCallback.h; sourceTree = "<group>"; }; 97059975107D975200A50A7C /* PolicyChecker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolicyChecker.cpp; sourceTree = "<group>"; }; 97059976107D975200A50A7C /* PolicyChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolicyChecker.h; sourceTree = "<group>"; }; - 970C4FDF1211266200C3D393 /* HTMLEntitySearch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLEntitySearch.cpp; sourceTree = "<group>"; }; - 970C4FE01211266200C3D393 /* HTMLEntitySearch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLEntitySearch.h; sourceTree = "<group>"; }; - 970C4FE11211266200C3D393 /* HTMLEntityTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLEntityTable.cpp; sourceTree = "<group>"; }; - 970C4FE21211266200C3D393 /* HTMLEntityTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLEntityTable.h; sourceTree = "<group>"; }; 9719AEFF11D09F2C00D45831 /* HTMLInputStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLInputStream.h; sourceTree = "<group>"; }; 9738899E116EA9DC00ADF313 /* DocumentWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentWriter.cpp; sourceTree = "<group>"; }; 9738899F116EA9DC00ADF313 /* DocumentWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentWriter.h; sourceTree = "<group>"; }; 973E325410883B7C005BC493 /* ResourceLoadNotifier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceLoadNotifier.cpp; sourceTree = "<group>"; }; 973E325510883B7C005BC493 /* ResourceLoadNotifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoadNotifier.h; sourceTree = "<group>"; }; - 976E2BA511CAE4DE006C56A0 /* CSSPreloadScanner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSPreloadScanner.cpp; sourceTree = "<group>"; }; - 976E2BA611CAE4DE006C56A0 /* CSSPreloadScanner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSPreloadScanner.h; sourceTree = "<group>"; }; - 976E895E11C0CA3A00EA9CA9 /* HTMLEntityParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLEntityParser.cpp; sourceTree = "<group>"; }; - 976E895F11C0CA3A00EA9CA9 /* HTMLEntityParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLEntityParser.h; sourceTree = "<group>"; }; - 978B6FC712128821001595EF /* HTMLViewSourceParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLViewSourceParser.cpp; sourceTree = "<group>"; }; - 978B6FC812128821001595EF /* HTMLViewSourceParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLViewSourceParser.h; sourceTree = "<group>"; }; + 976D6C58122B8A3D001FD1F7 /* AsyncFileWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AsyncFileWriter.h; path = fileapi/AsyncFileWriter.h; sourceTree = "<group>"; }; + 976D6C59122B8A3D001FD1F7 /* Blob.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Blob.cpp; path = fileapi/Blob.cpp; sourceTree = "<group>"; }; + 976D6C5A122B8A3D001FD1F7 /* Blob.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Blob.h; path = fileapi/Blob.h; sourceTree = "<group>"; }; + 976D6C5C122B8A3D001FD1F7 /* BlobBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BlobBuilder.cpp; path = fileapi/BlobBuilder.cpp; sourceTree = "<group>"; }; + 976D6C5D122B8A3D001FD1F7 /* BlobBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BlobBuilder.h; path = fileapi/BlobBuilder.h; sourceTree = "<group>"; }; + 976D6C5F122B8A3D001FD1F7 /* BlobURL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BlobURL.cpp; path = fileapi/BlobURL.cpp; sourceTree = "<group>"; }; + 976D6C60122B8A3D001FD1F7 /* BlobURL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BlobURL.h; path = fileapi/BlobURL.h; sourceTree = "<group>"; }; + 976D6C61122B8A3D001FD1F7 /* File.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = File.cpp; path = fileapi/File.cpp; sourceTree = "<group>"; }; + 976D6C62122B8A3D001FD1F7 /* File.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = File.h; path = fileapi/File.h; sourceTree = "<group>"; }; + 976D6C64122B8A3D001FD1F7 /* FileError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileError.h; path = fileapi/FileError.h; sourceTree = "<group>"; }; + 976D6C66122B8A3D001FD1F7 /* FileList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileList.cpp; path = fileapi/FileList.cpp; sourceTree = "<group>"; }; + 976D6C67122B8A3D001FD1F7 /* FileList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileList.h; path = fileapi/FileList.h; sourceTree = "<group>"; }; + 976D6C69122B8A3D001FD1F7 /* FileReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileReader.cpp; path = fileapi/FileReader.cpp; sourceTree = "<group>"; }; + 976D6C6A122B8A3D001FD1F7 /* FileReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileReader.h; path = fileapi/FileReader.h; sourceTree = "<group>"; }; + 976D6C6C122B8A3D001FD1F7 /* FileStreamProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileStreamProxy.cpp; path = fileapi/FileStreamProxy.cpp; sourceTree = "<group>"; }; + 976D6C6D122B8A3D001FD1F7 /* FileStreamProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileStreamProxy.h; path = fileapi/FileStreamProxy.h; sourceTree = "<group>"; }; + 976D6C6E122B8A3D001FD1F7 /* FileThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileThread.cpp; path = fileapi/FileThread.cpp; sourceTree = "<group>"; }; + 976D6C6F122B8A3D001FD1F7 /* FileThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileThread.h; path = fileapi/FileThread.h; sourceTree = "<group>"; }; + 976D6C70122B8A3D001FD1F7 /* FileThreadTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileThreadTask.h; path = fileapi/FileThreadTask.h; sourceTree = "<group>"; }; + 976D6C71122B8A3D001FD1F7 /* FileWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileWriter.cpp; path = fileapi/FileWriter.cpp; sourceTree = "<group>"; }; + 976D6C72122B8A3D001FD1F7 /* FileWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileWriter.h; path = fileapi/FileWriter.h; sourceTree = "<group>"; }; + 976D6C74122B8A3D001FD1F7 /* FileWriterClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileWriterClient.h; path = fileapi/FileWriterClient.h; sourceTree = "<group>"; }; + 976D6C75122B8A3D001FD1F7 /* ThreadableBlobRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadableBlobRegistry.cpp; path = fileapi/ThreadableBlobRegistry.cpp; sourceTree = "<group>"; }; + 976D6C76122B8A3D001FD1F7 /* ThreadableBlobRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadableBlobRegistry.h; path = fileapi/ThreadableBlobRegistry.h; sourceTree = "<group>"; }; + 977B371F1228721700B81FF8 /* HTMLElementStack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HTMLElementStack.cpp; path = parser/HTMLElementStack.cpp; sourceTree = "<group>"; }; + 977B37201228721700B81FF8 /* HTMLElementStack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLElementStack.h; path = parser/HTMLElementStack.h; sourceTree = "<group>"; }; + 977B37211228721700B81FF8 /* HTMLTreeBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HTMLTreeBuilder.cpp; path = parser/HTMLTreeBuilder.cpp; sourceTree = "<group>"; }; + 977B37221228721700B81FF8 /* HTMLTreeBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLTreeBuilder.h; path = parser/HTMLTreeBuilder.h; sourceTree = "<group>"; }; + 977B3849122883E900B81FF8 /* CSSPreloadScanner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CSSPreloadScanner.cpp; path = parser/CSSPreloadScanner.cpp; sourceTree = "<group>"; }; + 977B384A122883E900B81FF8 /* CSSPreloadScanner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSPreloadScanner.h; path = parser/CSSPreloadScanner.h; sourceTree = "<group>"; }; + 977B384B122883E900B81FF8 /* HTMLConstructionSite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HTMLConstructionSite.cpp; path = parser/HTMLConstructionSite.cpp; sourceTree = "<group>"; }; + 977B384C122883E900B81FF8 /* HTMLConstructionSite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLConstructionSite.h; path = parser/HTMLConstructionSite.h; sourceTree = "<group>"; }; + 977B384D122883E900B81FF8 /* HTMLDocumentParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HTMLDocumentParser.cpp; path = parser/HTMLDocumentParser.cpp; sourceTree = "<group>"; }; + 977B384E122883E900B81FF8 /* HTMLDocumentParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLDocumentParser.h; path = parser/HTMLDocumentParser.h; sourceTree = "<group>"; }; + 977B384F122883E900B81FF8 /* HTMLEntityNames.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = HTMLEntityNames.in; path = parser/HTMLEntityNames.in; sourceTree = "<group>"; }; + 977B3850122883E900B81FF8 /* HTMLEntityParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HTMLEntityParser.cpp; path = parser/HTMLEntityParser.cpp; sourceTree = "<group>"; }; + 977B3851122883E900B81FF8 /* HTMLEntityParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLEntityParser.h; path = parser/HTMLEntityParser.h; sourceTree = "<group>"; }; + 977B3852122883E900B81FF8 /* HTMLEntitySearch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HTMLEntitySearch.cpp; path = parser/HTMLEntitySearch.cpp; sourceTree = "<group>"; }; + 977B3853122883E900B81FF8 /* HTMLEntitySearch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLEntitySearch.h; path = parser/HTMLEntitySearch.h; sourceTree = "<group>"; }; + 977B3854122883E900B81FF8 /* HTMLEntityTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLEntityTable.h; path = parser/HTMLEntityTable.h; sourceTree = "<group>"; }; + 977B3855122883E900B81FF8 /* HTMLFormattingElementList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HTMLFormattingElementList.cpp; path = parser/HTMLFormattingElementList.cpp; sourceTree = "<group>"; }; + 977B3856122883E900B81FF8 /* HTMLFormattingElementList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLFormattingElementList.h; path = parser/HTMLFormattingElementList.h; sourceTree = "<group>"; }; + 977B3857122883E900B81FF8 /* HTMLParserScheduler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HTMLParserScheduler.cpp; path = parser/HTMLParserScheduler.cpp; sourceTree = "<group>"; }; + 977B3858122883E900B81FF8 /* HTMLParserScheduler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLParserScheduler.h; path = parser/HTMLParserScheduler.h; sourceTree = "<group>"; }; + 977B3859122883E900B81FF8 /* HTMLPreloadScanner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HTMLPreloadScanner.cpp; path = parser/HTMLPreloadScanner.cpp; sourceTree = "<group>"; }; + 977B385A122883E900B81FF8 /* HTMLPreloadScanner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLPreloadScanner.h; path = parser/HTMLPreloadScanner.h; sourceTree = "<group>"; }; + 977B385B122883E900B81FF8 /* HTMLScriptRunner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HTMLScriptRunner.cpp; path = parser/HTMLScriptRunner.cpp; sourceTree = "<group>"; }; + 977B385C122883E900B81FF8 /* HTMLScriptRunner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLScriptRunner.h; path = parser/HTMLScriptRunner.h; sourceTree = "<group>"; }; + 977B385D122883E900B81FF8 /* HTMLScriptRunnerHost.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLScriptRunnerHost.h; path = parser/HTMLScriptRunnerHost.h; sourceTree = "<group>"; }; + 977B385E122883E900B81FF8 /* HTMLTokenizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HTMLTokenizer.cpp; path = parser/HTMLTokenizer.cpp; sourceTree = "<group>"; }; + 977B385F122883E900B81FF8 /* HTMLTokenizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLTokenizer.h; path = parser/HTMLTokenizer.h; sourceTree = "<group>"; }; + 977B3860122883E900B81FF8 /* HTMLViewSourceParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HTMLViewSourceParser.cpp; path = parser/HTMLViewSourceParser.cpp; sourceTree = "<group>"; }; + 977B3861122883E900B81FF8 /* HTMLViewSourceParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLViewSourceParser.h; path = parser/HTMLViewSourceParser.h; sourceTree = "<group>"; }; 979F43D11075E44A0000F83B /* RedirectScheduler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RedirectScheduler.cpp; sourceTree = "<group>"; }; 979F43D21075E44A0000F83B /* RedirectScheduler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RedirectScheduler.h; sourceTree = "<group>"; }; 97C0784F1165D5BE003A32EF /* SuffixTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SuffixTree.h; sourceTree = "<group>"; }; + 97C1F552122855CB00EDE616 /* HTMLToken.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLToken.h; path = parser/HTMLToken.h; sourceTree = "<group>"; }; 97DCE1FF10807C750057D394 /* HistoryController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HistoryController.cpp; sourceTree = "<group>"; }; 97DCE20010807C750057D394 /* HistoryController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HistoryController.h; sourceTree = "<group>"; }; 97DD4D840FDF4D6D00ECF9A4 /* XSSAuditor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XSSAuditor.cpp; sourceTree = "<group>"; }; 97DD4D850FDF4D6E00ECF9A4 /* XSSAuditor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XSSAuditor.h; sourceTree = "<group>"; }; - 97E7936311C6030900E649BC /* HTMLPreloadScanner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLPreloadScanner.cpp; sourceTree = "<group>"; }; - 97E7936411C6030900E649BC /* HTMLPreloadScanner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLPreloadScanner.h; sourceTree = "<group>"; }; - 97E8B35411A23CE200169409 /* HTMLTokenizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLTokenizer.cpp; sourceTree = "<group>"; }; - 97E8B35511A23CE200169409 /* HTMLTokenizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLTokenizer.h; sourceTree = "<group>"; }; - 97E8B3C211A2890800169409 /* HTMLToken.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLToken.h; sourceTree = "<group>"; }; - 97EF560E11E40783007E026F /* HTMLConstructionSite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLConstructionSite.cpp; sourceTree = "<group>"; }; - 97EF560F11E40783007E026F /* HTMLConstructionSite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLConstructionSite.h; sourceTree = "<group>"; }; 97EF7DFD107E55B700D7C49C /* ScriptControllerBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptControllerBase.cpp; sourceTree = "<group>"; }; 9F0D6B2C121BFEBA006C0288 /* InspectorProfilerAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorProfilerAgent.cpp; sourceTree = "<group>"; }; 9F0D6B2D121BFEBA006C0288 /* InspectorProfilerAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorProfilerAgent.h; sourceTree = "<group>"; }; + 9F3B947D12241758005304E7 /* ScriptHeapSnapshot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptHeapSnapshot.h; sourceTree = "<group>"; }; 9F6FC1941122E82A00E80196 /* ScriptDebugServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptDebugServer.cpp; sourceTree = "<group>"; }; 9F6FC1951122E82A00E80196 /* ScriptDebugServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptDebugServer.h; sourceTree = "<group>"; }; 9F72304C11184B4100AD0126 /* ScriptProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptProfile.h; sourceTree = "<group>"; }; @@ -8862,8 +8899,6 @@ A833C7F60A2CF1D800D57664 /* xmlattrs.in */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = xmlattrs.in; sourceTree = "<group>"; }; A833C80A0A2CF25600D57664 /* XMLNames.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = XMLNames.cpp; sourceTree = "<group>"; }; A833C80B0A2CF25600D57664 /* XMLNames.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = XMLNames.h; sourceTree = "<group>"; }; - A83B3AEE11ADEFF500458809 /* HTMLScriptRunner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLScriptRunner.cpp; sourceTree = "<group>"; }; - A83B3AEF11ADEFF500458809 /* HTMLScriptRunner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLScriptRunner.h; sourceTree = "<group>"; }; A83B78F20CCAFF15000B0825 /* JSSVGFontFaceUriElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSVGFontFaceUriElement.h; sourceTree = "<group>"; }; A83B78F30CCAFF15000B0825 /* JSSVGFontFaceUriElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGFontFaceUriElement.cpp; sourceTree = "<group>"; }; A83B78F40CCAFF15000B0825 /* JSSVGFontFaceSrcElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSVGFontFaceSrcElement.h; sourceTree = "<group>"; }; @@ -8904,8 +8939,6 @@ A86629CC09DA2B47009633A5 /* JSMouseEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSMouseEvent.cpp; sourceTree = "<group>"; }; A86629CD09DA2B47009633A5 /* JSKeyboardEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSKeyboardEvent.h; sourceTree = "<group>"; }; A86629CE09DA2B47009633A5 /* JSKeyboardEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSKeyboardEvent.cpp; sourceTree = "<group>"; }; - A871038811A2947000DBD50E /* HTMLDocumentParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLDocumentParser.cpp; sourceTree = "<group>"; }; - A871038911A2947000DBD50E /* HTMLDocumentParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLDocumentParser.h; sourceTree = "<group>"; }; A871D44C0A127CBC00B12A68 /* HTMLPlugInElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HTMLPlugInElement.h; sourceTree = "<group>"; }; A871D44D0A127CBC00B12A68 /* HTMLPlugInElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLPlugInElement.cpp; sourceTree = "<group>"; }; A871D44E0A127CBC00B12A68 /* HTMLParamElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HTMLParamElement.h; sourceTree = "<group>"; }; @@ -8964,9 +8997,6 @@ A871DFDF0A15376B00B12A68 /* RenderReplaced.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderReplaced.h; sourceTree = "<group>"; }; A871DFE00A15376B00B12A68 /* RenderWidget.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderWidget.h; sourceTree = "<group>"; }; A871DFE10A15376B00B12A68 /* RenderWidget.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderWidget.cpp; sourceTree = "<group>"; }; - A879C62311A9D1F70059237A /* HTMLTreeBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLTreeBuilder.cpp; sourceTree = "<group>"; }; - A879C62411A9D1F70059237A /* HTMLTreeBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLTreeBuilder.h; sourceTree = "<group>"; }; - A87F163411AE841300CBB2E5 /* HTMLScriptRunnerHost.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLScriptRunnerHost.h; sourceTree = "<group>"; }; A883DF250F3D045D00F19BF6 /* VisibleSelection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VisibleSelection.cpp; sourceTree = "<group>"; }; A883DF260F3D045D00F19BF6 /* VisibleSelection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VisibleSelection.h; sourceTree = "<group>"; }; A88DD4860B4629A300C02990 /* PathTraversalState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PathTraversalState.h; sourceTree = "<group>"; }; @@ -8976,10 +9006,6 @@ A89943270B42338700D7C802 /* BitmapImage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BitmapImage.cpp; sourceTree = "<group>"; }; A89CCC500F44E98100B5DA10 /* ReplaceNodeWithSpanCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReplaceNodeWithSpanCommand.cpp; sourceTree = "<group>"; }; A89CCC510F44E98100B5DA10 /* ReplaceNodeWithSpanCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReplaceNodeWithSpanCommand.h; sourceTree = "<group>"; }; - A8A563B211DB3D10003AC2F0 /* HTMLElementStack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLElementStack.h; sourceTree = "<group>"; }; - A8A563B311DB3D10003AC2F0 /* HTMLElementStack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLElementStack.cpp; sourceTree = "<group>"; }; - A8A564A311DC0E59003AC2F0 /* HTMLFormattingElementList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLFormattingElementList.h; sourceTree = "<group>"; }; - A8A564A411DC0E59003AC2F0 /* HTMLFormattingElementList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLFormattingElementList.cpp; sourceTree = "<group>"; }; A8A909AA0CBCD6B50029B807 /* RenderSVGTransformableContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGTransformableContainer.h; sourceTree = "<group>"; }; A8A909AB0CBCD6B50029B807 /* RenderSVGTransformableContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGTransformableContainer.cpp; sourceTree = "<group>"; }; A8BC04911214F69600B5F122 /* HTMLEntityTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLEntityTable.cpp; sourceTree = "<group>"; }; @@ -9210,8 +9236,6 @@ A8E544BF0CA9D1C20097D09B /* DOMSVGAnimatedAngleInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMSVGAnimatedAngleInternal.h; sourceTree = "<group>"; }; A8E544C10CA9D1C20097D09B /* DOMSVGTextElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMSVGTextElement.h; sourceTree = "<group>"; }; A8E544C30CA9D1C20097D09B /* DOMSVGDescElementInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMSVGDescElementInternal.h; sourceTree = "<group>"; }; - A8E6A77F11D1661B00311F4A /* HTMLParserScheduler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLParserScheduler.h; sourceTree = "<group>"; }; - A8E6A78011D1661B00311F4A /* HTMLParserScheduler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLParserScheduler.cpp; sourceTree = "<group>"; }; A8EA73AF0A1900E300A8EF5F /* RenderFieldset.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderFieldset.cpp; sourceTree = "<group>"; }; A8EA73B00A1900E300A8EF5F /* RenderFieldset.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderFieldset.h; sourceTree = "<group>"; }; A8EA79E50A1916DF00A8EF5F /* HTMLOListElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HTMLOListElement.h; sourceTree = "<group>"; }; @@ -9873,8 +9897,6 @@ B2AFFC760D00A5C10030074D /* FontCustomPlatformData.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FontCustomPlatformData.h; sourceTree = "<group>"; }; B2AFFC770D00A5C10030074D /* SimpleFontDataMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = SimpleFontDataMac.mm; sourceTree = "<group>"; }; B2AFFC780D00A5C10030074D /* FontMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = FontMac.mm; sourceTree = "<group>"; }; - B2AFFC790D00A5C10030074D /* FontPlatformData.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FontPlatformData.h; sourceTree = "<group>"; }; - B2AFFC7A0D00A5C10030074D /* FontPlatformDataMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = FontPlatformDataMac.mm; sourceTree = "<group>"; }; B2AFFC7B0D00A5C10030074D /* GlyphPageTreeNodeMac.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = GlyphPageTreeNodeMac.cpp; sourceTree = "<group>"; }; B2AFFC850D00A5DF0030074D /* character-sets.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = "character-sets.txt"; sourceTree = "<group>"; }; B2AFFC860D00A5DF0030074D /* mac-encodings.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = "mac-encodings.txt"; sourceTree = "<group>"; }; @@ -10199,6 +10221,8 @@ B523CF041182675400EBB29C /* DatabaseSync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseSync.h; sourceTree = "<group>"; }; B525A96311CA2340003A23A8 /* JSSQLException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSQLException.h; sourceTree = "<group>"; }; B525A96411CA2340003A23A8 /* JSSQLException.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSQLException.cpp; sourceTree = "<group>"; }; + B5320D69122A24E9002D1440 /* FontPlatformData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontPlatformData.h; sourceTree = "<group>"; }; + B5320D6A122A24E9002D1440 /* FontPlatformDataCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FontPlatformDataCocoa.mm; sourceTree = "<group>"; }; B550B52111DC68A800923885 /* SQLStatementSync.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SQLStatementSync.cpp; sourceTree = "<group>"; }; B550B52211DC68A800923885 /* SQLStatementSync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQLStatementSync.h; sourceTree = "<group>"; }; B55D5AA2119131FC00BCC315 /* JSSQLTransactionSyncCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSQLTransactionSyncCallback.h; sourceTree = "<group>"; }; @@ -10292,8 +10316,6 @@ BC1402880E83680800319717 /* ScrollbarThemeComposite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollbarThemeComposite.cpp; sourceTree = "<group>"; }; BC1402890E83680800319717 /* ScrollbarThemeComposite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollbarThemeComposite.h; sourceTree = "<group>"; }; BC17F9650B64EBB8004A65CB /* JSHTMLSelectElementCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLSelectElementCustom.cpp; sourceTree = "<group>"; }; - BC1881D90E08C4ED00048C13 /* File.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = File.idl; sourceTree = "<group>"; }; - BC1881DC0E08C54300048C13 /* FileList.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FileList.idl; sourceTree = "<group>"; }; BC1A3797097C715F0019F3D8 /* DOM.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOM.h; sourceTree = "<group>"; }; BC1A3798097C715F0019F3D8 /* DOM.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOM.mm; sourceTree = "<group>"; }; BC1A3799097C715F0019F3D8 /* DOMCore.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMCore.h; sourceTree = "<group>"; }; @@ -10653,8 +10675,6 @@ BCB16C140979C3BD00467741 /* loader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = loader.h; sourceTree = "<group>"; }; BCB16C150979C3BD00467741 /* Request.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Request.cpp; sourceTree = "<group>"; }; BCB16C160979C3BD00467741 /* Request.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Request.h; sourceTree = "<group>"; }; - BCB4F88F0DB28DD60039139B /* RenderImageGeneratedContent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderImageGeneratedContent.h; sourceTree = "<group>"; }; - BCB4F8920DB28E530039139B /* RenderImageGeneratedContent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderImageGeneratedContent.cpp; sourceTree = "<group>"; }; BCB7735E0C17853D00132BA4 /* JSNodeFilterCondition.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSNodeFilterCondition.cpp; sourceTree = "<group>"; }; BCB7735F0C17853D00132BA4 /* JSNodeFilterCondition.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSNodeFilterCondition.h; sourceTree = "<group>"; }; BCB773600C17853D00132BA4 /* JSNodeFilterCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSNodeFilterCustom.cpp; sourceTree = "<group>"; }; @@ -10710,10 +10730,6 @@ BCD9C2BD0C17B69E005C90A2 /* JSNamedNodeMap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSNamedNodeMap.h; sourceTree = "<group>"; }; BCD9C2BE0C17B69E005C90A2 /* JSNodeList.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSNodeList.cpp; sourceTree = "<group>"; }; BCD9C2BF0C17B69E005C90A2 /* JSNodeList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSNodeList.h; sourceTree = "<group>"; }; - BCDBB8AA0E088CA500C60FF6 /* FileList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileList.h; sourceTree = "<group>"; }; - BCDBB8AB0E088CA500C60FF6 /* FileList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileList.cpp; sourceTree = "<group>"; }; - BCDBB8CB0E08958400C60FF6 /* File.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = File.h; sourceTree = "<group>"; }; - BCDBB8CC0E08958400C60FF6 /* File.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = File.cpp; sourceTree = "<group>"; }; BCDF317911F8D683003C5BF8 /* UserTypingGestureIndicator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserTypingGestureIndicator.cpp; sourceTree = "<group>"; }; BCDF317A11F8D683003C5BF8 /* UserTypingGestureIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserTypingGestureIndicator.h; sourceTree = "<group>"; }; BCDFD48C0E305290009D10AD /* XMLHttpRequestUpload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLHttpRequestUpload.h; sourceTree = "<group>"; }; @@ -10934,6 +10950,7 @@ C5EBDD81105EDDEC0056816F /* StorageEventDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageEventDispatcher.h; sourceTree = "<group>"; }; C6D74AD309AA282E000B0A52 /* ModifySelectionListLevel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModifySelectionListLevel.h; sourceTree = "<group>"; }; C6D74AE309AA290A000B0A52 /* ModifySelectionListLevel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ModifySelectionListLevel.cpp; sourceTree = "<group>"; }; + CD4E0AFA11F7BC27009D3811 /* fullscreen.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = fullscreen.css; sourceTree = "<group>"; }; 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>"; }; @@ -11305,6 +11322,7 @@ F523D18402DE42E8018635CA /* css */, F523D32402DE4478018635CA /* dom */, 93309D86099E64910056E581 /* editing */, + 976D6C57122B8A18001FD1F7 /* fileapi */, 51741D080B07257000ED442C /* history */, 93EEC1EC09C2877700C515D1 /* html */, 1C81B94D0E9732D900266E07 /* inspector */, @@ -11399,6 +11417,7 @@ A83B79100CCB001B000B0825 /* Core */, A83B790E0CCAFF97000B0825 /* CSS */, A83B79120CCB003F000B0825 /* Events */, + 89878576122CA1DA003AABDA /* FileAPI */, A83B79080CCAFF2B000B0825 /* HTML */, 1C5FAECA0DCFD8C900D58F78 /* Inspector */, 33503C9C10179A9A003B47E1 /* Notifications */, @@ -11592,38 +11611,6 @@ 1AD51A130CB59CD300953D11 /* DatabaseTracker.cpp */, 1AD51A120CB59CD300953D11 /* DatabaseTracker.h */, 51FAFE330CECBF2D00BB3F24 /* DatabaseTrackerClient.h */, - 899ABC201215E4A300F9F219 /* DirectoryEntry.cpp */, - 899ABC211215E4A300F9F219 /* DirectoryEntry.h */, - 899ABC221215E4A300F9F219 /* DirectoryEntry.idl */, - 899ABC231215E4A300F9F219 /* DirectoryReader.cpp */, - 899ABC241215E4A300F9F219 /* DirectoryReader.h */, - 899ABC251215E4A300F9F219 /* DirectoryReader.idl */, - 89686C9D122244A00076EAA4 /* DOMFilePath.cpp */, - 89686C9E122244A00076EAA4 /* DOMFilePath.h */, - 897A2D1911FF58A50082740C /* DOMFileSystem.cpp */, - 897A2D1A11FF58A50082740C /* DOMFileSystem.h */, - 897A2D1B11FF58A50082740C /* DOMFileSystem.idl */, - 899ABC2C1215E4BE00F9F219 /* EntriesCallback.h */, - 899ABC2D1215E4BE00F9F219 /* EntriesCallback.idl */, - 897A2D1C11FF58A50082740C /* Entry.cpp */, - 897A2D1D11FF58A50082740C /* Entry.h */, - 897A2D3B11FF63860082740C /* Entry.idl */, - 899ABC2E1215E4BE00F9F219 /* EntryArray.cpp */, - 899ABC2F1215E4BE00F9F219 /* EntryArray.h */, - 899ABC301215E4BE00F9F219 /* EntryArray.idl */, - 897A2D1E11FF58A50082740C /* EntryCallback.h */, - 897A2D1F11FF58A50082740C /* EntryCallback.idl */, - 897A2D2011FF58A50082740C /* ErrorCallback.h */, - 897A2D5D120000FF0082740C /* ErrorCallback.idl */, - 899ABC311215E4BE00F9F219 /* FileEntry.cpp */, - 899ABC321215E4BE00F9F219 /* FileEntry.h */, - 899ABC331215E4BE00F9F219 /* FileEntry.idl */, - 897A2D2111FF58A50082740C /* FileSystemCallback.h */, - 897A2D5F120001220082740C /* FileSystemCallback.idl */, - 89C0DD78121F0C69009E17CA /* FileSystemCallbacks.cpp */, - 89C0DD79121F0C69009E17CA /* FileSystemCallbacks.h */, - 897A2D60120001220082740C /* Flags.h */, - 897A2D61120001220082740C /* Flags.idl */, C585A69811D4FB3D004C3E4B /* IDBAny.cpp */, C585A69911D4FB3D004C3E4B /* IDBAny.h */, C585A69A11D4FB3D004C3E4B /* IDBAny.idl */, @@ -11690,10 +11677,6 @@ 511F23140DC160DA004F0032 /* LocalStorageTask.h */, 511F23150DC160DA004F0032 /* LocalStorageThread.cpp */, 511F23160DC160DA004F0032 /* LocalStorageThread.h */, - 897A2D73120001440082740C /* Metadata.h */, - 897A2D74120001440082740C /* Metadata.idl */, - 897A2D75120001440082740C /* MetadataCallback.h */, - 897A2D76120001440082740C /* MetadataCallback.idl */, 51A926780D53F0570063ECC2 /* OriginQuotaManager.cpp */, 51A926790D53F0570063ECC2 /* OriginQuotaManager.h */, 51A9267A0D53F0570063ECC2 /* OriginUsageRecord.cpp */, @@ -12028,6 +12011,7 @@ 49EECDC710503C2300099FAB /* ArrayBufferView.cpp */, 49EECDC810503C2300099FAB /* ArrayBufferView.h */, 49EECDC910503C2300099FAB /* ArrayBufferView.idl */, + 4617E7B0121E078F005EC8A8 /* AsyncFileWriter.h */, 6E4E91A710F7FB3100A2779C /* CanvasContextAttributes.cpp */, 6E4E91A810F7FB3100A2779C /* CanvasContextAttributes.h */, 49484FB3102CF23C00187DD3 /* CanvasGradient.cpp */, @@ -13855,6 +13839,57 @@ name = XPath; sourceTree = "<group>"; }; + 89878576122CA1DA003AABDA /* FileAPI */ = { + isa = PBXGroup; + children = ( + 2E2D99CB10E2BBDA00496337 /* JSBlob.cpp */, + 2E2D99CC10E2BBDA00496337 /* JSBlob.h */, + 89CD029111C85B870070B791 /* JSBlobBuilder.cpp */, + 89CD029211C85B870070B791 /* JSBlobBuilder.h */, + 89878586122CA26A003AABDA /* JSDirectoryEntry.cpp */, + 89878587122CA26A003AABDA /* JSDirectoryEntry.h */, + 89878588122CA26A003AABDA /* JSDirectoryReader.cpp */, + 89878589122CA26A003AABDA /* JSDirectoryReader.h */, + 8987858E122CA2A7003AABDA /* JSDOMFileSystem.cpp */, + 8987858F122CA2A7003AABDA /* JSDOMFileSystem.h */, + 89878590122CA2A7003AABDA /* JSEntriesCallback.cpp */, + 89878591122CA2A7003AABDA /* JSEntriesCallback.h */, + 89878592122CA2A7003AABDA /* JSEntry.cpp */, + 89878593122CA2A7003AABDA /* JSEntry.h */, + 89878594122CA2A7003AABDA /* JSEntryArray.cpp */, + 89878595122CA2A7003AABDA /* JSEntryArray.h */, + 89878596122CA2A7003AABDA /* JSEntryCallback.cpp */, + 89878597122CA2A7003AABDA /* JSEntryCallback.h */, + 89878598122CA2A7003AABDA /* JSErrorCallback.cpp */, + 89878599122CA2A7003AABDA /* JSErrorCallback.h */, + BC00F0100E0A189500FD04E3 /* JSFile.cpp */, + BC00F0110E0A189500FD04E3 /* JSFile.h */, + 8987859A122CA2A7003AABDA /* JSFileEntry.cpp */, + 8987859B122CA2A7003AABDA /* JSFileEntry.h */, + 2E3BC0C8117D3E0800B9409A /* JSFileError.cpp */, + 2E3BC0C9117D3E0800B9409A /* JSFileError.h */, + 898785EE122E1E87003AABDA /* JSFileException.cpp */, + 898785EF122E1E87003AABDA /* JSFileException.h */, + BC00F0120E0A189500FD04E3 /* JSFileList.cpp */, + BC00F0130E0A189500FD04E3 /* JSFileList.h */, + 2E94F439119207DA00B7F75D /* JSFileReader.cpp */, + 2E94F43A119207DA00B7F75D /* JSFileReader.h */, + 898785F2122E1EAC003AABDA /* JSFileReaderSync.cpp */, + 898785F3122E1EAC003AABDA /* JSFileReaderSync.h */, + 8987859C122CA2A7003AABDA /* JSFileSystemCallback.cpp */, + 8987859D122CA2A7003AABDA /* JSFileSystemCallback.h */, + 46DA844B1224A0710060D006 /* JSFileWriter.cpp */, + 46DA844C1224A0710060D006 /* JSFileWriter.h */, + 8987859E122CA2A7003AABDA /* JSFlags.cpp */, + 8987859F122CA2A7003AABDA /* JSFlags.h */, + 898785A0122CA2A7003AABDA /* JSMetadata.cpp */, + 898785A1122CA2A7003AABDA /* JSMetadata.h */, + 898785A2122CA2A7003AABDA /* JSMetadataCallback.cpp */, + 898785A3122CA2A7003AABDA /* JSMetadataCallback.h */, + ); + name = FileAPI; + sourceTree = "<group>"; + }; 93309D86099E64910056E581 /* editing */ = { isa = PBXGroup; children = ( @@ -14006,21 +14041,12 @@ isa = PBXGroup; children = ( 49484FAE102CF01E00187DD3 /* canvas */, + 97C1F5511228558800EDE616 /* parser */, B0149E7911A4B21500196A7B /* AsyncImageResizer.cpp */, B0149E7A11A4B21500196A7B /* AsyncImageResizer.h */, - 2EAFAF0B10E2AF2D007ED3D6 /* Blob.cpp */, - 2EAFAF0C10E2AF2D007ED3D6 /* Blob.h */, - 2EAFAF0D10E2AF2D007ED3D6 /* Blob.idl */, - 89BED5E911BE11CE00448492 /* BlobBuilder.cpp */, - 89BED5EA11BE11CE00448492 /* BlobBuilder.h */, - 89CD027911C859A80070B791 /* BlobBuilder.idl */, - 2EED575012109ED0007656BB /* BlobURL.cpp */, - 2EED575112109ED0007656BB /* BlobURL.h */, 93C441ED0F813A1A00C1A634 /* CollectionCache.cpp */, 93C441EE0F813A1A00C1A634 /* CollectionCache.h */, 93C441FF0F813AE100C1A634 /* CollectionType.h */, - 976E2BA511CAE4DE006C56A0 /* CSSPreloadScanner.cpp */, - 976E2BA611CAE4DE006C56A0 /* CSSPreloadScanner.h */, BC77D2380FF298080070887B /* DataGridColumn.cpp */, BC77CFC10FF175550070887B /* DataGridColumn.h */, BC77CF9E0FF172B30070887B /* DataGridColumn.idl */, @@ -14035,25 +14061,6 @@ 2ED609BA1145B07100C8684E /* DOMFormData.cpp */, 2ED609BB1145B07100C8684E /* DOMFormData.h */, 2E0888C3114883A900AF4265 /* DOMFormData.idl */, - BCDBB8CC0E08958400C60FF6 /* File.cpp */, - BCDBB8CB0E08958400C60FF6 /* File.h */, - BC1881D90E08C4ED00048C13 /* File.idl */, - 2E3BC0BB117D3A4F00B9409A /* FileError.h */, - 2E3BC0BC117D3A4F00B9409A /* FileError.idl */, - BCDBB8AB0E088CA500C60FF6 /* FileList.cpp */, - BCDBB8AA0E088CA500C60FF6 /* FileList.h */, - BC1881DC0E08C54300048C13 /* FileList.idl */, - 2E94F3CB118B908E00B7F75D /* FileReader.cpp */, - 2E94F3CC118B908E00B7F75D /* FileReader.h */, - 2E94F427119205B300B7F75D /* FileReader.idl */, - 895253DA116C4EF500CABF00 /* FileStreamProxy.cpp */, - 895253DB116C4EF500CABF00 /* FileStreamProxy.h */, - 8952535011641B3400CABF00 /* FileThread.cpp */, - 8952535111641B3400CABF00 /* FileThread.h */, - 895253DE116C4F0600CABF00 /* FileThreadTask.h */, - 46A26902121B6B4300C41F3A /* FileWriter.cpp */, - 46A26903121B6B4300C41F3A /* FileWriter.h */, - 46A26904121B6B4300C41F3A /* FileWriter.idl */, A8136D370973A8E700D74463 /* FormDataList.cpp */, A8136D360973A8E700D74463 /* FormDataList.h */, BC97E239109144950010D361 /* HTMLAllCollection.cpp */, @@ -14096,8 +14103,6 @@ A8DF3FC9097FA0FB0052981B /* HTMLCollection.cpp */, A8DF3FC8097FA0FB0052981B /* HTMLCollection.h */, 85DF2F690AA3C74300AD64C5 /* HTMLCollection.idl */, - 97EF560E11E40783007E026F /* HTMLConstructionSite.cpp */, - 97EF560F11E40783007E026F /* HTMLConstructionSite.h */, BC77CDB70FEFF1210070887B /* HTMLDataGridCellElement.cpp */, BC77CDBB0FEFF1420070887B /* HTMLDataGridCellElement.h */, BC77CDA20FEFEB530070887B /* HTMLDataGridCellElement.idl */, @@ -14125,30 +14130,18 @@ F523D23B02DE4396018635CA /* HTMLDocument.cpp */, F523D23C02DE4396018635CA /* HTMLDocument.h */, 1A494E290A12354300FDAFC1 /* HTMLDocument.idl */, - A871038811A2947000DBD50E /* HTMLDocumentParser.cpp */, - A871038911A2947000DBD50E /* HTMLDocumentParser.h */, F523D23E02DE4396018635CA /* HTMLElement.cpp */, F523D23F02DE4396018635CA /* HTMLElement.h */, 1A494BBB0A122DCD00FDAFC1 /* HTMLElement.idl */, - A8A563B311DB3D10003AC2F0 /* HTMLElementStack.cpp */, - A8A563B211DB3D10003AC2F0 /* HTMLElementStack.h */, A871D4550A127CBC00B12A68 /* HTMLEmbedElement.cpp */, A871D4520A127CBC00B12A68 /* HTMLEmbedElement.h */, 859128790AB222EC00202265 /* HTMLEmbedElement.idl */, - 976E895E11C0CA3A00EA9CA9 /* HTMLEntityParser.cpp */, - 976E895F11C0CA3A00EA9CA9 /* HTMLEntityParser.h */, - 970C4FDF1211266200C3D393 /* HTMLEntitySearch.cpp */, - 970C4FE01211266200C3D393 /* HTMLEntitySearch.h */, - 970C4FE11211266200C3D393 /* HTMLEntityTable.cpp */, - 970C4FE21211266200C3D393 /* HTMLEntityTable.h */, A81369B9097374F500D74463 /* HTMLFieldSetElement.cpp */, A81369B8097374F500D74463 /* HTMLFieldSetElement.h */, 1AE2A9F40A1CDA5700B42B25 /* HTMLFieldSetElement.idl */, A8CFF7980A156978000A4234 /* HTMLFontElement.cpp */, A8CFF79C0A156978000A4234 /* HTMLFontElement.h */, 1AE2A9F50A1CDA5700B42B25 /* HTMLFontElement.idl */, - A8A564A411DC0E59003AC2F0 /* HTMLFormattingElementList.cpp */, - A8A564A311DC0E59003AC2F0 /* HTMLFormattingElementList.h */, A8DF3FC7097FA0FB0052981B /* HTMLFormCollection.cpp */, A8DF3FC6097FA0FB0052981B /* HTMLFormCollection.h */, A81369B3097374F500D74463 /* HTMLFormControlElement.cpp */, @@ -14256,8 +14249,6 @@ BC588B4A0BFA723C00EE679E /* HTMLParserErrorCodes.cpp */, BC588AEF0BFA6CF900EE679E /* HTMLParserErrorCodes.h */, 449B19F30FA72ECE0015CA4A /* HTMLParserQuirks.h */, - A8E6A78011D1661B00311F4A /* HTMLParserScheduler.cpp */, - A8E6A77F11D1661B00311F4A /* HTMLParserScheduler.h */, A871D44D0A127CBC00B12A68 /* HTMLPlugInElement.cpp */, A871D44C0A127CBC00B12A68 /* HTMLPlugInElement.h */, 4415292D0E1AE8A000C4A2D0 /* HTMLPlugInImageElement.cpp */, @@ -14265,8 +14256,6 @@ A8EA7C9F0A192B9C00A8EF5F /* HTMLPreElement.cpp */, A8EA7CA20A192B9C00A8EF5F /* HTMLPreElement.h */, 1AE2AB850A1CE85000B42B25 /* HTMLPreElement.idl */, - 97E7936311C6030900E649BC /* HTMLPreloadScanner.cpp */, - 97E7936411C6030900E649BC /* HTMLPreloadScanner.h */, A43BF5961149290A00C643CA /* HTMLProgressElement.cpp */, A43BF5971149290A00C643CA /* HTMLProgressElement.h */, A4226EA51163D84D008B8397 /* HTMLProgressElement.idl */, @@ -14276,9 +14265,6 @@ A871DC160A15205700B12A68 /* HTMLScriptElement.cpp */, A871DC190A15205700B12A68 /* HTMLScriptElement.h */, 1AE2AB960A1CE88D00B42B25 /* HTMLScriptElement.idl */, - A83B3AEE11ADEFF500458809 /* HTMLScriptRunner.cpp */, - A83B3AEF11ADEFF500458809 /* HTMLScriptRunner.h */, - A87F163411AE841300CBB2E5 /* HTMLScriptRunnerHost.h */, A81369BD097374F500D74463 /* HTMLSelectElement.cpp */, A81369BC097374F500D74463 /* HTMLSelectElement.h */, 855542990AA4938800BA89F2 /* HTMLSelectElement.idl */, @@ -14317,11 +14303,6 @@ A871DC1D0A15205700B12A68 /* HTMLTitleElement.cpp */, A871DC1C0A15205700B12A68 /* HTMLTitleElement.h */, A80E7AAE0A19D1F1007FB8C5 /* HTMLTitleElement.idl */, - 97E8B3C211A2890800169409 /* HTMLToken.h */, - 97E8B35411A23CE200169409 /* HTMLTokenizer.cpp */, - 97E8B35511A23CE200169409 /* HTMLTokenizer.h */, - A879C62311A9D1F70059237A /* HTMLTreeBuilder.cpp */, - A879C62411A9D1F70059237A /* HTMLTreeBuilder.h */, A8EA79E70A1916DF00A8EF5F /* HTMLUListElement.cpp */, A8EA79E60A1916DF00A8EF5F /* HTMLUListElement.h */, 1A85B1D50A1B236C00D8C87C /* HTMLUListElement.idl */, @@ -14330,8 +14311,6 @@ E446139A0CD6331000FADA75 /* HTMLVideoElement.idl */, BCCD74E40A4C8DDF005FDA6D /* HTMLViewSourceDocument.cpp */, BCCD74DB0A4C8D35005FDA6D /* HTMLViewSourceDocument.h */, - 978B6FC712128821001595EF /* HTMLViewSourceParser.cpp */, - 978B6FC812128821001595EF /* HTMLViewSourceParser.h */, A77979130D6B9D0C003851B9 /* ImageData.cpp */, A77979140D6B9D0C003851B9 /* ImageData.h */, A77979150D6B9D0C003851B9 /* ImageData.idl */, @@ -14345,8 +14324,6 @@ A5AFB34E115151A700B045CB /* StepRange.h */, BCEF45E80E687767001C1287 /* TextMetrics.h */, BCEF453F0E676AC1001C1287 /* TextMetrics.idl */, - 2EED57FB1214A9C2007656BB /* ThreadableBlobRegistry.cpp */, - 2EED57FC1214A9C2007656BB /* ThreadableBlobRegistry.h */, E446139D0CD6331000FADA75 /* TimeRanges.cpp */, E446139E0CD6331000FADA75 /* TimeRanges.h */, E446139F0CD6331000FADA75 /* TimeRanges.idl */, @@ -14361,6 +14338,102 @@ tabWidth = 4; usesTabs = 0; }; + 976D6C57122B8A18001FD1F7 /* fileapi */ = { + isa = PBXGroup; + children = ( + 976D6C58122B8A3D001FD1F7 /* AsyncFileWriter.h */, + 976D6C59122B8A3D001FD1F7 /* Blob.cpp */, + 976D6C5A122B8A3D001FD1F7 /* Blob.h */, + 976D6C5C122B8A3D001FD1F7 /* BlobBuilder.cpp */, + 976D6C5D122B8A3D001FD1F7 /* BlobBuilder.h */, + 976D6C5F122B8A3D001FD1F7 /* BlobURL.cpp */, + 976D6C60122B8A3D001FD1F7 /* BlobURL.h */, + 89878539122CA064003AABDA /* DirectoryEntry.cpp */, + 8987853A122CA064003AABDA /* DirectoryEntry.h */, + 8987853B122CA064003AABDA /* DirectoryReader.cpp */, + 8987853C122CA064003AABDA /* DirectoryReader.h */, + 8987853D122CA064003AABDA /* DOMFilePath.cpp */, + 8987853E122CA064003AABDA /* DOMFilePath.h */, + 8987853F122CA064003AABDA /* DOMFileSystem.cpp */, + 89878540122CA064003AABDA /* DOMFileSystem.h */, + 89878541122CA064003AABDA /* EntriesCallback.h */, + 89878542122CA064003AABDA /* Entry.cpp */, + 89878543122CA064003AABDA /* Entry.h */, + 89878544122CA064003AABDA /* EntryArray.cpp */, + 89878545122CA064003AABDA /* EntryArray.h */, + 89878546122CA064003AABDA /* EntryCallback.h */, + 89878547122CA064003AABDA /* ErrorCallback.h */, + 976D6C61122B8A3D001FD1F7 /* File.cpp */, + 976D6C62122B8A3D001FD1F7 /* File.h */, + 89878548122CA064003AABDA /* FileEntry.cpp */, + 89878549122CA064003AABDA /* FileEntry.h */, + 976D6C64122B8A3D001FD1F7 /* FileError.h */, + 2EDF369E122C94C8002F7D4E /* FileException.h */, + 976D6C66122B8A3D001FD1F7 /* FileList.cpp */, + 976D6C67122B8A3D001FD1F7 /* FileList.h */, + 976D6C69122B8A3D001FD1F7 /* FileReader.cpp */, + 976D6C6A122B8A3D001FD1F7 /* FileReader.h */, + 2EDF369A122C94B4002F7D4E /* FileReaderSync.cpp */, + 2EDF369B122C94B4002F7D4E /* FileReaderSync.h */, + 976D6C6C122B8A3D001FD1F7 /* FileStreamProxy.cpp */, + 976D6C6D122B8A3D001FD1F7 /* FileStreamProxy.h */, + 8987854A122CA064003AABDA /* FileSystemCallback.h */, + 8987854B122CA064003AABDA /* FileSystemCallbacks.cpp */, + 8987854C122CA064003AABDA /* FileSystemCallbacks.h */, + 976D6C6E122B8A3D001FD1F7 /* FileThread.cpp */, + 976D6C6F122B8A3D001FD1F7 /* FileThread.h */, + 976D6C70122B8A3D001FD1F7 /* FileThreadTask.h */, + 976D6C71122B8A3D001FD1F7 /* FileWriter.cpp */, + 976D6C72122B8A3D001FD1F7 /* FileWriter.h */, + 976D6C74122B8A3D001FD1F7 /* FileWriterClient.h */, + 8987854D122CA064003AABDA /* Flags.h */, + 8987854E122CA064003AABDA /* LocalFileSystem.cpp */, + 8987854F122CA064003AABDA /* LocalFileSystem.h */, + 89878550122CA064003AABDA /* Metadata.h */, + 89878551122CA064003AABDA /* MetadataCallback.h */, + 976D6C75122B8A3D001FD1F7 /* ThreadableBlobRegistry.cpp */, + 976D6C76122B8A3D001FD1F7 /* ThreadableBlobRegistry.h */, + ); + name = fileapi; + sourceTree = "<group>"; + }; + 97C1F5511228558800EDE616 /* parser */ = { + isa = PBXGroup; + children = ( + 977B3849122883E900B81FF8 /* CSSPreloadScanner.cpp */, + 977B384A122883E900B81FF8 /* CSSPreloadScanner.h */, + 977B384B122883E900B81FF8 /* HTMLConstructionSite.cpp */, + 977B384C122883E900B81FF8 /* HTMLConstructionSite.h */, + 977B384D122883E900B81FF8 /* HTMLDocumentParser.cpp */, + 977B384E122883E900B81FF8 /* HTMLDocumentParser.h */, + 977B384F122883E900B81FF8 /* HTMLEntityNames.in */, + 977B371F1228721700B81FF8 /* HTMLElementStack.cpp */, + 977B37201228721700B81FF8 /* HTMLElementStack.h */, + 977B3850122883E900B81FF8 /* HTMLEntityParser.cpp */, + 977B3851122883E900B81FF8 /* HTMLEntityParser.h */, + 977B3852122883E900B81FF8 /* HTMLEntitySearch.cpp */, + 977B3853122883E900B81FF8 /* HTMLEntitySearch.h */, + 977B3854122883E900B81FF8 /* HTMLEntityTable.h */, + 977B3855122883E900B81FF8 /* HTMLFormattingElementList.cpp */, + 977B3856122883E900B81FF8 /* HTMLFormattingElementList.h */, + 977B3857122883E900B81FF8 /* HTMLParserScheduler.cpp */, + 977B3858122883E900B81FF8 /* HTMLParserScheduler.h */, + 977B3859122883E900B81FF8 /* HTMLPreloadScanner.cpp */, + 977B385A122883E900B81FF8 /* HTMLPreloadScanner.h */, + 977B385B122883E900B81FF8 /* HTMLScriptRunner.cpp */, + 977B385C122883E900B81FF8 /* HTMLScriptRunner.h */, + 977B385D122883E900B81FF8 /* HTMLScriptRunnerHost.h */, + 97C1F552122855CB00EDE616 /* HTMLToken.h */, + 977B385E122883E900B81FF8 /* HTMLTokenizer.cpp */, + 977B385F122883E900B81FF8 /* HTMLTokenizer.h */, + 977B37211228721700B81FF8 /* HTMLTreeBuilder.cpp */, + 977B37221228721700B81FF8 /* HTMLTreeBuilder.h */, + 977B3860122883E900B81FF8 /* HTMLViewSourceParser.cpp */, + 977B3861122883E900B81FF8 /* HTMLViewSourceParser.h */, + ); + name = parser; + sourceTree = "<group>"; + }; A59E3C1B11580F340072928E /* iphone */ = { isa = PBXGroup; children = ( @@ -14410,10 +14483,6 @@ 49EECEF3105070C400099FAB /* JSArrayBuffer.h */, 49EECF19105072F300099FAB /* JSArrayBufferView.cpp */, 49EECF1A105072F300099FAB /* JSArrayBufferView.h */, - 2E2D99CB10E2BBDA00496337 /* JSBlob.cpp */, - 2E2D99CC10E2BBDA00496337 /* JSBlob.h */, - 89CD029111C85B870070B791 /* JSBlobBuilder.cpp */, - 89CD029211C85B870070B791 /* JSBlobBuilder.h */, 65DF323309D1DE65000BE325 /* JSCanvasGradient.cpp */, 65DF323409D1DE65000BE325 /* JSCanvasGradient.h */, 65DF323509D1DE65000BE325 /* JSCanvasPattern.cpp */, @@ -14428,14 +14497,6 @@ BC77D1680FF19F550070887B /* JSDataGridColumnList.h */, 2E0888D21148848A00AF4265 /* JSDOMFormData.cpp */, 2E0888D31148848A00AF4265 /* JSDOMFormData.h */, - BC00F0100E0A189500FD04E3 /* JSFile.cpp */, - BC00F0110E0A189500FD04E3 /* JSFile.h */, - 2E3BC0C8117D3E0800B9409A /* JSFileError.cpp */, - 2E3BC0C9117D3E0800B9409A /* JSFileError.h */, - BC00F0120E0A189500FD04E3 /* JSFileList.cpp */, - BC00F0130E0A189500FD04E3 /* JSFileList.h */, - 2E94F439119207DA00B7F75D /* JSFileReader.cpp */, - 2E94F43A119207DA00B7F75D /* JSFileReader.h */, 49EECEF4105070C400099FAB /* JSFloat32Array.cpp */, 49EECEF5105070C400099FAB /* JSFloat32Array.h */, BC97E410109154FA0010D361 /* JSHTMLAllCollection.cpp */, @@ -15106,28 +15167,6 @@ B59DD697119029E5007E9684 /* JSDatabaseCallback.h */, B58CEB6811913607002A6790 /* JSDatabaseSync.cpp */, B58CEB6711913607002A6790 /* JSDatabaseSync.h */, - 899ABC551215EB2A00F9F219 /* JSDirectoryEntry.cpp */, - 899ABC561215EB2A00F9F219 /* JSDirectoryEntry.h */, - 899ABC6B1215ECEF00F9F219 /* JSDirectoryReader.cpp */, - 899ABC6C1215ECEF00F9F219 /* JSDirectoryReader.h */, - 897A2D8D1200035F0082740C /* JSDOMFileSystem.cpp */, - 897A2D8E1200035F0082740C /* JSDOMFileSystem.h */, - 899ABC571215EB2A00F9F219 /* JSEntriesCallback.cpp */, - 899ABC581215EB2A00F9F219 /* JSEntriesCallback.h */, - 897A2D4911FF6C900082740C /* JSEntry.cpp */, - 897A2D4A11FF6C900082740C /* JSEntry.h */, - 899ABC591215EB2A00F9F219 /* JSEntryArray.cpp */, - 899ABC5A1215EB2A00F9F219 /* JSEntryArray.h */, - 897A2D4B11FF6C900082740C /* JSEntryCallback.cpp */, - 897A2D4C11FF6C900082740C /* JSEntryCallback.h */, - 897A2D4D11FF6C900082740C /* JSErrorCallback.cpp */, - 897A2D4E11FF6C900082740C /* JSErrorCallback.h */, - 899ABC5B1215EB2A00F9F219 /* JSFileEntry.cpp */, - 899ABC5C1215EB2A00F9F219 /* JSFileEntry.h */, - 897A2D5511FF6CA40082740C /* JSFileSystemCallback.cpp */, - 897A2D5611FF6CA40082740C /* JSFileSystemCallback.h */, - 897A2D91120003760082740C /* JSFlags.cpp */, - 897A2D92120003760082740C /* JSFlags.h */, C585A66411D4FB07004C3E4B /* JSIDBAny.cpp */, C585A66511D4FB07004C3E4B /* JSIDBAny.h */, 81BE20A711F4B66F00915DFA /* JSIDBCursor.cpp */, @@ -15158,10 +15197,6 @@ C585A67B11D4FB07004C3E4B /* JSIDBSuccessEvent.h */, B656626F120B1227006EA85C /* JSIDBTransaction.cpp */, B656626E120B1227006EA85C /* JSIDBTransaction.h */, - 8947A82512222C4700D95F2D /* JSMetadata.cpp */, - 8947A82612222C4700D95F2D /* JSMetadata.h */, - 8947A82712222C4700D95F2D /* JSMetadataCallback.cpp */, - 8947A82812222C4700D95F2D /* JSMetadataCallback.h */, 514C76350CE9225E007EF3CD /* JSSQLError.cpp */, BC8243250D0CE8A200460C8F /* JSSQLError.h */, B525A96411CA2340003A23A8 /* JSSQLException.cpp */, @@ -15793,8 +15828,6 @@ B2AFFC750D00A5C10030074D /* FontCustomPlatformData.cpp */, B2AFFC760D00A5C10030074D /* FontCustomPlatformData.h */, B2AFFC780D00A5C10030074D /* FontMac.mm */, - B2AFFC790D00A5C10030074D /* FontPlatformData.h */, - B2AFFC7A0D00A5C10030074D /* FontPlatformDataMac.mm */, B2AFFC7B0D00A5C10030074D /* GlyphPageTreeNodeMac.cpp */, 49FFBF1C11C8550E006A7118 /* GraphicsContext3DMac.mm */, B277B4030B22F37C0004BEC6 /* GraphicsContextMac.mm */, @@ -15825,6 +15858,7 @@ isa = PBXGroup; children = ( B27535290B053814002CE64F /* cg */, + B5320D68122A24E9002D1440 /* cocoa */, A75E8B7F0E1DE2B0007F2481 /* filters */, B27535490B053814002CE64F /* mac */, F4EAF4AB10C74268009100D3 /* opentype */, @@ -16021,6 +16055,15 @@ name = cf; sourceTree = "<group>"; }; + B5320D68122A24E9002D1440 /* cocoa */ = { + isa = PBXGroup; + children = ( + B5320D69122A24E9002D1440 /* FontPlatformData.h */, + B5320D6A122A24E9002D1440 /* FontPlatformDataCocoa.mm */, + ); + path = cocoa; + sourceTree = "<group>"; + }; B5D31DF711CF60E5009F22B4 /* generic */ = { isa = PBXGroup; children = ( @@ -16123,6 +16166,7 @@ 41002CCB0F66EDEF009E660D /* ScriptFunctionCall.h */, 4FD8D0F0119C718B002FA825 /* ScriptGCEvent.cpp */, 4FD8D0F1119C718B002FA825 /* ScriptGCEvent.h */, + 9F3B947D12241758005304E7 /* ScriptHeapSnapshot.h */, 934CC1160EDCAC7300A658F2 /* ScriptInstance.h */, 41F066E30F64BCF600A07EAC /* ScriptObject.cpp */, 41F066E20F64BCF600A07EAC /* ScriptObject.h */, @@ -16607,9 +16651,10 @@ BCFB2F74097A2E1A00BA703D /* Arena.cpp */, BCFB2F75097A2E1A00BA703D /* Arena.h */, 2EF1BFF6121CB0BD00C27627 /* AsyncFileStream.h */, + 89D08D9C12228451001241DF /* AsyncFileSystem.cpp */, + 89D08D9D12228451001241DF /* AsyncFileSystem.h */, + 89D08D9E12228451001241DF /* AsyncFileSystemCallbacks.h */, 51E1ECB10C91C55600DC255B /* AutodrainedPool.h */, - 8988E10C11A3508B00DB732E /* BlobItem.cpp */, - 8988E10D11A3508B00DB732E /* BlobItem.h */, BCC8CFCA0986CD2400140BF2 /* ColorData.gperf */, 41D015C90F4B5C71004A662F /* ContentType.cpp */, 41D015C80F4B5C71004A662F /* ContentType.h */, @@ -17028,6 +17073,7 @@ BC9ADD220CC4032600098C4C /* WebKitCSSTransformValue.h */, 31611E540E1C4D4A00F6A579 /* WebKitCSSTransformValue.idl */, 4CDE54EC0E5579780089E26C /* wml.css */, + CD4E0AFA11F7BC27009D3811 /* fullscreen.css */, ); path = css; sourceTree = "<group>"; @@ -17111,8 +17157,10 @@ 0FD308D4117D168400A791F7 /* RenderIFrame.h */, BCEA4836097D93020094C9E4 /* RenderImage.cpp */, BCEA4837097D93020094C9E4 /* RenderImage.h */, - BCB4F8920DB28E530039139B /* RenderImageGeneratedContent.cpp */, - BCB4F88F0DB28DD60039139B /* RenderImageGeneratedContent.h */, + 08F2F0071213E61700DCEC48 /* RenderImageResource.cpp */, + 08F2F0081213E61700DCEC48 /* RenderImageResource.h */, + 08641D4512142F7D008DE9F6 /* RenderImageResourceStyleImage.cpp */, + 08641D4612142F7D008DE9F6 /* RenderImageResourceStyleImage.h */, A7AA66D411C5ED6A001D8C8C /* RenderIndicator.cpp */, A7AA66D511C5ED6A001D8C8C /* RenderIndicator.h */, BCEA4838097D93020094C9E4 /* RenderInline.cpp */, @@ -17647,6 +17695,7 @@ 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 */, @@ -17719,10 +17768,6 @@ BCE789861120E7A60060ECE5 /* BidiRun.h in Headers */, 938192050F87E1EC00D5352A /* BinaryPropertyList.h in Headers */, A89943280B42338800D7C802 /* BitmapImage.h in Headers */, - 2EAFAF0F10E2AF2D007ED3D6 /* Blob.h in Headers */, - 89BED5EC11BE11CE00448492 /* BlobBuilder.h in Headers */, - 8988E10F11A3508B00DB732E /* BlobItem.h in Headers */, - 2EED575612109ED0007656BB /* BlobURL.h in Headers */, 93F199BE08245E59001E9ABC /* BlockExceptions.h in Headers */, BC5EB5E10E81BE8700B25965 /* BorderData.h in Headers */, BC5EB5DB0E81B7EA00B25965 /* BorderValue.h in Headers */, @@ -17840,7 +17885,6 @@ A80E6D000A1989CA007FB8C5 /* CSSPageRule.h in Headers */, BC772B3E0C4EA91E0083285F /* CSSParser.h in Headers */, BC02A4B70E0997B9004B6D2B /* CSSParserValues.h in Headers */, - 976E2BA811CAE4DE006C56A0 /* CSSPreloadScanner.h in Headers */, A80E6CE60A1989CA007FB8C5 /* CSSPrimitiveValue.h in Headers */, E1ED8AC30CC49BE000BFC557 /* CSSPrimitiveValueMappings.h in Headers */, A80E6CFF0A1989CA007FB8C5 /* CSSProperty.h in Headers */, @@ -18709,15 +18753,8 @@ A75E8B8D0E1DE2D6007F2481 /* FEComponentTransfer.h in Headers */, A75E8B8F0E1DE2D6007F2481 /* FEComposite.h in Headers */, 84801955108BAFB300CB2B1F /* FEGaussianBlur.h in Headers */, - BCDBB8CD0E08958400C60FF6 /* File.h in Headers */, 066C772B0AB603B700238CC4 /* FileChooser.h in Headers */, - 2E3BC0BD117D3A4F00B9409A /* FileError.h in Headers */, - BCDBB8AC0E088CA500C60FF6 /* FileList.h in Headers */, - 2E94F4511192096A00B7F75D /* FileReader.h in Headers */, - 895253DD116C4EF500CABF00 /* FileStreamProxy.h in Headers */, 514B3F730C722047000530DF /* FileSystem.h in Headers */, - 8952535311641B3400CABF00 /* FileThread.h in Headers */, - 895253DF116C4F0600CABF00 /* FileThreadTask.h in Headers */, BC5EB69F0E81DAEB00B25965 /* FillLayer.h in Headers */, 845E72F80FD261EE00A87D79 /* Filter.h in Headers */, 08C9251A0FCC7C4A00480DEC /* FilterEffect.h in Headers */, @@ -18739,7 +18776,6 @@ B2C3DA680D006CD600EF6F26 /* FontFallbackList.h in Headers */, B2C3DA6A0D006CD600EF6F26 /* FontFamily.h in Headers */, A80E6CF30A1989CA007FB8C5 /* FontFamilyValue.h in Headers */, - B2AFFC810D00A5C10030074D /* FontPlatformData.h in Headers */, 37ACCE420DA2980F0089E602 /* FontRenderingMode.h in Headers */, B2C3DA6B0D006CD600EF6F26 /* FontSelector.h in Headers */, 37202199106213C600F25C4B /* FontSmoothingMode.h in Headers */, @@ -18812,7 +18848,6 @@ A81369D2097374F600D74463 /* HTMLButtonElement.h in Headers */, 93F199E508245E59001E9ABC /* HTMLCanvasElement.h in Headers */, A8DF3FD0097FA0FC0052981B /* HTMLCollection.h in Headers */, - 97EF561111E40783007E026F /* HTMLConstructionSite.h in Headers */, BC77CDBC0FEFF1420070887B /* HTMLDataGridCellElement.h in Headers */, BC77CB870FEBF5AF0070887B /* HTMLDataGridColElement.h in Headers */, BC212A1F0FE8333200EC3708 /* HTMLDataGridElement.h in Headers */, @@ -18822,17 +18857,12 @@ A8EA7CB70A192B9C00A8EF5F /* HTMLDivElement.h in Headers */, A8EA79F70A1916DF00A8EF5F /* HTMLDListElement.h in Headers */, 93F198E508245E59001E9ABC /* HTMLDocument.h in Headers */, - A871038B11A2947000DBD50E /* HTMLDocumentParser.h in Headers */, 93309DE8099E64920056E581 /* htmlediting.h in Headers */, 93F198E608245E59001E9ABC /* HTMLElement.h in Headers */, A17C81230F2A5CF7005DAAEB /* HTMLElementFactory.h in Headers */, - A8A563B411DB3D10003AC2F0 /* HTMLElementStack.h in Headers */, A871D45C0A127CBC00B12A68 /* HTMLEmbedElement.h in Headers */, - 976E896111C0CA3A00EA9CA9 /* HTMLEntityParser.h in Headers */, - A8BC044F1214EB2B00B5F122 /* HTMLEntitySearch.h in Headers */, A81369D4097374F600D74463 /* HTMLFieldSetElement.h in Headers */, A8CFF7A60A156978000A4234 /* HTMLFontElement.h in Headers */, - A8A564A511DC0E59003AC2F0 /* HTMLFormattingElementList.h in Headers */, A8DF3FCE097FA0FC0052981B /* HTMLFormCollection.h in Headers */, A81369CE097374F600D74463 /* HTMLFormControlElement.h in Headers */, A81369D0097374F600D74463 /* HTMLFormElement.h in Headers */, @@ -18874,16 +18904,12 @@ A871D4580A127CBC00B12A68 /* HTMLParamElement.h in Headers */, BC588AF00BFA6CF900EE679E /* HTMLParserErrorCodes.h in Headers */, 449B19F50FA72ECE0015CA4A /* HTMLParserQuirks.h in Headers */, - A8E6A78111D1661B00311F4A /* HTMLParserScheduler.h in Headers */, A871D4560A127CBC00B12A68 /* HTMLPlugInElement.h in Headers */, 4415292E0E1AE8A000C4A2D0 /* HTMLPlugInImageElement.h in Headers */, A8EA7CB00A192B9C00A8EF5F /* HTMLPreElement.h in Headers */, - 97E7936611C6030900E649BC /* HTMLPreloadScanner.h in Headers */, A43BF5991149290A00C643CA /* HTMLProgressElement.h in Headers */, A8CFF7A30A156978000A4234 /* HTMLQuoteElement.h in Headers */, A871DC250A15205700B12A68 /* HTMLScriptElement.h in Headers */, - A83B3AF111ADEFF500458809 /* HTMLScriptRunner.h in Headers */, - A87F163511AE841300CBB2E5 /* HTMLScriptRunnerHost.h in Headers */, A81369D8097374F600D74463 /* HTMLSelectElement.h in Headers */, E44613A80CD6331000FADA75 /* HTMLSourceElement.h in Headers */, A871DC230A15205700B12A68 /* HTMLStyleElement.h in Headers */, @@ -18897,13 +18923,9 @@ A871DB250A150BD600B12A68 /* HTMLTableSectionElement.h in Headers */, A81369D6097374F600D74463 /* HTMLTextAreaElement.h in Headers */, A871DC280A15205700B12A68 /* HTMLTitleElement.h in Headers */, - 97E8B3C311A2890800169409 /* HTMLToken.h in Headers */, - 97E8B35711A23CE200169409 /* HTMLTokenizer.h in Headers */, - A879C62611A9D1F70059237A /* HTMLTreeBuilder.h in Headers */, A8EA79F20A1916DF00A8EF5F /* HTMLUListElement.h in Headers */, E44613AB0CD6331000FADA75 /* HTMLVideoElement.h in Headers */, BCCD74DC0A4C8D35005FDA6D /* HTMLViewSourceDocument.h in Headers */, - 978B6FCA12128821001595EF /* HTMLViewSourceParser.h in Headers */, 514C76710CE923A1007EF3CD /* HTTPHeaderMap.h in Headers */, 514C76730CE923A1007EF3CD /* HTTPParsers.h in Headers */, 375CD232119D43C800A2A859 /* Hyphenation.h in Headers */, @@ -19644,7 +19666,8 @@ BCEA486A097D93020094C9E4 /* RenderHTMLCanvas.h in Headers */, 0FD308D6117D168500A791F7 /* RenderIFrame.h in Headers */, BCEA4876097D93020094C9E4 /* RenderImage.h in Headers */, - BCB4F8900DB28DD60039139B /* RenderImageGeneratedContent.h in Headers */, + 08F2F00A1213E61700DCEC48 /* RenderImageResource.h in Headers */, + 08641D4812142F7D008DE9F6 /* RenderImageResourceStyleImage.h in Headers */, A7AA66D711C5ED6A001D8C8C /* RenderIndicator.h in Headers */, BCEA4878097D93020094C9E4 /* RenderInline.h in Headers */, 750D029411D0E7F300BD1B27 /* RenderInputSpeech.h in Headers */, @@ -20138,7 +20161,6 @@ BCE658FF0EA9248A007E4533 /* Theme.h in Headers */, BCE659E60EA92FB2007E4533 /* ThemeMac.h in Headers */, BCE659A90EA927B9007E4533 /* ThemeTypes.h in Headers */, - 2EED57FE1214A9C2007656BB /* ThreadableBlobRegistry.h in Headers */, 0B90561B0F2578BF0095FF6A /* ThreadableLoader.h in Headers */, 0B90561C0F2578BF0095FF6A /* ThreadableLoaderClient.h in Headers */, 5112247410CFB8D8008099D7 /* ThreadableWebSocketChannel.h in Headers */, @@ -20333,45 +20355,83 @@ C50B561712119D23008B46E0 /* GroupSettings.h in Headers */, BCA979171215D055005C485C /* ImageBufferData.h in Headers */, 490707E71219C04300D90E51 /* ANGLEWebKitBridge.h in Headers */, - 899ABC271215E4A300F9F219 /* DirectoryEntry.h in Headers */, - 899ABC2A1215E4A300F9F219 /* DirectoryReader.h in Headers */, - 899ABC341215E4BE00F9F219 /* EntriesCallback.h in Headers */, - 899ABC371215E4BE00F9F219 /* EntryArray.h in Headers */, - 899ABC3A1215E4BE00F9F219 /* FileEntry.h in Headers */, - 899ABC5E1215EB2A00F9F219 /* JSDirectoryEntry.h in Headers */, - 899ABC601215EB2A00F9F219 /* JSEntriesCallback.h in Headers */, - 899ABC621215EB2A00F9F219 /* JSEntryArray.h in Headers */, - 899ABC641215EB2A00F9F219 /* JSFileEntry.h in Headers */, - 899ABC6E1215ECEF00F9F219 /* JSDirectoryReader.h in Headers */, - 899ABC7A1215F03100F9F219 /* JSDOMFileSystem.h in Headers */, - 899ABC7C1215F03300F9F219 /* JSEntry.h in Headers */, - 899ABC7E1215F03700F9F219 /* JSEntryCallback.h in Headers */, - 899ABC801215F03800F9F219 /* JSErrorCallback.h in Headers */, - 899ABC811215F03B00F9F219 /* JSFlags.h in Headers */, - 899ABC831215F03C00F9F219 /* JSFileSystemCallback.h in Headers */, - 899ABC871215F0DF00F9F219 /* DOMFileSystem.h in Headers */, - 899ABC961215F9DA00F9F219 /* ErrorCallback.h in Headers */, - 899ABC971215F9DF00F9F219 /* EntryCallback.h in Headers */, - 899ABCAA1215FA5500F9F219 /* FileSystemCallback.h in Headers */, - 899ABCAB1215FA5A00F9F219 /* Flags.h in Headers */, - 899ABCB91215FAB500F9F219 /* Entry.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 */, - 46A26906121B6B4300C41F3A /* FileWriter.h in Headers */, 2EF1BFF7121CB0BD00C27627 /* AsyncFileStream.h in Headers */, 2EF1BFF9121CB0CE00C27627 /* FileStreamClient.h in Headers */, - 89C0DD7B121F0C69009E17CA /* FileSystemCallbacks.h in Headers */, + 4617E7B1121E078F005EC8A8 /* AsyncFileWriter.h in Headers */, CE057FA61220731100A476D5 /* DocumentMarkerController.h in Headers */, 9F0D6B2F121BFEBA006C0288 /* InspectorProfilerAgent.h in Headers */, 2EB4BCD3121F03E300EC4885 /* BlobResourceHandle.h in Headers */, - 89686CA0122244A00076EAA4 /* DOMFilePath.h in Headers */, - 8947A82A12222C4700D95F2D /* JSMetadata.h in Headers */, - 8947A82C12222C4700D95F2D /* JSMetadataCallback.h in Headers */, - 8947A83C122234F400D95F2D /* Metadata.h in Headers */, - 8947A83D122234F900D95F2D /* MetadataCallback.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 */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -20735,10 +20795,6 @@ BCE7898B1120E8020060ECE5 /* BidiRun.cpp in Sources */, 938192030F87E1E600D5352A /* BinaryPropertyList.cpp in Sources */, A89943290B42338800D7C802 /* BitmapImage.cpp in Sources */, - 2EAFAF0E10E2AF2D007ED3D6 /* Blob.cpp in Sources */, - 89BED5EB11BE11CE00448492 /* BlobBuilder.cpp in Sources */, - 8988E10E11A3508B00DB732E /* BlobItem.cpp in Sources */, - 2EED575512109ED0007656BB /* BlobURL.cpp in Sources */, 93F19AE108245E59001E9ABC /* BlockExceptions.mm in Sources */, BCEA4854097D93020094C9E4 /* break_lines.cpp in Sources */, 93309DDA099E64920056E581 /* BreakBlockquoteCommand.cpp in Sources */, @@ -20837,7 +20893,6 @@ A80E6CF50A1989CA007FB8C5 /* CSSPageRule.cpp in Sources */, BC772B3D0C4EA91E0083285F /* CSSParser.cpp in Sources */, BC02A5400E099C5A004B6D2B /* CSSParserValues.cpp in Sources */, - 976E2BA711CAE4DE006C56A0 /* CSSPreloadScanner.cpp in Sources */, A80E6D050A1989CA007FB8C5 /* CSSPrimitiveValue.cpp in Sources */, A80E6CF70A1989CA007FB8C5 /* CSSProperty.cpp in Sources */, 0F6ECD460F252F3700BDE271 /* CSSPropertyLonghand.cpp in Sources */, @@ -21220,16 +21275,11 @@ A75E8B8C0E1DE2D6007F2481 /* FEComponentTransfer.cpp in Sources */, A75E8B8E0E1DE2D6007F2481 /* FEComposite.cpp in Sources */, 84801954108BAFB300CB2B1F /* FEGaussianBlur.cpp in Sources */, - BCDBB8CE0E08958400C60FF6 /* File.cpp in Sources */, 934FE9E50B5CA539003E4A73 /* FileChooser.cpp in Sources */, 066C772D0AB603D200238CC4 /* FileChooserMac.mm in Sources */, - BCDBB8AD0E088CA500C60FF6 /* FileList.cpp in Sources */, - 2E94F4501192096400B7F75D /* FileReader.cpp in Sources */, - 895253DC116C4EF500CABF00 /* FileStreamProxy.cpp in Sources */, 5160306C0CC4362300C8AC25 /* FileSystemCF.cpp in Sources */, 514B3F760C722055000530DF /* FileSystemMac.mm in Sources */, 5160300B0CC4251200C8AC25 /* FileSystemPOSIX.cpp in Sources */, - 8952535211641B3400CABF00 /* FileThread.cpp in Sources */, BC5EB69E0E81DAEB00B25965 /* FillLayer.cpp in Sources */, 08C925190FCC7C4A00480DEC /* FilterEffect.cpp in Sources */, A8CFF04D0A154F09000A4234 /* FixedTableLayout.cpp in Sources */, @@ -21258,7 +21308,6 @@ A80E6CEC0A1989CA007FB8C5 /* FontFamilyValue.cpp in Sources */, 72626E020EF022FE00A07E20 /* FontFastPath.cpp in Sources */, B2AFFC800D00A5C10030074D /* FontMac.mm in Sources */, - B2AFFC820D00A5C10030074D /* FontPlatformDataMac.mm in Sources */, B734B181119B9911006587BD /* FontTranscoder.cpp in Sources */, A80E6CF10A1989CA007FB8C5 /* FontValue.cpp in Sources */, D05CED290A40BB2C00C5AF38 /* FormatBlockCommand.cpp in Sources */, @@ -21313,7 +21362,6 @@ A81369D3097374F600D74463 /* HTMLButtonElement.cpp in Sources */, 93F19AFD08245E59001E9ABC /* HTMLCanvasElement.cpp in Sources */, A8DF3FD1097FA0FC0052981B /* HTMLCollection.cpp in Sources */, - 97EF561011E40783007E026F /* HTMLConstructionSite.cpp in Sources */, BC77CDB80FEFF1210070887B /* HTMLDataGridCellElement.cpp in Sources */, BC77CBAA0FEBF6C90070887B /* HTMLDataGridColElement.cpp in Sources */, BCF524600FEBEE5D0095BF26 /* HTMLDataGridElement.cpp in Sources */, @@ -21323,18 +21371,13 @@ A8EA7CB10A192B9C00A8EF5F /* HTMLDivElement.cpp in Sources */, A8EA79F50A1916DF00A8EF5F /* HTMLDListElement.cpp in Sources */, 93F19A9108245E59001E9ABC /* HTMLDocument.cpp in Sources */, - A871038A11A2947000DBD50E /* HTMLDocumentParser.cpp in Sources */, 93309DE7099E64920056E581 /* htmlediting.cpp in Sources */, 93F19A9208245E59001E9ABC /* HTMLElement.cpp in Sources */, A17C81220F2A5CF7005DAAEB /* HTMLElementFactory.cpp in Sources */, - A8A563B511DB3D10003AC2F0 /* HTMLElementStack.cpp in Sources */, A871D45F0A127CBC00B12A68 /* HTMLEmbedElement.cpp in Sources */, - 976E896011C0CA3A00EA9CA9 /* HTMLEntityParser.cpp in Sources */, - A8BC044E1214EB2A00B5F122 /* HTMLEntitySearch.cpp in Sources */, A8BC04921214F69600B5F122 /* HTMLEntityTable.cpp in Sources */, A81369D5097374F600D74463 /* HTMLFieldSetElement.cpp in Sources */, A8CFF7A20A156978000A4234 /* HTMLFontElement.cpp in Sources */, - A8A564A611DC0E59003AC2F0 /* HTMLFormattingElementList.cpp in Sources */, A8DF3FCF097FA0FC0052981B /* HTMLFormCollection.cpp in Sources */, A81369CF097374F600D74463 /* HTMLFormControlElement.cpp in Sources */, A81369D1097374F600D74463 /* HTMLFormElement.cpp in Sources */, @@ -21375,15 +21418,12 @@ A8EA7CB20A192B9C00A8EF5F /* HTMLParagraphElement.cpp in Sources */, A871D4590A127CBC00B12A68 /* HTMLParamElement.cpp in Sources */, BC588B4B0BFA723C00EE679E /* HTMLParserErrorCodes.cpp in Sources */, - A8E6A78211D1661B00311F4A /* HTMLParserScheduler.cpp in Sources */, A871D4570A127CBC00B12A68 /* HTMLPlugInElement.cpp in Sources */, 4415292F0E1AE8A000C4A2D0 /* HTMLPlugInImageElement.cpp in Sources */, A8EA7CAD0A192B9C00A8EF5F /* HTMLPreElement.cpp in Sources */, - 97E7936511C6030900E649BC /* HTMLPreloadScanner.cpp in Sources */, A43BF5981149290A00C643CA /* HTMLProgressElement.cpp in Sources */, A8CFF7A50A156978000A4234 /* HTMLQuoteElement.cpp in Sources */, A871DC220A15205700B12A68 /* HTMLScriptElement.cpp in Sources */, - A83B3AF011ADEFF500458809 /* HTMLScriptRunner.cpp in Sources */, A81369D9097374F600D74463 /* HTMLSelectElement.cpp in Sources */, E44613A70CD6331000FADA75 /* HTMLSourceElement.cpp in Sources */, A871DC260A15205700B12A68 /* HTMLStyleElement.cpp in Sources */, @@ -21397,12 +21437,9 @@ A871DB260A150BD600B12A68 /* HTMLTableSectionElement.cpp in Sources */, A81369D7097374F600D74463 /* HTMLTextAreaElement.cpp in Sources */, A871DC290A15205700B12A68 /* HTMLTitleElement.cpp in Sources */, - 97E8B35611A23CE200169409 /* HTMLTokenizer.cpp in Sources */, - A879C62511A9D1F70059237A /* HTMLTreeBuilder.cpp in Sources */, A8EA79F30A1916DF00A8EF5F /* HTMLUListElement.cpp in Sources */, E44613AA0CD6331000FADA75 /* HTMLVideoElement.cpp in Sources */, BCCD74E50A4C8DDF005FDA6D /* HTMLViewSourceDocument.cpp in Sources */, - 978B6FC912128821001595EF /* HTMLViewSourceParser.cpp in Sources */, 0B8C56D40F28627F000502E1 /* HTTPHeaderMap.cpp in Sources */, 514C76720CE923A1007EF3CD /* HTTPParsers.cpp in Sources */, 371A67CB11C6C7DB00047B8B /* HyphenationCF.cpp in Sources */, @@ -22186,7 +22223,8 @@ BCEA4869097D93020094C9E4 /* RenderHTMLCanvas.cpp in Sources */, 0FD308D5117D168500A791F7 /* RenderIFrame.cpp in Sources */, BCEA4875097D93020094C9E4 /* RenderImage.cpp in Sources */, - BCB4F8930DB28E530039139B /* RenderImageGeneratedContent.cpp in Sources */, + 08F2F0091213E61700DCEC48 /* RenderImageResource.cpp in Sources */, + 08641D4712142F7D008DE9F6 /* RenderImageResourceStyleImage.cpp in Sources */, A7AA66D611C5ED6A001D8C8C /* RenderIndicator.cpp in Sources */, BCEA4877097D93020094C9E4 /* RenderInline.cpp in Sources */, 750D029311D0E7F300BD1B27 /* RenderInputSpeech.cpp in Sources */, @@ -22636,7 +22674,6 @@ B2C3DA4A0D006C1D00EF6F26 /* TextStream.cpp in Sources */, BCE65D320EAD1211007E4533 /* Theme.cpp in Sources */, BCE659E90EA92FFA007E4533 /* ThemeMac.mm in Sources */, - 2EED57FD1214A9C2007656BB /* ThreadableBlobRegistry.cpp in Sources */, 0B90561E0F257E930095FF6A /* ThreadableLoader.cpp in Sources */, 5112247210CFB8C6008099D7 /* ThreadableWebSocketChannel.cpp in Sources */, 51DF6D800B92A18E00C2DC85 /* ThreadCheck.mm in Sources */, @@ -22800,35 +22837,64 @@ D0FF2A5D11F8C45A007E74E0 /* PingLoader.cpp in Sources */, C50B561612119D23008B46E0 /* GroupSettings.cpp in Sources */, 490707E61219C04300D90E51 /* ANGLEWebKitBridge.cpp in Sources */, - 899ABC261215E4A300F9F219 /* DirectoryEntry.cpp in Sources */, - 899ABC291215E4A300F9F219 /* DirectoryReader.cpp in Sources */, - 899ABC361215E4BE00F9F219 /* EntryArray.cpp in Sources */, - 899ABC391215E4BE00F9F219 /* FileEntry.cpp in Sources */, - 899ABC5D1215EB2A00F9F219 /* JSDirectoryEntry.cpp in Sources */, - 899ABC5F1215EB2A00F9F219 /* JSEntriesCallback.cpp in Sources */, - 899ABC611215EB2A00F9F219 /* JSEntryArray.cpp in Sources */, - 899ABC631215EB2A00F9F219 /* JSFileEntry.cpp in Sources */, - 899ABC6D1215ECEF00F9F219 /* JSDirectoryReader.cpp in Sources */, - 899ABC791215F03100F9F219 /* JSDOMFileSystem.cpp in Sources */, - 899ABC7B1215F03300F9F219 /* JSEntry.cpp in Sources */, - 899ABC7D1215F03600F9F219 /* JSEntryCallback.cpp in Sources */, - 899ABC7F1215F03800F9F219 /* JSErrorCallback.cpp in Sources */, - 899ABC821215F03B00F9F219 /* JSFlags.cpp in Sources */, - 899ABC841215F03D00F9F219 /* JSFileSystemCallback.cpp in Sources */, - 899ABC861215F0D800F9F219 /* DOMFileSystem.cpp in Sources */, - 899ABCBA1215FAB800F9F219 /* Entry.cpp in Sources */, C57FEDE11212EE9C0097BE65 /* FileSystem.cpp in Sources */, 2EDEF1F3121B0EFC00726DB2 /* BlobData.cpp in Sources */, 2EDEF1F6121B0EFC00726DB2 /* BlobRegistryImpl.cpp in Sources */, 2EF1BFEA121C9F4200C27627 /* FileStream.cpp in Sources */, - 46A26905121B6B4300C41F3A /* FileWriter.cpp in Sources */, - 89C0DD7A121F0C69009E17CA /* FileSystemCallbacks.cpp in Sources */, CE057FA51220731100A476D5 /* DocumentMarkerController.cpp in Sources */, 9F0D6B2E121BFEBA006C0288 /* InspectorProfilerAgent.cpp in Sources */, 2EB4BCD2121F03E300EC4885 /* BlobResourceHandle.cpp in Sources */, - 89686C9F122244A00076EAA4 /* DOMFilePath.cpp in Sources */, - 8947A82912222C4700D95F2D /* JSMetadata.cpp in Sources */, - 8947A82B12222C4700D95F2D /* JSMetadataCallback.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 */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/WebCore/accessibility/AXObjectCache.h b/WebCore/accessibility/AXObjectCache.h index 6da6842..28a5917 100644 --- a/WebCore/accessibility/AXObjectCache.h +++ b/WebCore/accessibility/AXObjectCache.h @@ -107,6 +107,7 @@ public: enum AXNotification { AXActiveDescendantChanged, AXCheckedStateChanged, + AXChildrenChanged, AXFocusedUIElementChanged, AXLayoutComplete, AXLoadComplete, diff --git a/WebCore/accessibility/AccessibilityRenderObject.cpp b/WebCore/accessibility/AccessibilityRenderObject.cpp index 92c57c6..e292971 100644 --- a/WebCore/accessibility/AccessibilityRenderObject.cpp +++ b/WebCore/accessibility/AccessibilityRenderObject.cpp @@ -3239,6 +3239,8 @@ void AccessibilityRenderObject::childrenChanged() if (!m_renderer) return; + bool sentChildrenChanged = false; + // Go up the accessibility parent chain, but only if the element already exists. This method is // called during render layouts, minimal work should be done. // If AX elements are created now, they could interrogate the render tree while it's in a funky state. @@ -3248,6 +3250,13 @@ void AccessibilityRenderObject::childrenChanged() continue; AccessibilityRenderObject* axParent = static_cast<AccessibilityRenderObject*>(parent); + + // Send the children changed notification on the first accessibility render object ancestor. + if (!sentChildrenChanged) { + axObjectCache()->postNotification(axParent->renderer(), AXObjectCache::AXChildrenChanged, true); + sentChildrenChanged = true; + } + // Only do work if the children haven't been marked dirty. This has the effect of blocking // future live region change notifications until the AX tree has been accessed again. This // is a good performance win for all parties. diff --git a/WebCore/accessibility/chromium/AXObjectCacheChromium.cpp b/WebCore/accessibility/chromium/AXObjectCacheChromium.cpp index 4118c63..d906a91 100644 --- a/WebCore/accessibility/chromium/AXObjectCacheChromium.cpp +++ b/WebCore/accessibility/chromium/AXObjectCacheChromium.cpp @@ -56,15 +56,34 @@ void AXObjectCache::attachWrapper(AccessibilityObject*) void AXObjectCache::postPlatformNotification(AccessibilityObject* obj, AXNotification notification) { - if (notification != AXCheckedStateChanged) - return; - if (!obj || !obj->document() || !obj->documentFrameView()) return; ChromeClientChromium* client = toChromeClientChromium(obj->documentFrameView()); - if (client) - client->didChangeAccessibilityObjectState(obj); + 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; + } + } } void AXObjectCache::handleFocusedUIElementChanged(RenderObject*, RenderObject*) diff --git a/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp b/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp index 94e984f..a15fd6d 100644 --- a/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp +++ b/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp @@ -51,6 +51,14 @@ bool RuntimeEnabledFeatures::isDeviceMotionEnabled = true; bool RuntimeEnabledFeatures::isDeviceOrientationEnabled = true; bool RuntimeEnabledFeatures::isSpeechInputEnabled = true; +#if ENABLE(XHR_RESPONSE_BLOB) +bool RuntimeEnabledFeatures::isXHRResponseBlobEnabled = false; +#endif + +#if ENABLE(FILE_SYSTEM) +bool RuntimeEnabledFeatures::isFileSystemEnabled = false; +#endif + #if ENABLE(VIDEO) bool RuntimeEnabledFeatures::audioEnabled() diff --git a/WebCore/bindings/generic/RuntimeEnabledFeatures.h b/WebCore/bindings/generic/RuntimeEnabledFeatures.h index fd7308e..fb43f3f 100644 --- a/WebCore/bindings/generic/RuntimeEnabledFeatures.h +++ b/WebCore/bindings/generic/RuntimeEnabledFeatures.h @@ -128,6 +128,19 @@ public: static bool speechInputEnabled() { return isSpeechInputEnabled; } static bool speechEnabled() { return isSpeechInputEnabled; } +#if ENABLE(XHR_RESPONSE_BLOB) + static bool xhrResponseBlobEnabled() { return isXHRResponseBlobEnabled; } + static void setXHRResponseBlobEnabled(bool isEnabled) { isXHRResponseBlobEnabled = isEnabled; } + static bool responseBlobEnabled() { return isXHRResponseBlobEnabled; } + static bool asBlobEnabled() { return isXHRResponseBlobEnabled; } +#endif + +#if ENABLE(FILE_SYSTEM) + static bool fileSystemEnabled() { return isFileSystemEnabled; } + static void setFileSystemEnabled(bool isEnabled) { isFileSystemEnabled = isEnabled; } + static bool requestFileSystemEnabled() { return isFileSystemEnabled; } +#endif + private: // Never instantiate. RuntimeEnabledFeatures() { } @@ -144,6 +157,13 @@ private: static bool isDeviceMotionEnabled; static bool isDeviceOrientationEnabled; static bool isSpeechInputEnabled; +#if ENABLE(XHR_RESPONSE_BLOB) + static bool isXHRResponseBlobEnabled; +#endif + +#if ENABLE(FILE_SYSTEM) + static bool isFileSystemEnabled; +#endif }; } // namespace WebCore diff --git a/WebCore/bindings/gobject/GNUmakefile.am b/WebCore/bindings/gobject/GNUmakefile.am new file mode 100644 index 0000000..12835cc --- /dev/null +++ b/WebCore/bindings/gobject/GNUmakefile.am @@ -0,0 +1,415 @@ +webkitgtk_gdom_built_sources += \ + DerivedSources/webkit/WebKitDOMAttr.cpp \ + DerivedSources/webkit/WebKitDOMAttrPrivate.h \ + DerivedSources/webkit/WebKitDOMBarInfo.cpp \ + DerivedSources/webkit/WebKitDOMBarInfoPrivate.h \ + DerivedSources/webkit/WebKitDOMBlob.cpp \ + DerivedSources/webkit/WebKitDOMBlobPrivate.h \ + DerivedSources/webkit/WebKitDOMCDATASection.cpp \ + DerivedSources/webkit/WebKitDOMCDATASectionPrivate.h \ + DerivedSources/webkit/WebKitDOMCharacterData.cpp \ + DerivedSources/webkit/WebKitDOMCharacterDataPrivate.h \ + DerivedSources/webkit/WebKitDOMComment.cpp \ + DerivedSources/webkit/WebKitDOMCommentPrivate.h \ + DerivedSources/webkit/WebKitDOMConsole.cpp \ + DerivedSources/webkit/WebKitDOMConsolePrivate.h \ + DerivedSources/webkit/WebKitDOMCSSRule.cpp \ + DerivedSources/webkit/WebKitDOMCSSRuleList.cpp \ + DerivedSources/webkit/WebKitDOMCSSRuleListPrivate.h \ + DerivedSources/webkit/WebKitDOMCSSRulePrivate.h \ + DerivedSources/webkit/WebKitDOMCSSStyleDeclaration.cpp \ + DerivedSources/webkit/WebKitDOMCSSStyleDeclarationPrivate.h \ + DerivedSources/webkit/WebKitDOMCSSStyleSheet.cpp \ + DerivedSources/webkit/WebKitDOMCSSStyleSheetPrivate.h \ + DerivedSources/webkit/WebKitDOMCSSValue.cpp \ + DerivedSources/webkit/WebKitDOMCSSValuePrivate.h \ + DerivedSources/webkit/WebKitDOMDatabase.cpp \ + DerivedSources/webkit/WebKitDOMDatabasePrivate.h \ + DerivedSources/webkit/WebKitDOMDocument.cpp \ + DerivedSources/webkit/WebKitDOMDocumentFragment.cpp \ + DerivedSources/webkit/WebKitDOMDocumentFragmentPrivate.h \ + DerivedSources/webkit/WebKitDOMDocumentPrivate.h \ + DerivedSources/webkit/WebKitDOMDocumentType.cpp \ + DerivedSources/webkit/WebKitDOMDocumentTypePrivate.h \ + DerivedSources/webkit/WebKitDOMDOMApplicationCache.cpp \ + DerivedSources/webkit/WebKitDOMDOMApplicationCachePrivate.h \ + DerivedSources/webkit/WebKitDOMDOMImplementation.cpp \ + DerivedSources/webkit/WebKitDOMDOMImplementationPrivate.h \ + DerivedSources/webkit/WebKitDOMDOMMimeTypeArray.cpp \ + DerivedSources/webkit/WebKitDOMDOMMimeTypeArrayPrivate.h \ + DerivedSources/webkit/WebKitDOMDOMMimeType.cpp \ + DerivedSources/webkit/WebKitDOMDOMMimeTypePrivate.h \ + DerivedSources/webkit/WebKitDOMDOMPluginArray.cpp \ + DerivedSources/webkit/WebKitDOMDOMPluginArrayPrivate.h \ + DerivedSources/webkit/WebKitDOMDOMPlugin.cpp \ + DerivedSources/webkit/WebKitDOMDOMPluginPrivate.h \ + DerivedSources/webkit/WebKitDOMDOMSelection.cpp \ + DerivedSources/webkit/WebKitDOMDOMSelectionPrivate.h \ + DerivedSources/webkit/WebKitDOMDOMStringList.cpp \ + DerivedSources/webkit/WebKitDOMDOMStringListPrivate.h \ + DerivedSources/webkit/WebKitDOMDOMStringMap.cpp \ + DerivedSources/webkit/WebKitDOMDOMStringMapPrivate.h \ + DerivedSources/webkit/WebKitDOMDOMWindow.cpp \ + DerivedSources/webkit/WebKitDOMDOMWindowPrivate.h \ + DerivedSources/webkit/WebKitDOMElement.cpp \ + DerivedSources/webkit/WebKitDOMElementPrivate.h \ + DerivedSources/webkit/WebKitDOMEntityReference.cpp \ + DerivedSources/webkit/WebKitDOMEntityReferencePrivate.h \ + DerivedSources/webkit/WebKitDOMEvent.cpp \ + DerivedSources/webkit/WebKitDOMEventPrivate.h \ + DerivedSources/webkit/WebKitDOMEventTargetPrivate.h \ + DerivedSources/webkit/WebKitDOMFile.cpp \ + DerivedSources/webkit/WebKitDOMFileList.cpp \ + DerivedSources/webkit/WebKitDOMFileListPrivate.h \ + DerivedSources/webkit/WebKitDOMFilePrivate.h \ + DerivedSources/webkit/WebKitDOMHistory.cpp \ + DerivedSources/webkit/WebKitDOMHistoryPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLAnchorElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLAnchorElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLAppletElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLAppletElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLAreaElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLAreaElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLBaseElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLBaseElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLBaseFontElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLBaseFontElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLBlockquoteElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLBlockquoteElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLBodyElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLBodyElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLBRElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLBRElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLButtonElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLButtonElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLCanvasElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLCanvasElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLCollection.cpp \ + DerivedSources/webkit/WebKitDOMHTMLCollectionPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLDirectoryElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLDirectoryElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLDivElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLDivElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLDListElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLDListElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLDocument.cpp \ + DerivedSources/webkit/WebKitDOMHTMLDocumentPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLEmbedElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLEmbedElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLFieldSetElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLFieldSetElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLFontElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLFontElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLFormElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLFormElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLFrameElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLFrameElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLFrameSetElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLFrameSetElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLHeadElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLHeadElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLHeadingElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLHeadingElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLHRElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLHRElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLHtmlElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLHtmlElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLIFrameElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLIFrameElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLImageElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLImageElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLInputElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLInputElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLIsIndexElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLIsIndexElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLLabelElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLLabelElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLLegendElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLLegendElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLLIElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLLIElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLLinkElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLLinkElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLMapElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLMapElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLMarqueeElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLMarqueeElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLMediaElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLMediaElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLMenuElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLMenuElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLMetaElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLMetaElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLModElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLModElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLObjectElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLObjectElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLOListElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLOListElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLOptGroupElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLOptGroupElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLOptionElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLOptionElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLOptionsCollection.cpp \ + DerivedSources/webkit/WebKitDOMHTMLOptionsCollectionPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLParagraphElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLParagraphElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLParamElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLParamElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLPreElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLPreElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLQuoteElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLQuoteElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLScriptElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLScriptElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLSelectElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLSelectElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLStyleElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLStyleElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLTableCaptionElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLTableCaptionElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLTableCellElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLTableCellElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLTableColElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLTableColElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLTableElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLTableElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLTableRowElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLTableRowElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLTableSectionElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLTableSectionElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLTextAreaElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLTextAreaElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLTitleElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLTitleElementPrivate.h \ + DerivedSources/webkit/WebKitDOMHTMLUListElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLUListElementPrivate.h \ + DerivedSources/webkit/WebKitDOMLocation.cpp \ + DerivedSources/webkit/WebKitDOMLocationPrivate.h \ + DerivedSources/webkit/WebKitDOMMediaError.cpp \ + DerivedSources/webkit/WebKitDOMMediaErrorPrivate.h \ + DerivedSources/webkit/WebKitDOMMediaList.cpp \ + DerivedSources/webkit/WebKitDOMMediaListPrivate.h \ + DerivedSources/webkit/WebKitDOMMemoryInfo.cpp \ + DerivedSources/webkit/WebKitDOMMemoryInfoPrivate.h \ + DerivedSources/webkit/WebKitDOMMessagePort.cpp \ + DerivedSources/webkit/WebKitDOMMessagePortPrivate.h \ + DerivedSources/webkit/WebKitDOMMouseEvent.cpp \ + DerivedSources/webkit/WebKitDOMMouseEventPrivate.h \ + DerivedSources/webkit/WebKitDOMNamedNodeMap.cpp \ + DerivedSources/webkit/WebKitDOMNamedNodeMapPrivate.h \ + DerivedSources/webkit/WebKitDOMNavigator.cpp \ + DerivedSources/webkit/WebKitDOMNavigatorPrivate.h \ + DerivedSources/webkit/WebKitDOMNode.cpp \ + DerivedSources/webkit/WebKitDOMNodeFilter.cpp \ + DerivedSources/webkit/WebKitDOMNodeFilterPrivate.h \ + DerivedSources/webkit/WebKitDOMNodeIterator.cpp \ + DerivedSources/webkit/WebKitDOMNodeIteratorPrivate.h \ + DerivedSources/webkit/WebKitDOMNodeList.cpp \ + DerivedSources/webkit/WebKitDOMNodeListPrivate.h \ + DerivedSources/webkit/WebKitDOMNodePrivate.h \ + DerivedSources/webkit/WebKitDOMProcessingInstruction.cpp \ + DerivedSources/webkit/WebKitDOMProcessingInstructionPrivate.h \ + DerivedSources/webkit/WebKitDOMRange.cpp \ + DerivedSources/webkit/WebKitDOMRangePrivate.h \ + DerivedSources/webkit/WebKitDOMScreen.cpp \ + DerivedSources/webkit/WebKitDOMScreenPrivate.h \ + DerivedSources/webkit/WebKitDOMStorage.cpp \ + DerivedSources/webkit/WebKitDOMStoragePrivate.h \ + DerivedSources/webkit/WebKitDOMStyleMedia.cpp \ + DerivedSources/webkit/WebKitDOMStyleMediaPrivate.h \ + DerivedSources/webkit/WebKitDOMStyleSheet.cpp \ + DerivedSources/webkit/WebKitDOMStyleSheetList.cpp \ + DerivedSources/webkit/WebKitDOMStyleSheetListPrivate.h \ + DerivedSources/webkit/WebKitDOMStyleSheetPrivate.h \ + DerivedSources/webkit/WebKitDOMText.cpp \ + DerivedSources/webkit/WebKitDOMTextPrivate.h \ + DerivedSources/webkit/WebKitDOMTimeRanges.cpp \ + DerivedSources/webkit/WebKitDOMTimeRangesPrivate.h \ + DerivedSources/webkit/WebKitDOMTreeWalker.cpp \ + DerivedSources/webkit/WebKitDOMTreeWalkerPrivate.h \ + DerivedSources/webkit/WebKitDOMUIEvent.cpp \ + DerivedSources/webkit/WebKitDOMUIEventPrivate.h \ + DerivedSources/webkit/WebKitDOMValidityState.cpp \ + DerivedSources/webkit/WebKitDOMValidityStatePrivate.h \ + DerivedSources/webkit/WebKitDOMWebKitPoint.cpp \ + DerivedSources/webkit/WebKitDOMWebKitPointPrivate.h \ + DerivedSources/webkit/WebKitDOMXPathExpression.cpp \ + DerivedSources/webkit/WebKitDOMXPathExpressionPrivate.h \ + DerivedSources/webkit/WebKitDOMXPathNSResolver.cpp \ + DerivedSources/webkit/WebKitDOMXPathNSResolverPrivate.h \ + DerivedSources/webkit/WebKitDOMXPathResult.cpp \ + DerivedSources/webkit/WebKitDOMXPathResultPrivate.h + +webkitgtk_built_h_api += \ + DerivedSources/webkit/WebKitDOMCSSRule.h \ + DerivedSources/webkit/WebKitDOMCSSRuleList.h \ + DerivedSources/webkit/WebKitDOMCSSStyleDeclaration.h \ + DerivedSources/webkit/WebKitDOMCSSStyleSheet.h \ + DerivedSources/webkit/WebKitDOMCSSValue.h \ + DerivedSources/webkit/WebKitDOMMediaList.h \ + DerivedSources/webkit/WebKitDOMStyleMedia.h \ + DerivedSources/webkit/WebKitDOMStyleSheet.h \ + DerivedSources/webkit/WebKitDOMStyleSheetList.h \ + DerivedSources/webkit/WebKitDOMAttr.h \ + DerivedSources/webkit/WebKitDOMCDATASection.h \ + DerivedSources/webkit/WebKitDOMCharacterData.h \ + DerivedSources/webkit/WebKitDOMComment.h \ + DerivedSources/webkit/WebKitDOMDocument.h \ + DerivedSources/webkit/WebKitDOMDocumentFragment.h \ + DerivedSources/webkit/WebKitDOMDocumentType.h \ + DerivedSources/webkit/WebKitDOMDOMImplementation.h \ + DerivedSources/webkit/WebKitDOMDOMStringList.h \ + DerivedSources/webkit/WebKitDOMDOMStringMap.h \ + DerivedSources/webkit/WebKitDOMElement.h \ + DerivedSources/webkit/WebKitDOMEntityReference.h \ + DerivedSources/webkit/WebKitDOMEvent.h \ + DerivedSources/webkit/WebKitDOMMessagePort.h \ + DerivedSources/webkit/WebKitDOMMouseEvent.h \ + DerivedSources/webkit/WebKitDOMNamedNodeMap.h \ + DerivedSources/webkit/WebKitDOMNode.h \ + DerivedSources/webkit/WebKitDOMNodeFilter.h \ + DerivedSources/webkit/WebKitDOMNodeIterator.h \ + DerivedSources/webkit/WebKitDOMNodeList.h \ + DerivedSources/webkit/WebKitDOMProcessingInstruction.h \ + DerivedSources/webkit/WebKitDOMRange.h \ + DerivedSources/webkit/WebKitDOMText.h \ + DerivedSources/webkit/WebKitDOMTreeWalker.h \ + DerivedSources/webkit/WebKitDOMUIEvent.h \ + DerivedSources/webkit/WebKitDOMBlob.h \ + DerivedSources/webkit/WebKitDOMFile.h \ + DerivedSources/webkit/WebKitDOMFileList.h \ + DerivedSources/webkit/WebKitDOMHTMLAnchorElement.h \ + DerivedSources/webkit/WebKitDOMHTMLAppletElement.h \ + DerivedSources/webkit/WebKitDOMHTMLAreaElement.h \ + DerivedSources/webkit/WebKitDOMHTMLBaseElement.h \ + DerivedSources/webkit/WebKitDOMHTMLBaseFontElement.h \ + DerivedSources/webkit/WebKitDOMHTMLBlockquoteElement.h \ + DerivedSources/webkit/WebKitDOMHTMLBodyElement.h \ + DerivedSources/webkit/WebKitDOMHTMLBRElement.h \ + DerivedSources/webkit/WebKitDOMHTMLButtonElement.h \ + DerivedSources/webkit/WebKitDOMHTMLCanvasElement.h \ + DerivedSources/webkit/WebKitDOMHTMLCollection.h \ + DerivedSources/webkit/WebKitDOMHTMLDirectoryElement.h \ + DerivedSources/webkit/WebKitDOMHTMLDivElement.h \ + DerivedSources/webkit/WebKitDOMHTMLDListElement.h \ + DerivedSources/webkit/WebKitDOMHTMLDocument.h \ + DerivedSources/webkit/WebKitDOMHTMLElement.h \ + DerivedSources/webkit/WebKitDOMHTMLEmbedElement.h \ + DerivedSources/webkit/WebKitDOMHTMLFieldSetElement.h \ + DerivedSources/webkit/WebKitDOMHTMLFontElement.h \ + DerivedSources/webkit/WebKitDOMHTMLFormElement.h \ + DerivedSources/webkit/WebKitDOMHTMLFrameElement.h \ + DerivedSources/webkit/WebKitDOMHTMLFrameSetElement.h \ + DerivedSources/webkit/WebKitDOMHTMLHeadElement.h \ + DerivedSources/webkit/WebKitDOMHTMLHeadingElement.h \ + DerivedSources/webkit/WebKitDOMHTMLHRElement.h \ + DerivedSources/webkit/WebKitDOMHTMLHtmlElement.h \ + DerivedSources/webkit/WebKitDOMHTMLIFrameElement.h \ + DerivedSources/webkit/WebKitDOMHTMLImageElement.h \ + DerivedSources/webkit/WebKitDOMHTMLInputElement.h \ + DerivedSources/webkit/WebKitDOMHTMLIsIndexElement.h \ + DerivedSources/webkit/WebKitDOMHTMLLabelElement.h \ + DerivedSources/webkit/WebKitDOMHTMLLegendElement.h \ + DerivedSources/webkit/WebKitDOMHTMLLIElement.h \ + DerivedSources/webkit/WebKitDOMHTMLLinkElement.h \ + DerivedSources/webkit/WebKitDOMHTMLMapElement.h \ + DerivedSources/webkit/WebKitDOMHTMLMarqueeElement.h \ + DerivedSources/webkit/WebKitDOMHTMLMediaElement.h \ + DerivedSources/webkit/WebKitDOMHTMLMenuElement.h \ + DerivedSources/webkit/WebKitDOMHTMLMetaElement.h \ + DerivedSources/webkit/WebKitDOMHTMLModElement.h \ + DerivedSources/webkit/WebKitDOMHTMLObjectElement.h \ + DerivedSources/webkit/WebKitDOMHTMLOListElement.h \ + DerivedSources/webkit/WebKitDOMHTMLOptGroupElement.h \ + DerivedSources/webkit/WebKitDOMHTMLOptionElement.h \ + DerivedSources/webkit/WebKitDOMHTMLOptionsCollection.h \ + DerivedSources/webkit/WebKitDOMHTMLParagraphElement.h \ + DerivedSources/webkit/WebKitDOMHTMLParamElement.h \ + DerivedSources/webkit/WebKitDOMHTMLPreElement.h \ + DerivedSources/webkit/WebKitDOMHTMLQuoteElement.h \ + DerivedSources/webkit/WebKitDOMHTMLScriptElement.h \ + DerivedSources/webkit/WebKitDOMHTMLSelectElement.h \ + DerivedSources/webkit/WebKitDOMHTMLStyleElement.h \ + DerivedSources/webkit/WebKitDOMHTMLTableElement.h \ + DerivedSources/webkit/WebKitDOMHTMLTableCaptionElement.h \ + DerivedSources/webkit/WebKitDOMHTMLTableColElement.h \ + DerivedSources/webkit/WebKitDOMHTMLTableSectionElement.h \ + DerivedSources/webkit/WebKitDOMHTMLTableCellElement.h \ + DerivedSources/webkit/WebKitDOMHTMLTextAreaElement.h \ + DerivedSources/webkit/WebKitDOMHTMLTitleElement.h \ + DerivedSources/webkit/WebKitDOMHTMLTableRowElement.h \ + DerivedSources/webkit/WebKitDOMHTMLUListElement.h \ + DerivedSources/webkit/WebKitDOMMediaError.h \ + DerivedSources/webkit/WebKitDOMTimeRanges.h \ + DerivedSources/webkit/WebKitDOMValidityState.h \ + DerivedSources/webkit/WebKitDOMDOMApplicationCache.h \ + DerivedSources/webkit/WebKitDOMBarInfo.h \ + DerivedSources/webkit/WebKitDOMConsole.h \ + DerivedSources/webkit/WebKitDOMDOMWindow.h \ + DerivedSources/webkit/WebKitDOMDOMSelection.h \ + DerivedSources/webkit/WebKitDOMEventTarget.h \ + DerivedSources/webkit/WebKitDOMHistory.h \ + DerivedSources/webkit/WebKitDOMLocation.h \ + DerivedSources/webkit/WebKitDOMMemoryInfo.h \ + DerivedSources/webkit/WebKitDOMObject.h \ + DerivedSources/webkit/WebKitDOMNavigator.h \ + DerivedSources/webkit/WebKitDOMScreen.h \ + DerivedSources/webkit/WebKitDOMWebKitPoint.h \ + DerivedSources/webkit/WebKitDOMDOMMimeType.h \ + DerivedSources/webkit/WebKitDOMDOMMimeTypeArray.h \ + DerivedSources/webkit/WebKitDOMDOMPlugin.h \ + DerivedSources/webkit/WebKitDOMDOMPluginArray.h \ + DerivedSources/webkit/WebKitDOMDatabase.h \ + DerivedSources/webkit/WebKitDOMStorage.h \ + DerivedSources/webkit/WebKitDOMXPathExpression.h \ + DerivedSources/webkit/WebKitDOMXPathNSResolver.h \ + DerivedSources/webkit/WebKitDOMXPathResult.h \ + DerivedSources/webkit/webkitdom.h \ + DerivedSources/webkit/webkitdomdefines.h + +if ENABLE_GEOLOCATION +webkitgtk_built_h_api += \ + $(top_builddir)/DerivedSources/webkit/WebKitDOMGeolocation.h +webkitgtk_gdom_built_sources += \ + DerivedSources/webkit/WebKitDOMGeolocation.cpp \ + DerivedSources/webkit/WebKitDOMGeolocationPrivate.h +endif + +if ENABLE_VIDEO +webkitgtk_built_h_api += \ + $(top_builddir)/DerivedSources/webkit/WebKitDOMHTMLAudioElement.h +webkitgtk_gdom_built_sources += \ + DerivedSources/webkit/WebKitDOMHTMLAudioElement.cpp \ + DerivedSources/webkit/WebKitDOMHTMLAudioElementPrivate.h +endif + +gdom_class_list := $(subst WebKitDOM,, $(filter-out %Private, $(basename $(notdir $(webkitgtk_gdom_built_sources))))) +gdom_class_list += Object EventTarget +DerivedSources/webkit/webkitdom.h: $(WebCore)/bindings/scripts/gobject-generate-headers.pl $(WebCore)/bindings/gobject/GNUmakefile.am + $(AM_V_GEN)echo $(gdom_class_list) | $(PERL) $< gdom > $@ + +DerivedSources/webkit/webkitdomdefines.h: $(WebCore)/bindings/scripts/gobject-generate-headers.pl $(WebCore)/bindings/gobject/GNUmakefile.am + $(AM_V_GEN)echo $(gdom_class_list) | $(PERL) $< defines > $@ + +# Because WebCore/bindings/gobject/WebKitDOMObject.h is static source but is also a distributed header +# required by other distributed headers (both static and auto-generated), need to move this to the +# DerivedSources/webkit directory. The reason is that we want all header files distributed in the +# include/webkit-x.y/webkit directory, but do not want to name the WebCore/bindings/gobject directory +# "webkit", as that's a bit presumptuous for a GTK binding. +$(top_builddir)/DerivedSources/webkit/WebKitDOMObject.h: $(WebCore)/bindings/gobject/WebKitDOMObject.h + $(AM_V_GEN)cp -f $< $@ + +$(top_builddir)/DerivedSources/webkit/WebKitDOMEventTarget.h: $(WebCore)/bindings/gobject/WebKitDOMEventTarget.h + $(AM_V_GEN)cp -f $< $@ + +$(top_builddir)/DerivedSources/webkit/WebKitDOMEventTargetPrivate.h: $(WebCore)/bindings/gobject/WebKitDOMEventTargetPrivate.h + $(AM_V_GEN)cp -f $< $@ + +# Filter out SVG for now +gdom_feature_defines := $(filter-out ENABLE-SVG%, $(FEATURE_DEFINES)) +DerivedSources/webkit/WebKitDOM%.cpp DerivedSources/webkit/WebKitDOM%.h DerivedSources/webkit/WebKitDOM%Private.h:: %.idl $(SCRIPTS_BINDINGS) $(WebCore)/bindings/scripts/CodeGeneratorGObject.pm + $(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts $(WebCore)/bindings/scripts/generate-bindings.pl --include $(WebCore)/dom --include $(WebCore)/html --include $(WebCore)/css --include $(WebCore)/page --include $(WebCore)/xml --include $(WebCore)/svg --outputDir "$(GENSOURCES_WEBKIT)" --defines "LANGUAGE_GOBJECT=1 $(gdom_feature_defines)" --generator GObject $< + diff --git a/WebCore/bindings/js/JSXMLHttpRequestCustom.cpp b/WebCore/bindings/js/JSXMLHttpRequestCustom.cpp index da75139..2da3771 100644 --- a/WebCore/bindings/js/JSXMLHttpRequestCustom.cpp +++ b/WebCore/bindings/js/JSXMLHttpRequestCustom.cpp @@ -124,7 +124,13 @@ JSValue JSXMLHttpRequest::send(ExecState* exec) JSValue JSXMLHttpRequest::responseText(ExecState* exec) const { - return jsOwnedStringOrNull(exec, impl()->responseText()); + ExceptionCode ec = 0; + const ScriptString& text = impl()->responseText(ec); + if (ec) { + setDOMException(exec, ec); + return jsUndefined(); + } + return jsOwnedStringOrNull(exec, text); } EncodedJSValue JSC_HOST_CALL JSXMLHttpRequestConstructor::constructJSXMLHttpRequest(ExecState* exec) diff --git a/WebCore/bindings/js/ScriptHeapSnapshot.h b/WebCore/bindings/js/ScriptHeapSnapshot.h new file mode 100644 index 0000000..c81c782 --- /dev/null +++ b/WebCore/bindings/js/ScriptHeapSnapshot.h @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2010, Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ScriptHeapSnapshot_h +#define ScriptHeapSnapshot_h + +#include "InspectorValues.h" +#include "PlatformString.h" + +namespace WebCore { + +class ScriptHeapSnapshot : public RefCounted<ScriptHeapSnapshot> { +public: + virtual ~ScriptHeapSnapshot() {} + + String title() const { return ""; } + unsigned int uid() const { return 0; } + + PassRefPtr<InspectorObject> buildInspectorObjectForHead() const { return InspectorObject::create(); } + +private: + ScriptHeapSnapshot() {} +}; + +} // namespace WebCore + +#endif // ScriptHeapSnapshot_h diff --git a/WebCore/bindings/js/ScriptProfile.cpp b/WebCore/bindings/js/ScriptProfile.cpp index 0eb2814..8731ec2 100644 --- a/WebCore/bindings/js/ScriptProfile.cpp +++ b/WebCore/bindings/js/ScriptProfile.cpp @@ -76,7 +76,7 @@ static PassRefPtr<InspectorObject> buildInspectorObjectFor(const JSC::ProfileNod result->setNumber("totalTime", node->totalTime()); result->setNumber("selfTime", node->selfTime()); result->setNumber("numberOfCalls", node->numberOfCalls()); - result->setBool("visible", node->visible()); + result->setBoolean("visible", node->visible()); result->setNumber("callUID", node->callIdentifier().hash()); RefPtr<InspectorArray> childrenArray = InspectorArray::create(); diff --git a/WebCore/bindings/js/ScriptProfiler.h b/WebCore/bindings/js/ScriptProfiler.h index 180c49f..05e7a25 100644 --- a/WebCore/bindings/js/ScriptProfiler.h +++ b/WebCore/bindings/js/ScriptProfiler.h @@ -28,6 +28,7 @@ #define ScriptProfiler_h #if ENABLE(JAVASCRIPT_DEBUGGER) +#include "ScriptHeapSnapshot.h" #include "ScriptProfile.h" #include "ScriptState.h" @@ -39,8 +40,7 @@ class ScriptProfiler : public Noncopyable { public: static void start(ScriptState* state, const String& title); static PassRefPtr<ScriptProfile> stop(ScriptState* state, const String& title); - static void takeHeapSnapshot() { } - static long getProfilerLogLines(long, String*) { return 0; } + static PassRefPtr<ScriptHeapSnapshot> takeHeapSnapshot(const String&) { return 0; } static bool isProfilerAlwaysEnabled(); }; diff --git a/WebCore/bindings/js/SerializedScriptValue.cpp b/WebCore/bindings/js/SerializedScriptValue.cpp index 00ec25f..ca18ec0 100644 --- a/WebCore/bindings/js/SerializedScriptValue.cpp +++ b/WebCore/bindings/js/SerializedScriptValue.cpp @@ -1080,6 +1080,12 @@ PassRefPtr<SerializedScriptValue> SerializedScriptValue::create(JSContextRef ori return serializedValue; } +SerializedScriptValue* SerializedScriptValue::nullValue() +{ + DEFINE_STATIC_LOCAL(RefPtr<SerializedScriptValue>, nullValue, (SerializedScriptValue::create())); + return nullValue.get(); +} + JSValueRef SerializedScriptValue::deserialize(JSContextRef destinationContext, JSValueRef* exception) { JSLock lock(SilenceAssertionsOnly); diff --git a/WebCore/bindings/js/SerializedScriptValue.h b/WebCore/bindings/js/SerializedScriptValue.h index 2b7d222..32ce418 100644 --- a/WebCore/bindings/js/SerializedScriptValue.h +++ b/WebCore/bindings/js/SerializedScriptValue.h @@ -213,6 +213,8 @@ namespace WebCore { { return adoptRef(new SerializedScriptValue(SerializedScriptValueData())); } + + static SerializedScriptValue* nullValue(); PassRefPtr<SerializedScriptValue> release() { diff --git a/WebCore/bindings/objc/PublicDOMInterfaces.h b/WebCore/bindings/objc/PublicDOMInterfaces.h index ea46436..428ac4a 100644 --- a/WebCore/bindings/objc/PublicDOMInterfaces.h +++ b/WebCore/bindings/objc/PublicDOMInterfaces.h @@ -156,6 +156,9 @@ - (DOMNodeList *)getElementsByClassName:(NSString *)tagname AVAILABLE_IN_WEBKIT_VERSION_4_0; - (DOMElement *)querySelector:(NSString *)selectors AVAILABLE_IN_WEBKIT_VERSION_4_0; - (DOMNodeList *)querySelectorAll:(NSString *)selectors AVAILABLE_IN_WEBKIT_VERSION_4_0; +#if defined(ENABLE_FULLSCREEN_API) && ENABLE_FULLSCREEN_API +- (void)webkitCancelFullScreen AVAILABLE_IN_WEBKIT_VERSION_4_0; +#endif @end @interface DOMDocumentFragment : DOMNode WEBKIT_VERSION_1_3 @@ -224,6 +227,9 @@ - (DOMNodeList *)getElementsByClassName:(NSString *)name AVAILABLE_IN_WEBKIT_VERSION_4_0; - (DOMElement *)querySelector:(NSString *)selectors AVAILABLE_IN_WEBKIT_VERSION_4_0; - (DOMNodeList *)querySelectorAll:(NSString *)selectors AVAILABLE_IN_WEBKIT_VERSION_4_0; +#if defined(ENABLE_FULLSCREEN_API) && ENABLE_FULLSCREEN_API +- (void)webkitRequestFullScreen:(unsigned short)flags AVAILABLE_IN_WEBKIT_VERSION_4_0; +#endif @end @interface DOMEntity : DOMNode WEBKIT_VERSION_1_3 diff --git a/WebCore/bindings/scripts/CodeGeneratorCPP.pm b/WebCore/bindings/scripts/CodeGeneratorCPP.pm index 6bafb1e..f9dd5f2 100644 --- a/WebCore/bindings/scripts/CodeGeneratorCPP.pm +++ b/WebCore/bindings/scripts/CodeGeneratorCPP.pm @@ -393,7 +393,9 @@ sub GenerateHeader # Destructor if ($parentName eq "WebDOMObject") { - push(@headerContent, " ~$className();\n"); + push(@headerContent, " virtual ~$className();\n"); + } else { + push(@headerContent, " virtual ~$className() { }\n"); } push(@headerContent, "\n"); diff --git a/WebCore/bindings/scripts/CodeGeneratorGObject.pm b/WebCore/bindings/scripts/CodeGeneratorGObject.pm index 5700ff7..6a1d115 100644 --- a/WebCore/bindings/scripts/CodeGeneratorGObject.pm +++ b/WebCore/bindings/scripts/CodeGeneratorGObject.pm @@ -479,23 +479,11 @@ sub EventSignalName { } sub GenerateEventListener { - my $attribute = shift; + my $name = shift; my $object = shift; my $interfaceName = shift; - # This marks event listeners in some subclasses of Element. We - # cannot add them, otherwise we'll get runtime errors because of - # duplicated signal definitions between a class and some ancestor. - - # FIXME: it would be very good to be a lot more precise in how we - # do this... - if ($attribute->signature->extendedAttributes->{"WindowEventListener"}) { - return; - } - - my $name = $attribute->signature->name; - my $domSignalName = substr($name, 2); - my $gobjectSignalName = EventSignalName($domSignalName); + my $gobjectSignalName = EventSignalName($name); my $txtInstallSignal = << "EOF"; g_signal_new("${gobjectSignalName}", @@ -510,11 +498,11 @@ sub GenerateEventListener { EOF push(@txtInstallSignals, $txtInstallSignal); - my ${listenerName} = $domSignalName . "Listener"; + my ${listenerName} = $name . "Listener"; my $txtInstallEventListener = << "EOF"; RefPtr<WebCore::GObjectEventListener> ${listenerName} = WebCore::GObjectEventListener::create(reinterpret_cast<GObject*>(object), "${gobjectSignalName}"); - coreObject->addEventListener("${domSignalName}", ${listenerName}, false); + coreObject->addEventListener("${name}", ${listenerName}, false); EOF push(@txtInstallEventListeners, $txtInstallEventListener); @@ -522,6 +510,34 @@ EOF $implIncludes{"GObjectEventListener.h"} = 1; } +my @eventSignalNames = ( + # User Interface Event types + "focus", "blur", + # Basic Event types + "load", "unload", "abort", "error", "select", "change", "submit", "reset", + "resize", "scroll", + # Mouse Event types + "click", "dblclick", "mousedown", "mouseup", + "mousemove", "mouseover", "mouseout", + # Mouse Wheel Event types + "mousewheel", + # Keyboard Event types + "keydown", "keypress", "keyup", + # -- Events not in the spec but defined in WebKit + # Media Event types, + "loadstart", "progress", "suspend", "emptied", "stalled", "play", + "loadedmetadata", "loadeddata", "waiting", "playing", "canplay", + "canplaythrough", "seeking", "seeked", "timeupdate", "ended", + "ratechange", "durationchange", "volumechange", + # Drag and Drop Event types + "drag", "dragend", "dragenter", "dragleave", "dragover", "dragstart", "drop", + # Cut and Paste Event types + "beforecut", "cut", "beforecopy", "copy", "beforepaste", "paste", + # Animations + "webkitanimationend", "webkitanimationstart", "webkitanimationiteration", + # Other + "contextmenu", "input", "invalid", "search", "selectstart"); + sub GenerateProperties { my ($object, $interfaceName, $dataNode) = @_; @@ -584,13 +600,20 @@ EOF push(@txtSetProps, $txtSetProps); foreach my $attribute (@readableProperties) { - if ($attribute->signature->type eq "EventListener") { - GenerateEventListener($attribute, $object, $interfaceName); - } else { + if ($attribute->signature->type ne "EventListener") { GenerateProperty($attribute, $interfaceName, \@writeableProperties); } } + # We need to define all the events there are in all base classes + # that implement EventTarget. For now we only care about these + # two. + if ($interfaceName eq "Node" || $interfaceName eq "DOMWindow") { + foreach my $signalName (@eventSignalNames) { + GenerateEventListener($signalName, $object, $interfaceName); + } + } + push(@cBodyPriv, "};\n\n"); $txtGetProp = << "EOF"; @@ -888,7 +911,11 @@ sub GenerateFunction { if (!$paramTypeIsPrimitive) { if ($returnType ne "void") { # TODO: return proper default result - push(@cBody, " g_return_val_if_fail($paramName, 0);\n"); + # FIXME: Temporary hack for generating a proper implementation + # of the webkit_dom_document_evaluate function (Bug-ID: 42115) + if (!(($functionName eq "webkit_dom_document_evaluate") && ($paramIDLType eq "XPathResult"))) { + push(@cBody, " g_return_val_if_fail($paramName, 0);\n"); + } } else { push(@cBody, " g_return_if_fail($paramName);\n"); } @@ -906,13 +933,18 @@ sub GenerateFunction { } elsif ($paramIDLType eq "CompareHow") { push(@cBody, " WebCore::Range::CompareHow converted_${paramName} = static_cast<WebCore::Range::CompareHow>($paramName);\n"); } elsif ($paramIsGDOMType) { - push(@cBody, " WebCore::${paramIDLType} * converted_${paramName} = WebKit::core($paramName);\n"); + push(@cBody, " WebCore::${paramIDLType} * converted_${paramName} = NULL;\n"); + push(@cBody, " if (${paramName} != NULL) {\n"); + push(@cBody, " converted_${paramName} = WebKit::core($paramName);\n"); + if ($returnType ne "void") { # TODO: return proper default result - push(@cBody, " g_return_val_if_fail(converted_${paramName}, 0);\n"); + push(@cBody, " g_return_val_if_fail(converted_${paramName}, 0);\n"); } else { - push(@cBody, " g_return_if_fail(converted_${paramName});\n"); + push(@cBody, " g_return_if_fail(converted_${paramName});\n"); } + + push(@cBody, " }\n"); } $returnParamName = "converted_".$paramName if $param->extendedAttributes->{"Return"}; } diff --git a/WebCore/bindings/scripts/CodeGeneratorV8.pm b/WebCore/bindings/scripts/CodeGeneratorV8.pm index 56838ca..028169f 100644 --- a/WebCore/bindings/scripts/CodeGeneratorV8.pm +++ b/WebCore/bindings/scripts/CodeGeneratorV8.pm @@ -762,8 +762,11 @@ END } if ($useExceptions) { - push(@implContentDecls, " $nativeType v = "); - push(@implContentDecls, "$getterString;\n"); + if ($nativeType =~ /^V8Parameter/) { + push(@implContentDecls, " " . ConvertToV8Parameter($attribute->signature, $nativeType, "v", $getterString) . ";\n"); + } else { + push(@implContentDecls, " $nativeType v = $getterString;\n"); + } push(@implContentDecls, GenerateSetDOMException(" ")); $result = "v"; $result .= ".release()" if (IsRefPtrType($returnType)); @@ -830,6 +833,8 @@ sub GenerateNormalAttrSetter my $implClassName = shift; my $interfaceName = shift; + $implIncludes{"V8BindingMacros.h"} = 1; + my $attrExt = $attribute->signature->extendedAttributes; my $conditionalString = GenerateConditionalString($attribute->signature); @@ -890,7 +895,12 @@ END push(@implContentDecls, " return;\n"); } } else { - push(@implContentDecls, " $nativeType v = " . JSValueToNative($attribute->signature, "value") . ";\n"); + my $value = JSValueToNative($attribute->signature, "value"); + if ($nativeType =~ /^V8Parameter/) { + push(@implContentDecls, " " . ConvertToV8Parameter($attribute->signature, $nativeType, "v", $value, "VOID") . "\n"); + } else { + push(@implContentDecls, " $nativeType v = $value;\n"); + } } my $result = "v"; @@ -1236,13 +1246,7 @@ END push(@implContentDecls, " }\n"); } elsif ($nativeType =~ /^V8Parameter/) { my $value = JSValueToNative($parameter, "args[$paramIndex]", BasicTypeCanFailConversion($parameter) ? "${parameterName}Ok" : undef); - if ($parameter->type eq "DOMString") { - $implIncludes{"V8BindingMacros.h"} = 1; - push(@implContentDecls, " STRING_TO_V8PARAMETER_EXCEPTION_BLOCK($nativeType, $parameterName, $value);\n"); - } else { - # Don't know how to properly check for conversion exceptions when $parameter->type is "DOMUserData" - push(@implContentDecls, " $nativeType $parameterName = $value;\n"); - } + push(@implContentDecls, " " . ConvertToV8Parameter($parameter, $nativeType, $parameterName, $value) . "\n"); } else { $implIncludes{"V8BindingMacros.h"} = 1; # For functions with "StrictTypeChecking", if an input parameter's type does not match the signature, @@ -3055,7 +3059,8 @@ my %non_wrapper_types = ( 'EventTarget' => 1, 'NodeFilter' => 1, 'EventListener' => 1, - 'IDBKey' => 1 + 'IDBKey' => 1, + 'Date' => 1 ); @@ -3316,6 +3321,25 @@ sub GetCallbackClassName return "V8$interfaceName"; } +sub ConvertToV8Parameter +{ + my $signature = shift; + my $nativeType = shift; + my $variableName = shift; + my $value = shift; + my $suffix = shift; + + die "Wrong native type passed: $nativeType" unless $nativeType =~ /^V8Parameter/; + if ($signature->type eq "DOMString") { + my $macro = "STRING_TO_V8PARAMETER_EXCEPTION_BLOCK"; + $macro .= "_$suffix" if $suffix; + return "$macro($nativeType, $variableName, $value);" + } else { + # Don't know how to properly check for conversion exceptions when $parameter->type is "DOMUserData" + return "$nativeType $variableName($value, true);"; + } +} + sub DebugPrint { my $output = shift; diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestCallback.h b/WebCore/bindings/scripts/test/CPP/WebDOMTestCallback.h index a4d130e..91ff787 100644 --- a/WebCore/bindings/scripts/test/CPP/WebDOMTestCallback.h +++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestCallback.h @@ -44,7 +44,7 @@ public: explicit WebDOMTestCallback(WebCore::TestCallback*); WebDOMTestCallback(const WebDOMTestCallback&); WebDOMTestCallback& operator=(const WebDOMTestCallback&); - ~WebDOMTestCallback(); + virtual ~WebDOMTestCallback(); bool callbackWithClass1Param(const WebDOMClass1& class1Param); bool callbackWithClass2Param(const WebDOMClass2& class2Param, const WebDOMString& strArg); diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.h b/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.h index ca20c4e..5db5db8 100644 --- a/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.h +++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.h @@ -39,7 +39,7 @@ public: explicit WebDOMTestInterface(WebCore::TestInterface*); WebDOMTestInterface(const WebDOMTestInterface&); WebDOMTestInterface& operator=(const WebDOMTestInterface&); - ~WebDOMTestInterface(); + virtual ~WebDOMTestInterface(); WebCore::TestInterface* impl() const; diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h index 2fedf41..770ce51 100644 --- a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h +++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h @@ -41,7 +41,7 @@ public: explicit WebDOMTestObj(WebCore::TestObj*); WebDOMTestObj(const WebDOMTestObj&); WebDOMTestObj& operator=(const WebDOMTestObj&); - ~WebDOMTestObj(); + virtual ~WebDOMTestObj(); enum { WEBDOM_CONST_VALUE_0 = 0, diff --git a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp index e547d35..fbe538d 100644 --- a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp +++ b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp @@ -62,8 +62,11 @@ webkit_dom_test_callback_callback_with_class1param(WebKitDOMTestCallback* self, g_return_val_if_fail(self, 0); WebCore::TestCallback * item = WebKit::core(self); g_return_val_if_fail(class1param, 0); - WebCore::Class1 * converted_class1param = WebKit::core(class1param); - g_return_val_if_fail(converted_class1param, 0); + WebCore::Class1 * converted_class1param = NULL; + if (class1param != NULL) { + converted_class1param = WebKit::core(class1param); + g_return_val_if_fail(converted_class1param, 0); + } gboolean res = item->callbackWithClass1Param(converted_class1param); return res; } @@ -76,8 +79,11 @@ webkit_dom_test_callback_callback_with_class2param(WebKitDOMTestCallback* self, WebCore::TestCallback * item = WebKit::core(self); g_return_val_if_fail(class2param, 0); g_return_val_if_fail(str_arg, 0); - WebCore::Class2 * converted_class2param = WebKit::core(class2param); - g_return_val_if_fail(converted_class2param, 0); + WebCore::Class2 * converted_class2param = NULL; + if (class2param != NULL) { + converted_class2param = WebKit::core(class2param); + g_return_val_if_fail(converted_class2param, 0); + } WTF::String converted_str_arg = WTF::String::fromUTF8(str_arg); gboolean res = item->callbackWithClass2Param(converted_class2param, converted_str_arg); return res; @@ -90,8 +96,11 @@ webkit_dom_test_callback_callback_with_non_bool_return_type(WebKitDOMTestCallbac g_return_val_if_fail(self, 0); WebCore::TestCallback * item = WebKit::core(self); g_return_val_if_fail(class3param, 0); - WebCore::Class3 * converted_class3param = WebKit::core(class3param); - g_return_val_if_fail(converted_class3param, 0); + WebCore::Class3 * converted_class3param = NULL; + if (class3param != NULL) { + converted_class3param = WebKit::core(class3param); + g_return_val_if_fail(converted_class3param, 0); + } glong res = item->callbackWithNonBoolReturnType(converted_class3param); return res; } diff --git a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp index 56c6e14..3c27b81 100644 --- a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp +++ b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp @@ -70,8 +70,11 @@ webkit_dom_test_obj_void_method_with_args(WebKitDOMTestObj* self, glong int_arg, g_return_if_fail(str_arg); g_return_if_fail(obj_arg); WTF::String converted_str_arg = WTF::String::fromUTF8(str_arg); - WebCore::TestObj * converted_obj_arg = WebKit::core(obj_arg); - g_return_if_fail(converted_obj_arg); + WebCore::TestObj * converted_obj_arg = NULL; + if (obj_arg != NULL) { + converted_obj_arg = WebKit::core(obj_arg); + g_return_if_fail(converted_obj_arg); + } item->voidMethodWithArgs(int_arg, converted_str_arg, converted_obj_arg); } @@ -94,8 +97,11 @@ webkit_dom_test_obj_int_method_with_args(WebKitDOMTestObj* self, glong int_arg, g_return_val_if_fail(str_arg, 0); g_return_val_if_fail(obj_arg, 0); WTF::String converted_str_arg = WTF::String::fromUTF8(str_arg); - WebCore::TestObj * converted_obj_arg = WebKit::core(obj_arg); - g_return_val_if_fail(converted_obj_arg, 0); + WebCore::TestObj * converted_obj_arg = NULL; + if (obj_arg != NULL) { + converted_obj_arg = WebKit::core(obj_arg); + g_return_val_if_fail(converted_obj_arg, 0); + } glong res = item->intMethodWithArgs(int_arg, converted_str_arg, converted_obj_arg); return res; } @@ -120,8 +126,11 @@ webkit_dom_test_obj_obj_method_with_args(WebKitDOMTestObj* self, glong int_arg, g_return_val_if_fail(str_arg, 0); g_return_val_if_fail(obj_arg, 0); WTF::String converted_str_arg = WTF::String::fromUTF8(str_arg); - WebCore::TestObj * converted_obj_arg = WebKit::core(obj_arg); - g_return_val_if_fail(converted_obj_arg, 0); + WebCore::TestObj * converted_obj_arg = NULL; + if (obj_arg != NULL) { + converted_obj_arg = WebKit::core(obj_arg); + g_return_val_if_fail(converted_obj_arg, 0); + } PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->objMethodWithArgs(int_arg, converted_str_arg, converted_obj_arg)); WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj*>(WebKit::kit(g_res.get())); return res; @@ -136,8 +145,11 @@ webkit_dom_test_obj_method_that_requires_all_args(WebKitDOMTestObj* self, const g_return_val_if_fail(str_arg, 0); g_return_val_if_fail(obj_arg, 0); WTF::String converted_str_arg = WTF::String::fromUTF8(str_arg); - WebCore::TestObj * converted_obj_arg = WebKit::core(obj_arg); - g_return_val_if_fail(converted_obj_arg, 0); + WebCore::TestObj * converted_obj_arg = NULL; + if (obj_arg != NULL) { + converted_obj_arg = WebKit::core(obj_arg); + g_return_val_if_fail(converted_obj_arg, 0); + } PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->methodThatRequiresAllArgs(converted_str_arg, converted_obj_arg)); WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj*>(WebKit::kit(g_res.get())); return res; @@ -152,8 +164,11 @@ webkit_dom_test_obj_method_that_requires_all_args_and_throws(WebKitDOMTestObj* s g_return_val_if_fail(str_arg, 0); g_return_val_if_fail(obj_arg, 0); WTF::String converted_str_arg = WTF::String::fromUTF8(str_arg); - WebCore::TestObj * converted_obj_arg = WebKit::core(obj_arg); - g_return_val_if_fail(converted_obj_arg, 0); + WebCore::TestObj * converted_obj_arg = NULL; + if (obj_arg != NULL) { + converted_obj_arg = WebKit::core(obj_arg); + g_return_val_if_fail(converted_obj_arg, 0); + } WebCore::ExceptionCode ec = 0; PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->methodThatRequiresAllArgsAndThrows(converted_str_arg, converted_obj_arg, ec)); if (ec) { @@ -172,8 +187,11 @@ webkit_dom_test_obj_serialized_value(WebKitDOMTestObj* self, WebKitDOMSerialized g_return_if_fail(self); WebCore::TestObj * item = WebKit::core(self); g_return_if_fail(serialized_arg); - WebCore::SerializedScriptValue * converted_serialized_arg = WebKit::core(serialized_arg); - g_return_if_fail(converted_serialized_arg); + WebCore::SerializedScriptValue * converted_serialized_arg = NULL; + if (serialized_arg != NULL) { + converted_serialized_arg = WebKit::core(serialized_arg); + g_return_if_fail(converted_serialized_arg); + } item->serializedValue(converted_serialized_arg); } @@ -184,8 +202,11 @@ webkit_dom_test_obj_idb_key(WebKitDOMTestObj* self, WebKitDOMIDBKey* key) g_return_if_fail(self); WebCore::TestObj * item = WebKit::core(self); g_return_if_fail(key); - WebCore::IDBKey * converted_key = WebKit::core(key); - g_return_if_fail(converted_key); + WebCore::IDBKey * converted_key = NULL; + if (key != NULL) { + converted_key = WebKit::core(key); + g_return_if_fail(converted_key); + } item->idbKey(converted_key); } @@ -470,8 +491,11 @@ webkit_dom_test_obj_set_test_obj_attr(WebKitDOMTestObj* self, WebKitDOMTestObj* g_return_if_fail(self); WebCore::TestObj * item = WebKit::core(self); g_return_if_fail(value); - WebCore::TestObj * converted_value = WebKit::core(value); - g_return_if_fail(converted_value); + WebCore::TestObj * converted_value = NULL; + if (value != NULL) { + converted_value = WebKit::core(value); + g_return_if_fail(converted_value); + } item->setTestObjAttr(converted_value); } @@ -493,8 +517,11 @@ webkit_dom_test_obj_set_xml_obj_attr(WebKitDOMTestObj* self, WebKitDOMTestObj* v g_return_if_fail(self); WebCore::TestObj * item = WebKit::core(self); g_return_if_fail(value); - WebCore::TestObj * converted_value = WebKit::core(value); - g_return_if_fail(converted_value); + WebCore::TestObj * converted_value = NULL; + if (value != NULL) { + converted_value = WebKit::core(value); + g_return_if_fail(converted_value); + } item->setXMLObjAttr(converted_value); } diff --git a/WebCore/bindings/scripts/test/TestObj.idl b/WebCore/bindings/scripts/test/TestObj.idl index a2bc89d..94f734b 100644 --- a/WebCore/bindings/scripts/test/TestObj.idl +++ b/WebCore/bindings/scripts/test/TestObj.idl @@ -50,13 +50,13 @@ module test { attribute [Reflect] DOMString reflectedStringAttr; attribute [Reflect] long reflectedIntegralAttr; attribute [Reflect] boolean reflectedBooleanAttr; - attribute [Reflect,URL] DOMString reflectedURLAttr; - attribute [Reflect,NonEmpty,URL] DOMString reflectedNonEmptyURLAttr; + attribute [Reflect, URL] DOMString reflectedURLAttr; + attribute [Reflect, NonEmpty, URL] DOMString reflectedNonEmptyURLAttr; attribute [Reflect=customContentStringAttr] DOMString reflectedStringAttr; attribute [Reflect=customContentIntegralAttr] long reflectedCustomIntegralAttr; attribute [Reflect=customContentBooleanAttr] boolean reflectedCustomBooleanAttr; - attribute [Reflect=customContentURLAttr,URL] DOMString reflectedCustomURLAttr; - attribute [Reflect=customContentNonEmptyURLAttr,NonEmpty,URL] DOMString reflectedCustomNonEmptyURLAttr; + attribute [Reflect=customContentURLAttr, URL] DOMString reflectedCustomURLAttr; + attribute [Reflect=customContentNonEmptyURLAttr, NonEmpty, URL] DOMString reflectedCustomNonEmptyURLAttr; // Methods void voidMethod(); diff --git a/WebCore/bindings/v8/ScriptHeapSnapshot.cpp b/WebCore/bindings/v8/ScriptHeapSnapshot.cpp new file mode 100644 index 0000000..885d039 --- /dev/null +++ b/WebCore/bindings/v8/ScriptHeapSnapshot.cpp @@ -0,0 +1,99 @@ +/* + * 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 "ScriptHeapSnapshot.h" + +#include "InspectorValues.h" +#include "V8Binding.h" +#include <v8-profiler.h> +#include <wtf/PassRefPtr.h> +#include <wtf/RefPtr.h> + +namespace WebCore { + +String ScriptHeapSnapshot::title() const +{ + v8::HandleScope scope; + return toWebCoreString(m_snapshot->GetTitle()); +} + +unsigned int ScriptHeapSnapshot::uid() const +{ + return m_snapshot->GetUid(); +} + +static PassRefPtr<InspectorObject> buildInspectorObjectFor(const v8::HeapGraphNode* root) +{ + v8::HandleScope scope; + RefPtr<InspectorObject> result = InspectorObject::create(); + RefPtr<InspectorObject> lowLevels = InspectorObject::create(); + RefPtr<InspectorObject> entries = InspectorObject::create(); + RefPtr<InspectorObject> children = InspectorObject::create(); + for (int i = 0, count = root->GetChildrenCount(); i < count; ++i) { + const v8::HeapGraphNode* node = root->GetChild(i)->GetToNode(); + if (node->GetType() == v8::HeapGraphNode::kInternal) { + RefPtr<InspectorObject> lowLevel = InspectorObject::create(); + lowLevel->setNumber("count", node->GetInstancesCount()); + lowLevel->setNumber("size", node->GetSelfSize()); + lowLevel->setString("type", toWebCoreString(node->GetName())); + lowLevels->setObject(toWebCoreString(node->GetName()), lowLevel); + } else if (node->GetInstancesCount()) { + RefPtr<InspectorObject> entry = InspectorObject::create(); + entry->setString("constructorName", toWebCoreString(node->GetName())); + entry->setNumber("count", node->GetInstancesCount()); + entry->setNumber("size", node->GetSelfSize()); + entries->setObject(toWebCoreString(node->GetName()), entry); + } else { + RefPtr<InspectorObject> entry = InspectorObject::create(); + entry->setString("constructorName", toWebCoreString(node->GetName())); + for (int j = 0, count = node->GetChildrenCount(); j < count; ++j) { + const v8::HeapGraphEdge* v8Edge = node->GetChild(j); + const v8::HeapGraphNode* v8Child = v8Edge->GetToNode(); + RefPtr<InspectorObject> child = InspectorObject::create(); + child->setString("constructorName", toWebCoreString(v8Child->GetName())); + child->setNumber("count", v8Edge->GetName()->ToInteger()->Value()); + entry->setObject(String::number(reinterpret_cast<unsigned long long>(v8Child)), child); + } + children->setObject(String::number(reinterpret_cast<unsigned long long>(node)), entry); + } + } + result->setObject("lowlevels", lowLevels); + result->setObject("entries", entries); + result->setObject("children", children); + return result.release(); +} + +PassRefPtr<InspectorObject> ScriptHeapSnapshot::buildInspectorObjectForHead() const +{ + return buildInspectorObjectFor(m_snapshot->GetRoot()); +} + +} // namespace WebCore diff --git a/WebCore/bindings/v8/ScriptHeapSnapshot.h b/WebCore/bindings/v8/ScriptHeapSnapshot.h new file mode 100644 index 0000000..794a5a9 --- /dev/null +++ b/WebCore/bindings/v8/ScriptHeapSnapshot.h @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010, Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * 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 ScriptHeapSnapshot_h +#define ScriptHeapSnapshot_h + +#include "PlatformString.h" + +namespace v8 { +class HeapSnapshot; +} + +namespace WebCore { + +class InspectorObject; + +class ScriptHeapSnapshot : public RefCounted<ScriptHeapSnapshot> { +public: + static PassRefPtr<ScriptHeapSnapshot> create(const v8::HeapSnapshot* snapshot) + { + return adoptRef(new ScriptHeapSnapshot(snapshot)); + } + virtual ~ScriptHeapSnapshot() {} + + String title() const; + unsigned int uid() const; + + PassRefPtr<InspectorObject> buildInspectorObjectForHead() const; + +private: + ScriptHeapSnapshot(const v8::HeapSnapshot* snapshot) + : m_snapshot(snapshot) + {} + + const v8::HeapSnapshot* m_snapshot; +}; + +} // namespace WebCore + +#endif // ScriptHeapSnapshot_h diff --git a/WebCore/bindings/v8/ScriptProfile.cpp b/WebCore/bindings/v8/ScriptProfile.cpp index 95ac0de..c5a6dbf 100644 --- a/WebCore/bindings/v8/ScriptProfile.cpp +++ b/WebCore/bindings/v8/ScriptProfile.cpp @@ -65,7 +65,7 @@ static PassRefPtr<InspectorObject> buildInspectorObjectFor(const v8::CpuProfileN result->setNumber("totalTime", node->GetTotalTime()); result->setNumber("selfTime", node->GetSelfTime()); result->setNumber("numberOfCalls", 0); - result->setBool("visible", true); + result->setBoolean("visible", true); result->setNumber("callUID", node->GetCallUid()); RefPtr<InspectorArray> children = InspectorArray::create(); @@ -75,7 +75,7 @@ static PassRefPtr<InspectorObject> buildInspectorObjectFor(const v8::CpuProfileN children->pushObject(buildInspectorObjectFor(child)); } result->setArray("children", children); - return result; + return result.release(); } PassRefPtr<InspectorObject> ScriptProfile::buildInspectorObjectForHead() const diff --git a/WebCore/bindings/v8/ScriptProfiler.cpp b/WebCore/bindings/v8/ScriptProfiler.cpp index 0de4a24..ab7cfa7 100644 --- a/WebCore/bindings/v8/ScriptProfiler.cpp +++ b/WebCore/bindings/v8/ScriptProfiler.cpp @@ -29,8 +29,9 @@ */ #include "config.h" - #include "ScriptProfiler.h" + +#include "InspectorValues.h" #include "ScriptString.h" #include <v8-profiler.h> @@ -52,21 +53,11 @@ PassRefPtr<ScriptProfile> ScriptProfiler::stop(ScriptState* state, const String& return profile ? ScriptProfile::create(profile) : 0; } -void ScriptProfiler::takeHeapSnapshot() -{ - v8::V8::ResumeProfilerEx(v8::PROFILER_MODULE_HEAP_SNAPSHOT - | v8::PROFILER_MODULE_HEAP_STATS - | v8::PROFILER_MODULE_JS_CONSTRUCTORS); -} - -long ScriptProfiler::getProfilerLogLines(long position, String* data) +PassRefPtr<ScriptHeapSnapshot> ScriptProfiler::takeHeapSnapshot(const String& title) { - static char buffer[65536]; - const int readSize = v8::V8::GetLogLines(position, buffer, sizeof(buffer) - 1); - buffer[readSize] = '\0'; - position += readSize; - *data = buffer; - return position; + v8::HandleScope hs; + const v8::HeapSnapshot* snapshot = v8::HeapProfiler::TakeSnapshot(v8String(title), v8::HeapSnapshot::kAggregated); + return snapshot ? ScriptHeapSnapshot::create(snapshot) : 0; } bool ScriptProfiler::isProfilerAlwaysEnabled() diff --git a/WebCore/bindings/v8/ScriptProfiler.h b/WebCore/bindings/v8/ScriptProfiler.h index b1ab3b1..b75a054 100644 --- a/WebCore/bindings/v8/ScriptProfiler.h +++ b/WebCore/bindings/v8/ScriptProfiler.h @@ -32,6 +32,7 @@ #define ScriptProfiler_h #include "PlatformString.h" +#include "ScriptHeapSnapshot.h" #include "ScriptProfile.h" #include "ScriptState.h" @@ -39,12 +40,13 @@ namespace WebCore { +class InspectorObject; + class ScriptProfiler : public Noncopyable { public: static void start(ScriptState* state, const String& title); static PassRefPtr<ScriptProfile> stop(ScriptState* state, const String& title); - static void takeHeapSnapshot(); - static long getProfilerLogLines(long position, String* data); + static PassRefPtr<ScriptHeapSnapshot> takeHeapSnapshot(const String& title); static bool isProfilerAlwaysEnabled(); }; diff --git a/WebCore/bindings/v8/SerializedScriptValue.cpp b/WebCore/bindings/v8/SerializedScriptValue.cpp index 395ef1a..0b908b8 100644 --- a/WebCore/bindings/v8/SerializedScriptValue.cpp +++ b/WebCore/bindings/v8/SerializedScriptValue.cpp @@ -1096,6 +1096,12 @@ PassRefPtr<SerializedScriptValue> SerializedScriptValue::create() return adoptRef(new SerializedScriptValue()); } +SerializedScriptValue* SerializedScriptValue::nullValue() +{ + DEFINE_STATIC_LOCAL(RefPtr<SerializedScriptValue>, nullValue, (SerializedScriptValue::create())); + return nullValue.get(); +} + PassRefPtr<SerializedScriptValue> SerializedScriptValue::release() { RefPtr<SerializedScriptValue> result = adoptRef(new SerializedScriptValue(m_data, WireData)); diff --git a/WebCore/bindings/v8/SerializedScriptValue.h b/WebCore/bindings/v8/SerializedScriptValue.h index 3710b5a..275e5f2 100644 --- a/WebCore/bindings/v8/SerializedScriptValue.h +++ b/WebCore/bindings/v8/SerializedScriptValue.h @@ -52,6 +52,8 @@ public: static PassRefPtr<SerializedScriptValue> createFromWire(String data); static PassRefPtr<SerializedScriptValue> create(String data); static PassRefPtr<SerializedScriptValue> create(); + + static SerializedScriptValue* nullValue(); PassRefPtr<SerializedScriptValue> release(); diff --git a/WebCore/bindings/v8/V8Binding.cpp b/WebCore/bindings/v8/V8Binding.cpp index 3799cdb..bfbc647 100644 --- a/WebCore/bindings/v8/V8Binding.cpp +++ b/WebCore/bindings/v8/V8Binding.cpp @@ -368,27 +368,33 @@ StringType v8StringToWebCoreString(v8::Handle<v8::String> v8String, ExternalMode template String v8StringToWebCoreString<String>(v8::Handle<v8::String>, ExternalMode); template AtomicString v8StringToWebCoreString<AtomicString>(v8::Handle<v8::String>, ExternalMode); +String int32ToWebCoreString(int value) +{ + // Caching of small strings below is not thread safe: newly constructed AtomicString + // are not safely published. + ASSERT(WTF::isMainThread()); + + // Most numbers used are <= 100. Even if they aren't used there's very little cost in using the space. + const int kLowNumbers = 100; + DEFINE_STATIC_LOCAL(Vector<AtomicString>, lowNumbers, (kLowNumbers + 1)); + String webCoreString; + if (0 <= value && value <= kLowNumbers) { + webCoreString = lowNumbers[value]; + if (!webCoreString) { + AtomicString valueString = AtomicString(String::number(value)); + lowNumbers[value] = valueString; + webCoreString = valueString; + } + } else + webCoreString = String::number(value); + return webCoreString; +} String v8NonStringValueToWebCoreString(v8::Handle<v8::Value> object) { ASSERT(!object->IsString()); - if (object->IsInt32()) { - int value = object->Int32Value(); - // Most numbers used are <= 100. Even if they aren't used there's very little in using the space. - const int kLowNumbers = 100; - static AtomicString lowNumbers[kLowNumbers + 1]; - String webCoreString; - if (0 <= value && value <= kLowNumbers) { - webCoreString = lowNumbers[value]; - if (!webCoreString) { - AtomicString valueString = AtomicString(String::number(value)); - lowNumbers[value] = valueString; - webCoreString = valueString; - } - } else - webCoreString = String::number(value); - return webCoreString; - } + if (object->IsInt32()) + return int32ToWebCoreString(object->Int32Value()); v8::TryCatch block; v8::Handle<v8::String> v8String = object->ToString(); diff --git a/WebCore/bindings/v8/V8Binding.h b/WebCore/bindings/v8/V8Binding.h index 087c128..58989ed 100644 --- a/WebCore/bindings/v8/V8Binding.h +++ b/WebCore/bindings/v8/V8Binding.h @@ -210,6 +210,61 @@ namespace WebCore { v8::Persistent<v8::String> getToStringName(); v8::Persistent<v8::FunctionTemplate> getToStringTemplate(); + String int32ToWebCoreString(int value); + + class V8ParameterBase { + public: + operator String() { return toString<String>(); } + operator AtomicString() { return toString<AtomicString>(); } + + protected: + V8ParameterBase(v8::Local<v8::Value> object) : m_v8Object(object), m_mode(Externalize), m_string() { } + + bool prepareBase() + { + if (LIKELY(m_v8Object->IsString())) + return true; + + if (LIKELY(m_v8Object->IsInt32())) { + setString(int32ToWebCoreString(m_v8Object->Int32Value())); + return true; + } + + m_mode = DoNotExternalize; + v8::TryCatch block; + m_v8Object = m_v8Object->ToString(); + // Handle the case where an exception is thrown as part of invoking toString on the object. + if (block.HasCaught()) { + block.ReThrow(); + return false; + } + + return true; + } + + v8::Local<v8::Value> object() { return m_v8Object; } + + void setString(String string) + { + m_string = string; + m_v8Object.Clear(); // To signal that String is ready. + } + + private: + v8::Local<v8::Value> m_v8Object; + ExternalMode m_mode; + String m_string; + + template <class StringType> + StringType toString() + { + if (LIKELY(!m_v8Object.IsEmpty())) + return v8StringToWebCoreString<StringType>(m_v8Object.As<v8::String>(), m_mode); + + return StringType(m_string); + } + }; + // V8Parameter is an adapter class that converts V8 values to Strings // or AtomicStrings as appropriate, using multiple typecast operators. enum V8ParameterMode { @@ -218,22 +273,38 @@ namespace WebCore { WithUndefinedOrNullCheck }; template <V8ParameterMode MODE = DefaultMode> - class V8Parameter { + class V8Parameter: public V8ParameterBase { public: - V8Parameter(v8::Local<v8::Value> object = v8::Local<v8::Value>()) : m_v8Object(object) { } - operator String(); - operator AtomicString(); - private: - v8::Local<v8::Value> m_v8Object; + V8Parameter(v8::Local<v8::Value> object) : V8ParameterBase(object) { } + V8Parameter(v8::Local<v8::Value> object, bool) : V8ParameterBase(object) { prepare(); } + + bool prepare(); }; - template<> inline V8Parameter<DefaultMode>::operator String() { return toWebCoreString(m_v8Object); } - template<> inline V8Parameter<WithNullCheck>::operator String() { return toWebCoreStringWithNullCheck(m_v8Object); } - template<> inline V8Parameter<WithUndefinedOrNullCheck>::operator String() { return toWebCoreStringWithNullOrUndefinedCheck(m_v8Object); } + template<> inline bool V8Parameter<DefaultMode>::prepare() + { + return V8ParameterBase::prepareBase(); + } + + template<> inline bool V8Parameter<WithNullCheck>::prepare() + { + if (object()->IsNull()) { + setString(String()); + return true; + } - template<> inline V8Parameter<DefaultMode>::operator AtomicString() { return v8ValueToAtomicWebCoreString(m_v8Object); } - template<> inline V8Parameter<WithNullCheck>::operator AtomicString() { return toAtomicWebCoreStringWithNullCheck(m_v8Object); } - template<> inline V8Parameter<WithUndefinedOrNullCheck>::operator AtomicString() { return toAtomicWebCoreStringWithNullCheck(m_v8Object); } + return V8ParameterBase::prepareBase(); + } + + template<> inline bool V8Parameter<WithUndefinedOrNullCheck>::prepare() + { + if (object()->IsNull() || object()->IsUndefined()) { + setString(String()); + return true; + } + + return V8ParameterBase::prepareBase(); + } } // namespace WebCore diff --git a/WebCore/bindings/v8/custom/V8BindingMacros.h b/WebCore/bindings/v8/custom/V8BindingMacros.h index b569b10..ad02c3e 100644 --- a/WebCore/bindings/v8/custom/V8BindingMacros.h +++ b/WebCore/bindings/v8/custom/V8BindingMacros.h @@ -38,12 +38,11 @@ } #define STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(type, var, value) \ - type var; \ - { \ - v8::Local<v8::Value> v8Value = (value); \ - v8::TryCatch block; \ - (value)->ToString(); \ - if (block.HasCaught()) \ - return block.ReThrow(); \ - var = v8Value; \ - } + type var(value); \ + if (!var.prepare()) \ + return v8::Undefined(); + +#define STRING_TO_V8PARAMETER_EXCEPTION_BLOCK_VOID(type, var, value) \ + type var(value); \ + if (!var.prepare()) \ + return; diff --git a/WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp b/WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp new file mode 100644 index 0000000..7ca18ab --- /dev/null +++ b/WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp @@ -0,0 +1,96 @@ +/* + * 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 "V8DOMStringMap.h" + +#include "DOMStringMap.h" +#include "V8Binding.h" + +namespace WebCore { + +v8::Handle<v8::Integer> V8DOMStringMap::namedPropertyQuery(v8::Local<v8::String> name, const v8::AccessorInfo& info) +{ + INC_STATS("DOM.DOMStringMap.NamedPropertyQuery"); + if (V8DOMStringMap::toNative(info.Holder())->contains(toWebCoreString(name))) + return v8::Integer::New(v8::None); + return v8::Handle<v8::Integer>(); +} + +v8::Handle<v8::Value> V8DOMStringMap::namedPropertyGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) +{ + INC_STATS("DOM.DOMStringMap.NamedPropertyGetter"); + return v8String(V8DOMStringMap::toNative(info.Holder())->item(toWebCoreString(name))); +} + +v8::Handle<v8::Array> V8DOMStringMap::namedPropertyEnumerator(const v8::AccessorInfo& info) +{ + INC_STATS("DOM.DOMStringMap.NamedPropertyEnumerator"); + Vector<String> names; + V8DOMStringMap::toNative(info.Holder())->getNames(names); + v8::Handle<v8::Array> properties = v8::Array::New(names.size()); + for (unsigned i = 0; i < names.size(); ++i) + properties->Set(v8::Integer::New(i), v8String(names[i])); + return properties; +} + +v8::Handle<v8::Boolean> V8DOMStringMap::namedPropertyDeleter(v8::Local<v8::String> name, const v8::AccessorInfo& info) +{ + INC_STATS("DOM.DOMStringMap.NamedPropertyDeleter"); + v8::Handle<v8::Value> value = info.Holder()->GetRealNamedPropertyInPrototypeChain(name); + if (!value.IsEmpty()) + return v8::False(); + if (info.Holder()->HasRealNamedCallbackProperty(name)) + return v8::False(); + + ExceptionCode ec = 0; + V8DOMStringMap::toNative(info.Holder())->deleteItem(toWebCoreString(name), ec); + if (ec) + throwError(ec); + return v8::True(); +} + +v8::Handle<v8::Value> V8DOMStringMap::namedPropertySetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info) +{ + INC_STATS("DOM.DOMStringMap.NamedPropertySetter"); + v8::Handle<v8::Value> property = info.Holder()->GetRealNamedPropertyInPrototypeChain(name); + if (!property.IsEmpty()) + return value; + if (info.Holder()->HasRealNamedCallbackProperty(name)) + return value; + + ExceptionCode ec = 0; + V8DOMStringMap::toNative(info.Holder())->setItem(toWebCoreString(name), toWebCoreString(value), ec); + if (ec) + return throwError(ec); + return value; +} + +} // namespace WebCore diff --git a/WebCore/bindings/v8/custom/V8DeviceMotionEventCustom.cpp b/WebCore/bindings/v8/custom/V8DeviceMotionEventCustom.cpp index 39692b6..67f27c5 100644 --- a/WebCore/bindings/v8/custom/V8DeviceMotionEventCustom.cpp +++ b/WebCore/bindings/v8/custom/V8DeviceMotionEventCustom.cpp @@ -30,6 +30,7 @@ #include "DeviceMotionData.h" #include "V8Binding.h" +#include "V8BindingMacros.h" #include "V8Proxy.h" #include <v8.h> @@ -110,7 +111,7 @@ v8::Handle<v8::Value> V8DeviceMotionEvent::intervalAccessorGetter(v8::Local<v8:: v8::Handle<v8::Value> V8DeviceMotionEvent::initDeviceMotionEventCallback(const v8::Arguments& args) { DeviceMotionEvent* imp = V8DeviceMotionEvent::toNative(args.Holder()); - V8Parameter<> type = args[0]; + STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, type, args[0]); bool bubbles = args[1]->BooleanValue(); bool cancelable = args[2]->BooleanValue(); // If any of the parameters are null or undefined, mark them as not provided. diff --git a/WebCore/bindings/v8/custom/V8DeviceOrientationEventCustom.cpp b/WebCore/bindings/v8/custom/V8DeviceOrientationEventCustom.cpp index 26cc6cc..72f759a 100644 --- a/WebCore/bindings/v8/custom/V8DeviceOrientationEventCustom.cpp +++ b/WebCore/bindings/v8/custom/V8DeviceOrientationEventCustom.cpp @@ -30,6 +30,7 @@ #include "DeviceOrientation.h" #include "V8Binding.h" +#include "V8BindingMacros.h" #include "V8Proxy.h" #include <v8.h> @@ -69,7 +70,7 @@ v8::Handle<v8::Value> V8DeviceOrientationEvent::gammaAccessorGetter(v8::Local<v8 v8::Handle<v8::Value> V8DeviceOrientationEvent::initDeviceOrientationEventCallback(const v8::Arguments& args) { DeviceOrientationEvent* imp = V8DeviceOrientationEvent::toNative(args.Holder()); - V8Parameter<> type = args[0]; + STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, type, args[0]); bool bubbles = args[1]->BooleanValue(); bool cancelable = args[2]->BooleanValue(); // If alpha, beta or gamma are null or undefined, mark them as not provided. diff --git a/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp b/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp index 3da664f..cfeb503 100644 --- a/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp +++ b/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp @@ -49,7 +49,11 @@ v8::Handle<v8::Value> V8XMLHttpRequest::responseTextAccessorGetter(v8::Local<v8: { INC_STATS("DOM.XMLHttpRequest.responsetext._get"); XMLHttpRequest* xmlHttpRequest = V8XMLHttpRequest::toNative(info.Holder()); - return xmlHttpRequest->responseText().v8StringOrNull(); + ExceptionCode ec = 0; + const ScriptString& text = xmlHttpRequest->responseText(ec); + if (ec) + return throwError(ec); + return text.v8StringOrNull(); } v8::Handle<v8::Value> V8XMLHttpRequest::openCallback(const v8::Arguments& args) diff --git a/WebCore/css/CSSComputedStyleDeclaration.cpp b/WebCore/css/CSSComputedStyleDeclaration.cpp index cbb9ca8..edb6987 100644 --- a/WebCore/css/CSSComputedStyleDeclaration.cpp +++ b/WebCore/css/CSSComputedStyleDeclaration.cpp @@ -404,14 +404,22 @@ PassRefPtr<CSSPrimitiveValue> CSSComputedStyleDeclaration::currentColorOrValidCo return CSSPrimitiveValue::createColor(color.rgb()); } -static PassRefPtr<CSSValue> getBorderRadiusCornerValue(IntSize radius) +static PassRefPtr<CSSValue> getBorderRadiusCornerValue(LengthSize radius) { - if (radius.width() == radius.height()) - return CSSPrimitiveValue::create(radius.width(), CSSPrimitiveValue::CSS_PX); - RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); - list->append(CSSPrimitiveValue::create(radius.width(), CSSPrimitiveValue::CSS_PX)); - list->append(CSSPrimitiveValue::create(radius.height(), CSSPrimitiveValue::CSS_PX)); + 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); + } + 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)); + 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)); return list.release(); } @@ -715,6 +723,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper case CSSPropertyBackgroundColor: return CSSPrimitiveValue::createColor(m_allowVisitedStyle? style->visitedDependentColor(CSSPropertyBackgroundColor).rgb() : style->backgroundColor().rgb()); case CSSPropertyBackgroundImage: + // FIXME: Broken for multiple backgrounds. https://bugs.webkit.org/show_bug.cgi?id=44853 if (style->backgroundImage()) return style->backgroundImage()->cssValue(); return CSSPrimitiveValue::createIdentifier(CSSValueNone); @@ -861,7 +870,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper if (cursors && cursors->size() > 0) { list = CSSValueList::createCommaSeparated(); for (unsigned i = 0; i < cursors->size(); ++i) - list->append(CSSPrimitiveValue::create((*cursors)[i].image()->url(), CSSPrimitiveValue::CSS_URI)); + list->append((*cursors)[i].image()->cssValue()); } RefPtr<CSSValue> value = CSSPrimitiveValue::create(style->cursor()); if (list) { diff --git a/WebCore/css/CSSFontSelector.cpp b/WebCore/css/CSSFontSelector.cpp index b98dcae..50627d7 100644 --- a/WebCore/css/CSSFontSelector.cpp +++ b/WebCore/css/CSSFontSelector.cpp @@ -356,16 +356,14 @@ void CSSFontSelector::fontLoaded() { if (!m_document || m_document->inPageCache() || !m_document->renderer()) return; - m_document->recalcStyle(Document::Force); - m_document->renderer()->setNeedsLayoutAndPrefWidthsRecalc(); + m_document->scheduleForcedStyleRecalc(); } void CSSFontSelector::fontCacheInvalidated() { if (!m_document || m_document->inPageCache() || !m_document->renderer()) return; - m_document->recalcStyle(Document::Force); - m_document->renderer()->setNeedsLayoutAndPrefWidthsRecalc(); + m_document->scheduleForcedStyleRecalc(); } static FontData* fontDataForGenericFamily(Document* document, const FontDescription& fontDescription, const AtomicString& familyName) diff --git a/WebCore/css/CSSFunctionValue.cpp b/WebCore/css/CSSFunctionValue.cpp index 0fc260d..70e8174 100644 --- a/WebCore/css/CSSFunctionValue.cpp +++ b/WebCore/css/CSSFunctionValue.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008 Apple Inc. All Rights Reserved. + * Copyright (C) 2008, 2010 Apple Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -25,15 +25,17 @@ #include "config.h" #include "CSSFunctionValue.h" + #include "CSSValueList.h" +#include <wtf/PassOwnPtr.h> namespace WebCore { CSSFunctionValue::CSSFunctionValue(CSSParserFunction* function) + : m_name(function->name) { - m_name = function->name; if (function->args) - m_args = CSSValueList::createFromParserValueList(function->args); + m_args = CSSValueList::createFromParserValueList(function->args.get()); } CSSFunctionValue::~CSSFunctionValue() @@ -58,7 +60,8 @@ CSSParserValue CSSFunctionValue::parserValue() const val.function = new CSSParserFunction; val.function->name.characters = const_cast<UChar*>(m_name.characters()); val.function->name.length = m_name.length(); - val.function->args = m_args ? m_args->createParserValueList() : 0; + if (m_args) + val.function->args = m_args->createParserValueList(); return val; } diff --git a/WebCore/css/CSSGrammar.y b/WebCore/css/CSSGrammar.y index 26b2ba8..ec507be 100644 --- a/WebCore/css/CSSGrammar.y +++ b/WebCore/css/CSSGrammar.y @@ -2,7 +2,7 @@ /* * Copyright (C) 2002-2003 Lars Knoll (knoll@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. + * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) * Copyright (C) 2008 Eric Seidel <eric@webkit.org> * @@ -34,6 +34,7 @@ #include "Document.h" #include "HTMLNames.h" #include "MediaList.h" +#include "MediaQueryExp.h" #include "WebKitCSSKeyframeRule.h" #include "WebKitCSSKeyframesRule.h" #include <wtf/FastMalloc.h> @@ -98,7 +99,7 @@ static int cssyylex(YYSTYPE* yylval, void* parser) %} -%expect 55 +%expect 56 %nonassoc LOWEST_PREC @@ -201,6 +202,7 @@ static int cssyylex(YYSTYPE* yylval, void* parser) %type <relation> combinator %type <rule> charset +%type <rule> ignored_charset %type <rule> ruleset %type <rule> media %type <rule> import @@ -389,6 +391,13 @@ charset: } ; +ignored_charset: + CHARSET_SYM maybe_space STRING maybe_space ';' { + // Ignore any @charset rule not at the beginning of the style sheet. + $$ = 0; + } +; + rule_list: /* empty */ | rule_list rule maybe_sgml { @@ -413,6 +422,7 @@ rule: valid_rule { static_cast<CSSParser*>(parser)->m_hadSyntacticallyValidCSSRule = true; } + | ignored_charset | invalid_rule | invalid_at ; @@ -617,11 +627,11 @@ media_query_exp_list: media_query_exp { CSSParser* p = static_cast<CSSParser*>(parser); $$ = p->createFloatingMediaQueryExpList(); - $$->append(p->sinkFloatingMediaQueryExp($1)); + $$->append(p->sinkFloatingMediaQueryExp($1).leakPtr()); } | media_query_exp_list maybe_space MEDIA_AND maybe_space media_query_exp { $$ = $1; - $$->append(static_cast<CSSParser*>(parser)->sinkFloatingMediaQueryExp($5)); + $$->append(static_cast<CSSParser*>(parser)->sinkFloatingMediaQueryExp($5).leakPtr()); } ; diff --git a/WebCore/css/CSSImageGeneratorValue.cpp b/WebCore/css/CSSImageGeneratorValue.cpp index 4cf0873..784f438 100644 --- a/WebCore/css/CSSImageGeneratorValue.cpp +++ b/WebCore/css/CSSImageGeneratorValue.cpp @@ -86,6 +86,8 @@ Image* CSSImageGeneratorValue::getImage(RenderObject* renderer, const IntSize& s SizeCountPair& sizeCount = it->second; IntSize oldSize = sizeCount.first; if (oldSize != size) { + // If renderer is the only client, make sure we don't delete this. + RefPtr<CSSImageGeneratorValue> protect(this); removeClient(renderer); addClient(renderer, size); } diff --git a/WebCore/css/CSSImageValue.cpp b/WebCore/css/CSSImageValue.cpp index 96a8dec..dc2d700 100644 --- a/WebCore/css/CSSImageValue.cpp +++ b/WebCore/css/CSSImageValue.cpp @@ -26,6 +26,7 @@ #include "CachedImage.h" #include "DocLoader.h" #include "StyleCachedImage.h" +#include "StylePendingImage.h" namespace WebCore { @@ -43,8 +44,19 @@ CSSImageValue::CSSImageValue() CSSImageValue::~CSSImageValue() { - if (m_image) - m_image->cachedImage()->removeClient(this); + if (m_image && m_image->isCachedImage()) + static_cast<StyleCachedImage*>(m_image.get())->cachedImage()->removeClient(this); +} + +StyleImage* CSSImageValue::cachedOrPendingImage() +{ + if (getIdent() == CSSValueNone) + return 0; + + if (!m_image) + m_image = StylePendingImage::create(this); + + return m_image.get(); } StyleCachedImage* CSSImageValue::cachedImage(DocLoader* loader) @@ -71,20 +83,20 @@ StyleCachedImage* CSSImageValue::cachedImage(DocLoader* loader, const String& ur } } - return m_image.get(); + return m_image->isCachedImage() ? static_cast<StyleCachedImage*>(m_image.get()) : 0; } String CSSImageValue::cachedImageURL() { - if (!m_image) + if (!m_image || !m_image->isCachedImage()) return String(); - return m_image->cachedImage()->url(); + return static_cast<StyleCachedImage*>(m_image.get())->cachedImage()->url(); } void CSSImageValue::clearCachedImage() { - if (m_image) - m_image->cachedImage()->removeClient(this); + if (m_image && m_image->isCachedImage()) + static_cast<StyleCachedImage*>(m_image.get())->cachedImage()->removeClient(this); m_image = 0; m_accessedImage = false; } diff --git a/WebCore/css/CSSImageValue.h b/WebCore/css/CSSImageValue.h index a1715cd..4205c4f 100644 --- a/WebCore/css/CSSImageValue.h +++ b/WebCore/css/CSSImageValue.h @@ -29,6 +29,7 @@ namespace WebCore { class DocLoader; class StyleCachedImage; +class StyleImage; class CSSImageValue : public CSSPrimitiveValue, private CachedResourceClient { public: @@ -37,6 +38,8 @@ public: virtual ~CSSImageValue(); virtual StyleCachedImage* cachedImage(DocLoader*); + // Returns a StyleCachedImage if the image is cached already, otherwise a StylePendingImage. + StyleImage* cachedOrPendingImage(); virtual bool isImageValue() const { return true; } @@ -50,7 +53,7 @@ protected: private: CSSImageValue(); - RefPtr<StyleCachedImage> m_image; + RefPtr<StyleImage> m_image; bool m_accessedImage; }; diff --git a/WebCore/css/CSSImportRule.cpp b/WebCore/css/CSSImportRule.cpp index b4d7e69..cc6083e 100644 --- a/WebCore/css/CSSImportRule.cpp +++ b/WebCore/css/CSSImportRule.cpp @@ -1,7 +1,7 @@ /* * (C) 1999-2003 Lars Knoll (knoll@kde.org) * (C) 2002-2003 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2002, 2005, 2006, 2008, 2009 Apple Inc. All rights reserved. + * Copyright (C) 2002, 2005, 2006, 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 @@ -65,7 +65,7 @@ void CSSImportRule::setCSSStyleSheet(const String& href, const KURL& baseURL, co CSSStyleSheet* parent = parentStyleSheet(); bool strict = !parent || parent->useStrictParsing(); bool enforceMIMEType = strict; - bool needsSiteSpecificQuirks = parent && parent->doc() && parent->doc()->settings() && parent->doc()->settings()->needsSiteSpecificQuirks(); + bool needsSiteSpecificQuirks = parent && parent->document() && parent->document()->settings() && parent->document()->settings()->needsSiteSpecificQuirks(); #if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) if (enforceMIMEType && needsSiteSpecificQuirks) { @@ -78,7 +78,7 @@ void CSSImportRule::setCSSStyleSheet(const String& href, const KURL& baseURL, co String sheetText = sheet->sheetText(enforceMIMEType, &validMIMEType); m_styleSheet->parseString(sheetText, strict); - if (!parent || !parent->doc() || !parent->doc()->securityOrigin()->canRequest(baseURL)) + if (!parent || !parent->document() || !parent->document()->securityOrigin()->canRequest(baseURL)) crossOriginCSS = true; if (crossOriginCSS && !validMIMEType && !m_styleSheet->hasSyntacticallyValidCSSHeader()) @@ -115,7 +115,7 @@ void CSSImportRule::insertedIntoParent() if (!parentSheet) return; - DocLoader* docLoader = parentSheet->doc()->docLoader(); + DocLoader* docLoader = parentSheet->document()->docLoader(); if (!docLoader) return; @@ -143,7 +143,7 @@ void CSSImportRule::insertedIntoParent() // removed from the pending sheet count, so let the doc know // the sheet being imported is pending. if (parentSheet && parentSheet->loadCompleted() && root == parentSheet) - parentSheet->doc()->addPendingSheet(); + parentSheet->document()->addPendingSheet(); m_loading = true; m_cachedSheet->addClient(this); } diff --git a/WebCore/css/CSSMutableStyleDeclaration.cpp b/WebCore/css/CSSMutableStyleDeclaration.cpp index e3fed35..f620be1 100644 --- a/WebCore/css/CSSMutableStyleDeclaration.cpp +++ b/WebCore/css/CSSMutableStyleDeclaration.cpp @@ -1,6 +1,6 @@ /* * (C) 1999-2003 Lars Knoll (knoll@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. + * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -499,13 +499,13 @@ void CSSMutableStyleDeclaration::setNeedsStyleRecalc() return; } - // FIXME: quick&dirty hack for KDE 3.0... make this MUCH better! (Dirk) StyleBase* root = this; while (StyleBase* parent = root->parent()) root = parent; - if (root->isCSSStyleSheet()) - if (Document* doc = static_cast<CSSStyleSheet*>(root)->doc()) - doc->updateStyleSelector(); + if (root->isCSSStyleSheet()) { + if (Document* document = static_cast<CSSStyleSheet*>(root)->document()) + document->styleSelectorChanged(DeferRecalcStyle); + } } bool CSSMutableStyleDeclaration::getPropertyPriority(int propertyID) const diff --git a/WebCore/css/CSSNamespace.h b/WebCore/css/CSSNamespace.h index d7fab4c..6225c36 100644 --- a/WebCore/css/CSSNamespace.h +++ b/WebCore/css/CSSNamespace.h @@ -1,7 +1,7 @@ /* * Copyright (C) 1999-2003 Lars Knoll (knoll@kde.org) * 1999 Waldo Bastian (bastian@kde.org) - * Copyright (C) 2004, 2006 Apple Computer, Inc. + * Copyright (C) 2004, 2006, 2010 Apple Inc. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -27,27 +27,23 @@ namespace WebCore { struct CSSNamespace : Noncopyable { - AtomicString m_prefix; - AtomicString m_uri; - CSSNamespace* m_parent; - - CSSNamespace(const AtomicString& prefix, const AtomicString& uri, CSSNamespace* parent) - : m_prefix(prefix) - , m_uri(uri) - , m_parent(parent) + AtomicString prefix; + AtomicString uri; + OwnPtr<CSSNamespace> parent; + + CSSNamespace(const AtomicString& prefix, const AtomicString& uri, PassOwnPtr<CSSNamespace> parent) + : prefix(prefix) + , uri(uri) + , parent(parent) { } - ~CSSNamespace() { delete m_parent; } - - const AtomicString& uri() { return m_uri; } - const AtomicString& prefix() { return m_prefix; } CSSNamespace* namespaceForPrefix(const AtomicString& prefix) { - if (prefix == m_prefix) - return this; - if (m_parent) - return m_parent->namespaceForPrefix(prefix); + for (CSSNamespace* candidate = this; candidate; candidate = candidate->parent.get()) { + if (candidate->prefix == prefix) + return candidate; + } return 0; } }; diff --git a/WebCore/css/CSSParser.cpp b/WebCore/css/CSSParser.cpp index f511507..07cd300 100644 --- a/WebCore/css/CSSParser.cpp +++ b/WebCore/css/CSSParser.cpp @@ -138,7 +138,6 @@ CSSParser::CSSParser(bool strictParsing) , m_important(false) , m_id(0) , m_styleSheet(0) - , m_mediaQuery(0) , m_valueList(0) , m_parsedProperties(static_cast<CSSProperty**>(fastMalloc(32 * sizeof(CSSProperty*)))) , m_numParsedProperties(0) @@ -160,9 +159,6 @@ CSSParser::CSSParser(bool strictParsing) , m_allowImportRules(true) , m_allowVariablesRules(true) , m_allowNamespaceDeclarations(true) - , m_floatingMediaQuery(0) - , m_floatingMediaQueryExp(0) - , m_floatingMediaQueryExpList(0) { #if YYDEBUG > 0 cssyydebug = 1; @@ -180,12 +176,8 @@ CSSParser::~CSSParser() fastFree(m_data); - if (m_floatingMediaQueryExpList) { + if (m_floatingMediaQueryExpList) deleteAllValues(*m_floatingMediaQueryExpList); - delete m_floatingMediaQueryExpList; - } - delete m_floatingMediaQueryExp; - delete m_floatingMediaQuery; fastDeleteAllValues(m_floatingSelectors); deleteAllValues(m_floatingValueLists); deleteAllValues(m_floatingFunctions); @@ -409,10 +401,15 @@ bool CSSParser::parseMediaQuery(MediaList* queries, const String& string) if (string.isEmpty()) return true; +<<<<<<< HEAD #ifdef ANDROID_INSTRUMENT android::TimeCounter::start(android::TimeCounter::CSSParseTimeCounter); #endif m_mediaQuery = 0; +======= + ASSERT(!m_mediaQuery); + +>>>>>>> webkit.org at r66666 // can't use { because tokenizer state switches from mediaquery to initial state when it sees { token. // instead insert one " " (which is WHITESPACE in CSSGrammar.y) setupParser("@-webkit-mediaquery ", string, "} "); @@ -421,8 +418,7 @@ bool CSSParser::parseMediaQuery(MediaList* queries, const String& string) bool ok = false; if (m_mediaQuery) { ok = true; - queries->appendMediaQuery(m_mediaQuery); - m_mediaQuery = 0; + queries->appendMediaQuery(m_mediaQuery.release()); } #ifdef ANDROID_INSTRUMENT @@ -466,12 +462,13 @@ void CSSParser::clearProperties() Document* CSSParser::document() const { StyleBase* root = m_styleSheet; - Document* doc = 0; while (root && root->parent()) root = root->parent(); - if (root && root->isCSSStyleSheet()) - doc = static_cast<CSSStyleSheet*>(root)->doc(); - return doc; + if (!root) + return 0; + if (!root->isCSSStyleSheet()) + return 0; + return static_cast<CSSStyleSheet*>(root)->document(); } bool CSSParser::validUnit(CSSParserValue* value, Units unitflags, bool strict) @@ -1219,14 +1216,14 @@ bool CSSParser::parseValue(int propId, bool important) case CSSPropertyBorderBottomRightRadius: { if (num != 1 && num != 2) return false; - validPrimitive = validUnit(value, FLength, m_strict); + validPrimitive = validUnit(value, FLength | FPercent, m_strict); if (!validPrimitive) return false; RefPtr<CSSPrimitiveValue> parsedValue1 = CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveValue::UnitTypes)value->unit); RefPtr<CSSPrimitiveValue> parsedValue2; if (num == 2) { value = m_valueList->next(); - validPrimitive = validUnit(value, FLength, m_strict); + validPrimitive = validUnit(value, FLength | FPercent, m_strict); if (!validPrimitive) return false; parsedValue2 = CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveValue::UnitTypes)value->unit); @@ -1242,7 +1239,7 @@ bool CSSParser::parseValue(int propId, bool important) case CSSPropertyWebkitBorderRadius: return parseBorderRadius(propId, important); case CSSPropertyOutlineOffset: - validPrimitive = validUnit(value, FLength, m_strict); + validPrimitive = validUnit(value, FLength | FPercent, m_strict); break; case CSSPropertyTextShadow: // CSS2 property, dropped in CSS2.1, back in CSS3, so treat as CSS3 case CSSPropertyWebkitBoxShadow: @@ -2363,7 +2360,7 @@ bool CSSParser::parseContent(int propId, bool important) parsedValue = CSSImageValue::create(m_styleSheet->completeURL(val->string)); } else if (val->unit == CSSParserValue::Function) { // attr(X) | counter(X [,Y]) | counters(X, Y, [,Z]) | -webkit-gradient(...) - CSSParserValueList* args = val->function->args; + CSSParserValueList* args = val->function->args.get(); if (!args) return false; if (equalIgnoringCase(val->function->name, "attr(")) { @@ -2913,7 +2910,7 @@ PassRefPtr<CSSValue> CSSParser::parseAnimationTimingFunction() return 0; // The only timing function we accept for now is a cubic bezier function. 4 points must be specified. - CSSParserValueList* args = value->function->args; + CSSParserValueList* args = value->function->args.get(); if (!equalIgnoringCase(value->function->name, "cubic-bezier(") || !args || args->size() != 7) return 0; @@ -3088,7 +3085,7 @@ bool CSSParser::parseDashboardRegions(int propId, bool important) // also allow // dashboard-region(label, type) or dashboard-region(label type) // dashboard-region(label, type) or dashboard-region(label type) - CSSParserValueList* args = value->function->args; + CSSParserValueList* args = value->function->args.get(); if (!equalIgnoringCase(value->function->name, "dashboard-region(") || !args) { valid = false; break; @@ -3234,7 +3231,7 @@ PassRefPtr<CSSValue> CSSParser::parseCounterContent(CSSParserValueList* args, bo bool CSSParser::parseShape(int propId, bool important) { CSSParserValue* value = m_valueList->current(); - CSSParserValueList* args = value->function->args; + CSSParserValueList* args = value->function->args.get(); if (!equalIgnoringCase(value->function->name, "rect(") || !args) return false; @@ -3598,7 +3595,7 @@ bool CSSParser::parseFontWeight(bool important) static bool isValidFormatFunction(CSSParserValue* val) { - CSSParserValueList* args = val->function->args; + CSSParserValueList* args = val->function->args.get(); return equalIgnoringCase(val->function->name, "format(") && (args->current()->unit == CSSPrimitiveValue::CSS_STRING || args->current()->unit == CSSPrimitiveValue::CSS_IDENT); } @@ -3621,7 +3618,7 @@ bool CSSParser::parseFontFaceSrc() expectComma = true; } else if (val->unit == CSSParserValue::Function) { // There are two allowed functions: local() and format(). - CSSParserValueList* args = val->function->args; + CSSParserValueList* args = val->function->args.get(); if (args && args->size() == 1) { if (equalIgnoringCase(val->function->name, "local(") && !expectComma) { expectComma = true; @@ -3959,7 +3956,7 @@ static inline int colorIntFromValue(CSSParserValue* v) bool CSSParser::parseColorParameters(CSSParserValue* value, int* colorArray, bool parseAlpha) { - CSSParserValueList* args = value->function->args; + CSSParserValueList* args = value->function->args.get(); CSSParserValue* v = args->current(); Units unitType = FUnknown; // Get the first value and its type @@ -4000,7 +3997,7 @@ bool CSSParser::parseColorParameters(CSSParserValue* value, int* colorArray, boo // The first value, HUE, is in an angle with a value between 0 and 360 bool CSSParser::parseHSLParameters(CSSParserValue* value, double* colorArray, bool parseAlpha) { - CSSParserValueList* args = value->function->args; + CSSParserValueList* args = value->function->args.get(); CSSParserValue* v = args->current(); // Get the first value if (!validUnit(v, FNumber, true)) @@ -4549,7 +4546,7 @@ bool CSSParser::parseBorderRadius(int propId, bool important) if (i - indexAfterSlash >= 4) return false; - if (!validUnit(value, FLength, m_strict)) + if (!validUnit(value, FLength | FPercent, m_strict)) return false; RefPtr<CSSPrimitiveValue> radius = CSSPrimitiveValue::create(value->fValue, static_cast<CSSPrimitiveValue::UnitTypes>(value->unit)); @@ -4649,7 +4646,7 @@ static bool parseGradientColorStop(CSSParser* p, CSSParserValue* a, CSSGradientC !equalIgnoringCase(a->function->name, "color-stop(")) return false; - CSSParserValueList* args = a->function->args; + CSSParserValueList* args = a->function->args.get(); if (!args) return false; @@ -4708,7 +4705,7 @@ bool CSSParser::parseGradient(RefPtr<CSSValue>& gradient) RefPtr<CSSGradientValue> result = CSSGradientValue::create(); // Walk the arguments. - CSSParserValueList* args = m_valueList->current()->function->args; + CSSParserValueList* args = m_valueList->current()->function->args.get(); if (!args || args->size() == 0) return false; @@ -4829,7 +4826,7 @@ bool CSSParser::parseCanvas(RefPtr<CSSValue>& canvas) RefPtr<CSSCanvasValue> result = CSSCanvasValue::create(); // Walk the arguments. - CSSParserValueList* args = m_valueList->current()->function->args; + CSSParserValueList* args = m_valueList->current()->function->args.get(); if (!args || args->size() != 1) return false; @@ -4949,7 +4946,7 @@ PassRefPtr<CSSValueList> CSSParser::parseTransform() return 0; // Every primitive requires at least one argument. - CSSParserValueList* args = value->function->args; + CSSParserValueList* args = value->function->args.get(); if (!args) return 0; @@ -5371,52 +5368,45 @@ CSSParserValue& CSSParser::sinkFloatingValue(CSSParserValue& value) MediaQueryExp* CSSParser::createFloatingMediaQueryExp(const AtomicString& mediaFeature, CSSParserValueList* values) { - delete m_floatingMediaQueryExp; - m_floatingMediaQueryExp = new MediaQueryExp(mediaFeature, values); - return m_floatingMediaQueryExp; + m_floatingMediaQueryExp = adoptPtr(new MediaQueryExp(mediaFeature, values)); + return m_floatingMediaQueryExp.get(); } -MediaQueryExp* CSSParser::sinkFloatingMediaQueryExp(MediaQueryExp* e) +PassOwnPtr<MediaQueryExp> CSSParser::sinkFloatingMediaQueryExp(MediaQueryExp* expression) { - ASSERT(e == m_floatingMediaQueryExp); - m_floatingMediaQueryExp = 0; - return e; + ASSERT_UNUSED(expression, expression == m_floatingMediaQueryExp); + return m_floatingMediaQueryExp.release(); } Vector<MediaQueryExp*>* CSSParser::createFloatingMediaQueryExpList() { - if (m_floatingMediaQueryExpList) { + if (m_floatingMediaQueryExpList) deleteAllValues(*m_floatingMediaQueryExpList); - delete m_floatingMediaQueryExpList; - } - m_floatingMediaQueryExpList = new Vector<MediaQueryExp*>; - return m_floatingMediaQueryExpList; + m_floatingMediaQueryExpList = adoptPtr(new Vector<MediaQueryExp*>); + return m_floatingMediaQueryExpList.get(); } -Vector<MediaQueryExp*>* CSSParser::sinkFloatingMediaQueryExpList(Vector<MediaQueryExp*>* l) +PassOwnPtr<Vector<MediaQueryExp*> > CSSParser::sinkFloatingMediaQueryExpList(Vector<MediaQueryExp*>* list) { - ASSERT(l == m_floatingMediaQueryExpList); - m_floatingMediaQueryExpList = 0; - return l; + ASSERT_UNUSED(list, list == m_floatingMediaQueryExpList); + return m_floatingMediaQueryExpList.release(); } -MediaQuery* CSSParser::createFloatingMediaQuery(MediaQuery::Restrictor r, const String& mediaType, Vector<MediaQueryExp*>* exprs) +MediaQuery* CSSParser::createFloatingMediaQuery(MediaQuery::Restrictor restrictor, const String& mediaType, PassOwnPtr<Vector<MediaQueryExp*> > expressions) { - delete m_floatingMediaQuery; - m_floatingMediaQuery = new MediaQuery(r, mediaType, exprs); - return m_floatingMediaQuery; + m_floatingMediaQuery = adoptPtr(new MediaQuery(restrictor, mediaType, expressions)); + return m_floatingMediaQuery.get(); } -MediaQuery* CSSParser::createFloatingMediaQuery(Vector<MediaQueryExp*>* exprs) +MediaQuery* CSSParser::createFloatingMediaQuery(PassOwnPtr<Vector<MediaQueryExp*> > expressions) { - return createFloatingMediaQuery(MediaQuery::None, "all", exprs); + return createFloatingMediaQuery(MediaQuery::None, "all", expressions); } -MediaQuery* CSSParser::sinkFloatingMediaQuery(MediaQuery* mq) +PassOwnPtr<MediaQuery> CSSParser::sinkFloatingMediaQuery(MediaQuery* query) { - ASSERT(mq == m_floatingMediaQuery); - m_floatingMediaQuery = 0; - return mq; + ASSERT_UNUSED(query, query == m_floatingMediaQuery); + return m_floatingMediaQuery.release(); } MediaList* CSSParser::createMediaList() @@ -5678,7 +5668,7 @@ bool CSSParser::checkForVariables(CSSParserValueList* valueList) break; } - if (valueList->valueAt(i)->unit == CSSParserValue::Function && checkForVariables(valueList->valueAt(i)->function->args)) { + if (valueList->valueAt(i)->unit == CSSParserValue::Function && checkForVariables(valueList->valueAt(i)->function->args.get())) { hasVariables = true; break; } diff --git a/WebCore/css/CSSParser.h b/WebCore/css/CSSParser.h index 1e233c8..6211e62 100644 --- a/WebCore/css/CSSParser.h +++ b/WebCore/css/CSSParser.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2003 Lars Knoll (knoll@kde.org) - * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. + * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. All rights reserved. * Copyright (C) 2008 Eric Seidel <eric@webkit.org> * Copyright (C) 2009 - 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. * @@ -194,12 +194,12 @@ namespace WebCore { void endDeclarationsForMarginBox(); MediaQueryExp* createFloatingMediaQueryExp(const AtomicString&, CSSParserValueList*); - MediaQueryExp* sinkFloatingMediaQueryExp(MediaQueryExp*); + PassOwnPtr<MediaQueryExp> sinkFloatingMediaQueryExp(MediaQueryExp*); Vector<MediaQueryExp*>* createFloatingMediaQueryExpList(); - Vector<MediaQueryExp*>* sinkFloatingMediaQueryExpList(Vector<MediaQueryExp*>*); - MediaQuery* createFloatingMediaQuery(MediaQuery::Restrictor, const String&, Vector<MediaQueryExp*>*); - MediaQuery* createFloatingMediaQuery(Vector<MediaQueryExp*>*); - MediaQuery* sinkFloatingMediaQuery(MediaQuery*); + PassOwnPtr<Vector<MediaQueryExp*> > sinkFloatingMediaQueryExpList(Vector<MediaQueryExp*>*); + MediaQuery* createFloatingMediaQuery(MediaQuery::Restrictor, const String&, PassOwnPtr<Vector<MediaQueryExp*> >); + MediaQuery* createFloatingMediaQuery(PassOwnPtr<Vector<MediaQueryExp*> >); + PassOwnPtr<MediaQuery> sinkFloatingMediaQuery(MediaQuery*); void addNamespace(const AtomicString& prefix, const AtomicString& uri); @@ -221,7 +221,7 @@ namespace WebCore { CSSStyleSheet* m_styleSheet; RefPtr<CSSRule> m_rule; RefPtr<CSSRule> m_keyframe; - MediaQuery* m_mediaQuery; + OwnPtr<MediaQuery> m_mediaQuery; CSSParserValueList* m_valueList; CSSProperty** m_parsedProperties; CSSSelectorList* m_selectorListForParseSelector; @@ -301,9 +301,9 @@ namespace WebCore { HashSet<CSSParserValueList*> m_floatingValueLists; HashSet<CSSParserFunction*> m_floatingFunctions; - MediaQuery* m_floatingMediaQuery; - MediaQueryExp* m_floatingMediaQueryExp; - Vector<MediaQueryExp*>* m_floatingMediaQueryExpList; + OwnPtr<MediaQuery> m_floatingMediaQuery; + OwnPtr<MediaQueryExp> m_floatingMediaQueryExp; + OwnPtr<Vector<MediaQueryExp*> > m_floatingMediaQueryExpList; Vector<CSSSelector*> m_reusableSelectorVector; diff --git a/WebCore/css/CSSParserValues.h b/WebCore/css/CSSParserValues.h index 5c6f55e..8644d9b 100644 --- a/WebCore/css/CSSParserValues.h +++ b/WebCore/css/CSSParserValues.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2003 Lars Knoll (knoll@kde.org) - * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. + * Copyright (C) 2004, 2005, 2006, 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 @@ -90,9 +90,7 @@ private: struct CSSParserFunction : FastAllocBase { CSSParserString name; - CSSParserValueList* args; - - ~CSSParserFunction() { delete args; } + OwnPtr<CSSParserValueList> args; }; } diff --git a/WebCore/css/CSSPrimitiveValue.cpp b/WebCore/css/CSSPrimitiveValue.cpp index 0508cd5..b4478b4 100644 --- a/WebCore/css/CSSPrimitiveValue.cpp +++ b/WebCore/css/CSSPrimitiveValue.cpp @@ -329,9 +329,6 @@ int CSSPrimitiveValue::computeLengthInt(RenderStyle* style, RenderStyle* rootSty return static_cast<int>(result); } -const int intMaxForLength = 0x7ffffff; // max value for a 28-bit int -const int intMinForLength = (-0x7ffffff - 1); // min value for a 28-bit int - // Lengths expect an int that is only 28-bits, so we have to check for a different overflow. int CSSPrimitiveValue::computeLengthIntForLength(RenderStyle* style, RenderStyle* rootStyle) { diff --git a/WebCore/css/CSSPrimitiveValueMappings.h b/WebCore/css/CSSPrimitiveValueMappings.h index b1d2d3d..3da5cf6 100644 --- a/WebCore/css/CSSPrimitiveValueMappings.h +++ b/WebCore/css/CSSPrimitiveValueMappings.h @@ -262,6 +262,9 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ControlPart e) case MediaControlsBackgroundPart: m_value.ident = CSSValueMediaControlsBackground; break; + case MediaControlsFullscreenBackgroundPart: + m_value.ident = CSSValueMediaControlsFullscreenBackground; + break; case MediaCurrentTimePart: m_value.ident = CSSValueMediaCurrentTimeDisplay; break; @@ -1005,6 +1008,9 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EListStyleType e) case Armenian: m_value.ident = CSSValueArmenian; break; + case Asterisks: + m_value.ident = CSSValueAsterisks; + break; case BinaryListStyle: m_value.ident = CSSValueBinary; break; @@ -1086,6 +1092,9 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EListStyleType e) case EthiopicHalehameTig: m_value.ident = CSSValueEthiopicHalehameTig; break; + case Footnotes: + m_value.ident = CSSValueFootnotes; + break; case Georgian: m_value.ident = CSSValueGeorgian; break; @@ -1602,7 +1611,7 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETextAlign e) { switch (e) { case TAAUTO: - m_value.ident = CSSValueAuto; + m_value.ident = CSSValueWebkitAuto; break; case LEFT: m_value.ident = CSSValueLeft; diff --git a/WebCore/css/CSSPropertyNames.in b/WebCore/css/CSSPropertyNames.in index 0216ae1..a3063db 100644 --- a/WebCore/css/CSSPropertyNames.in +++ b/WebCore/css/CSSPropertyNames.in @@ -20,6 +20,7 @@ font-style font-variant font-weight text-rendering +-webkit-font-smoothing -webkit-text-size-adjust zoom @@ -213,7 +214,6 @@ z-index -webkit-column-width -webkit-columns -webkit-font-size-delta --webkit-font-smoothing -webkit-highlight -webkit-hyphenate-character -webkit-hyphenate-locale diff --git a/WebCore/css/CSSSelector.cpp b/WebCore/css/CSSSelector.cpp index 1f336a2..fb8f695 100644 --- a/WebCore/css/CSSSelector.cpp +++ b/WebCore/css/CSSSelector.cpp @@ -248,6 +248,13 @@ PseudoId CSSSelector::pseudoId(PseudoType type) return NOPSEUDO; #endif +#if ENABLE(FULLSCREEN_API) + case PseudoFullScreen: + return FULL_SCREEN; + case PseudoFullScreenDocument: + return FULL_SCREEN_DOCUMENT; +#endif + case PseudoInputListButton: #if ENABLE(DATALIST) return INPUT_LIST_BUTTON; @@ -426,6 +433,10 @@ static HashMap<AtomicStringImpl*, CSSSelector::PseudoType>* nameToPseudoTypeMap( DEFINE_STATIC_LOCAL(AtomicString, firstPage, ("first")); DEFINE_STATIC_LOCAL(AtomicString, leftPage, ("left")); DEFINE_STATIC_LOCAL(AtomicString, rightPage, ("right")); +#if ENABLE(FULLSCREEN_API) + DEFINE_STATIC_LOCAL(AtomicString, fullScreen, ("-webkit-full-screen")); + DEFINE_STATIC_LOCAL(AtomicString, fullScreenDocument, ("-webkit-full-screen-document")); +#endif static HashMap<AtomicStringImpl*, CSSSelector::PseudoType>* nameToPseudoType = 0; if (!nameToPseudoType) { @@ -537,6 +548,10 @@ static HashMap<AtomicStringImpl*, CSSSelector::PseudoType>* nameToPseudoTypeMap( nameToPseudoType->set(firstPage.impl(), CSSSelector::PseudoFirstPage); nameToPseudoType->set(leftPage.impl(), CSSSelector::PseudoLeftPage); nameToPseudoType->set(rightPage.impl(), CSSSelector::PseudoRightPage); +#if ENABLE(FULLSCREEN_API) + nameToPseudoType->set(fullScreen.impl(), CSSSelector::PseudoFullScreen); + nameToPseudoType->set(fullScreenDocument.impl(), CSSSelector::PseudoFullScreenDocument); +#endif } return nameToPseudoType; } @@ -666,6 +681,10 @@ void CSSSelector::extractPseudoType() const case PseudoSingleButton: case PseudoNoButton: case PseudoNotParsed: +#if ENABLE(FULLSCREEN_API) + case PseudoFullScreen: + case PseudoFullScreenDocument: +#endif break; case PseudoFirstPage: case PseudoLeftPage: diff --git a/WebCore/css/CSSSelector.h b/WebCore/css/CSSSelector.h index e253949..00e23b9 100644 --- a/WebCore/css/CSSSelector.h +++ b/WebCore/css/CSSSelector.h @@ -217,6 +217,10 @@ namespace WebCore { PseudoLeftPage, PseudoRightPage, PseudoFirstPage, +#if ENABLE(FULLSCREEN_API) + PseudoFullScreen, + PseudoFullScreenDocument, +#endif }; enum MarginBoxType { diff --git a/WebCore/css/CSSStyleSelector.cpp b/WebCore/css/CSSStyleSelector.cpp index aa724a3..a75dede 100644 --- a/WebCore/css/CSSStyleSelector.cpp +++ b/WebCore/css/CSSStyleSelector.cpp @@ -49,7 +49,6 @@ #include "CSSVariablesRule.h" #include "CachedImage.h" #include "Counter.h" -#include "CounterContent.h" #include "FocusController.h" #include "FontFamilyValue.h" #include "FontValue.h" @@ -83,6 +82,7 @@ #include "ShadowValue.h" #include "SkewTransformOperation.h" #include "StyleCachedImage.h" +#include "StylePendingImage.h" #include "StyleGeneratedImage.h" #include "StyleSheetList.h" #include "Text.h" @@ -199,12 +199,12 @@ if (value->isValueList()) { \ currChild = new FillLayer(LayerType##FillLayer); \ prevChild->setNext(currChild); \ } \ - mapFill##Prop(currChild, valueList->itemWithoutBoundsCheck(i)); \ + mapFill##Prop(property, currChild, valueList->itemWithoutBoundsCheck(i)); \ prevChild = currChild; \ currChild = currChild->next(); \ } \ } else { \ - mapFill##Prop(currChild, value); \ + mapFill##Prop(property, currChild, value); \ currChild = currChild->next(); \ } \ while (currChild) { \ @@ -370,15 +370,15 @@ public: CSSRuleDataList* getIDRules(AtomicStringImpl* key) { return m_idRules.get(key); } CSSRuleDataList* getClassRules(AtomicStringImpl* key) { return m_classRules.get(key); } CSSRuleDataList* getTagRules(AtomicStringImpl* key) { return m_tagRules.get(key); } - CSSRuleDataList* getUniversalRules() { return m_universalRules; } - CSSRuleDataList* getPageRules() { return m_pageRules; } + CSSRuleDataList* getUniversalRules() { return m_universalRules.get(); } + CSSRuleDataList* getPageRules() { return m_pageRules.get(); } public: AtomRuleMap m_idRules; AtomRuleMap m_classRules; AtomRuleMap m_tagRules; - CSSRuleDataList* m_universalRules; - CSSRuleDataList* m_pageRules; + OwnPtr<CSSRuleDataList> m_universalRules; + OwnPtr<CSSRuleDataList> m_pageRules; unsigned m_ruleCount; unsigned m_pageRuleCount; }; @@ -413,21 +413,19 @@ static const MediaQueryEvaluator& printEval() return staticPrintEval; } -CSSStyleSelector::CSSStyleSelector(Document* doc, StyleSheetList* styleSheets, CSSStyleSheet* mappedElementSheet, +CSSStyleSelector::CSSStyleSelector(Document* document, StyleSheetList* styleSheets, CSSStyleSheet* mappedElementSheet, CSSStyleSheet* pageUserSheet, const Vector<RefPtr<CSSStyleSheet> >* pageGroupUserSheets, bool strictParsing, bool matchAuthorAndUserStyles) : m_backgroundData(BackgroundFillLayer) - , m_checker(doc, strictParsing) + , m_checker(document, strictParsing) , m_element(0) , m_styledElement(0) , m_elementLinkState(NotInsideLink) - , m_fontSelector(CSSFontSelector::create(doc)) + , m_fontSelector(CSSFontSelector::create(document)) { - init(); - m_matchAuthorAndUserStyles = matchAuthorAndUserStyles; - Element* root = doc->documentElement(); + Element* root = document->documentElement(); if (!defaultStyle) { if (!root || elementCanUseSimpleDefaultStyle(root)) @@ -436,32 +434,28 @@ CSSStyleSelector::CSSStyleSelector(Document* doc, StyleSheetList* styleSheets, C loadFullDefaultStyle(); } - m_userStyle = 0; - // construct document root element default style. this is needed // to evaluate media queries that contain relative constraints, like "screen and (max-width: 10em)" // This is here instead of constructor, because when constructor is run, // document doesn't have documentElement // NOTE: this assumes that element that gets passed to styleForElement -call // is always from the document that owns the style selector - FrameView* view = doc->view(); + FrameView* view = document->view(); if (view) - m_medium = new MediaQueryEvaluator(view->mediaType()); + m_medium = adoptPtr(new MediaQueryEvaluator(view->mediaType())); else - m_medium = new MediaQueryEvaluator("all"); + m_medium = adoptPtr(new MediaQueryEvaluator("all")); if (root) m_rootDefaultStyle = styleForElement(root, 0, false, true); // don't ref, because the RenderStyle is allocated from global heap - if (m_rootDefaultStyle && view) { - delete m_medium; - m_medium = new MediaQueryEvaluator(view->mediaType(), view->frame(), m_rootDefaultStyle.get()); - } + if (m_rootDefaultStyle && view) + m_medium = adoptPtr(new MediaQueryEvaluator(view->mediaType(), view->frame(), m_rootDefaultStyle.get())); - m_authorStyle = new CSSRuleSet(); + m_authorStyle = adoptPtr(new CSSRuleSet); // FIXME: This sucks! The user sheet is reparsed every time! - OwnPtr<CSSRuleSet> tempUserStyle(new CSSRuleSet); + OwnPtr<CSSRuleSet> tempUserStyle = adoptPtr(new CSSRuleSet); if (pageUserSheet) tempUserStyle->addRulesFromSheet(pageUserSheet, *m_medium, this); if (pageGroupUserSheets) { @@ -475,7 +469,7 @@ CSSStyleSelector::CSSStyleSelector(Document* doc, StyleSheetList* styleSheets, C } if (tempUserStyle->m_ruleCount > 0 || tempUserStyle->m_pageRuleCount > 0) - m_userStyle = tempUserStyle.leakPtr(); + m_userStyle = tempUserStyle.release(); // Add rules from elements like SVG's <font-face> if (mappedElementSheet) @@ -489,8 +483,8 @@ CSSStyleSelector::CSSStyleSelector(Document* doc, StyleSheetList* styleSheets, C m_authorStyle->addRulesFromSheet(static_cast<CSSStyleSheet*>(sheet), *m_medium, this); } - if (doc->renderer() && doc->renderer()->style()) - doc->renderer()->style()->font().update(fontSelector()); + if (document->renderer() && document->renderer()->style()) + document->renderer()->style()->font().update(fontSelector()); } // This is a simplified style setting function for keyframe styles @@ -500,23 +494,10 @@ void CSSStyleSelector::addKeyframeStyle(PassRefPtr<WebKitCSSKeyframesRule> rule) m_keyframesRuleMap.add(s.impl(), rule); } -void CSSStyleSelector::init() -{ - initElement(0); - m_matchedDecls.clear(); - m_ruleList = 0; - m_rootDefaultStyle = 0; - m_medium = 0; -} - CSSStyleSelector::~CSSStyleSelector() { m_fontSelector->clearDocument(); - delete m_medium; - delete m_authorStyle; - delete m_userStyle; deleteAllValues(m_viewportDependentMediaQueryResults); - m_keyframesRuleMap.clear(); } static CSSStyleSheet* parseUASheet(const String& str) @@ -556,6 +537,14 @@ static void loadFullDefaultStyle() String quirksRules = String(quirksUserAgentStyleSheet, sizeof(quirksUserAgentStyleSheet)) + RenderTheme::defaultTheme()->extraQuirksStyleSheet(); CSSStyleSheet* quirksSheet = parseUASheet(quirksRules); defaultQuirksStyle->addRulesFromSheet(quirksSheet, screenEval()); + +#if ENABLE(FULLSCREEN_API) + // Full-screen rules. + String fullscreenRules = String(fullscreenUserAgentStyleSheet, sizeof(fullscreenUserAgentStyleSheet)) + RenderTheme::defaultTheme()->extraDefaultStyleSheet(); + CSSStyleSheet* fullscreenSheet = parseUASheet(fullscreenRules); + defaultStyle->addRulesFromSheet(fullscreenSheet, screenEval()); + defaultQuirksStyle->addRulesFromSheet(fullscreenSheet, screenEval()); +#endif } static void loadSimpleDefaultStyle() @@ -855,6 +844,8 @@ inline void CSSStyleSelector::initForStyleResolve(Element* e, RenderStyle* paren m_matchedDecls.clear(); + m_pendingImageProperties.clear(); + m_ruleList = 0; m_fontDirty = false; @@ -1135,8 +1126,6 @@ PassRefPtr<RenderStyle> CSSStyleSelector::styleForDocument(Document* document) documentStyle->setFontDescription(fontDescription); documentStyle->font().update(0); - if (document->inCompatMode()) - documentStyle->setHtmlHacks(true); // enable html specific rendering tricks return documentStyle.release(); } @@ -1258,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, firstUserRule, lastUserRule); + matchRules(m_userStyle.get(), firstUserRule, lastUserRule); // 5. Now check author rules, beginning first with presentational attributes // mapped from HTML. @@ -1297,7 +1286,7 @@ PassRefPtr<RenderStyle> CSSStyleSelector::styleForElement(Element* e, RenderStyl // 6. Check the rules in author sheets next. if (m_matchAuthorAndUserStyles) - matchRules(m_authorStyle, firstAuthorRule, lastAuthorRule); + matchRules(m_authorStyle.get(), firstAuthorRule, lastAuthorRule); // 7. Now check our inline style attribute. if (m_matchAuthorAndUserStyles && m_styledElement) { @@ -1347,7 +1336,8 @@ PassRefPtr<RenderStyle> CSSStyleSelector::styleForElement(Element* e, RenderStyl applyDeclarations<false>(true, firstUserRule, lastUserRule); } applyDeclarations<false>(true, firstUARule, lastUARule); - + + ASSERT(!m_fontDirty); // If our font got dirtied by one of the non-essential font props, // go ahead and update it a second time. if (m_fontDirty) @@ -1356,6 +1346,9 @@ PassRefPtr<RenderStyle> CSSStyleSelector::styleForElement(Element* e, RenderStyl // Clean up our style object's display and text decorations (among other fixups). adjustRenderStyle(style(), e); + // Start loading images referenced by this style. + loadPendingImages(); + // If we have first-letter pseudo style, do not share this style if (m_style->hasPseudoStyle(FIRST_LETTER)) m_style->setUnique(); @@ -1380,7 +1373,7 @@ PassRefPtr<RenderStyle> CSSStyleSelector::styleForElement(Element* e, RenderStyl return m_style.release(); } -PassRefPtr<RenderStyle> CSSStyleSelector::styleForKeyframe(const RenderStyle* elementStyle, const WebKitCSSKeyframeRule* keyframeRule, KeyframeList& list) +PassRefPtr<RenderStyle> CSSStyleSelector::styleForKeyframe(const RenderStyle* elementStyle, const WebKitCSSKeyframeRule* keyframeRule, KeyframeValue& keyframe) { if (keyframeRule->style()) addMatchedDeclaration(keyframeRule->style()); @@ -1414,7 +1407,10 @@ PassRefPtr<RenderStyle> CSSStyleSelector::styleForKeyframe(const RenderStyle* el if (m_fontDirty) updateFont(); - // Add all the animating properties to the list + // Start loading images referenced by this style. + loadPendingImages(); + + // Add all the animating properties to the keyframe. if (keyframeRule->style()) { CSSMutableStyleDeclaration::const_iterator end = keyframeRule->style()->end(); for (CSSMutableStyleDeclaration::const_iterator it = keyframeRule->style()->begin(); it != end; ++it) { @@ -1422,7 +1418,7 @@ PassRefPtr<RenderStyle> CSSStyleSelector::styleForKeyframe(const RenderStyle* el // Timing-function within keyframes is special, because it is not animated; it just // describes the timing function between this keyframe and the next. if (property != CSSPropertyWebkitAnimationTimingFunction) - list.addProperty(property); + keyframe.addProperty(property); } } @@ -1443,7 +1439,6 @@ void CSSStyleSelector::keyframeStylesForAnimation(Element* e, const RenderStyle* return; const WebKitCSSKeyframesRule* rule = m_keyframesRuleMap.find(list.animationName().impl()).get()->second.get(); - RefPtr<RenderStyle> keyframeStyle; // Construct and populate the style for each keyframe for (unsigned i = 0; i < rule->length(); ++i) { @@ -1452,34 +1447,36 @@ void CSSStyleSelector::keyframeStylesForAnimation(Element* e, const RenderStyle* initForStyleResolve(e); const WebKitCSSKeyframeRule* keyframeRule = rule->item(i); - - keyframeStyle = styleForKeyframe(elementStyle, keyframeRule, list); + + KeyframeValue keyframe(0, 0); + keyframe.setStyle(styleForKeyframe(elementStyle, keyframeRule, keyframe)); // Add this keyframe style to all the indicated key times Vector<float> keys; keyframeRule->getKeys(keys); for (size_t keyIndex = 0; keyIndex < keys.size(); ++keyIndex) { - float key = keys[keyIndex]; - list.insert(key, keyframeStyle.get()); + keyframe.setKey(keys[keyIndex]); + list.insert(keyframe); } - keyframeStyle.release(); } // If the 0% keyframe is missing, create it (but only if there is at least one other keyframe) int initialListSize = list.size(); - if (initialListSize > 0 && list.beginKeyframes()->key() != 0) { - RefPtr<WebKitCSSKeyframeRule> keyframe = WebKitCSSKeyframeRule::create(); - keyframe->setKeyText("0%"); - keyframeStyle = styleForKeyframe(elementStyle, keyframe.get(), list); - list.insert(0, keyframeStyle.release()); + if (initialListSize > 0 && list[0].key() != 0) { + RefPtr<WebKitCSSKeyframeRule> keyframeRule = WebKitCSSKeyframeRule::create(); + keyframeRule->setKeyText("0%"); + KeyframeValue keyframe(0, 0); + keyframe.setStyle(styleForKeyframe(elementStyle, keyframeRule.get(), keyframe)); + list.insert(keyframe); } // If the 100% keyframe is missing, create it (but only if there is at least one other keyframe) - if (initialListSize > 0 && (list.endKeyframes() - 1)->key() != 1) { - RefPtr<WebKitCSSKeyframeRule> keyframe = WebKitCSSKeyframeRule::create(); - keyframe->setKeyText("100%"); - keyframeStyle = styleForKeyframe(elementStyle, keyframe.get(), list); - list.insert(1, keyframeStyle.release()); + if (initialListSize > 0 && (list[list.size() - 1].key() != 1)) { + RefPtr<WebKitCSSKeyframeRule> keyframeRule = WebKitCSSKeyframeRule::create(); + keyframeRule->setKeyText("100%"); + KeyframeValue keyframe(1, 0); + keyframe.setStyle(styleForKeyframe(elementStyle, keyframeRule.get(), keyframe)); + list.insert(keyframe); } } @@ -1518,8 +1515,8 @@ PassRefPtr<RenderStyle> CSSStyleSelector::pseudoStyleForElement(PseudoId pseudo, matchUARules(firstUARule, lastUARule); if (m_matchAuthorAndUserStyles) { - matchRules(m_userStyle, firstUserRule, lastUserRule); - matchRules(m_authorStyle, firstAuthorRule, lastAuthorRule); + matchRules(m_userStyle.get(), firstUserRule, lastUserRule); + matchRules(m_authorStyle.get(), firstAuthorRule, lastAuthorRule); } if (m_matchedDecls.isEmpty() && !visitedStyle) @@ -1569,6 +1566,9 @@ PassRefPtr<RenderStyle> CSSStyleSelector::pseudoStyleForElement(PseudoId pseudo, // Clean up our style object's display and text decorations (among other fixups). adjustRenderStyle(style(), 0); + // Start loading images referenced by this style. + loadPendingImages(); + // Hang our visited style off m_style. if (visitedStyle) m_style->addCachedPseudoStyle(visitedStyle.release()); @@ -1588,8 +1588,8 @@ PassRefPtr<RenderStyle> CSSStyleSelector::styleForPage(int pageIndex) const bool isFirst = isFirstPage(pageIndex); const String page = pageName(pageIndex); matchPageRules(defaultPrintStyle, isLeft, isFirst, page); - matchPageRules(m_userStyle, isLeft, isFirst, page); - matchPageRules(m_authorStyle, isLeft, isFirst, page); + matchPageRules(m_userStyle.get(), isLeft, isFirst, page); + matchPageRules(m_authorStyle.get(), isLeft, isFirst, page); m_lineHeightValue = 0; applyDeclarations<true>(false, 0, m_matchedDecls.size() - 1); @@ -1603,6 +1603,9 @@ PassRefPtr<RenderStyle> CSSStyleSelector::styleForPage(int pageIndex) applyDeclarations<false>(false, 0, m_matchedDecls.size() - 1); + // Start loading images referenced by this style. + loadPendingImages(); + // Now return the style. return m_style.release(); } @@ -1865,14 +1868,14 @@ PassRefPtr<CSSRuleList> CSSStyleSelector::pseudoStyleRulesForElement(Element* e, // Now we check user sheet rules. if (m_matchAuthorAndUserStyles) { int firstUserRule = -1, lastUserRule = -1; - matchRules(m_userStyle, firstUserRule, lastUserRule); + matchRules(m_userStyle.get(), firstUserRule, lastUserRule); } } if (m_matchAuthorAndUserStyles) { // Check the rules in author sheets. int firstAuthorRule = -1, lastAuthorRule = -1; - matchRules(m_authorStyle, firstAuthorRule, lastAuthorRule); + matchRules(m_authorStyle.get(), firstAuthorRule, lastAuthorRule); } m_checker.m_collectRulesOnly = false; @@ -2598,22 +2601,7 @@ bool CSSStyleSelector::SelectorChecker::checkOneSelector(CSSSelector* sel, Eleme return true; break; case CSSSelector::PseudoLang: { - Node* n = e; - AtomicString value; - // The language property is inherited, so we iterate over the parents - // to find the first language. - while (n && value.isNull()) { - if (n->isElementNode()) { - // Spec: xml:lang takes precedence -- http://www.w3.org/TR/xhtml1/#C_7 - value = static_cast<Element*>(n)->fastGetAttribute(XMLNames::langAttr); - if (value.isNull()) - value = static_cast<Element*>(n)->fastGetAttribute(langAttr); - } else if (n->isDocumentNode()) - // checking the MIME content-language - value = static_cast<Document*>(n)->contentLanguage(); - - n = n->parent(); - } + AtomicString value = e->computeInheritedLanguage(); const AtomicString& argument = sel->argument(); if (value.isEmpty() || !value.startsWith(argument, false)) break; @@ -2621,6 +2609,26 @@ bool CSSStyleSelector::SelectorChecker::checkOneSelector(CSSSelector* sel, Eleme break; return true; } +#if ENABLE(FULLSCREEN_API) + case CSSSelector::PseudoFullScreen: + // While a Document is in the fullscreen state, and the document's current fullscreen + // element is an element in the document, the 'full-screen' pseudoclass applies to + // that element. Also, an <iframe>, <object> or <embed> element whose child browsing + // context's Document is in the fullscreen state has the 'full-screen' pseudoclass applied. + if (!e->document()->webkitFullScreen()) + return false; + if (e != e->document()->webkitCurrentFullScreenElement()) + return false; + return true; + case CSSSelector::PseudoFullScreenDocument: + // While a Document is in the fullscreen state, the 'full-screen-document' pseudoclass applies + // to the root element of that Document. + if (!e->document()->webkitFullScreen()) + return false; + if (e != e->document()->documentElement()) + return false; + return true; +#endif case CSSSelector::PseudoUnknown: case CSSSelector::PseudoNotParsed: default: @@ -2745,11 +2753,9 @@ CSSValue* CSSStyleSelector::resolveVariableDependentValue(CSSVariableDependentVa // ----------------------------------------------------------------- CSSRuleSet::CSSRuleSet() + : m_ruleCount(0) + , m_pageRuleCount(0) { - m_universalRules = 0; - m_pageRules = 0; - m_ruleCount = 0; - m_pageRuleCount = 0; } CSSRuleSet::~CSSRuleSet() @@ -2757,9 +2763,6 @@ CSSRuleSet::~CSSRuleSet() deleteAllValues(m_idRules); deleteAllValues(m_classRules); deleteAllValues(m_tagRules); - - delete m_universalRules; - delete m_pageRules; } @@ -2794,7 +2797,7 @@ void CSSRuleSet::addRule(CSSStyleRule* rule, CSSSelector* sel) // Just put it in the universal rule set. if (!m_universalRules) - m_universalRules = new CSSRuleDataList(m_ruleCount++, rule, sel); + m_universalRules = adoptPtr(new CSSRuleDataList(m_ruleCount++, rule, sel)); else m_universalRules->append(m_ruleCount++, rule, sel); } @@ -2802,7 +2805,7 @@ void CSSRuleSet::addRule(CSSStyleRule* rule, CSSSelector* sel) void CSSRuleSet::addPageRule(CSSStyleRule* rule, CSSSelector* sel) { if (!m_pageRules) - m_pageRules = new CSSRuleDataList(m_pageRuleCount++, rule, sel); + m_pageRules = adoptPtr(new CSSRuleDataList(m_pageRuleCount++, rule, sel)); else m_pageRules->append(m_pageRuleCount++, rule, sel); } @@ -2922,7 +2925,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 + 11, CSS_zoom_is_end_of_first_prop_range); + COMPILE_ASSERT(CSSPropertyZoom == CSSPropertyColor + 12, 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 @@ -3120,7 +3123,8 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value) // What follows is a list that maps the CSS properties into their corresponding front-end // RenderStyle values. Shorthands (e.g. border, background) occur in this list as well and // are only hit when mapping "inherit" or "initial" into front-end values. - switch (static_cast<CSSPropertyID>(id)) { + CSSPropertyID property = static_cast<CSSPropertyID>(id); + switch (property) { // ident only properties case CSSPropertyBackgroundAttachment: HANDLE_BACKGROUND_VALUE(attachment, Attachment, value) @@ -3510,11 +3514,7 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value) CSSCursorImageValue* image = static_cast<CSSCursorImageValue*>(primitiveValue); if (image->updateIfSVGCursorIsUsed(m_element)) // Elements with SVG cursors are not allowed to share style. m_style->setUnique(); - // FIXME: Temporary clumsiness to pass off a CachedImage to an API that will eventually convert to using - // StyleImage. - RefPtr<StyleCachedImage> styleCachedImage(image->cachedImage(m_element->document()->docLoader())); - if (styleCachedImage) - m_style->addCursor(styleCachedImage->cachedImage(), image->hotSpot()); + m_style->addCursor(cachedOrPendingFromValue(CSSPropertyCursor, image), image->hotSpot()); } else if (type == CSSPrimitiveValue::CSS_IDENT) m_style->setCursor(*primitiveValue); } @@ -3611,7 +3611,7 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value) case CSSPropertyListStyleImage: { HANDLE_INHERIT_AND_INITIAL(listStyleImage, ListStyleImage) - m_style->setListStyleImage(styleImage(value)); + m_style->setListStyleImage(styleImage(CSSPropertyListStyleImage, value)); return; } @@ -4066,10 +4066,10 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value) fontDescription.setKeywordSize(primitiveValue->getIdent() - CSSValueXxSmall + 1); break; case CSSValueLarger: - size = largerFontSize(oldSize, m_style->htmlHacks()); + size = largerFontSize(oldSize, m_checker.m_document->inQuirksMode()); break; case CSSValueSmaller: - size = smallerFontSize(oldSize, m_style->htmlHacks()); + size = smallerFontSize(oldSize, m_checker.m_document->inQuirksMode()); break; default: return; @@ -4273,16 +4273,15 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value) break; } case CSSPrimitiveValue::CSS_URI: { - CSSImageValue* image = static_cast<CSSImageValue*>(val); - m_style->setContent(image->cachedImage(m_element->document()->docLoader()), didSet); + m_style->setContent(cachedOrPendingFromValue(CSSPropertyContent, static_cast<CSSImageValue*>(val)), didSet); didSet = true; break; } case CSSPrimitiveValue::CSS_COUNTER: { Counter* counterValue = val->getCounterValue(); - CounterContent* counter = new CounterContent(counterValue->identifier(), - (EListStyleType)counterValue->listStyleNumber(), counterValue->separator()); - m_style->setContent(counter, didSet); + OwnPtr<CounterContent> counter = adoptPtr(new CounterContent(counterValue->identifier(), + (EListStyleType)counterValue->listStyleNumber(), counterValue->separator())); + m_style->setContent(counter.release(), didSet); didSet = true; } } @@ -4701,7 +4700,7 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value) } NinePieceImage image; - mapNinePieceImage(value, image); + mapNinePieceImage(property, value, image); if (id == CSSPropertyWebkitBorderImage) m_style->setBorderImage(image); @@ -4751,17 +4750,26 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value) if (!pair) return; - int width = pair->first()->computeLengthInt(style(), m_rootElementStyle, zoomFactor); - int height = pair->second()->computeLengthInt(style(), m_rootElementStyle, zoomFactor); + Length radiusWidth; + Length radiusHeight; + if (pair->first()->primitiveType() == CSSPrimitiveValue::CSS_PERCENTAGE) + radiusWidth = Length(pair->first()->getDoubleValue(), Percent); + else + radiusWidth = Length(max(intMinForLength, min(intMaxForLength, pair->first()->computeLengthInt(style(), m_rootElementStyle, zoomFactor))), Fixed); + if (pair->second()->primitiveType() == CSSPrimitiveValue::CSS_PERCENTAGE) + radiusHeight = Length(pair->second()->getDoubleValue(), Percent); + else + radiusHeight = Length(max(intMinForLength, min(intMaxForLength, pair->second()->computeLengthInt(style(), m_rootElementStyle, zoomFactor))), Fixed); + int width = radiusWidth.rawValue(); + int height = radiusHeight.rawValue(); if (width < 0 || height < 0) return; - if (width == 0) - height = 0; // Null out the other value. + radiusHeight = radiusWidth; // Null out the other value. else if (height == 0) - width = 0; // Null out the other value. + radiusWidth = radiusHeight; // Null out the other value. - IntSize size(width, height); + LengthSize size(radiusWidth, radiusHeight); switch (id) { case CSSPropertyBorderTopLeftRadius: m_style->setBorderTopLeftRadius(size); @@ -4851,7 +4859,7 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value) reflection->setOffset(Length(reflectValue->offset()->computeLengthIntForLength(style(), m_rootElementStyle, zoomFactor), Fixed)); } NinePieceImage mask; - mapNinePieceImage(reflectValue->mask(), mask); + mapNinePieceImage(property, reflectValue->mask(), mask); reflection->setMask(mask); m_style->setBoxReflect(reflection.release()); @@ -5820,7 +5828,7 @@ Length CSSStyleSelector::inchLength(double inch) return Length(CSSPrimitiveValue::create(inch, CSSPrimitiveValue::CSS_IN)->computeLengthIntForLength(style(), m_rootElementStyle), Fixed); } -void CSSStyleSelector::mapFillAttachment(FillLayer* layer, CSSValue* value) +void CSSStyleSelector::mapFillAttachment(CSSPropertyID, FillLayer* layer, CSSValue* value) { if (value->cssValueType() == CSSValue::CSS_INITIAL) { layer->setAttachment(FillLayer::initialFillAttachment(layer->type())); @@ -5846,7 +5854,7 @@ void CSSStyleSelector::mapFillAttachment(FillLayer* layer, CSSValue* value) } } -void CSSStyleSelector::mapFillClip(FillLayer* layer, CSSValue* value) +void CSSStyleSelector::mapFillClip(CSSPropertyID, FillLayer* layer, CSSValue* value) { if (value->cssValueType() == CSSValue::CSS_INITIAL) { layer->setClip(FillLayer::initialFillClip(layer->type())); @@ -5860,7 +5868,7 @@ void CSSStyleSelector::mapFillClip(FillLayer* layer, CSSValue* value) layer->setClip(*primitiveValue); } -void CSSStyleSelector::mapFillComposite(FillLayer* layer, CSSValue* value) +void CSSStyleSelector::mapFillComposite(CSSPropertyID, FillLayer* layer, CSSValue* value) { if (value->cssValueType() == CSSValue::CSS_INITIAL) { layer->setComposite(FillLayer::initialFillComposite(layer->type())); @@ -5874,7 +5882,7 @@ void CSSStyleSelector::mapFillComposite(FillLayer* layer, CSSValue* value) layer->setComposite(*primitiveValue); } -void CSSStyleSelector::mapFillOrigin(FillLayer* layer, CSSValue* value) +void CSSStyleSelector::mapFillOrigin(CSSPropertyID, FillLayer* layer, CSSValue* value) { if (value->cssValueType() == CSSValue::CSS_INITIAL) { layer->setOrigin(FillLayer::initialFillOrigin(layer->type())); @@ -5888,26 +5896,36 @@ void CSSStyleSelector::mapFillOrigin(FillLayer* layer, CSSValue* value) layer->setOrigin(*primitiveValue); } -StyleImage* CSSStyleSelector::styleImage(CSSValue* value) +StyleImage* CSSStyleSelector::styleImage(CSSPropertyID property, CSSValue* value) { if (value->isImageValue()) - return static_cast<CSSImageValue*>(value)->cachedImage(m_element->document()->docLoader()); + return cachedOrPendingFromValue(property, static_cast<CSSImageValue*>(value)); + if (value->isImageGeneratorValue()) return static_cast<CSSImageGeneratorValue*>(value)->generatedImage(); + return 0; } -void CSSStyleSelector::mapFillImage(FillLayer* layer, CSSValue* value) +StyleImage* CSSStyleSelector::cachedOrPendingFromValue(CSSPropertyID property, CSSImageValue* value) +{ + StyleImage* image = value->cachedOrPendingImage(); + if (image && image->isPendingImage()) + m_pendingImageProperties.add(property); + return image; +} + +void CSSStyleSelector::mapFillImage(CSSPropertyID property, FillLayer* layer, CSSValue* value) { if (value->cssValueType() == CSSValue::CSS_INITIAL) { layer->setImage(FillLayer::initialFillImage(layer->type())); return; } - layer->setImage(styleImage(value)); + layer->setImage(styleImage(property, value)); } -void CSSStyleSelector::mapFillRepeatX(FillLayer* layer, CSSValue* value) +void CSSStyleSelector::mapFillRepeatX(CSSPropertyID, FillLayer* layer, CSSValue* value) { if (value->cssValueType() == CSSValue::CSS_INITIAL) { layer->setRepeatX(FillLayer::initialFillRepeatX(layer->type())); @@ -5921,7 +5939,7 @@ void CSSStyleSelector::mapFillRepeatX(FillLayer* layer, CSSValue* value) layer->setRepeatX(*primitiveValue); } -void CSSStyleSelector::mapFillRepeatY(FillLayer* layer, CSSValue* value) +void CSSStyleSelector::mapFillRepeatY(CSSPropertyID, FillLayer* layer, CSSValue* value) { if (value->cssValueType() == CSSValue::CSS_INITIAL) { layer->setRepeatY(FillLayer::initialFillRepeatY(layer->type())); @@ -5935,7 +5953,7 @@ void CSSStyleSelector::mapFillRepeatY(FillLayer* layer, CSSValue* value) layer->setRepeatY(*primitiveValue); } -void CSSStyleSelector::mapFillSize(FillLayer* layer, CSSValue* value) +void CSSStyleSelector::mapFillSize(CSSPropertyID, FillLayer* layer, CSSValue* value) { if (!value->isPrimitiveValue()) { layer->setSizeType(SizeNone); @@ -5997,7 +6015,7 @@ void CSSStyleSelector::mapFillSize(FillLayer* layer, CSSValue* value) layer->setSizeLength(b); } -void CSSStyleSelector::mapFillXPosition(FillLayer* layer, CSSValue* value) +void CSSStyleSelector::mapFillXPosition(CSSPropertyID, FillLayer* layer, CSSValue* value) { if (value->cssValueType() == CSSValue::CSS_INITIAL) { layer->setXPosition(FillLayer::initialFillXPosition(layer->type())); @@ -6021,7 +6039,7 @@ void CSSStyleSelector::mapFillXPosition(FillLayer* layer, CSSValue* value) layer->setXPosition(l); } -void CSSStyleSelector::mapFillYPosition(FillLayer* layer, CSSValue* value) +void CSSStyleSelector::mapFillYPosition(CSSPropertyID, FillLayer* layer, CSSValue* value) { if (value->cssValueType() == CSSValue::CSS_INITIAL) { layer->setYPosition(FillLayer::initialFillYPosition(layer->type())); @@ -6209,7 +6227,7 @@ void CSSStyleSelector::mapAnimationTimingFunction(Animation* animation, CSSValue } } -void CSSStyleSelector::mapNinePieceImage(CSSValue* value, NinePieceImage& image) +void CSSStyleSelector::mapNinePieceImage(CSSPropertyID property, CSSValue* value, NinePieceImage& image) { // If we're a primitive value, then we are "none" and don't need to alter the empty image at all. if (!value || value->isPrimitiveValue()) @@ -6219,7 +6237,7 @@ void CSSStyleSelector::mapNinePieceImage(CSSValue* value, NinePieceImage& image) CSSBorderImageValue* borderImage = static_cast<CSSBorderImageValue*>(value); // Set the image (this kicks off the load). - image.setImage(styleImage(borderImage->imageValue())); + image.setImage(styleImage(property, borderImage->imageValue())); // Set up a length box to represent our image slices. LengthBox l; @@ -6430,7 +6448,7 @@ float CSSStyleSelector::fontSizeForKeyword(Document* document, int keyword, bool if (!settings) return 1.0f; - bool quirksMode = document->inCompatMode(); + bool quirksMode = document->inQuirksMode(); int mediumSize = fixed ? settings->defaultFixedFontSize() : settings->defaultFontSize(); if (mediumSize >= fontSizeTableMin && mediumSize <= fontSizeTableMax) { // Look up the entry in the table. @@ -6828,4 +6846,101 @@ bool CSSStyleSelector::createTransformOperations(CSSValue* inValue, RenderStyle* return true; } +void CSSStyleSelector::loadPendingImages() +{ + if (m_pendingImageProperties.isEmpty()) + return; + + HashSet<int>::const_iterator end = m_pendingImageProperties.end(); + for (HashSet<int>::const_iterator it = m_pendingImageProperties.begin(); it != end; ++it) { + CSSPropertyID currentProperty = static_cast<CSSPropertyID>(*it); + + DocLoader* docLoader = m_element->document()->docLoader(); + + switch (currentProperty) { + case CSSPropertyBackgroundImage: { + for (FillLayer* backgroundLayer = m_style->accessBackgroundLayers(); backgroundLayer; backgroundLayer = backgroundLayer->next()) { + if (backgroundLayer->image() && backgroundLayer->image()->isPendingImage()) { + CSSImageValue* imageValue = static_cast<StylePendingImage*>(backgroundLayer->image())->cssImageValue(); + backgroundLayer->setImage(imageValue->cachedImage(docLoader)); + } + } + break; + } + + case CSSPropertyContent: { + for (ContentData* contentData = const_cast<ContentData*>(m_style->contentData()); contentData; contentData = contentData->next()) { + if (contentData->isImage() && contentData->image()->isPendingImage()) { + CSSImageValue* imageValue = static_cast<StylePendingImage*>(contentData->image())->cssImageValue(); + contentData->setImage(imageValue->cachedImage(docLoader)); + } + } + break; + } + + case CSSPropertyCursor: { + if (CursorList* cursorList = m_style->cursors()) { + for (size_t i = 0; i < cursorList->size(); ++i) { + CursorData& currentCursor = (*cursorList)[i]; + if (currentCursor.image()->isPendingImage()) { + CSSImageValue* imageValue = static_cast<StylePendingImage*>(currentCursor.image())->cssImageValue(); + currentCursor.setImage(imageValue->cachedImage(docLoader)); + } + } + } + break; + } + + case CSSPropertyListStyleImage: { + if (m_style->listStyleImage() && m_style->listStyleImage()->isPendingImage()) { + CSSImageValue* imageValue = static_cast<StylePendingImage*>(m_style->listStyleImage())->cssImageValue(); + m_style->setListStyleImage(imageValue->cachedImage(docLoader)); + } + break; + } + + case CSSPropertyWebkitBorderImage: { + const NinePieceImage& borderImage = m_style->borderImage(); + if (borderImage.image() && borderImage.image()->isPendingImage()) { + CSSImageValue* imageValue = static_cast<StylePendingImage*>(borderImage.image())->cssImageValue(); + m_style->setBorderImage(NinePieceImage(imageValue->cachedImage(docLoader), borderImage.slices(), borderImage.horizontalRule(), borderImage.verticalRule())); + } + break; + } + + case CSSPropertyWebkitBoxReflect: { + const NinePieceImage& maskImage = m_style->boxReflect()->mask(); + if (maskImage.image() && maskImage.image()->isPendingImage()) { + CSSImageValue* imageValue = static_cast<StylePendingImage*>(maskImage.image())->cssImageValue(); + m_style->boxReflect()->setMask(NinePieceImage(imageValue->cachedImage(docLoader), maskImage.slices(), maskImage.horizontalRule(), maskImage.verticalRule())); + } + break; + } + + case CSSPropertyWebkitMaskBoxImage: { + const NinePieceImage& maskBoxImage = m_style->maskBoxImage(); + if (maskBoxImage.image() && maskBoxImage.image()->isPendingImage()) { + CSSImageValue* imageValue = static_cast<StylePendingImage*>(maskBoxImage.image())->cssImageValue(); + m_style->setMaskBoxImage(NinePieceImage(imageValue->cachedImage(docLoader), maskBoxImage.slices(), maskBoxImage.horizontalRule(), maskBoxImage.verticalRule())); + } + break; + } + + case CSSPropertyWebkitMaskImage: { + for (FillLayer* maskLayer = m_style->accessMaskLayers(); maskLayer; maskLayer = maskLayer->next()) { + if (maskLayer->image() && maskLayer->image()->isPendingImage()) { + CSSImageValue* imageValue = static_cast<StylePendingImage*>(maskLayer->image())->cssImageValue(); + maskLayer->setImage(imageValue->cachedImage(docLoader)); + } + } + break; + } + default: + ASSERT_NOT_REACHED(); + } + } + + m_pendingImageProperties.clear(); +} + } // namespace WebCore diff --git a/WebCore/css/CSSStyleSelector.h b/WebCore/css/CSSStyleSelector.h index b0d977e..28d4488 100644 --- a/WebCore/css/CSSStyleSelector.h +++ b/WebCore/css/CSSStyleSelector.h @@ -1,6 +1,6 @@ /* * Copyright (C) 1999 Lars Knoll (knoll@kde.org) - * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. + * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -40,6 +40,7 @@ class CSSPrimitiveValue; class CSSProperty; class CSSFontFace; class CSSFontFaceRule; +class CSSImageValue; class CSSRuleData; class CSSRuleDataList; class CSSRuleList; @@ -58,6 +59,7 @@ class Frame; class FrameView; class KURL; class KeyframeList; +class KeyframeValue; class MediaQueryEvaluator; class Node; class Settings; @@ -113,7 +115,7 @@ public: RenderStyle* style() const { return m_style.get(); } - PassRefPtr<RenderStyle> styleForKeyframe(const RenderStyle*, const WebKitCSSKeyframeRule*, KeyframeList&); + PassRefPtr<RenderStyle> styleForKeyframe(const RenderStyle*, const WebKitCSSKeyframeRule*, KeyframeValue&); public: // These methods will give back the set of rules that matched for a given element (or a pseudo-element). @@ -194,8 +196,8 @@ public: bool isFirstPage(int pageIndex) const; String pageName(int pageIndex) const; - CSSRuleSet* m_authorStyle; - CSSRuleSet* m_userStyle; + OwnPtr<CSSRuleSet> m_authorStyle; + OwnPtr<CSSRuleSet> m_userStyle; bool m_hasUAAppearance; BorderData m_borderData; @@ -234,22 +236,20 @@ public: private: static RenderStyle* s_styleNotYetAvailable; - void init(); - void matchUARules(int& firstUARule, int& lastUARule); void updateFont(); void cacheBorderAndBackground(); - void mapFillAttachment(FillLayer*, CSSValue*); - void mapFillClip(FillLayer*, CSSValue*); - void mapFillComposite(FillLayer*, CSSValue*); - void mapFillOrigin(FillLayer*, CSSValue*); - void mapFillImage(FillLayer*, CSSValue*); - void mapFillRepeatX(FillLayer*, CSSValue*); - void mapFillRepeatY(FillLayer*, CSSValue*); - void mapFillSize(FillLayer*, CSSValue*); - void mapFillXPosition(FillLayer*, CSSValue*); - void mapFillYPosition(FillLayer*, CSSValue*); + void mapFillAttachment(CSSPropertyID, FillLayer*, CSSValue*); + void mapFillClip(CSSPropertyID, FillLayer*, CSSValue*); + void mapFillComposite(CSSPropertyID, FillLayer*, CSSValue*); + void mapFillOrigin(CSSPropertyID, FillLayer*, CSSValue*); + void mapFillImage(CSSPropertyID, FillLayer*, CSSValue*); + void mapFillRepeatX(CSSPropertyID, FillLayer*, CSSValue*); + void mapFillRepeatY(CSSPropertyID, FillLayer*, CSSValue*); + void mapFillSize(CSSPropertyID, FillLayer*, CSSValue*); + void mapFillXPosition(CSSPropertyID, FillLayer*, CSSValue*); + void mapFillYPosition(CSSPropertyID, FillLayer*, CSSValue*); void mapAnimationDelay(Animation*, CSSValue*); void mapAnimationDirection(Animation*, CSSValue*); @@ -261,7 +261,7 @@ public: void mapAnimationProperty(Animation*, CSSValue*); void mapAnimationTimingFunction(Animation*, CSSValue*); - void mapNinePieceImage(CSSValue*, NinePieceImage&); + void mapNinePieceImage(CSSPropertyID, CSSValue*, NinePieceImage&); void applyProperty(int id, CSSValue*); void applyPageSizeProperty(CSSValue*); @@ -272,7 +272,10 @@ public: void applySVGProperty(int id, CSSValue*); #endif - StyleImage* styleImage(CSSValue* value); + void loadPendingImages(); + + StyleImage* styleImage(CSSPropertyID, CSSValue* value); + StyleImage* cachedOrPendingFromValue(CSSPropertyID property, CSSImageValue* value); // We collect the set of decls that match in |m_matchedDecls|. We then walk the // set of matched decls four times, once for those properties that others depend on (like font-size), @@ -285,8 +288,10 @@ public: Vector<CSSRuleData*, 32> m_matchedRules; RefPtr<CSSRuleList> m_ruleList; + + HashSet<int> m_pendingImageProperties; // Hash of CSSPropertyIDs - MediaQueryEvaluator* m_medium; + OwnPtr<MediaQueryEvaluator> m_medium; RefPtr<RenderStyle> m_rootDefaultStyle; PseudoId m_dynamicPseudo; diff --git a/WebCore/css/CSSStyleSheet.cpp b/WebCore/css/CSSStyleSheet.cpp index 1ef1c2b..9bbcb8b 100644 --- a/WebCore/css/CSSStyleSheet.cpp +++ b/WebCore/css/CSSStyleSheet.cpp @@ -36,8 +36,7 @@ namespace WebCore { CSSStyleSheet::CSSStyleSheet(CSSStyleSheet* parentSheet, const String& href, const KURL& baseURL, const String& charset) : StyleSheet(parentSheet, href, baseURL) - , m_doc(parentSheet ? parentSheet->doc() : 0) - , m_namespaces(0) + , m_document(parentSheet ? parentSheet->document() : 0) , m_charset(charset) , m_loadCompleted(false) , m_strictParsing(!parentSheet || parentSheet->useStrictParsing()) @@ -48,8 +47,7 @@ CSSStyleSheet::CSSStyleSheet(CSSStyleSheet* parentSheet, const String& href, con CSSStyleSheet::CSSStyleSheet(Node* parentNode, const String& href, const KURL& baseURL, const String& charset) : StyleSheet(parentNode, href, baseURL) - , m_doc(parentNode->document()) - , m_namespaces(0) + , m_document(parentNode->document()) , m_charset(charset) , m_loadCompleted(false) , m_strictParsing(false) @@ -60,20 +58,18 @@ CSSStyleSheet::CSSStyleSheet(Node* parentNode, const String& href, const KURL& b CSSStyleSheet::CSSStyleSheet(CSSRule* ownerRule, const String& href, const KURL& baseURL, const String& charset) : StyleSheet(ownerRule, href, baseURL) - , m_namespaces(0) , m_charset(charset) , m_loadCompleted(false) , m_strictParsing(!ownerRule || ownerRule->useStrictParsing()) , m_hasSyntacticallyValidCSSHeader(true) { CSSStyleSheet* parentSheet = ownerRule ? ownerRule->parentStyleSheet() : 0; - m_doc = parentSheet ? parentSheet->doc() : 0; + m_document = parentSheet ? parentSheet->document() : 0; m_isUserStyleSheet = parentSheet ? parentSheet->isUserStyleSheet() : false; } CSSStyleSheet::~CSSStyleSheet() { - delete m_namespaces; } CSSRule *CSSStyleSheet::ownerRule() const @@ -137,7 +133,7 @@ int CSSStyleSheet::addRule(const String& selector, const String& style, Exceptio PassRefPtr<CSSRuleList> CSSStyleSheet::cssRules(bool omitCharsetRules) { KURL url = finalURL(); - if (!url.isEmpty() && doc() && !doc()->securityOrigin()->canRequest(url)) + if (!url.isEmpty() && document() && !document()->securityOrigin()->canRequest(url)) return 0; return CSSRuleList::create(this, omitCharsetRules); } @@ -159,7 +155,7 @@ void CSSStyleSheet::addNamespace(CSSParser* p, const AtomicString& prefix, const if (uri.isNull()) return; - m_namespaces = new CSSNamespace(prefix, uri, m_namespaces); + m_namespaces = adoptPtr(new CSSNamespace(prefix, uri, m_namespaces.release())); if (prefix.isEmpty()) // Set the default namespace on the parser so that selectors that omit namespace info will @@ -174,11 +170,10 @@ const AtomicString& CSSStyleSheet::determineNamespace(const AtomicString& prefix if (prefix == starAtom) return starAtom; // We'll match any namespace. if (m_namespaces) { - CSSNamespace* ns = m_namespaces->namespaceForPrefix(prefix); - if (ns) - return ns->uri(); + if (CSSNamespace* namespaceForPrefix = m_namespaces->namespaceForPrefix(prefix)) + return namespaceForPrefix->uri; } - return nullAtom; // Assume we wont match any namespaces. + return nullAtom; // Assume we won't match any namespaces. } bool CSSStyleSheet::parseString(const String &string, bool strict) @@ -224,14 +219,14 @@ void CSSStyleSheet::styleSheetChanged() StyleBase* root = this; while (StyleBase* parent = root->parent()) root = parent; - Document* documentToUpdate = root->isCSSStyleSheet() ? static_cast<CSSStyleSheet*>(root)->doc() : 0; + Document* documentToUpdate = root->isCSSStyleSheet() ? static_cast<CSSStyleSheet*>(root)->document() : 0; /* FIXME: We don't need to do everything updateStyleSelector does, * basically we just need to recreate the document's selector with the * already existing style sheets. */ if (documentToUpdate) - documentToUpdate->updateStyleSelector(); + documentToUpdate->styleSelectorChanged(DeferRecalcStyle); } KURL CSSStyleSheet::completeURL(const String& url) const diff --git a/WebCore/css/CSSStyleSheet.h b/WebCore/css/CSSStyleSheet.h index fe82794..3b18522 100644 --- a/WebCore/css/CSSStyleSheet.h +++ b/WebCore/css/CSSStyleSheet.h @@ -1,6 +1,6 @@ /* * (C) 1999-2003 Lars Knoll (knoll@kde.org) - * Copyright (C) 2004, 2006, 2007, 2008 Apple Inc. All rights reserved. + * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -87,7 +87,7 @@ public: virtual void checkLoaded(); - Document* doc() { return m_doc; } + Document* document() { return m_document; } const String& charset() const { return m_charset; } @@ -112,8 +112,8 @@ private: virtual bool isCSSStyleSheet() const { return true; } virtual String type() const { return "text/css"; } - Document* m_doc; - CSSNamespace* m_namespaces; + Document* m_document; + OwnPtr<CSSNamespace> m_namespaces; String m_charset; bool m_loadCompleted : 1; bool m_strictParsing : 1; diff --git a/WebCore/css/CSSValueKeywords.in b/WebCore/css/CSSValueKeywords.in index d302990..7a9b9c7 100644 --- a/WebCore/css/CSSValueKeywords.in +++ b/WebCore/css/CSSValueKeywords.in @@ -288,6 +288,8 @@ tigrinya-et-abegede ethiopic-abegede-ti-et upper-greek upper-norwegian +asterisks +footnotes hebrew armenian georgian @@ -585,6 +587,7 @@ media-volume-slider media-volume-sliderthumb media-volume-slider-mute-button media-controls-background +media-controls-fullscreen-background media-current-time-display media-time-remaining-display menulist diff --git a/WebCore/css/CSSValueList.cpp b/WebCore/css/CSSValueList.cpp index 8f1f88d..f8d8457 100644 --- a/WebCore/css/CSSValueList.cpp +++ b/WebCore/css/CSSValueList.cpp @@ -1,6 +1,6 @@ -/** +/* * (C) 1999-2003 Lars Knoll (knoll@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. + * Copyright (C) 2004, 2005, 2006, 2007, 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,11 +17,13 @@ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ + #include "config.h" #include "CSSValueList.h" #include "CSSParserValues.h" #include "PlatformString.h" +#include <wtf/PassOwnPtr.h> namespace WebCore { @@ -34,11 +36,9 @@ CSSValueList::CSSValueList(CSSParserValueList* list) : m_isSpaceSeparated(true) { if (list) { - unsigned s = list->size(); - for (unsigned i = 0; i < s; ++i) { - CSSParserValue* v = list->valueAt(i); - append(v->createCSSValue()); - } + size_t size = list->size(); + for (unsigned i = 0; i < size; ++i) + append(list->valueAt(i)->createCSSValue()); } } @@ -120,15 +120,15 @@ String CSSValueList::cssText() const return result; } -CSSParserValueList* CSSValueList::createParserValueList() const +PassOwnPtr<CSSParserValueList> CSSValueList::createParserValueList() const { - unsigned s = m_values.size(); - if (!s) + size_t size = m_values.size(); + if (!size) return 0; - CSSParserValueList* result = new CSSParserValueList; - for (unsigned i = 0; i < s; ++i) + OwnPtr<CSSParserValueList> result = adoptPtr(new CSSParserValueList); + for (size_t i = 0; i < size; ++i) result->addValue(m_values[i]->parserValue()); - return result; + return result.release(); } void CSSValueList::addSubresourceStyleURLs(ListHashSet<KURL>& urls, const CSSStyleSheet* styleSheet) diff --git a/WebCore/css/CSSValueList.h b/WebCore/css/CSSValueList.h index b835345..0d5c882 100644 --- a/WebCore/css/CSSValueList.h +++ b/WebCore/css/CSSValueList.h @@ -1,6 +1,6 @@ /* * (C) 1999-2003 Lars Knoll (knoll@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. + * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -58,7 +58,7 @@ public: virtual String cssText() const; - CSSParserValueList* createParserValueList() const; + PassOwnPtr<CSSParserValueList> createParserValueList() const; virtual void addSubresourceStyleURLs(ListHashSet<KURL>&, const CSSStyleSheet*); diff --git a/WebCore/css/CSSVariablesDeclaration.cpp b/WebCore/css/CSSVariablesDeclaration.cpp index cb852cb..e40750a 100644 --- a/WebCore/css/CSSVariablesDeclaration.cpp +++ b/WebCore/css/CSSVariablesDeclaration.cpp @@ -169,7 +169,7 @@ void CSSVariablesDeclaration::setNeedsStyleRecalc() while (StyleBase* parent = root->parent()) root = parent; if (root->isCSSStyleSheet()) - static_cast<CSSStyleSheet*>(root)->doc()->updateStyleSelector(); + static_cast<CSSStyleSheet*>(root)->document()->styleSelectorChanged(DeferRecalcStyle); } } diff --git a/WebCore/css/MediaList.cpp b/WebCore/css/MediaList.cpp index 85cf590..e67c9c7 100644 --- a/WebCore/css/MediaList.cpp +++ b/WebCore/css/MediaList.cpp @@ -1,6 +1,6 @@ /* * (C) 1999-2003 Lars Knoll (knoll@kde.org) - * Copyright (C) 2004, 2006 Apple Computer, Inc. + * Copyright (C) 2004, 2006, 2010 Apple Inc. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -122,7 +122,7 @@ void MediaList::deleteMedium(const String& oldMedium, ExceptionCode& ec) CSSParser p(true); MediaQuery* oldQuery = 0; - bool deleteOldQuery = false; + OwnPtr<MediaQuery> createdQuery; if (p.parseMediaQuery(tempMediaList.get(), oldMedium)) { if (tempMediaList->m_queries.size() > 0) @@ -130,8 +130,8 @@ void MediaList::deleteMedium(const String& oldMedium, ExceptionCode& ec) } else if (m_fallback) { String medium = parseMediaDescriptor(oldMedium); if (!medium.isNull()) { - oldQuery = new MediaQuery(MediaQuery::None, medium, 0); - deleteOldQuery = true; + createdQuery = adoptPtr(new MediaQuery(MediaQuery::None, medium, 0)); + oldQuery = createdQuery.get(); } } @@ -148,8 +148,6 @@ void MediaList::deleteMedium(const String& oldMedium, ExceptionCode& ec) break; } } - if (deleteOldQuery) - delete oldQuery; } if (!ec) @@ -242,9 +240,9 @@ void MediaList::appendMedium(const String& newMedium, ExceptionCode& ec) notifyChanged(); } -void MediaList::appendMediaQuery(MediaQuery* mediaQuery) +void MediaList::appendMediaQuery(PassOwnPtr<MediaQuery> mediaQuery) { - m_queries.append(mediaQuery); + m_queries.append(mediaQuery.leakPtr()); } void MediaList::notifyChanged() diff --git a/WebCore/css/MediaList.h b/WebCore/css/MediaList.h index e91ca9d..f4b1fa7 100644 --- a/WebCore/css/MediaList.h +++ b/WebCore/css/MediaList.h @@ -1,6 +1,6 @@ /* * (C) 1999-2003 Lars Knoll (knoll@kde.org) - * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. + * Copyright (C) 2004, 2006, 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 @@ -73,7 +73,7 @@ public: String mediaText() const; void setMediaText(const String&, ExceptionCode&xo); - void appendMediaQuery(MediaQuery*); + void appendMediaQuery(PassOwnPtr<MediaQuery>); const Vector<MediaQuery*>& mediaQueries() const { return m_queries; } private: diff --git a/WebCore/css/fullscreen.css b/WebCore/css/fullscreen.css new file mode 100644 index 0000000..ebf3a02 --- /dev/null +++ b/WebCore/css/fullscreen.css @@ -0,0 +1,27 @@ +:-webkit-full-screen { + position:fixed; + top:0; + left:0; + right:0; + bottom:0; +} + +:root:full-screen-document:not(:full-screen) { + overflow:hidden; +} + +video:-webkit-full-screen { + width: 100%; + height: 100% + image-fit: fill; +} + +img:-webkit-full-screen { + width: 100%; + height: 100%; + image-fit: fill; +} + +video:-webkit-full-page-media:-webkit-full-screen::-webkit-media-controls-panel { + bottom: 0px; +} diff --git a/WebCore/dom/ClassNodeList.cpp b/WebCore/dom/ClassNodeList.cpp index d482359..60d668b 100644 --- a/WebCore/dom/ClassNodeList.cpp +++ b/WebCore/dom/ClassNodeList.cpp @@ -37,7 +37,7 @@ namespace WebCore { ClassNodeList::ClassNodeList(PassRefPtr<Node> rootNode, const String& classNames) : DynamicNodeList(rootNode) - , m_classNames(classNames, m_rootNode->document()->inCompatMode()) + , m_classNames(classNames, m_rootNode->document()->inQuirksMode()) , m_originalClassNames(classNames) { } diff --git a/WebCore/dom/ContainerNode.cpp b/WebCore/dom/ContainerNode.cpp index ef62b38..064d4e5 100644 --- a/WebCore/dom/ContainerNode.cpp +++ b/WebCore/dom/ContainerNode.cpp @@ -72,6 +72,23 @@ void ContainerNode::removeAllChildren() removeAllChildrenInContainer<Node, ContainerNode>(this); } + +void ContainerNode::takeAllChildrenFrom(ContainerNode* oldParent) +{ + NodeVector children; + for (Node* child = oldParent->firstChild(); child; child = child->nextSibling()) + children.append(child); + oldParent->removeAllChildren(); + + for (unsigned i = 0; i < children.size(); ++i) { + ExceptionCode ec = 0; + // FIXME: We need a no mutation event version of adoptNode. + RefPtr<Node> child = document()->adoptNode(children[i].release(), ec); + ASSERT(!ec); + parserAddChild(child.release()); + } +} + ContainerNode::~ContainerNode() { removeAllChildren(); diff --git a/WebCore/dom/ContainerNode.h b/WebCore/dom/ContainerNode.h index ad0a54a..ab90783 100644 --- a/WebCore/dom/ContainerNode.h +++ b/WebCore/dom/ContainerNode.h @@ -75,6 +75,7 @@ public: virtual bool removeChildren(); void removeAllChildren(); + void takeAllChildrenFrom(ContainerNode*); void cloneChildNodes(ContainerNode* clone); diff --git a/WebCore/dom/DecodedDataDocumentParser.cpp b/WebCore/dom/DecodedDataDocumentParser.cpp index 51cc847..39bf8e4 100644 --- a/WebCore/dom/DecodedDataDocumentParser.cpp +++ b/WebCore/dom/DecodedDataDocumentParser.cpp @@ -50,7 +50,7 @@ void DecodedDataDocumentParser::appendBytes(DocumentWriter* writer , const char* if (decoded.isEmpty()) return; - writer->reportDataRecieved(); + writer->reportDataReceived(); append(decoded); } diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp index 2528b3a..99ce273 100644 --- a/WebCore/dom/Document.cpp +++ b/WebCore/dom/Document.cpp @@ -82,7 +82,6 @@ #include "HTMLStyleElement.h" #include "HTMLTitleElement.h" #include "HTTPParsers.h" -#include "HistoryItem.h" #include "HitTestRequest.h" #include "HitTestResult.h" #include "ImageLoader.h" @@ -136,6 +135,7 @@ #include "XMLHttpRequest.h" #include "XMLNSNames.h" #include "XMLNames.h" +#include "XSSAuditor.h" #include "htmlediting.h" #include <wtf/CurrentTime.h> #include <wtf/HashFunctions.h> @@ -371,9 +371,12 @@ private: Document::Document(Frame* frame, const KURL& url, bool isXHTML, bool isHTML) : ContainerNode(0) + , m_compatibilityMode(NoQuirksMode) + , m_compatibilityModeLocked(false) , m_domTreeVersion(0) , m_styleSheets(StyleSheetList::create(this)) , m_styleRecalcTimer(this, &Document::styleRecalcTimerFired) + , m_pendingStyleRecalcShouldForce(false) , m_frameElementsShouldIgnoreScrolling(false) , m_containsValidityStyleRules(false) , m_updateFocusAppearanceRestoresSelection(false) @@ -415,6 +418,11 @@ Document::Document(Frame* frame, const KURL& url, bool isXHTML, bool isHTML) #endif , m_weakReference(DocumentWeakReference::create(this)) , m_idAttributeName(idAttr) +#if ENABLE(FULLSCREEN_API) + , m_isFullScreen(0) + , m_areKeysEnabledInFullScreen(0) +#endif + , m_loadEventDelayCount(0) { m_document = this; @@ -442,8 +450,6 @@ Document::Document(Frame* frame, const KURL& url, bool isXHTML, bool isHTML) m_bParsing = false; m_wellFormed = false; - setParseMode(Strict); - m_textColor = Color::black; m_listenerTypes = 0; setInDocument(); @@ -502,6 +508,9 @@ void Document::removedLastRef() m_activeNode = 0; m_titleElement = 0; m_documentElement = 0; +#if ENABLE(FULLSCREEN_API) + m_fullScreenElement = 0; +#endif // removeAllChildren() doesn't always unregister IDs, do it upfront to avoid having stale references in the map. m_elementsById.clear(); @@ -599,6 +608,20 @@ void Document::destroyAllWrapperCaches() } #endif +void Document::setCompatibilityMode(CompatibilityMode mode) +{ + if (m_compatibilityModeLocked || mode == m_compatibilityMode) + return; + ASSERT(!documentElement() && !m_styleSheets->length()); + bool wasInQuirksMode = inQuirksMode(); + m_compatibilityMode = mode; + if (inQuirksMode() != wasInQuirksMode) { + // All user stylesheets have to reparse using the different mode. + clearPageUserSheet(); + clearPageGroupUserSheets(); + } +} + void Document::resetLinkColor() { m_linkColor = Color(0, 0, 238); @@ -617,13 +640,11 @@ void Document::resetActiveLinkColor() void Document::setDocType(PassRefPtr<DocumentType> docType) { // This should never be called more than once. - // Note: This is not a public DOM method and can only be called by the parser. ASSERT(!m_docType || !docType); - if (m_docType && docType) - return; m_docType = docType; if (m_docType) m_docType->setDocument(this); +<<<<<<< HEAD #ifdef ANDROID_META_SUPPORT if (m_docType && !ownerElement() && m_docType->publicId().startsWith("-//wapforum//dtd xhtml mobile 1.", false)) { @@ -635,6 +656,8 @@ void Document::setDocType(PassRefPtr<DocumentType> docType) } #endif determineParseMode(); +======= +>>>>>>> webkit.org at r66666 } DOMImplementation* Document::implementation() const @@ -1388,12 +1411,18 @@ PassRefPtr<TreeWalker> Document::createTreeWalker(Node* root, unsigned whatToSho return TreeWalker::create(root, whatToShow, filter, expandEntityReferences); } +void Document::scheduleForcedStyleRecalc() +{ + m_pendingStyleRecalcShouldForce = true; + scheduleStyleRecalc(); +} + void Document::scheduleStyleRecalc() { if (m_styleRecalcTimer.isActive() || inPageCache()) return; - ASSERT(childNeedsStyleRecalc()); + ASSERT(childNeedsStyleRecalc() || m_pendingStyleRecalcShouldForce); if (!documentsThatNeedStyleRecalc) documentsThatNeedStyleRecalc = new HashSet<Document*>; @@ -1416,6 +1445,7 @@ void Document::unscheduleStyleRecalc() documentsThatNeedStyleRecalc->remove(this); m_styleRecalcTimer.stop(); + m_pendingStyleRecalcShouldForce = false; } void Document::styleRecalcTimerFired(Timer<Document>*) @@ -1457,6 +1487,9 @@ void Document::recalcStyle(StyleChange change) ASSERT(!renderer() || renderArena()); if (!renderer() || !renderArena()) goto bail_out; + + if (m_pendingStyleRecalcShouldForce) + change = Force; if (change == Force) { // style selector may set this again during recalc @@ -1512,14 +1545,14 @@ void Document::updateStyleIfNeeded() { ASSERT(!view() || (!view()->isInLayout() && !view()->isPainting())); - if (!childNeedsStyleRecalc() || inPageCache()) + if ((!m_pendingStyleRecalcShouldForce && !childNeedsStyleRecalc()) || inPageCache()) return; - + if (m_frame) m_frame->animation()->beginAnimationUpdate(); recalcStyle(NoChange); - + // Tell the animation controller that updateStyleIfNeeded is finished and it can do any post-processing if (m_frame) m_frame->animation()->endAnimationUpdate(); @@ -1534,7 +1567,6 @@ void Document::updateStyleForAllDocuments() HashSet<Document*>::iterator it = documentsThatNeedStyleRecalc->begin(); Document* doc = *it; documentsThatNeedStyleRecalc->remove(doc); - ASSERT(doc->childNeedsStyleRecalc() && !doc->inPageCache()); doc->updateStyleIfNeeded(); } } @@ -1572,7 +1604,7 @@ void Document::updateLayoutIgnorePendingStylesheets() // suspend JS instead of doing a layout with inaccurate information. if (body() && !body()->renderer() && m_pendingSheetLayout == NoLayoutWithPendingSheets) { m_pendingSheetLayout = DidLayoutWithPendingSheets; - updateStyleSelector(); + styleSelectorChanged(RecalcStyleImmediately); } else if (m_hasNodesWithPlaceholderStyle) // If new nodes have been added or style recalc has been done with style sheets still pending, some nodes // may not have had their real style calculated yet. Normally this gets cleaned when style sheets arrive @@ -1652,7 +1684,7 @@ void Document::createStyleSelector() if (Settings* docSettings = settings()) matchAuthorAndUserStyles = docSettings->authorAndUserStylesEnabled(); m_styleSelector.set(new CSSStyleSelector(this, m_styleSheets.get(), m_mappedElementSheet.get(), pageUserSheet(), pageGroupUserSheets(), - !inCompatMode(), matchAuthorAndUserStyles)); + !inQuirksMode(), matchAuthorAndUserStyles)); } void Document::attach() @@ -1883,6 +1915,8 @@ void Document::implicitOpen() removeChildren(); + setCompatibilityMode(NoQuirksMode); + m_parser = createParser(); setParsing(true); @@ -2036,8 +2070,7 @@ void Document::implicitClose() ImageLoader::dispatchPendingLoadEvents(); dispatchWindowLoadEvent(); enqueuePageshowEvent(PageshowEventNotPersisted); - if (m_pendingStateObject) - enqueuePopstateEvent(m_pendingStateObject.release()); + enqueuePopstateEvent(m_pendingStateObject ? m_pendingStateObject.release() : SerializedScriptValue::nullValue()); if (f) f->loader()->handledOnloadEvents(); @@ -2212,12 +2245,6 @@ void Document::setURL(const KURL& url) updateBaseURL(); } -void Document::setBaseElementURL(const KURL& baseElementURL) -{ - m_baseElementURL = baseElementURL; - updateBaseURL(); -} - void Document::updateBaseURL() { // DOM 3 Core: When the Document supports the feature "HTML" [DOM Level 2 HTML], the base URI is computed using @@ -2238,6 +2265,41 @@ void Document::updateBaseURL() m_mappedElementSheet->setFinalURL(m_baseURL); } +void Document::processBaseElement() +{ + // Find the first href attribute in a base element and the first target attribute in a base element. + const AtomicString* href = 0; + const AtomicString* target = 0; + for (Node* node = document()->firstChild(); node && (!href || !target); node = node->traverseNextNode()) { + if (node->hasTagName(baseTag)) { + if (!href) { + const AtomicString& value = static_cast<Element*>(node)->fastGetAttribute(hrefAttr); + if (!value.isNull()) + href = &value; + } + if (!target) { + const AtomicString& value = static_cast<Element*>(node)->fastGetAttribute(targetAttr); + if (!value.isNull()) + target = &value; + } + } + } + + // FIXME: Since this doesn't share code with completeURL it may not handle encodings correctly. + KURL baseElementURL; + if (href) { + String strippedHref = deprecatedParseURL(*href); + if (!strippedHref.isEmpty() && (!frame() || frame()->script()->xssAuditor()->canSetBaseElementURL(*href))) + baseElementURL = KURL(url(), strippedHref); + } + if (m_baseElementURL != baseElementURL) { + m_baseElementURL = baseElementURL; + updateBaseURL(); + } + + m_baseTarget = target ? *target : nullAtom; +} + String Document::userAgent(const KURL& url) const { return frame() ? frame()->loader()->userAgent(url) : String(); @@ -2259,14 +2321,23 @@ CSSStyleSheet* Document::pageUserSheet() // Parse the sheet and cache it. m_pageUserSheet = CSSStyleSheet::createInline(this, settings()->userStyleSheetLocation()); m_pageUserSheet->setIsUserStyleSheet(true); - m_pageUserSheet->parseString(userSheetText, !inCompatMode()); + m_pageUserSheet->parseString(userSheetText, !inQuirksMode()); return m_pageUserSheet.get(); } void Document::clearPageUserSheet() { - m_pageUserSheet = 0; - updateStyleSelector(); + if (m_pageUserSheet) { + m_pageUserSheet = 0; + styleSelectorChanged(DeferRecalcStyle); + } +} + +void Document::updatePageUserSheet() +{ + clearPageUserSheet(); + if (pageUserSheet()) + styleSelectorChanged(RecalcStyleImmediately); } const Vector<RefPtr<CSSStyleSheet> >* Document::pageGroupUserSheets() const @@ -2296,7 +2367,7 @@ const Vector<RefPtr<CSSStyleSheet> >* Document::pageGroupUserSheets() const continue; RefPtr<CSSStyleSheet> parsedSheet = CSSStyleSheet::createInline(const_cast<Document*>(this), sheet->url()); parsedSheet->setIsUserStyleSheet(sheet->level() == UserStyleSheet::UserLevel); - parsedSheet->parseString(sheet->source(), !inCompatMode()); + parsedSheet->parseString(sheet->source(), !inQuirksMode()); if (!m_pageGroupUserSheets) m_pageGroupUserSheets.set(new Vector<RefPtr<CSSStyleSheet> >); m_pageGroupUserSheets->append(parsedSheet.release()); @@ -2308,9 +2379,18 @@ const Vector<RefPtr<CSSStyleSheet> >* Document::pageGroupUserSheets() const void Document::clearPageGroupUserSheets() { - m_pageGroupUserSheets.clear(); m_pageGroupUserSheetCacheValid = false; - updateStyleSelector(); + if (m_pageGroupUserSheets && m_pageGroupUserSheets->size()) { + m_pageGroupUserSheets->clear(); + styleSelectorChanged(DeferRecalcStyle); + } +} + +void Document::updatePageGroupUserSheets() +{ + clearPageGroupUserSheets(); + if (pageGroupUserSheets() && pageGroupUserSheets()->size()) + styleSelectorChanged(RecalcStyleImmediately); } CSSStyleSheet* Document::elementSheet() @@ -2480,7 +2560,7 @@ void Document::processHttpEquiv(const String& equiv, const String& content) // -dwh m_selectedStylesheetSet = content; m_preferredStylesheetSet = content; - updateStyleSelector(); + styleSelectorChanged(DeferRecalcStyle); } else if (equalIgnoringCase(equiv, "refresh")) { double delay; String url; @@ -2746,9 +2826,7 @@ String Document::selectedStylesheetSet() const void Document::setSelectedStylesheetSet(const String& aString) { m_selectedStylesheetSet = aString; - updateStyleSelector(); - if (renderer()) - renderer()->repaint(); + styleSelectorChanged(DeferRecalcStyle); } // This method is called whenever a top-level stylesheet has finished loading. @@ -2764,35 +2842,44 @@ void Document::removePendingSheet() printf("Stylesheet loaded at time %d. %d stylesheets still remain.\n", elapsedTime(), m_pendingStylesheets); #endif - updateStyleSelector(); + styleSelectorChanged(RecalcStyleImmediately); + + if (m_pendingStylesheets) + return; ScriptableDocumentParser* parser = scriptableDocumentParser(); - if (!m_pendingStylesheets && parser) + if (parser) parser->executeScriptsWaitingForStylesheets(); - if (!m_pendingStylesheets && m_gotoAnchorNeededAfterStylesheetsLoad && view()) + if (m_gotoAnchorNeededAfterStylesheetsLoad && view()) view()->scrollToFragment(m_frame->loader()->url()); } -void Document::updateStyleSelector() +void Document::styleSelectorChanged(StyleSelectorUpdateFlag updateFlag) { // Don't bother updating, since we haven't loaded all our style info yet // and haven't calculated the style selector for the first time. - if (!m_didCalculateStyleSelector && !haveStylesheetsLoaded()) + if (!attached() || (!m_didCalculateStyleSelector && !haveStylesheetsLoaded())) return; - if (didLayoutWithPendingStylesheets() && m_pendingStylesheets <= 0) { - m_pendingSheetLayout = IgnoreLayoutWithPendingSheets; - if (renderer()) - renderer()->repaint(); - } - #ifdef INSTRUMENT_LAYOUT_SCHEDULING if (!ownerElement()) printf("Beginning update of style selector at time %d.\n", elapsedTime()); #endif recalcStyleSelector(); + + if (updateFlag == DeferRecalcStyle) { + scheduleForcedStyleRecalc(); + return; + } + + if (didLayoutWithPendingStylesheets() && m_pendingStylesheets <= 0) { + m_pendingSheetLayout = IgnoreLayoutWithPendingSheets; + if (renderer()) + renderer()->repaint(); + } + // This recalcStyle initiates a new recalc cycle. We need to bracket it to // make sure animations get the correct update time if (m_frame) @@ -3246,6 +3333,19 @@ void Document::nodeWillBeRemoved(Node* n) frame->selection()->nodeWillBeRemoved(n); frame->dragCaretController()->nodeWillBeRemoved(n); } + +#if ENABLE(FULLSCREEN_API) + // If the current full screen element or any of its ancestors is removed, set the current + // full screen element to the document root, and fire a fullscreenchange event to inform + // clients of the DOM. + ASSERT(n); + if (n->contains(m_fullScreenElement.get())) { + ASSERT(n != documentElement()); + m_fullScreenElement = documentElement(); + m_fullScreenElement->setNeedsStyleRecalc(); + m_fullScreenElement->dispatchEvent(Event::create(eventNames().webkitfullscreenchangeEvent, true, false)); + } +#endif } void Document::textInserted(Node* text, unsigned offset, unsigned length) @@ -3767,7 +3867,7 @@ void Document::setInPageCache(bool flag) m_savedRenderer = renderer(); if (FrameView* v = view()) v->resetScrollbars(); - unscheduleStyleRecalc(); + m_styleRecalcTimer.stop(); } else { ASSERT(!renderer() || renderer() == m_savedRenderer); ASSERT(m_renderArena); @@ -3984,7 +4084,7 @@ const SVGDocumentExtensions* Document::svgExtensions() SVGDocumentExtensions* Document::accessSVGExtensions() { if (!m_svgExtensions) - m_svgExtensions.set(new SVGDocumentExtensions(this)); + m_svgExtensions = adoptPtr(new SVGDocumentExtensions(this)); return m_svgExtensions.get(); } #endif @@ -4560,7 +4660,7 @@ Element* Document::findAnchor(const String& name) for (Node* node = this; node; node = node->traverseNextNode()) { if (node->hasTagName(aTag)) { HTMLAnchorElement* anchor = static_cast<HTMLAnchorElement*>(node); - if (inCompatMode()) { + if (inQuirksMode()) { // Quirks mode, case insensitive comparison of names. if (equalIgnoringCase(anchor->name(), name)) return anchor; @@ -4659,5 +4759,78 @@ InspectorController* Document::inspectorController() const return page() ? page()->inspectorController() : 0; } #endif + +#if ENABLE(FULLSCREEN_API) +void Document::webkitRequestFullScreenForElement(Element* element, unsigned short flags) +{ + if (!page() || !page()->settings()->fullScreenEnabled()) + return; + + if (!element) + element = documentElement(); + + if (!page()->chrome()->client()->supportsFullScreenForElement(element)) + return; + + m_areKeysEnabledInFullScreen = flags & Element::ALLOW_KEYBOARD_INPUT; + page()->chrome()->client()->enterFullScreenForElement(element); +} + +void Document::webkitCancelFullScreen() +{ + if (!page() || !m_fullScreenElement) + return; + + page()->chrome()->client()->exitFullScreenForElement(m_fullScreenElement.get()); +} + +void Document::webkitWillEnterFullScreenForElement(Element* element) +{ + ASSERT(element); + ASSERT(page() && page()->settings()->fullScreenEnabled()); + + m_fullScreenElement = element; + m_isFullScreen = true; + documentElement()->setNeedsStyleRecalc(FullStyleChange); + m_fullScreenElement->setNeedsStyleRecalc(FullStyleChange); + updateStyleIfNeeded(); + + m_fullScreenElement->dispatchEvent(Event::create(eventNames().webkitfullscreenchangeEvent, true, false)); +} + +void Document::webkitDidEnterFullScreenForElement(Element*) +{ +} + +void Document::webkitWillExitFullScreenForElement(Element*) +{ +} + +void Document::webkitDidExitFullScreenForElement(Element* element) +{ + ASSERT(element); + m_isFullScreen = false; + m_areKeysEnabledInFullScreen = false; + + // m_fullScreenElement has already been cleared; recalc the style of + // the passed in element instead. + element->setNeedsStyleRecalc(FullStyleChange); + if (element != documentElement()) + documentElement()->setNeedsStyleRecalc(FullStyleChange); + updateStyleIfNeeded(); + + element->dispatchEvent(Event::create(eventNames().webkitfullscreenchangeEvent, true, false)); +} + +#endif + +void Document::decrementLoadEventDelayCount() +{ + ASSERT(m_loadEventDelayCount); + --m_loadEventDelayCount; + + if (frame() && !m_loadEventDelayCount) + frame()->loader()->checkCompleted(); +} } // namespace WebCore diff --git a/WebCore/dom/Document.h b/WebCore/dom/Document.h index 18dc838..ac0c2a2 100644 --- a/WebCore/dom/Document.h +++ b/WebCore/dom/Document.h @@ -85,7 +85,6 @@ class HTMLFrameOwnerElement; class HTMLHeadElement; class HTMLInputElement; class HTMLMapElement; -class HistoryItem; class HitTestRequest; class HitTestResult; class InspectorTimelineAgent; @@ -182,7 +181,9 @@ enum PageshowEventPersistence { PageshowEventNotPersisted = 0, PageshowEventPersisted = 1 }; - + +enum StyleSelectorUpdateFlag { RecalcStyleImmediately, DeferRecalcStyle }; + class Document : public ContainerNode, public ScriptExecutionContext { public: static PassRefPtr<Document> create(Frame* frame, const KURL& url) @@ -271,6 +272,9 @@ public: DEFINE_ATTRIBUTE_EVENT_LISTENER(touchend); DEFINE_ATTRIBUTE_EVENT_LISTENER(touchcancel); #endif +#if ENABLE(FULLSCREEN_API) + DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitfullscreenchange); +#endif DocumentType* doctype() const { return m_docType.get(); } @@ -440,8 +444,7 @@ public: * constructed from these which is used to create the a new style selector which collates all of the stylesheets * found and is used to calculate the derived styles for all rendering objects. */ - void updateStyleSelector(); - + void styleSelectorChanged(StyleSelectorUpdateFlag); void recalcStyleSelector(); bool usesDescendantRules() const { return m_usesDescendantRules; } @@ -539,12 +542,8 @@ public: void setURL(const KURL&); const KURL& baseURL() const { return m_baseURL; } - // Setting the BaseElementURL will change the baseURL. - void setBaseElementURL(const KURL&); - const String& baseTarget() const { return m_baseTarget; } - // Setting the BaseElementTarget will change the baseTarget. - void setBaseElementTarget(const String& baseTarget) { m_baseTarget = baseTarget; } + void processBaseElement(); KURL completeURL(const String&) const; @@ -552,9 +551,11 @@ public: CSSStyleSheet* pageUserSheet(); void clearPageUserSheet(); + void updatePageUserSheet(); const Vector<RefPtr<CSSStyleSheet> >* pageGroupUserSheets() const; void clearPageGroupUserSheets(); + void updatePageGroupUserSheets(); CSSStyleSheet* elementSheet(); CSSStyleSheet* mappedElementSheet(); @@ -571,14 +572,16 @@ public: bool paginated() const { return printing() || paginatedForScreen(); } - enum ParseMode { Compat, AlmostStrict, Strict }; + enum CompatibilityMode { QuirksMode, LimitedQuirksMode, NoQuirksMode }; - void setParseMode(ParseMode m) { m_parseMode = m; } - ParseMode parseMode() const { return m_parseMode; } + virtual void setCompatibilityModeFromDoctype() { } + void setCompatibilityMode(CompatibilityMode m); + void lockCompatibilityMode() { m_compatibilityModeLocked = true; } + CompatibilityMode compatibilityMode() const { return m_compatibilityMode; } - bool inCompatMode() const { return m_parseMode == Compat; } - bool inAlmostStrictMode() const { return m_parseMode == AlmostStrict; } - bool inStrictMode() const { return m_parseMode == Strict; } + bool inQuirksMode() const { return m_compatibilityMode == QuirksMode; } + bool inLimitedQuirksMode() const { return m_compatibilityMode == LimitedQuirksMode; } + bool inNoQuirksMode() const { return m_compatibilityMode == NoQuirksMode; } void setParsing(bool); bool parsing() const { return m_bParsing; } @@ -640,6 +643,7 @@ public: void setCSSTarget(Element*); Element* cssTarget() const { return m_cssTarget; } + void scheduleForcedStyleRecalc(); void scheduleStyleRecalc(); void unscheduleStyleRecalc(); void styleRecalcTimerFired(Timer<Document>*); @@ -993,16 +997,35 @@ public: void enqueueEvent(PassRefPtr<Event>); void enqueuePageshowEvent(PageshowEventPersistence); void enqueueHashchangeEvent(const String& oldURL, const String& newURL); + void enqueuePopstateEvent(PassRefPtr<SerializedScriptValue> stateObject); void addMediaCanStartListener(MediaCanStartListener*); void removeMediaCanStartListener(MediaCanStartListener*); MediaCanStartListener* takeAnyMediaCanStartListener(); const QualifiedName& idAttributeName() const { return m_idAttributeName; } + +#if ENABLE(FULLSCREEN_API) + bool webkitFullScreen() const { return m_isFullScreen; } + bool webkitFullScreenKeyboardInputAllowed() const { return m_isFullScreen && m_areKeysEnabledInFullScreen; } + Element* webkitCurrentFullScreenElement() const { return m_fullScreenElement.get(); } + void webkitRequestFullScreenForElement(Element*, unsigned short flags); + void webkitCancelFullScreen(); + + void webkitWillEnterFullScreenForElement(Element*); + void webkitDidEnterFullScreenForElement(Element*); + void webkitWillExitFullScreenForElement(Element*); + void webkitDidExitFullScreenForElement(Element*); +#endif bool writeDisabled() const { return m_writeDisabled; } void setWriteDisabled(bool flag) { m_writeDisabled = flag; } + // Used to allow element that loads data without going through a FrameLoader to delay the 'load' event. + void incrementLoadEventDelayCount() { ++m_loadEventDelayCount; } + void decrementLoadEventDelayCount(); + bool isDelayingLoadEvent() const { return m_loadEventDelayCount; } + protected: Document(Frame*, const KURL&, bool isXHTML, bool isHTML); @@ -1017,7 +1040,6 @@ private: virtual bool isDocument() const { return true; } virtual void removedLastRef(); - virtual void determineParseMode() { } virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); @@ -1045,7 +1067,6 @@ private: void createStyleSelector(); - void enqueuePopstateEvent(PassRefPtr<SerializedScriptValue> stateObject); void pendingEventTimerFired(Timer<Document>*); PassRefPtr<NodeList> handleZeroPadding(const HitTestRequest&, HitTestResult&) const; @@ -1105,7 +1126,8 @@ private: bool m_ignoreAutofocus; - ParseMode m_parseMode; + CompatibilityMode m_compatibilityMode; + bool m_compatibilityModeLocked; // This is cheaper than making setCompatibilityMode virtual. Color m_textColor; @@ -1142,9 +1164,12 @@ private: bool m_loadingSheet; bool m_visuallyOrdered; bool m_bParsing; + Timer<Document> m_styleRecalcTimer; + bool m_pendingStyleRecalcShouldForce; bool m_inStyleRecalc; bool m_closeAfterStyleRecalc; + bool m_usesDescendantRules; bool m_usesSiblingRules; bool m_usesFirstLineRules; @@ -1281,6 +1306,14 @@ private: HashSet<MediaCanStartListener*> m_mediaCanStartListeners; QualifiedName m_idAttributeName; + +#if ENABLE(FULLSCREEN_API) + bool m_isFullScreen; + bool m_areKeysEnabledInFullScreen; + RefPtr<Element> m_fullScreenElement; +#endif + + int m_loadEventDelayCount; }; inline bool Document::hasElementWithId(AtomicStringImpl* id) const @@ -1296,8 +1329,7 @@ inline bool Node::isDocumentNode() const // here because it uses a Document method but we really want to inline it inline Node::Node(Document* document, ConstructionType type) - : TreeShared<ContainerNode>(initialRefCount(type)) - , m_document(document) + : m_document(document) , m_previous(0) , m_next(0) , m_renderer(0) diff --git a/WebCore/dom/Document.idl b/WebCore/dom/Document.idl index 3ae551e..0bd93b8 100644 --- a/WebCore/dom/Document.idl +++ b/WebCore/dom/Document.idl @@ -245,6 +245,13 @@ module core { [DontEnum] void initializeWMLPageState(); #endif +#if defined(ENABLE_FULLSCREEN_API) && ENABLE_FULLSCREEN_API + readonly attribute boolean webkitFullScreen; + readonly attribute boolean webkitFullScreenKeyboardInputAllowed; + readonly attribute Element webkitCurrentFullScreenElement; + void webkitCancelFullScreen(); +#endif + #if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C // Event handler DOM attributes attribute [DontEnum] EventListener onabort; @@ -317,6 +324,7 @@ module core { attribute [DontEnum,Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchmove; attribute [DontEnum,Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchend; attribute [DontEnum,Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchcancel; + attribute [DontEnum, Conditional=FULLSCREEN_API] EventListener onwebkitfullscreenchange; #endif #if defined(LANGUAGE_CPP) && LANGUAGE_CPP diff --git a/WebCore/dom/DocumentMarker.h b/WebCore/dom/DocumentMarker.h index 55d2e33..e6160ae 100644 --- a/WebCore/dom/DocumentMarker.h +++ b/WebCore/dom/DocumentMarker.h @@ -39,7 +39,8 @@ struct DocumentMarker { Spelling, Grammar, TextMatch, - Replacement + Replacement, + RejectedCorrection }; MarkerType type; diff --git a/WebCore/dom/Element.cpp b/WebCore/dom/Element.cpp index 2d44f62..1855101 100644 --- a/WebCore/dom/Element.cpp +++ b/WebCore/dom/Element.cpp @@ -273,8 +273,8 @@ static float localZoomForRenderer(RenderObject* renderer) // FIXME: This does the wrong thing if two opposing zooms are in effect and canceled each // other out, but the alternative is that we'd have to crawl up the whole render tree every // time (or store an additional bit in the RenderStyle to indicate that a zoom was specified). - float zoomFactor = 1.0f; - if (renderer->style()->effectiveZoom() != 1.0f) { + float zoomFactor = 1; + if (renderer->style()->effectiveZoom() != 1) { // Need to find the nearest enclosing RenderObject that set up // a differing zoom, and then we divide our result by it to eliminate the zoom. RenderObject* prev = renderer; @@ -367,9 +367,9 @@ int Element::clientWidth() // When in strict mode, clientWidth for the document element should return the width of the containing frame. // When in quirks mode, clientWidth for the body element should return the width of the containing frame. - bool inCompatMode = document()->inCompatMode(); - if ((!inCompatMode && document()->documentElement() == this) || - (inCompatMode && isHTMLElement() && document()->body() == this)) { + bool inQuirksMode = document()->inQuirksMode(); + if ((!inQuirksMode && document()->documentElement() == this) || + (inQuirksMode && isHTMLElement() && document()->body() == this)) { if (FrameView* view = document()->view()) { if (RenderView* renderView = document()->renderView()) return adjustForAbsoluteZoom(view->layoutWidth(), renderView); @@ -387,10 +387,10 @@ int Element::clientHeight() // When in strict mode, clientHeight for the document element should return the height of the containing frame. // When in quirks mode, clientHeight for the body element should return the height of the containing frame. - bool inCompatMode = document()->inCompatMode(); + bool inQuirksMode = document()->inQuirksMode(); - if ((!inCompatMode && document()->documentElement() == this) || - (inCompatMode && isHTMLElement() && document()->body() == this)) { + if ((!inQuirksMode && document()->documentElement() == this) || + (inQuirksMode && isHTMLElement() && document()->body() == this)) { if (FrameView* view = document()->view()) { if (RenderView* renderView = document()->renderView()) return adjustForAbsoluteZoom(view->layoutHeight(), renderView); @@ -1313,8 +1313,11 @@ void Element::focus(bool restorePreviousSelection) RefPtr<Node> protect; if (Page* page = doc->page()) { // Focus and change event handlers can cause us to lose our last ref. + // If a focus event handler changes the focus to a different node it + // does not make sense to continue and update appearence. protect = this; - page->focusController()->setFocusedNode(this, doc->frame()); + if (!page->focusController()->setFocusedNode(this, doc->frame())) + return; } // Setting the focused node above might have invalidated the layout due to scripts. @@ -1420,6 +1423,28 @@ RenderStyle* Element::computedStyle(PseudoId pseudoElementSpecifier) return pseudoElementSpecifier ? data->m_computedStyle->getCachedPseudoStyle(pseudoElementSpecifier) : data->m_computedStyle.get(); } +AtomicString Element::computeInheritedLanguage() const +{ + const Node* n = this; + AtomicString value; + // The language property is inherited, so we iterate over the parents to find the first language. + while (n && value.isNull()) { + if (n->isElementNode()) { + // Spec: xml:lang takes precedence -- http://www.w3.org/TR/xhtml1/#C_7 + value = static_cast<const Element*>(n)->fastGetAttribute(XMLNames::langAttr); + if (value.isNull()) + value = static_cast<const Element*>(n)->fastGetAttribute(HTMLNames::langAttr); + } else if (n->isDocumentNode()) { + // checking the MIME content-language + value = static_cast<const Document*>(n)->contentLanguage(); + } + + n = n->parent(); + } + + return value; +} + void Element::cancelFocusAppearanceUpdate() { if (hasRareData()) @@ -1498,7 +1523,7 @@ bool Element::webkitMatchesSelector(const String& selector, ExceptionCode& ec) return false; } - bool strictParsing = !document()->inCompatMode(); + bool strictParsing = !document()->inQuirksMode(); CSSParser p(strictParsing); CSSSelectorList selectorList; @@ -1591,5 +1616,12 @@ bool Element::childShouldCreateRenderer(Node* child) const return Node::childShouldCreateRenderer(child); } #endif + +#if ENABLE(FULLSCREEN_API) +void Element::webkitRequestFullScreen(unsigned short flags) +{ + document()->webkitRequestFullScreenForElement(this, flags); +} +#endif } // namespace WebCore diff --git a/WebCore/dom/Element.h b/WebCore/dom/Element.h index 694db98..5bbddc2 100644 --- a/WebCore/dom/Element.h +++ b/WebCore/dom/Element.h @@ -94,6 +94,9 @@ public: DEFINE_ATTRIBUTE_EVENT_LISTENER(touchend); DEFINE_ATTRIBUTE_EVENT_LISTENER(touchcancel); #endif +#if ENABLE(FULLSCREEN_API) + DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitfullscreenchange); +#endif virtual PassRefPtr<DocumentFragment> deprecatedCreateContextualFragment(const String&, FragmentScriptingPermission = FragmentScriptingAllowed); @@ -215,6 +218,8 @@ public: RenderStyle* computedStyle(PseudoId = NOPSEUDO); + AtomicString computeInheritedLanguage() const; + void dispatchAttrRemovalEvent(Attribute*); void dispatchAttrAdditionEvent(Attribute*); @@ -292,6 +297,14 @@ public: #if ENABLE(SVG) virtual bool childShouldCreateRenderer(Node*) const; #endif + +#if ENABLE(FULLSCREEN_API) + enum { + ALLOW_KEYBOARD_INPUT = 1 + }; + + void webkitRequestFullScreen(unsigned short flags); +#endif protected: Element(const QualifiedName& tagName, Document* document, ConstructionType type) diff --git a/WebCore/dom/Element.idl b/WebCore/dom/Element.idl index 0ad3184..2b62a1a 100644 --- a/WebCore/dom/Element.idl +++ b/WebCore/dom/Element.idl @@ -100,10 +100,8 @@ module core { NodeList getElementsByClassName(in DOMString name); #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT -#if !defined(V8_BINDING) || !V8_BINDING readonly attribute DOMStringMap dataset; #endif -#endif // NodeSelector - Selector API Element querySelector(in DOMString selectors) @@ -133,6 +131,11 @@ module core { readonly attribute DOMString innerText; #endif +#if defined(ENABLE_FULLSCREEN_API) && ENABLE_FULLSCREEN_API + const unsigned short ALLOW_KEYBOARD_INPUT = 1; + void webkitRequestFullScreen(in unsigned short flags); +#endif + #if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C // Event handler DOM attributes attribute [DontEnum] EventListener onabort; @@ -205,6 +208,7 @@ module core { attribute [DontEnum,Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchmove; attribute [DontEnum,Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchend; attribute [DontEnum,Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchcancel; + attribute [DontEnum, Conditional=FULLSCREEN_API] EventListener onwebkitfullscreenchange; #endif }; diff --git a/WebCore/dom/EventNames.h b/WebCore/dom/EventNames.h index 85fe69b..6b8b908 100644 --- a/WebCore/dom/EventNames.h +++ b/WebCore/dom/EventNames.h @@ -170,6 +170,8 @@ namespace WebCore { \ macro(loadend) \ \ + macro(webkitfullscreenchange) + \ // end of DOM_EVENT_NAMES_FOR_EACH class EventNames : public Noncopyable { diff --git a/WebCore/dom/NamedNodeMap.cpp b/WebCore/dom/NamedNodeMap.cpp index 7c9298a..bc56f7e 100644 --- a/WebCore/dom/NamedNodeMap.cpp +++ b/WebCore/dom/NamedNodeMap.cpp @@ -309,7 +309,7 @@ void NamedNodeMap::setClass(const String& classStr) return; } - m_classNames.set(classStr, element()->document()->inCompatMode()); + m_classNames.set(classStr, element()->document()->inQuirksMode()); } int NamedNodeMap::declCount() const diff --git a/WebCore/dom/Node.cpp b/WebCore/dom/Node.cpp index 2c63b62..9b27089 100644 --- a/WebCore/dom/Node.cpp +++ b/WebCore/dom/Node.cpp @@ -1076,21 +1076,27 @@ void Node::checkSetPrefix(const AtomicString& prefix, ExceptionCode& ec) // Attribute-specific checks are in Attr::setPrefix(). } -bool Node::canReplaceChild(Node* newChild, Node*) +static bool isChildTypeAllowed(Node* newParent, Node* child) { - if (newChild->nodeType() != DOCUMENT_FRAGMENT_NODE) { - if (!childTypeAllowed(newChild->nodeType())) + if (child->nodeType() != Node::DOCUMENT_FRAGMENT_NODE) { + if (!newParent->childTypeAllowed(child->nodeType())) return false; - } else { - for (Node *n = newChild->firstChild(); n; n = n->nextSibling()) { - if (!childTypeAllowed(n->nodeType())) - return false; - } } + + for (Node *n = child->firstChild(); n; n = n->nextSibling()) { + if (!newParent->childTypeAllowed(n->nodeType())) + return false; + } + return true; } -void Node::checkReplaceChild(Node* newChild, Node* oldChild, ExceptionCode& ec) +bool Node::canReplaceChild(Node* newChild, Node*) +{ + return isChildTypeAllowed(this, newChild); +} + +static void checkAcceptChild(Node* newParent, Node* newChild, ExceptionCode& ec) { // Perform error checking as required by spec for adding a new child. Used by replaceChild(). @@ -1101,113 +1107,69 @@ void Node::checkReplaceChild(Node* newChild, Node* oldChild, ExceptionCode& ec) } // NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly - if (isReadOnlyNode()) { + if (newParent->isReadOnlyNode()) { ec = NO_MODIFICATION_ALLOWED_ERR; return; } - bool shouldAdoptChild = false; - // WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that // created this node. // We assume that if newChild is a DocumentFragment, all children are created from the same document // as the fragment itself (otherwise they could not have been added as children) - if (newChild->document() != document()) { + if (newChild->document() != newParent->document() && newChild->inDocument()) { // but if the child is not in a document yet then loosen the // restriction, so that e.g. creating an element with the Option() // constructor and then adding it to a different document works, // as it does in Mozilla and Mac IE. - if (!newChild->inDocument()) { - shouldAdoptChild = true; - } else { - ec = WRONG_DOCUMENT_ERR; - return; - } + ec = WRONG_DOCUMENT_ERR; + return; } // HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the // newChild node, or if the node to append is one of this node's ancestors. - + // check for ancestor/same node - if (newChild == this || isDescendantOf(newChild)) { + if (newChild == newParent || newParent->isDescendantOf(newChild)) { ec = HIERARCHY_REQUEST_ERR; return; } - - if (!canReplaceChild(newChild, oldChild)) { - ec = HIERARCHY_REQUEST_ERR; - return; - } - - // change the document pointer of newChild and all of its children to be the new document - if (shouldAdoptChild) - for (Node* node = newChild; node; node = node->traverseNextNode(newChild)) - node->setDocument(document()); } -void Node::checkAddChild(Node *newChild, ExceptionCode& ec) +static void transferOwnerDocument(Document* newDocument, Node* root) { - // Perform error checking as required by spec for adding a new child. Used by appendChild() and insertBefore(). - - // Not mentioned in spec: throw NOT_FOUND_ERR if newChild is null - if (!newChild) { - ec = NOT_FOUND_ERR; - return; + // FIXME: To match Gecko, we should do this for nodes that are already in the document as well. + if (root->document() != newDocument && !root->inDocument()) { + for (Node* node = root; node; node = node->traverseNextNode(root)) + node->setDocument(newDocument); } +} - // NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly - if (isReadOnlyNode()) { - ec = NO_MODIFICATION_ALLOWED_ERR; +void Node::checkReplaceChild(Node* newChild, Node* oldChild, ExceptionCode& ec) +{ + checkAcceptChild(this, newChild, ec); + if (ec) return; - } - - bool shouldAdoptChild = false; - // WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that - // created this node. - // We assume that if newChild is a DocumentFragment, all children are created from the same document - // as the fragment itself (otherwise they could not have been added as children) - if (newChild->document() != document()) { - // but if the child is not in a document yet then loosen the - // restriction, so that e.g. creating an element with the Option() - // constructor and then adding it to a different document works, - // as it does in Mozilla and Mac IE. - if (!newChild->inDocument()) { - shouldAdoptChild = true; - } else { - ec = WRONG_DOCUMENT_ERR; - return; - } + if (!canReplaceChild(newChild, oldChild)) { + ec = HIERARCHY_REQUEST_ERR; + return; } - // HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the - // newChild node, or if the node to append is one of this node's ancestors. + transferOwnerDocument(document(), newChild); +} - // check for ancestor/same node - if (newChild == this || isDescendantOf(newChild)) { - ec = HIERARCHY_REQUEST_ERR; +void Node::checkAddChild(Node *newChild, ExceptionCode& ec) +{ + checkAcceptChild(this, newChild, ec); + if (ec) return; - } - if (newChild->nodeType() != DOCUMENT_FRAGMENT_NODE) { - if (!childTypeAllowed(newChild->nodeType())) { - ec = HIERARCHY_REQUEST_ERR; - return; - } - } - else { - for (Node *n = newChild->firstChild(); n; n = n->nextSibling()) { - if (!childTypeAllowed(n->nodeType())) { - ec = HIERARCHY_REQUEST_ERR; - return; - } - } + if (!isChildTypeAllowed(this, newChild)) { + ec = HIERARCHY_REQUEST_ERR; + return; } - - // change the document pointer of newChild and all of its children to be the new document - if (shouldAdoptChild) - for (Node* node = newChild; node; node = node->traverseNextNode(newChild)) - node->setDocument(document()); + + transferOwnerDocument(document(), newChild); } bool Node::isDescendantOf(const Node *other) const @@ -1646,7 +1608,7 @@ PassRefPtr<Element> Node::querySelector(const String& selectors, ExceptionCode& ec = SYNTAX_ERR; return 0; } - bool strictParsing = !document()->inCompatMode(); + bool strictParsing = !document()->inQuirksMode(); CSSParser p(strictParsing); CSSSelectorList querySelectorList; @@ -1693,7 +1655,7 @@ PassRefPtr<NodeList> Node::querySelectorAll(const String& selectors, ExceptionCo ec = SYNTAX_ERR; return 0; } - bool strictParsing = !document()->inCompatMode(); + bool strictParsing = !document()->inQuirksMode(); CSSParser p(strictParsing); CSSSelectorList querySelectorList; diff --git a/WebCore/dom/Node.h b/WebCore/dom/Node.h index e4e2b4a..c7f07f1 100644 --- a/WebCore/dom/Node.h +++ b/WebCore/dom/Node.h @@ -647,7 +647,6 @@ private: HasSVGRareDataFlag = 1 << 23, // SVGElement #endif StyleChangeMask = 1 << nodeStyleChangeShift | 1 << (nodeStyleChangeShift + 1), - CreateWithZeroRefCountFlag = 1 << 26, #if ENABLE(SVG) DefaultNodeFlags = IsParsingChildrenFinishedFlag | IsStyleAttributeValidFlag | AreSVGAttributesValidFlag @@ -664,8 +663,6 @@ private: void clearFlag(NodeFlags mask) const { m_nodeFlags &= ~mask; } protected: - // CreateWithZeroRefCountFlag is deprecated and can be removed once we convert all element - // classes to start with a reference count of 1. enum ConstructionType { CreateOther = DefaultNodeFlags, CreateText = DefaultNodeFlags | IsTextFlag, @@ -673,10 +670,8 @@ protected: CreateContainer = DefaultNodeFlags | IsContainerFlag, CreateElement = CreateContainer | IsElementFlag, CreateStyledElement = CreateElement | IsStyledElementFlag, - CreateStyledElementZeroRefCount = CreateStyledElement | CreateWithZeroRefCountFlag, CreateHTMLElement = CreateStyledElement | IsHTMLFlag, CreateSVGElement = CreateStyledElement | IsSVGFlag, - CreateSVGElementZeroRefCount = CreateSVGElement | CreateWithZeroRefCountFlag, }; Node(Document*, ConstructionType); @@ -696,7 +691,6 @@ private: void markCachedNodeListsSlow(JSC::MarkStack&, JSC::JSGlobalData&); #endif - static bool initialRefCount(ConstructionType); void setStyleChange(StyleChangeType); virtual void refEventTarget() { ref(); } @@ -753,11 +747,6 @@ private: #endif }; -inline bool Node::initialRefCount(ConstructionType type) -{ - return !(type & CreateWithZeroRefCountFlag); -} - // Used in Node::addSubresourceAttributeURLs() and in addSubresourceStyleURLs() inline void addSubresourceURL(ListHashSet<KURL>& urls, const KURL& url) { diff --git a/WebCore/dom/OptionElement.cpp b/WebCore/dom/OptionElement.cpp index 1de5fa4..240a8fc 100644 --- a/WebCore/dom/OptionElement.cpp +++ b/WebCore/dom/OptionElement.cpp @@ -73,7 +73,7 @@ String OptionElement::collectOptionLabelOrText(const OptionElementData& data, co String text; // WinIE does not use the label attribute, so as a quirk, we ignore it. - if (!document->inCompatMode()) + if (!document->inQuirksMode()) text = data.label(); if (text.isEmpty()) text = collectOptionInnerText(element); diff --git a/WebCore/dom/ProcessingInstruction.cpp b/WebCore/dom/ProcessingInstruction.cpp index 739d62f..8f4a0ce 100644 --- a/WebCore/dom/ProcessingInstruction.cpp +++ b/WebCore/dom/ProcessingInstruction.cpp @@ -274,9 +274,8 @@ void ProcessingInstruction::removedFromDocument() document()->removeStyleSheetCandidateNode(this); - // FIXME: It's terrible to do a synchronous update of the style selector just because a <style> or <link> element got removed. if (m_cachedSheet) - document()->updateStyleSelector(); + document()->styleSelectorChanged(DeferRecalcStyle); } void ProcessingInstruction::finishParsingChildren() diff --git a/WebCore/dom/SelectorNodeList.cpp b/WebCore/dom/SelectorNodeList.cpp index 5beaaee..039a29f 100644 --- a/WebCore/dom/SelectorNodeList.cpp +++ b/WebCore/dom/SelectorNodeList.cpp @@ -46,7 +46,7 @@ PassRefPtr<StaticNodeList> createSelectorNodeList(Node* rootNode, const CSSSelec Vector<RefPtr<Node> > nodes; Document* document = rootNode->document(); CSSSelector* onlySelector = querySelectorList.hasOneSelector() ? querySelectorList.first() : 0; - bool strictParsing = !document->inCompatMode(); + bool strictParsing = !document->inQuirksMode(); CSSStyleSelector::SelectorChecker selectorChecker(document, strictParsing); diff --git a/WebCore/dom/StyleElement.cpp b/WebCore/dom/StyleElement.cpp index 4c0e56f..c3a7300 100644 --- a/WebCore/dom/StyleElement.cpp +++ b/WebCore/dom/StyleElement.cpp @@ -67,9 +67,8 @@ void StyleElement::removedFromDocument(Document* document, Element* element) if (!document->renderer()) return; - // FIXME: It's terrible to do a synchronous update of the style selector just because a <style> or <link> element got removed. if (m_sheet) - document->updateStyleSelector(); + document->styleSelectorChanged(DeferRecalcStyle); } void StyleElement::childrenChanged(Element* element) @@ -138,7 +137,7 @@ void StyleElement::createSheet(Element* e, int startLineNumber, const String& te document->addPendingSheet(); m_loading = true; m_sheet = CSSStyleSheet::create(e, String(), KURL(), document->inputEncoding()); - m_sheet->parseStringAtLine(text, !document->inCompatMode(), startLineNumber); + m_sheet->parseStringAtLine(text, !document->inQuirksMode(), startLineNumber); m_sheet->setMedia(mediaList.get()); m_sheet->setTitle(e->title()); m_loading = false; diff --git a/WebCore/dom/StyledElement.cpp b/WebCore/dom/StyledElement.cpp index 9b22f1d..a158e2e 100644 --- a/WebCore/dom/StyledElement.cpp +++ b/WebCore/dom/StyledElement.cpp @@ -126,7 +126,7 @@ void StyledElement::createInlineStyleDecl() m_inlineStyleDecl = CSSMutableStyleDeclaration::create(); m_inlineStyleDecl->setParent(document()->elementSheet()); m_inlineStyleDecl->setNode(this); - m_inlineStyleDecl->setStrictParsing(isHTMLElement() && !document()->inCompatMode()); + m_inlineStyleDecl->setStrictParsing(isHTMLElement() && !document()->inQuirksMode()); } void StyledElement::destroyInlineStyleDecl() @@ -234,7 +234,7 @@ void StyledElement::parseMappedAttribute(Attribute* attr) if (attributeMap()) { if (attr->isNull()) attributeMap()->setIdForStyleResolution(nullAtom); - else if (document()->inCompatMode()) + else if (document()->inQuirksMode()) attributeMap()->setIdForStyleResolution(attr->value().lower()); else attributeMap()->setIdForStyleResolution(attr->value()); diff --git a/WebCore/dom/XMLDocumentParser.cpp b/WebCore/dom/XMLDocumentParser.cpp index c6d9f89..4b76472 100644 --- a/WebCore/dom/XMLDocumentParser.cpp +++ b/WebCore/dom/XMLDocumentParser.cpp @@ -231,7 +231,7 @@ void XMLDocumentParser::end() insertErrorMessageBlock(); else { exitText(); - document()->updateStyleSelector(); + document()->styleSelectorChanged(RecalcStyleImmediately); } clearCurrentNodeStack(); diff --git a/WebCore/dom/XMLDocumentParserLibxml2.cpp b/WebCore/dom/XMLDocumentParserLibxml2.cpp index 37da83c..db94c50 100644 --- a/WebCore/dom/XMLDocumentParserLibxml2.cpp +++ b/WebCore/dom/XMLDocumentParserLibxml2.cpp @@ -361,6 +361,17 @@ private: unsigned m_currentOffset; }; +static void switchToUTF16(xmlParserCtxtPtr ctxt) +{ + // Hack around libxml2's lack of encoding overide support by manually + // resetting the encoding to UTF-16 before every chunk. Otherwise libxml + // will detect <?xml version="1.0" encoding="<encoding name>"?> blocks + // and switch encodings, causing the parse to fail. + const UChar BOM = 0xFEFF; + const unsigned char BOMHighByte = *reinterpret_cast<const unsigned char*>(&BOM); + xmlSwitchEncoding(ctxt, BOMHighByte == 0xFF ? XML_CHAR_ENCODING_UTF16LE : XML_CHAR_ENCODING_UTF16BE); +} + static bool shouldAllowExternalLoad(const KURL& url) { String urlString = url.string(); @@ -476,9 +487,7 @@ PassRefPtr<XMLParserContext> XMLParserContext::createStringParser(xmlSAXHandlerP xmlParserCtxtPtr parser = xmlCreatePushParserCtxt(handlers, 0, 0, 0, 0); parser->_private = userData; parser->replaceEntities = true; - const UChar BOM = 0xFEFF; - const unsigned char BOMHighByte = *reinterpret_cast<const unsigned char*>(&BOM); - xmlSwitchEncoding(parser, BOMHighByte == 0xFF ? XML_CHAR_ENCODING_UTF16LE : XML_CHAR_ENCODING_UTF16BE); + switchToUTF16(parser); return adoptRef(new XMLParserContext(parser)); } @@ -645,14 +654,7 @@ void XMLDocumentParser::doWrite(const String& parseString) // keep this alive until this function is done. RefPtr<XMLDocumentParser> protect(this); - // Hack around libxml2's lack of encoding overide support by manually - // resetting the encoding to UTF-16 before every chunk. Otherwise libxml - // will detect <?xml version="1.0" encoding="<encoding name>"?> blocks - // and switch encodings, causing the parse to fail. - const UChar BOM = 0xFEFF; - const unsigned char BOMHighByte = *reinterpret_cast<const unsigned char*>(&BOM); - xmlSwitchEncoding(context->context(), BOMHighByte == 0xFF ? XML_CHAR_ENCODING_UTF16LE : XML_CHAR_ENCODING_UTF16BE); - + switchToUTF16(context->context()); XMLDocumentParserScope scope(document()->docLoader()); xmlParseChunk(context->context(), reinterpret_cast<const char*>(parseString.characters()), sizeof(UChar) * parseString.length(), 0); @@ -1231,6 +1233,7 @@ static xmlEntityPtr getEntityHandler(void* closure, const xmlChar* name) static void startDocumentHandler(void* closure) { xmlParserCtxt* ctxt = static_cast<xmlParserCtxt*>(closure); + switchToUTF16(ctxt); getParser(closure)->startDocument(ctxt->version, ctxt->encoding, ctxt->standalone); xmlSAX2StartDocument(closure); } @@ -1313,7 +1316,7 @@ void XMLDocumentParser::doEnd() document()->setTransformSource(new TransformSource(doc)); document()->setParsing(false); // Make the doc think it's done, so it will apply xsl sheets. - document()->updateStyleSelector(); + document()->styleSelectorChanged(RecalcStyleImmediately); document()->setParsing(true); m_parserStopped = true; } diff --git a/WebCore/dom/XMLDocumentParserQt.cpp b/WebCore/dom/XMLDocumentParserQt.cpp index 606770f..dfd6fb1 100644 --- a/WebCore/dom/XMLDocumentParserQt.cpp +++ b/WebCore/dom/XMLDocumentParserQt.cpp @@ -211,7 +211,7 @@ void XMLDocumentParser::doEnd() if (m_sawXSLTransform) { document()->setTransformSource(new TransformSource(m_originalSourceForTransform)); document()->setParsing(false); // Make the doc think it's done, so it will apply xsl sheets. - document()->updateStyleSelector(); + document()->styleSelectorChanged(RecalcStyleImmediately); document()->setParsing(true); m_parserStopped = true; } diff --git a/WebCore/dom/make_names.pl b/WebCore/dom/make_names.pl index e111eb7..9dec124 100755 --- a/WebCore/dom/make_names.pl +++ b/WebCore/dom/make_names.pl @@ -128,7 +128,6 @@ sub defaultTagPropertyHash return ( 'constructorNeedsCreatedByParser' => 0, 'constructorNeedsFormElement' => 0, - 'createWithNew' => 0, 'interfaceName' => defaultInterfaceName($_[0]), # By default, the JSInterfaceName is the same as the interfaceName. 'JSInterfaceName' => defaultInterfaceName($_[0]), @@ -317,16 +316,8 @@ END ; } - my $newPrefix = ""; - my $createSuffix = "::create"; - - if ($enabledTags{$tagName}{createWithNew}) { - $newPrefix = "new "; - $createSuffix = ""; - } - # Call the constructor with the right parameters. - print F " return $newPrefix$interfaceName${createSuffix}($constructorTagName, document"; + print F " return ${interfaceName}::create($constructorTagName, document"; print F ", formElement" if $enabledTags{$tagName}{constructorNeedsFormElement}; print F ", createdByParser" if $enabledTags{$tagName}{constructorNeedsCreatedByParser}; print F ");\n}\n\n"; diff --git a/WebCore/editing/ApplyStyleCommand.cpp b/WebCore/editing/ApplyStyleCommand.cpp index 0a02e7a..4385a16 100644 --- a/WebCore/editing/ApplyStyleCommand.cpp +++ b/WebCore/editing/ApplyStyleCommand.cpp @@ -909,6 +909,16 @@ void ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock(Node* node, Node* unsp } } +static Node* highestEmbeddingAncestor(Node* startNode, Node* enclosingNode) +{ + for (Node* n = startNode; n && n != enclosingNode; n = n->parent()) { + if (n->isHTMLElement() && getIdentifierValue(computedStyle(n).get(), CSSPropertyUnicodeBidi) == CSSValueEmbed) + return n; + } + + return 0; +} + void ApplyStyleCommand::applyInlineStyle(CSSMutableStyleDeclaration *style) { Node* startDummySpanAncestor = 0; @@ -952,56 +962,51 @@ void ApplyStyleCommand::applyInlineStyle(CSSMutableStyleDeclaration *style) endDummySpanAncestor = dummySpanAncestorForNode(end.node()); } + // Remove style from the selection. + // Use the upstream position of the start for removing style. + // This will ensure we remove all traces of the relevant styles from the selection + // and prevent us from adding redundant ones, as described in: + // <rdar://problem/3724344> Bolding and unbolding creates extraneous tags + Position removeStart = start.upstream(); int unicodeBidi = getIdentifierValue(style, CSSPropertyUnicodeBidi); int direction = 0; - HTMLElement* startUnsplitAncestor = 0; - HTMLElement* endUnsplitAncestor = 0; + RefPtr<CSSMutableStyleDeclaration> styleWithoutEmbedding; if (unicodeBidi) { // Leave alone an ancestor that provides the desired single level embedding, if there is one. if (unicodeBidi == CSSValueEmbed) direction = getIdentifierValue(style, CSSPropertyDirection); - startUnsplitAncestor = splitAncestorsWithUnicodeBidi(start.node(), true, direction); - endUnsplitAncestor = splitAncestorsWithUnicodeBidi(end.node(), false, direction); + HTMLElement* startUnsplitAncestor = splitAncestorsWithUnicodeBidi(start.node(), true, direction); + HTMLElement* endUnsplitAncestor = splitAncestorsWithUnicodeBidi(end.node(), false, direction); removeEmbeddingUpToEnclosingBlock(start.node(), startUnsplitAncestor); removeEmbeddingUpToEnclosingBlock(end.node(), endUnsplitAncestor); - } - // Remove style from the selection. - // Use the upstream position of the start for removing style. - // This will ensure we remove all traces of the relevant styles from the selection - // and prevent us from adding redundant ones, as described in: - // <rdar://problem/3724344> Bolding and unbolding creates extraneous tags - Position removeStart = start.upstream(); - Position embeddingRemoveStart = removeStart; - Position embeddingRemoveEnd = end; - if (unicodeBidi) { // Avoid removing the dir attribute and the unicode-bidi and direction properties from the unsplit ancestors. + Position embeddingRemoveStart = removeStart; if (startUnsplitAncestor && nodeFullySelected(startUnsplitAncestor, removeStart, end)) embeddingRemoveStart = positionInParentAfterNode(startUnsplitAncestor); + + Position embeddingRemoveEnd = end; if (endUnsplitAncestor && nodeFullySelected(endUnsplitAncestor, removeStart, end)) embeddingRemoveEnd = positionInParentBeforeNode(endUnsplitAncestor).downstream(); - } - - if (embeddingRemoveStart != removeStart || embeddingRemoveEnd != end) { - RefPtr<CSSMutableStyleDeclaration> embeddingStyle = CSSMutableStyleDeclaration::create(); - embeddingStyle->setProperty(CSSPropertyUnicodeBidi, CSSValueEmbed); - embeddingStyle->setProperty(CSSPropertyDirection, direction); - if (comparePositions(embeddingRemoveStart, embeddingRemoveEnd) <= 0) - removeInlineStyle(embeddingStyle, embeddingRemoveStart, embeddingRemoveEnd); - RefPtr<CSSMutableStyleDeclaration> styleWithoutEmbedding = style->copy(); - styleWithoutEmbedding->removeProperty(CSSPropertyUnicodeBidi); - styleWithoutEmbedding->removeProperty(CSSPropertyDirection); - removeInlineStyle(styleWithoutEmbedding, removeStart, end); - } else - removeInlineStyle(style, removeStart, end); + if (embeddingRemoveEnd != removeStart || embeddingRemoveEnd != end) { + RefPtr<CSSMutableStyleDeclaration> embeddingStyle = CSSMutableStyleDeclaration::create(); + embeddingStyle->setProperty(CSSPropertyUnicodeBidi, CSSValueEmbed); + embeddingStyle->setProperty(CSSPropertyDirection, direction); + if (comparePositions(embeddingRemoveStart, embeddingRemoveEnd) <= 0) + removeInlineStyle(embeddingStyle, embeddingRemoveStart, embeddingRemoveEnd); + styleWithoutEmbedding = style->copy(); + styleWithoutEmbedding->removeProperty(CSSPropertyUnicodeBidi); + styleWithoutEmbedding->removeProperty(CSSPropertyDirection); + } + } + removeInlineStyle(styleWithoutEmbedding ? styleWithoutEmbedding.get() : style, removeStart, end); start = startPosition(); end = endPosition(); if (splitStart) { - bool mergedStart = mergeStartWithPreviousIfIdentical(start, end); - if (mergedStart) { + if (mergeStartWithPreviousIfIdentical(start, end)) { start = startPosition(); end = endPosition(); } @@ -1018,41 +1023,33 @@ void ApplyStyleCommand::applyInlineStyle(CSSMutableStyleDeclaration *style) // to check a computed style updateLayout(); - Position embeddingApplyStart = start; - Position embeddingApplyEnd = end; + RefPtr<CSSMutableStyleDeclaration> styleToApply = style; if (unicodeBidi) { // Avoid applying the unicode-bidi and direction properties beneath ancestors that already have them. - Node* startEnclosingBlock = enclosingBlock(start.node()); - for (Node* n = start.node(); n != startEnclosingBlock; n = n->parent()) { - if (n->isHTMLElement() && getIdentifierValue(computedStyle(n).get(), CSSPropertyUnicodeBidi) == CSSValueEmbed) { - embeddingApplyStart = positionInParentAfterNode(n); - break; - } - } + Node* embeddingStartNode = highestEmbeddingAncestor(start.node(), enclosingBlock(start.node())); + Node* embeddingEndNode = highestEmbeddingAncestor(end.node(), enclosingBlock(end.node())); - Node* endEnclosingBlock = enclosingBlock(end.node()); - for (Node* n = end.node(); n != endEnclosingBlock; n = n->parent()) { - if (n->isHTMLElement() && getIdentifierValue(computedStyle(n).get(), CSSPropertyUnicodeBidi) == CSSValueEmbed) { - embeddingApplyEnd = positionInParentBeforeNode(n); - break; - } - } - } + if (embeddingStartNode || embeddingEndNode) { + Position embeddingApplyStart = embeddingStartNode ? positionInParentAfterNode(embeddingStartNode) : start; + Position embeddingApplyEnd = embeddingEndNode ? positionInParentBeforeNode(embeddingEndNode) : end; + ASSERT(embeddingApplyStart.isNotNull() && embeddingApplyEnd.isNotNull()); - if (embeddingApplyStart != start || embeddingApplyEnd != end) { - if (embeddingApplyStart.isNotNull() && embeddingApplyEnd.isNotNull()) { RefPtr<CSSMutableStyleDeclaration> embeddingStyle = CSSMutableStyleDeclaration::create(); embeddingStyle->setProperty(CSSPropertyUnicodeBidi, CSSValueEmbed); embeddingStyle->setProperty(CSSPropertyDirection, direction); applyInlineStyleToRange(embeddingStyle.get(), embeddingApplyStart, embeddingApplyEnd); + + if (styleWithoutEmbedding) + styleToApply = styleWithoutEmbedding; + else { + styleToApply = style->copy(); + styleToApply->removeProperty(CSSPropertyUnicodeBidi); + styleToApply->removeProperty(CSSPropertyDirection); + } } + } - RefPtr<CSSMutableStyleDeclaration> styleWithoutEmbedding = style->copy(); - styleWithoutEmbedding->removeProperty(CSSPropertyUnicodeBidi); - styleWithoutEmbedding->removeProperty(CSSPropertyDirection); - applyInlineStyleToRange(styleWithoutEmbedding.get(), start, end); - } else - applyInlineStyleToRange(style, start, end); + applyInlineStyleToRange(styleToApply.get(), start, end); // Remove dummy style spans created by splitting text elements. cleanupUnstyledAppleStyleSpans(startDummySpanAncestor); @@ -1135,94 +1132,113 @@ void ApplyStyleCommand::applyInlineStyleToRange(CSSMutableStyleDeclaration* styl } } -bool ApplyStyleCommand::shouldRemoveTextDecorationTag(CSSStyleDeclaration* styleToApply, int textDecorationAddedByTag) const -{ - // Honor text-decorations-in-effect - RefPtr<CSSValue> textDecorationsToApply = styleToApply->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect); - if (!textDecorationsToApply || !textDecorationsToApply->isValueList()) - textDecorationsToApply = styleToApply->getPropertyCSSValue(CSSPropertyTextDecoration); - - // When there is no text decorations to apply, remove any one of u, s, & strike - if (!textDecorationsToApply || !textDecorationsToApply->isValueList()) - return true; - - // Remove node if it implicitly adds style not present in styleToApply - CSSValueList* valueList = static_cast<CSSValueList*>(textDecorationsToApply.get()); - RefPtr<CSSPrimitiveValue> value = CSSPrimitiveValue::createIdentifier(textDecorationAddedByTag); - return !valueList->hasValue(value.get()); -} - -// This function maps from styling tags to CSS styles. Used for knowing which -// styling tags should be removed when toggling styles. -bool ApplyStyleCommand::implicitlyStyledElementShouldBeRemovedWhenApplyingStyle(HTMLElement* elem, CSSMutableStyleDeclaration* style) -{ - CSSMutableStyleDeclaration::const_iterator end = style->end(); - for (CSSMutableStyleDeclaration::const_iterator it = style->begin(); it != end; ++it) { - const CSSProperty& property = *it; - // FIXME: This should probably be re-written to lookup the tagname in a - // hash and match against an expected property/value pair. - switch (property.id()) { - case CSSPropertyFontWeight: - // IE inserts "strong" tags for execCommand("bold"), so we remove them, even though they're not strictly presentational - if (elem->hasLocalName(bTag) || elem->hasLocalName(strongTag)) - return !equalIgnoringCase(property.value()->cssText(), "bold") || !elem->hasChildNodes(); - break; - case CSSPropertyVerticalAlign: - if (elem->hasLocalName(subTag)) - return !equalIgnoringCase(property.value()->cssText(), "sub") || !elem->hasChildNodes(); - if (elem->hasLocalName(supTag)) - return !equalIgnoringCase(property.value()->cssText(), "sup") || !elem->hasChildNodes(); - break; - case CSSPropertyFontStyle: - // IE inserts "em" tags for execCommand("italic"), so we remove them, even though they're not strictly presentational - if (elem->hasLocalName(iTag) || elem->hasLocalName(emTag)) - return !equalIgnoringCase(property.value()->cssText(), "italic") || !elem->hasChildNodes(); - break; - case CSSPropertyTextDecoration: - case CSSPropertyWebkitTextDecorationsInEffect: - if (elem->hasLocalName(uTag)) - return shouldRemoveTextDecorationTag(style, CSSValueUnderline) || !elem->hasChildNodes(); - else if (elem->hasLocalName(sTag) || elem->hasTagName(strikeTag)) - return shouldRemoveTextDecorationTag(style,CSSValueLineThrough) || !elem->hasChildNodes(); - } - } - return false; -} - bool ApplyStyleCommand::removeInlineStyleFromElement(CSSMutableStyleDeclaration* style, HTMLElement* element, InlineStyleRemovalMode mode) { ASSERT(style); ASSERT(element); - bool removed = false; - if (m_styledInlineElement && element->hasTagName(m_styledInlineElement->tagQName())) { - removed = true; if (mode == RemoveAttributesAndElements) removeNodePreservingChildren(element); + return true; } - if (implicitlyStyledElementShouldBeRemovedWhenApplyingStyle(element, style)) { + bool removed = false; + if (removeImplicitlyStyledElement(style, element, mode)) removed = true; - if (mode == RemoveAttributesAndElements) - replaceWithSpanOrRemoveIfWithoutAttributes(element); - } if (!element->inDocument()) return removed; // If the node was converted to a span, the span may still contain relevant // styles which must be removed (e.g. <b style='font-weight: bold'>) - if (removeHTMLFontStyle(style, element, mode)) - removed = true; - if (removeHTMLBidiEmbeddingStyle(style, element, mode)) - removed = true; if (removeCSSStyle(style, element, mode)) removed = true; return removed; } + +enum EPushDownType { ShouldBePushedDown, ShouldNotBePushedDown }; +struct HTMLEquivalent { + int propertyID; + bool isValueList; + int primitiveId; + const QualifiedName* element; + const QualifiedName* attribute; + EPushDownType pushDownType; +}; + +static const HTMLEquivalent HTMLEquivalents[] = { + { CSSPropertyFontWeight, false, CSSValueBold, &bTag, 0, ShouldBePushedDown }, + { CSSPropertyFontWeight, false, CSSValueBold, &strongTag, 0, ShouldBePushedDown }, + { CSSPropertyVerticalAlign, false, CSSValueSub, &subTag, 0, ShouldBePushedDown }, + { CSSPropertyVerticalAlign, false, CSSValueSuper, &supTag, 0, ShouldBePushedDown }, + { CSSPropertyFontStyle, false, CSSValueItalic, &iTag, 0, ShouldBePushedDown }, + { CSSPropertyFontStyle, false, CSSValueItalic, &emTag, 0, ShouldBePushedDown }, + + // text-decorations should be CSSValueList + { CSSPropertyTextDecoration, true, CSSValueUnderline, &uTag, 0, ShouldBePushedDown }, + { CSSPropertyTextDecoration, true, CSSValueLineThrough, &sTag, 0, ShouldBePushedDown }, + { CSSPropertyTextDecoration, true, CSSValueLineThrough, &strikeTag, 0, ShouldBePushedDown }, + { CSSPropertyWebkitTextDecorationsInEffect, true, CSSValueUnderline, &uTag, 0, ShouldBePushedDown }, + { CSSPropertyWebkitTextDecorationsInEffect, true, CSSValueLineThrough, &sTag, 0, ShouldBePushedDown }, + { CSSPropertyWebkitTextDecorationsInEffect, true, CSSValueLineThrough, &strikeTag, 0, ShouldBePushedDown }, + + // FIXME: font attributes should only be removed if values were different + { CSSPropertyColor, false, CSSValueInvalid, &fontTag, &colorAttr, ShouldBePushedDown }, + { CSSPropertyFontFamily, false, CSSValueInvalid, &fontTag, &faceAttr, ShouldBePushedDown }, + { CSSPropertyFontSize, false, CSSValueInvalid, &fontTag, &sizeAttr, ShouldBePushedDown }, + + // unicode-bidi and direction are pushed down separately so don't push down with other styles. + { CSSPropertyUnicodeBidi, false, CSSValueInvalid, 0, &dirAttr, ShouldNotBePushedDown }, + { CSSPropertyDirection, false, CSSValueInvalid, 0, &dirAttr, ShouldNotBePushedDown }, +}; + +bool ApplyStyleCommand::removeImplicitlyStyledElement(CSSMutableStyleDeclaration* style, HTMLElement* element, InlineStyleRemovalMode mode, CSSMutableStyleDeclaration* extractedStyle) +{ + // Current implementation does not support stylePushedDown when mode == RemoveNone because of early exit. + ASSERT(!extractedStyle || mode != RemoveNone); + bool removed = false; + for (size_t i = 0; i < sizeof(HTMLEquivalents) / sizeof(HTMLEquivalent); i++) { + const HTMLEquivalent& equivalent = HTMLEquivalents[i]; + ASSERT(equivalent.element || equivalent.attribute); + if ((extractedStyle && equivalent.pushDownType == ShouldNotBePushedDown) + || (equivalent.element && !element->hasTagName(*equivalent.element)) + || (equivalent.attribute && !element->hasAttribute(*equivalent.attribute))) + continue; + + RefPtr<CSSValue> styleValue = style->getPropertyCSSValue(equivalent.propertyID); + if (!styleValue) + continue; + RefPtr<CSSPrimitiveValue> mapValue = CSSPrimitiveValue::createIdentifier(equivalent.primitiveId); + + 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 (styleValue->cssText() == mapValue->cssText()) + continue; // If CSS value is primitive, then skip if they are equal. + + if (extractedStyle) { + if (equivalent.primitiveId == CSSValueInvalid) + extractedStyle->setProperty(equivalent.propertyID, element->getAttribute(*equivalent.attribute)); + else + extractedStyle->setProperty(equivalent.propertyID, mapValue->cssText()); + } + if (mode == RemoveNone) + return true; + + removed = true; + if (!equivalent.attribute) { + replaceWithSpanOrRemoveIfWithoutAttributes(element); + break; + } + removeNodeAttribute(element, *equivalent.attribute); + if (isEmptyFontTag(element) || isSpanWithoutAttributesOrUnstyleStyleSpan(element)) + removeNodePreservingChildren(element); + } + return removed; +} + void ApplyStyleCommand::replaceWithSpanOrRemoveIfWithoutAttributes(HTMLElement*& elem) { bool removeNode = false; @@ -1247,66 +1263,6 @@ void ApplyStyleCommand::replaceWithSpanOrRemoveIfWithoutAttributes(HTMLElement*& } } -bool ApplyStyleCommand::removeHTMLFontStyle(CSSMutableStyleDeclaration* style, HTMLElement* elem, InlineStyleRemovalMode mode) -{ - ASSERT(style); - ASSERT(elem); - - if (!elem->hasLocalName(fontTag)) - return false; - - bool removed = false; - CSSMutableStyleDeclaration::const_iterator end = style->end(); - for (CSSMutableStyleDeclaration::const_iterator it = style->begin(); it != end; ++it) { - const QualifiedName* attrToRemove = 0; - switch ((*it).id()) { - case CSSPropertyColor: - attrToRemove = &colorAttr; - break; - case CSSPropertyFontFamily: - attrToRemove = &faceAttr; - break; - case CSSPropertyFontSize: - attrToRemove = &sizeAttr; - break; - } - - if (attrToRemove) { - removed = true; - if (mode == RemoveAttributesAndElements) - removeNodeAttribute(elem, *attrToRemove); - } - } - - if (isEmptyFontTag(elem) && mode == RemoveAttributesAndElements) - removeNodePreservingChildren(elem); - - return removed; -} - -bool ApplyStyleCommand::removeHTMLBidiEmbeddingStyle(CSSMutableStyleDeclaration* style, HTMLElement* elem, InlineStyleRemovalMode mode) -{ - ASSERT(style); - ASSERT(elem); - - if (!elem->hasAttribute(dirAttr)) - return false; - - if (!style->getPropertyCSSValue(CSSPropertyUnicodeBidi) && !style->getPropertyCSSValue(CSSPropertyDirection)) - return false; - - if (mode == RemoveNone) - return true; - - removeNodeAttribute(elem, dirAttr); - - // FIXME: should this be isSpanWithoutAttributesOrUnstyleStyleSpan? Need a test. - if (isUnstyledStyleSpan(elem)) - removeNodePreservingChildren(elem); - - return true; -} - bool ApplyStyleCommand::removeCSSStyle(CSSMutableStyleDeclaration* style, HTMLElement* elem, InlineStyleRemovalMode mode) { ASSERT(style); @@ -1364,7 +1320,7 @@ HTMLElement* ApplyStyleCommand::highestAncestorWithConflictingInlineStyle(CSSMut return result; } -PassRefPtr<CSSMutableStyleDeclaration> ApplyStyleCommand::extractInlineStyleToPushDown(Node* node, bool isStyledElement, const Vector<int>& properties) +PassRefPtr<CSSMutableStyleDeclaration> ApplyStyleCommand::extractInlineStyleToPushDown(CSSMutableStyleDeclaration* styleToApply, Node* node, bool isStyledElement) { ASSERT(node); ASSERT(node->isElementNode()); @@ -1380,8 +1336,16 @@ PassRefPtr<CSSMutableStyleDeclaration> ApplyStyleCommand::extractInlineStyleToPu return style.release(); } - if (!style) - return 0; + if (!style) { + style = CSSMutableStyleDeclaration::create(); + removeImplicitlyStyledElement(styleToApply, element, RemoveAttributesAndElements, style.get()); + return style.release(); + } + + Vector<int> properties; + CSSMutableStyleDeclaration::const_iterator end = styleToApply->end(); + for (CSSMutableStyleDeclaration::const_iterator it = styleToApply->begin(); it != end; ++it) + properties.append(it->id()); style = style->copyPropertiesInSet(properties.data(), properties.size()); for (size_t i = 0; i < properties.size(); i++) { @@ -1396,6 +1360,8 @@ PassRefPtr<CSSMutableStyleDeclaration> ApplyStyleCommand::extractInlineStyleToPu if (isSpanWithoutAttributesOrUnstyleStyleSpan(element)) removeNodePreservingChildren(element); + removeImplicitlyStyledElement(styleToApply, element, RemoveAttributesAndElements, style.get()); + return style.release(); } @@ -1406,15 +1372,14 @@ void ApplyStyleCommand::applyInlineStyleToPushDown(Node* node, CSSMutableStyleDe if (!style || !style->length() || !node->renderer()) return; - // Since addInlineStyleIfNeeded can't add styles to block-flow render objects, add style attribute instead. - // FIXME: applyInlineStyleToRange should be used here instead. - if ((node->renderer()->isBlockFlow() || node->childNodeCount()) && node->isHTMLElement()) { + RefPtr<CSSMutableStyleDeclaration> newInlineStyle = style; + if (node->isHTMLElement()) { HTMLElement* element = static_cast<HTMLElement*>(node); CSSMutableStyleDeclaration* existingInlineStyle = element->inlineStyleDecl(); // Avoid overriding existing styles of node if (existingInlineStyle) { - RefPtr<CSSMutableStyleDeclaration> newInlineStyle = existingInlineStyle->copy(); + newInlineStyle = existingInlineStyle->copy(); CSSMutableStyleDeclaration::const_iterator end = style->end(); for (CSSMutableStyleDeclaration::const_iterator it = style->begin(); it != end; ++it) { ExceptionCode ec; @@ -1441,22 +1406,23 @@ void ApplyStyleCommand::applyInlineStyleToPushDown(Node* node, CSSMutableStyleDe } } } + } + } - setNodeAttribute(element, styleAttr, newInlineStyle->cssText()); - } else - setNodeAttribute(element, styleAttr, style->cssText()); - + // Since addInlineStyleIfNeeded can't add styles to block-flow render objects, add style attribute instead. + // FIXME: applyInlineStyleToRange should be used here instead. + if ((node->renderer()->isBlockFlow() || node->childNodeCount()) && node->isHTMLElement()) { + setNodeAttribute(static_cast<HTMLElement*>(node), styleAttr, newInlineStyle->cssText()); return; } if (node->renderer()->isText() && static_cast<RenderText*>(node->renderer())->isAllCollapsibleWhitespace()) return; - // FIXME: addInlineStyleIfNeeded may override the style of node // We can't wrap node with the styled element here because new styled element will never be removed if we did. // If we modified the child pointer in pushDownInlineStyleAroundNode to point to new style element // then we fall into an infinite loop where we keep removing and adding styled element wrapping node. - addInlineStyleIfNeeded(style, node, node, DoNotAddStyledElement); + addInlineStyleIfNeeded(newInlineStyle.get(), node, node, DoNotAddStyledElement); } void ApplyStyleCommand::pushDownInlineStyleAroundNode(CSSMutableStyleDeclaration* style, Node* targetNode) @@ -1465,11 +1431,6 @@ void ApplyStyleCommand::pushDownInlineStyleAroundNode(CSSMutableStyleDeclaration if (!highestAncestor) return; - Vector<int> properties; - CSSMutableStyleDeclaration::const_iterator end = style->end(); - for (CSSMutableStyleDeclaration::const_iterator it = style->begin(); it != end; ++it) - properties.append(it->id()); - // The outer loop is traversing the tree vertically from highestAncestor to targetNode Node* current = highestAncestor; while (current != targetNode) { @@ -1481,7 +1442,7 @@ void ApplyStyleCommand::pushDownInlineStyleAroundNode(CSSMutableStyleDeclaration RefPtr<StyledElement> styledElement; if (current->isStyledElement() && m_styledInlineElement && current->hasTagName(m_styledInlineElement->tagQName())) styledElement = static_cast<StyledElement*>(current); - RefPtr<CSSMutableStyleDeclaration> styleToPushDown = extractInlineStyleToPushDown(current, styledElement, properties); + RefPtr<CSSMutableStyleDeclaration> styleToPushDown = extractInlineStyleToPushDown(style, current, styledElement); // The inner loop will go through children on each level // FIXME: we should aggregate inline child elements together so that we don't wrap each child separately. @@ -1533,6 +1494,13 @@ void ApplyStyleCommand::removeInlineStyle(PassRefPtr<CSSMutableStyleDeclaration> } Position pushDownStart = start.downstream(); + // If the pushDownStart is at the end of a text node, then this node is not fully selected. + // Move it to the next deep quivalent position to avoid removing the style from this node. + // e.g. if pushDownStart was at Position("hello", 5) in <b>hello<div>world</div></b>, we want Position("world", 0) instead. + Node* pushDownStartContainer = pushDownStart.containerNode(); + if (pushDownStartContainer && pushDownStartContainer->isTextNode() + && pushDownStart.computeOffsetInContainerNode() == pushDownStartContainer->maxCharacterOffset()) + pushDownStart = nextVisuallyDistinctCandidate(pushDownStart); Position pushDownEnd = end.upstream(); pushDownInlineStyleAroundNode(style.get(), pushDownStart.node()); pushDownInlineStyleAroundNode(style.get(), pushDownEnd.node()); diff --git a/WebCore/editing/ApplyStyleCommand.h b/WebCore/editing/ApplyStyleCommand.h index abe4909..969384a 100644 --- a/WebCore/editing/ApplyStyleCommand.h +++ b/WebCore/editing/ApplyStyleCommand.h @@ -71,16 +71,13 @@ private: CSSMutableStyleDeclaration* style() const { return m_style.get(); } // style-removal helpers - bool shouldRemoveTextDecorationTag(CSSStyleDeclaration* styleToApply, int textDecorationAddedByTag) const; - bool implicitlyStyledElementShouldBeRemovedWhenApplyingStyle(HTMLElement*, CSSMutableStyleDeclaration*); bool removeInlineStyleFromElement(CSSMutableStyleDeclaration*, HTMLElement*, InlineStyleRemovalMode = RemoveAttributesAndElements); inline bool shouldRemoveInlineStyleFromElement(CSSMutableStyleDeclaration* style, HTMLElement* element) {return removeInlineStyleFromElement(style, element, RemoveNone);} + bool removeImplicitlyStyledElement(CSSMutableStyleDeclaration*, HTMLElement*, InlineStyleRemovalMode, CSSMutableStyleDeclaration* extractedStyle = 0); void replaceWithSpanOrRemoveIfWithoutAttributes(HTMLElement*&); - bool removeHTMLFontStyle(CSSMutableStyleDeclaration*, HTMLElement*, InlineStyleRemovalMode = RemoveAttributesAndElements); - bool removeHTMLBidiEmbeddingStyle(CSSMutableStyleDeclaration*, HTMLElement*, InlineStyleRemovalMode = RemoveAttributesAndElements); bool removeCSSStyle(CSSMutableStyleDeclaration*, HTMLElement*, InlineStyleRemovalMode = RemoveAttributesAndElements); HTMLElement* highestAncestorWithConflictingInlineStyle(CSSMutableStyleDeclaration*, Node*); - PassRefPtr<CSSMutableStyleDeclaration> extractInlineStyleToPushDown(Node*, bool isStyledElement, const Vector<int>&); + PassRefPtr<CSSMutableStyleDeclaration> extractInlineStyleToPushDown(CSSMutableStyleDeclaration*, Node*, bool isStyledElement); void applyInlineStyleToPushDown(Node*, CSSMutableStyleDeclaration *style); void pushDownInlineStyleAroundNode(CSSMutableStyleDeclaration*, Node*); void removeInlineStyle(PassRefPtr<CSSMutableStyleDeclaration>, const Position& start, const Position& end); diff --git a/WebCore/editing/Editor.cpp b/WebCore/editing/Editor.cpp index 3dd6e27..117292c 100644 --- a/WebCore/editing/Editor.cpp +++ b/WebCore/editing/Editor.cpp @@ -918,6 +918,56 @@ TriState Editor::selectionHasStyle(CSSStyleDeclaration* style) const return state; } + +static bool hasTransparentBackgroundColor(CSSStyleDeclaration* style) +{ + RefPtr<CSSValue> cssValue = style->getPropertyCSSValue(CSSPropertyBackgroundColor); + if (!cssValue) + return true; + + if (!cssValue->isPrimitiveValue()) + return false; + CSSPrimitiveValue* value = static_cast<CSSPrimitiveValue*>(cssValue.get()); + + if (value->primitiveType() == CSSPrimitiveValue::CSS_RGBCOLOR) + return !alphaChannel(value->getRGBA32Value()); + + return value->getIdent() == CSSValueTransparent; +} + +String Editor::selectionStartCSSPropertyValue(int propertyID) +{ + Node* nodeToRemove; + RefPtr<CSSStyleDeclaration> selectionStyle = m_frame->selectionComputedStyle(nodeToRemove); + if (!selectionStyle) + return String(); + + 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. + if (propertyID == CSSPropertyBackgroundColor && (m_frame->selection()->isRange() || hasTransparentBackgroundColor(selectionStyle.get()))) { + RefPtr<Range> range(m_frame->selection()->toNormalizedRange()); + ExceptionCode ec = 0; + for (Node* ancestor = range->commonAncestorContainer(ec); ancestor; ancestor = ancestor->parentNode()) { + selectionStyle = computedStyle(ancestor); + if (!hasTransparentBackgroundColor(selectionStyle.get())) { + value = selectionStyle->getPropertyValue(CSSPropertyBackgroundColor); + break; + } + } + } + + return value; +} + void Editor::indent() { applyCommand(IndentOutdentCommand::create(m_frame->document(), IndentOutdentCommand::Indent)); @@ -1003,11 +1053,16 @@ Editor::Editor(Frame* frame) // This is off by default, since most editors want this behavior (this matches IE but not FF). , m_shouldStyleWithCSS(false) , m_killRing(adoptPtr(new KillRing)) -{ + , m_correctionPanelTimer(this, &Editor::correctionPanelTimerFired) +{ } Editor::~Editor() { +#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) + if (client()) + client()->dismissCorrectionPanel(true); +#endif } void Editor::clear() @@ -2301,22 +2356,29 @@ bool Editor::spellingPanelIsShowing() void Editor::markMisspellingsAfterTypingToPosition(const VisiblePosition &p) { #if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) - bool markSpelling = isContinuousSpellCheckingEnabled(); - bool markGrammar = markSpelling && isGrammarCheckingEnabled(); - bool performTextCheckingReplacements = isAutomaticQuoteSubstitutionEnabled() - || isAutomaticLinkDetectionEnabled() - || isAutomaticDashSubstitutionEnabled() - || isAutomaticTextReplacementEnabled() - || (markSpelling && isAutomaticSpellingCorrectionEnabled()); - if (!markSpelling && !performTextCheckingReplacements) + TextCheckingOptions textCheckingOptions = 0; + if (isContinuousSpellCheckingEnabled()) + textCheckingOptions |= MarkSpelling; + + if (isAutomaticQuoteSubstitutionEnabled() + || isAutomaticLinkDetectionEnabled() + || isAutomaticDashSubstitutionEnabled() + || isAutomaticTextReplacementEnabled() + || ((textCheckingOptions & MarkSpelling) && isAutomaticSpellingCorrectionEnabled())) + textCheckingOptions |= PerformReplacement; + + if (!textCheckingOptions & (MarkSpelling | PerformReplacement)) return; - + + if (isGrammarCheckingEnabled()) + textCheckingOptions |= MarkGrammar; + VisibleSelection adjacentWords = VisibleSelection(startOfWord(p, LeftWordIfOnBoundary), endOfWord(p, RightWordIfOnBoundary)); - if (markGrammar) { + if (textCheckingOptions & MarkGrammar) { VisibleSelection selectedSentence = VisibleSelection(startOfSentence(p), endOfSentence(p)); - markAllMisspellingsAndBadGrammarInRanges(true, adjacentWords.toNormalizedRange().get(), true, selectedSentence.toNormalizedRange().get(), performTextCheckingReplacements); + markAllMisspellingsAndBadGrammarInRanges(textCheckingOptions, adjacentWords.toNormalizedRange().get(), selectedSentence.toNormalizedRange().get()); } else { - markAllMisspellingsAndBadGrammarInRanges(markSpelling, adjacentWords.toNormalizedRange().get(), false, adjacentWords.toNormalizedRange().get(), performTextCheckingReplacements); + markAllMisspellingsAndBadGrammarInRanges(textCheckingOptions, adjacentWords.toNormalizedRange().get(), adjacentWords.toNormalizedRange().get()); } #else if (!isContinuousSpellCheckingEnabled()) @@ -2460,13 +2522,18 @@ static inline bool isAmbiguousBoundaryCharacter(UChar character) return character == '\'' || character == rightSingleQuotationMark || character == hebrewPunctuationGershayim; } -void Editor::markAllMisspellingsAndBadGrammarInRanges(bool markSpelling, Range* spellingRange, bool markGrammar, Range* grammarRange, bool performTextCheckingReplacements) +void Editor::markAllMisspellingsAndBadGrammarInRanges(TextCheckingOptions textCheckingOptions, Range* spellingRange, Range* grammarRange) { + bool shouldMarkSpelling = textCheckingOptions & MarkSpelling; + bool shouldMarkGrammar = textCheckingOptions & MarkGrammar; + bool shouldPerformReplacement = textCheckingOptions & PerformReplacement; + bool shouldShowCorrectionPanel = textCheckingOptions & ShowCorrectionPanel; + // This function is called with selections already expanded to word boundaries. ExceptionCode ec = 0; - if (!client() || !spellingRange || (markGrammar && !grammarRange)) + if (!client() || !spellingRange || (shouldMarkGrammar && !grammarRange)) return; - + // If we're not in an editable node, bail. Node* editableNode = spellingRange->startContainer(); if (!editableNode || !editableNode->isContentEditable()) @@ -2489,8 +2556,8 @@ void Editor::markAllMisspellingsAndBadGrammarInRanges(bool markSpelling, Range* bool adjustSelectionForParagraphBoundaries = false; String paragraphString; RefPtr<Range> paragraphRange; - - if (markGrammar) { + + if (shouldMarkGrammar) { // The spelling range should be contained in the paragraph-aligned extension of the grammar range. paragraphRange = paragraphAlignedRangeForRange(grammarRange, grammarRangeStartOffset, paragraphString); RefPtr<Range> offsetAsRange = Range::create(paragraphRange->startContainer(ec)->document(), paragraphRange->startPosition(), spellingRange->startPosition()); @@ -2501,10 +2568,10 @@ void Editor::markAllMisspellingsAndBadGrammarInRanges(bool markSpelling, Range* } spellingRangeEndOffset = spellingRangeStartOffset + TextIterator::rangeLength(spellingRange); paragraphLength = paragraphString.length(); - if (paragraphLength <= 0 || (spellingRangeStartOffset >= spellingRangeEndOffset && (!markGrammar || grammarRangeStartOffset >= grammarRangeEndOffset))) + if (paragraphLength <= 0 || (spellingRangeStartOffset >= spellingRangeEndOffset && (!shouldMarkGrammar || grammarRangeStartOffset >= grammarRangeEndOffset))) return; - - if (performTextCheckingReplacements) { + + if (shouldPerformReplacement) { if (m_frame->selection()->selectionType() == VisibleSelection::CaretSelection) { // Attempt to save the caret position so we can restore it later if needed RefPtr<Range> offsetAsRange = Range::create(paragraphRange->startContainer(ec)->document(), paragraphRange->startPosition(), paragraphRange->startPosition()); @@ -2520,14 +2587,16 @@ void Editor::markAllMisspellingsAndBadGrammarInRanges(bool markSpelling, Range* } } } - + Vector<TextCheckingResult> results; uint64_t checkingTypes = 0; - if (markSpelling) + if (shouldMarkSpelling) checkingTypes |= TextCheckingTypeSpelling; - if (markGrammar) + if (shouldMarkGrammar) checkingTypes |= TextCheckingTypeGrammar; - if (performTextCheckingReplacements) { + if (shouldShowCorrectionPanel) + checkingTypes |= TextCheckingTypeCorrection; + if (shouldPerformReplacement) { if (isAutomaticLinkDetectionEnabled()) checkingTypes |= TextCheckingTypeLink; if (isAutomaticQuoteSubstitutionEnabled()) @@ -2536,20 +2605,26 @@ void Editor::markAllMisspellingsAndBadGrammarInRanges(bool markSpelling, Range* checkingTypes |= TextCheckingTypeDash; if (isAutomaticTextReplacementEnabled()) checkingTypes |= TextCheckingTypeReplacement; - if (markSpelling && isAutomaticSpellingCorrectionEnabled()) + if (shouldMarkSpelling && isAutomaticSpellingCorrectionEnabled()) checkingTypes |= TextCheckingTypeCorrection; } client()->checkTextOfParagraph(paragraphString.characters(), paragraphLength, checkingTypes, results); - + +#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) + // If this checking is only for showing correction panel, we shouldn't bother to mark misspellings. + if (shouldShowCorrectionPanel) + shouldMarkSpelling = false; +#endif + for (unsigned i = 0; i < results.size(); i++) { const TextCheckingResult* result = &results[i]; int resultLocation = result->location + offsetDueToReplacement; int resultLength = result->length; - if (markSpelling && result->type == TextCheckingTypeSpelling && resultLocation >= spellingRangeStartOffset && resultLocation + resultLength <= spellingRangeEndOffset) { + if (shouldMarkSpelling && result->type == TextCheckingTypeSpelling && resultLocation >= spellingRangeStartOffset && resultLocation + resultLength <= spellingRangeEndOffset) { ASSERT(resultLength > 0 && resultLocation >= 0); RefPtr<Range> misspellingRange = TextIterator::subrange(spellingRange, resultLocation - spellingRangeStartOffset, resultLength); misspellingRange->startContainer(ec)->document()->markers()->addMarker(misspellingRange.get(), DocumentMarker::Spelling); - } else if (markGrammar && result->type == TextCheckingTypeGrammar && resultLocation < grammarRangeEndOffset && resultLocation + resultLength > grammarRangeStartOffset) { + } else if (shouldMarkGrammar && result->type == TextCheckingTypeGrammar && resultLocation < grammarRangeEndOffset && resultLocation + resultLength > grammarRangeStartOffset) { ASSERT(resultLength > 0 && resultLocation >= 0); for (unsigned j = 0; j < result->details.size(); j++) { const GrammarDetail* detail = &result->details[j]; @@ -2559,7 +2634,7 @@ void Editor::markAllMisspellingsAndBadGrammarInRanges(bool markSpelling, Range* grammarRange->startContainer(ec)->document()->markers()->addMarker(badGrammarRange.get(), DocumentMarker::Grammar, detail->userDescription); } } - } else if (performTextCheckingReplacements && resultLocation + resultLength <= spellingRangeEndOffset && resultLocation + resultLength >= spellingRangeStartOffset + } else if ((shouldPerformReplacement || shouldShowCorrectionPanel) && resultLocation + resultLength <= spellingRangeEndOffset && resultLocation + resultLength >= spellingRangeStartOffset && (result->type == TextCheckingTypeLink || result->type == TextCheckingTypeQuote || result->type == TextCheckingTypeDash @@ -2590,7 +2665,7 @@ void Editor::markAllMisspellingsAndBadGrammarInRanges(bool markSpelling, Range* size_t markerCount = markers.size(); for (size_t i = 0; i < markerCount; ++i) { const DocumentMarker& marker = markers[i]; - if (marker.type == DocumentMarker::Replacement && static_cast<int>(marker.startOffset) < endOffset && static_cast<int>(marker.endOffset) > startOffset) { + if ((marker.type == DocumentMarker::Replacement || marker.type == DocumentMarker::RejectedCorrection) && static_cast<int>(marker.startOffset) < endOffset && static_cast<int>(marker.endOffset) > startOffset) { doReplacement = false; break; } @@ -2598,7 +2673,7 @@ void Editor::markAllMisspellingsAndBadGrammarInRanges(bool markSpelling, Range* break; } } - if (doReplacement && selectionToReplace != m_frame->selection()->selection()) { + if (doReplacement && !shouldShowCorrectionPanel && selectionToReplace != m_frame->selection()->selection()) { if (m_frame->shouldChangeSelection(selectionToReplace)) { m_frame->selection()->setSelection(selectionToReplace); selectionChanged = true; @@ -2606,30 +2681,52 @@ void Editor::markAllMisspellingsAndBadGrammarInRanges(bool markSpelling, Range* doReplacement = false; } } + + String replacedString; if (doReplacement) { if (result->type == TextCheckingTypeLink) { restoreSelectionAfterChange = false; if (canEditRichly()) applyCommand(CreateLinkCommand::create(m_frame->document(), result->replacement)); } else if (canEdit() && shouldInsertText(result->replacement, rangeToReplace.get(), EditorInsertActionTyped)) { - String replacedString; if (result->type == TextCheckingTypeCorrection) replacedString = plainText(rangeToReplace.get()); - replaceSelectionWithText(result->replacement, false, false); - spellingRangeEndOffset += replacementLength - resultLength; - offsetDueToReplacement += replacementLength - resultLength; - if (resultLocation < selectionOffset) - selectionOffset += replacementLength - resultLength; - if (result->type == TextCheckingTypeCorrection) { - // Add a marker so that corrections can easily be undone and won't be re-corrected. - RefPtr<Range> replacedRange = TextIterator::subrange(paragraphRange.get(), resultLocation, replacementLength); - replacedRange->startContainer()->document()->markers()->addMarker(replacedRange.get(), DocumentMarker::Replacement, replacedString); +#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) + if (shouldShowCorrectionPanel && resultLocation + resultLength == spellingRangeEndOffset && result->type == TextCheckingTypeCorrection) { + // We only show the correction panel on the last word. + Vector<FloatQuad> textQuads; + rangeToReplace->textQuads(textQuads); + Vector<FloatQuad>::const_iterator end = textQuads.end(); + FloatRect totalBoundingBox; + for (Vector<FloatQuad>::const_iterator it = textQuads.begin(); it < end; ++it) + totalBoundingBox.unite(it->boundingBox()); + m_rangeToBeReplacedByCorrection = rangeToReplace; + m_stringToBeReplacedByCorrection = replacedString; + client()->showCorrectionPanel(totalBoundingBox, m_stringToBeReplacedByCorrection, result->replacement, this); + doReplacement = false; + } +#endif + if (doReplacement) { + replaceSelectionWithText(result->replacement, false, false); + spellingRangeEndOffset += replacementLength - resultLength; + offsetDueToReplacement += replacementLength - resultLength; + if (resultLocation < selectionOffset) + selectionOffset += replacementLength - resultLength; + if (result->type == TextCheckingTypeCorrection) { +#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) + if (client()) + client()->dismissCorrectionPanel(true); +#endif + // Add a marker so that corrections can easily be undone and won't be re-corrected. + RefPtr<Range> replacedRange = TextIterator::subrange(paragraphRange.get(), resultLocation, replacementLength); + replacedRange->startContainer()->document()->markers()->addMarker(replacedRange.get(), DocumentMarker::Replacement, replacedString); + } } } } } } - + if (selectionChanged) { // Restore the caret position if we have made any replacements setEnd(paragraphRange.get(), endOfParagraph(startOfNextParagraph(paragraphRange->startPosition()))); @@ -2671,7 +2768,10 @@ void Editor::markMisspellingsAndBadGrammar(const VisibleSelection& spellingSelec #if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) if (!isContinuousSpellCheckingEnabled()) return; - markAllMisspellingsAndBadGrammarInRanges(true, spellingSelection.toNormalizedRange().get(), markGrammar && isGrammarCheckingEnabled(), grammarSelection.toNormalizedRange().get(), false); + TextCheckingOptions textCheckingOptions = MarkSpelling; + if (markGrammar && isGrammarCheckingEnabled()) + textCheckingOptions |= MarkGrammar; + markAllMisspellingsAndBadGrammarInRanges(textCheckingOptions, spellingSelection.toNormalizedRange().get(), grammarSelection.toNormalizedRange().get()); #else RefPtr<Range> firstMisspellingRange; markMisspellings(spellingSelection, firstMisspellingRange); @@ -2680,6 +2780,45 @@ void Editor::markMisspellingsAndBadGrammar(const VisibleSelection& spellingSelec #endif } +void Editor::correctionPanelTimerFired(Timer<Editor>*) +{ +#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + VisibleSelection selection(frame()->selection()->selection()); + VisiblePosition start(selection.start(), selection.affinity()); + VisiblePosition p = startOfWord(start, LeftWordIfOnBoundary); + VisibleSelection adjacentWords = VisibleSelection(p, start); + markAllMisspellingsAndBadGrammarInRanges(MarkSpelling | ShowCorrectionPanel, adjacentWords.toNormalizedRange().get(), 0); +#endif +} + +void Editor::handleRejectedCorrection() +{ + Range* replacedRange = m_rangeToBeReplacedByCorrection.get(); + if (!replacedRange || m_frame->document() != replacedRange->ownerDocument()) + return; + + replacedRange->startContainer()->document()->markers()->addMarker(replacedRange, DocumentMarker::RejectedCorrection, m_stringToBeReplacedByCorrection); +} + +void Editor::startCorrectionPanelTimer() +{ +#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) + static const double correctionPanelTimerInterval = 0.3; + if (client()) + client()->dismissCorrectionPanel(true); + if (isAutomaticSpellingCorrectionEnabled()) + m_correctionPanelTimer.startOneShot(correctionPanelTimerInterval); +#endif +} + +void Editor::handleCancelOperation() +{ +#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) + if (client()) + client()->dismissCorrectionPanel(false); +#endif +} + PassRefPtr<Range> Editor::rangeForPoint(const IntPoint& windowPoint) { Document* document = m_frame->documentAtPoint(windowPoint); diff --git a/WebCore/editing/Editor.h b/WebCore/editing/Editor.h index 83aef7e..78e89b4 100644 --- a/WebCore/editing/Editor.h +++ b/WebCore/editing/Editor.h @@ -119,6 +119,7 @@ public: void respondToChangedContents(const VisibleSelection& endingSelection); TriState selectionHasStyle(CSSStyleDeclaration*) const; + String selectionStartCSSPropertyValue(int propertyID); const SimpleFontData* fontForSelection(bool&) const; WritingDirection textDirectionForSelection(bool&) const; @@ -223,7 +224,15 @@ public: void toggleAutomaticTextReplacement(); bool isAutomaticSpellingCorrectionEnabled(); void toggleAutomaticSpellingCorrection(); - void markAllMisspellingsAndBadGrammarInRanges(bool markSpelling, Range* spellingRange, bool markGrammar, Range* grammarRange, bool performTextCheckingReplacements); + enum TextCheckingOptionFlags { + MarkSpelling = 1 << 0, + MarkGrammar = 1 << 1, + PerformReplacement = 1 << 2, + ShowCorrectionPanel = 1 << 3, + }; + typedef unsigned TextCheckingOptions; + + void markAllMisspellingsAndBadGrammarInRanges(TextCheckingOptions, Range* spellingRange, Range* grammarRange); void changeBackToReplacedString(const String& replacedString); #endif void advanceToNextMisspelling(bool startBeforeSelection = false); @@ -293,9 +302,13 @@ public: bool insideVisibleArea(const IntPoint&) const; bool insideVisibleArea(Range*) const; PassRefPtr<Range> nextVisibleRange(Range*, const String&, bool forward, bool caseFlag, bool wrapFlag); - + void addToKillRing(Range*, bool prepend); + void handleCancelOperation(); + void startCorrectionPanelTimer(); + void handleRejectedCorrection(); + void pasteAsFragment(PassRefPtr<DocumentFragment>, bool smartReplace, bool matchStyle); void pasteAsPlainText(const String&, bool smartReplace); @@ -317,6 +330,9 @@ private: bool m_shouldStartNewKillRingSequence; bool m_shouldStyleWithCSS; OwnPtr<KillRing> m_killRing; + RefPtr<Range> m_rangeToBeReplacedByCorrection; + String m_stringToBeReplacedByCorrection; + Timer<Editor> m_correctionPanelTimer; bool canDeleteRange(Range*) const; bool canSmartReplaceWithPasteboard(Pasteboard*); @@ -334,8 +350,9 @@ private: PassRefPtr<Range> firstVisibleRange(const String&, bool caseFlag); PassRefPtr<Range> lastVisibleRange(const String&, bool caseFlag); - + void changeSelectionAfterCommand(const VisibleSelection& newSelection, bool closeTyping, bool clearTypingStyle); + void correctionPanelTimerFired(Timer<Editor>*); Node* findEventTargetFromSelection() const; }; diff --git a/WebCore/editing/EditorCommand.cpp b/WebCore/editing/EditorCommand.cpp index eb89593..4b8da0e 100644 --- a/WebCore/editing/EditorCommand.cpp +++ b/WebCore/editing/EditorCommand.cpp @@ -239,7 +239,9 @@ static TriState stateStyle(Frame* frame, int propertyID, const char* desiredValu static String valueStyle(Frame* frame, int propertyID) { - return frame->selectionStartStylePropertyValue(propertyID); + // FIXME: Rather than retrieving the style at the start of the current selection, + // we should retrieve the style present throughout the selection for non-Mac platforms. + return frame->editor()->selectionStartCSSPropertyValue(propertyID); } static TriState stateTextWritingDirection(Frame* frame, WritingDirection direction) @@ -1067,6 +1069,14 @@ static bool executeYankAndSelect(Frame* frame, Event*, EditorCommandSource, cons return true; } +#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) +static bool executeCancelOperation(Frame* frame, Event*, EditorCommandSource, const String&) +{ + frame->editor()->handleCancelOperation(); + return true; +} +#endif + // Supported functions static bool supported(Frame*, EditorCommandSource) @@ -1453,6 +1463,9 @@ static const CommandMap& createCommandMap() { "Unselect", { executeUnselect, supported, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, { "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 } }, +#endif }; // These unsupported commands are listed here since they appear in the Microsoft diff --git a/WebCore/editing/ReplaceSelectionCommand.cpp b/WebCore/editing/ReplaceSelectionCommand.cpp index d497f30..38f3ed2 100644 --- a/WebCore/editing/ReplaceSelectionCommand.cpp +++ b/WebCore/editing/ReplaceSelectionCommand.cpp @@ -992,6 +992,12 @@ void ReplaceSelectionCommand::doApply() if (shouldMergeStart(selectionStartWasStartOfParagraph, fragment.hasInterchangeNewlineAtStart(), startIsInsideMailBlockquote)) { VisiblePosition destination = startOfInsertedContent.previous(); VisiblePosition startOfParagraphToMove = startOfInsertedContent; + // We need to handle the case where we need to merge the end + // but our destination node is inside an inline that is the last in the block. + // We insert a placeholder before the newly inserted content to avoid being merged into the inline. + Node* destinationNode = destination.deepEquivalent().node(); + if (m_shouldMergeEnd && destinationNode != destinationNode->enclosingInlineElement() && destinationNode->enclosingInlineElement()->nextSibling()) + insertNodeBefore(createBreakElement(document()), refNode.get()); // Merging the the first paragraph of inserted content with the content that came // before the selection that was pasted into would also move content after @@ -1115,7 +1121,7 @@ bool ReplaceSelectionCommand::shouldRemoveEndBR(Node* endBR, const VisiblePositi return false; // Remove the br if it is collapsed away and so is unnecessary. - if (!document()->inStrictMode() && isEndOfBlock(visiblePos) && !isStartOfParagraph(visiblePos)) + if (!document()->inNoQuirksMode() && isEndOfBlock(visiblePos) && !isStartOfParagraph(visiblePos)) return true; // A br that was originally holding a line open should be displaced by inserted content or turned into a line break. diff --git a/WebCore/editing/SelectionController.cpp b/WebCore/editing/SelectionController.cpp index 3672e3e..97dde55 100644 --- a/WebCore/editing/SelectionController.cpp +++ b/WebCore/editing/SelectionController.cpp @@ -118,6 +118,7 @@ void SelectionController::setSelection(const VisibleSelection& s, bool closeTypi m_selection = s; m_caretRectNeedsUpdate = true; invalidateCaretRect(); + updateCaretRect(); return; } if (!m_frame) { diff --git a/WebCore/editing/TextIterator.cpp b/WebCore/editing/TextIterator.cpp index 57f9a3c..daba80e 100644 --- a/WebCore/editing/TextIterator.cpp +++ b/WebCore/editing/TextIterator.cpp @@ -522,7 +522,7 @@ void TextIterator::handleTextBox() } String str = renderer->text(); unsigned start = m_offset; - unsigned end = (m_node == m_endContainer) ? m_endOffset : UINT_MAX; + unsigned end = (m_node == m_endContainer) ? static_cast<unsigned>(m_endOffset) : UINT_MAX; while (m_textBox) { unsigned textBoxStart = m_textBox->start(); unsigned runStart = max(textBoxStart, start); diff --git a/WebCore/editing/TypingCommand.cpp b/WebCore/editing/TypingCommand.cpp index ac865e5..81a6d5c 100644 --- a/WebCore/editing/TypingCommand.cpp +++ b/WebCore/editing/TypingCommand.cpp @@ -307,6 +307,10 @@ void TypingCommand::markMisspellingsAfterTyping() VisiblePosition p2 = startOfWord(start, LeftWordIfOnBoundary); if (p1 != p2) document()->frame()->editor()->markMisspellingsAfterTypingToPosition(p1); +#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) + else + document()->frame()->editor()->startCorrectionPanelTimer(); +#endif } } diff --git a/WebCore/editing/markup.cpp b/WebCore/editing/markup.cpp index 1baf1bc..7bf85a4 100644 --- a/WebCore/editing/markup.cpp +++ b/WebCore/editing/markup.cpp @@ -91,6 +91,57 @@ private: QualifiedName m_name; String m_value; }; + +enum EntityMask { + EntityNone = 0x0000, + EntityAmp = 0x0001, + EntityLt = 0x0002, + EntityGt = 0x0004, + EntityQuot = 0x0008, + EntityNbsp = 0x0010, + + EntityMaskInCDATA = EntityNone, + EntityMaskInPCDATA = EntityAmp | EntityLt | EntityGt, + EntityMaskInHTMLPCDATA = EntityMaskInPCDATA | EntityNbsp, + EntityMaskInAttributeValue = EntityAmp | EntityLt | EntityGt | EntityQuot, + EntityMaskInHTMLAttributeValue = EntityMaskInAttributeValue | EntityNbsp, +}; + +struct EntityDescription { + UChar entity; + const String& reference; + EntityMask mask; +}; + +static void appendCharactersReplacingEntities(Vector<UChar>& out, const UChar* content, size_t length, EntityMask entityMask) +{ + DEFINE_STATIC_LOCAL(const String, ampReference, ("&")); + DEFINE_STATIC_LOCAL(const String, ltReference, ("<")); + DEFINE_STATIC_LOCAL(const String, gtReference, (">")); + DEFINE_STATIC_LOCAL(const String, quotReference, (""")); + DEFINE_STATIC_LOCAL(const String, nbspReference, (" ")); + + static const EntityDescription entityMaps[] = { + { '&', ampReference, EntityAmp }, + { '<', ltReference, EntityLt }, + { '>', gtReference, EntityGt }, + { '"', quotReference, EntityQuot }, + { noBreakSpace, nbspReference, EntityNbsp }, + }; + + size_t positionAfterLastEntity = 0; + for (size_t i = 0; i < length; i++) { + for (size_t m = 0; m < sizeof(entityMaps) / sizeof(EntityDescription); m++) { + if (content[i] == entityMaps[m].entity && entityMaps[m].mask & entityMask) { + out.append(content + positionAfterLastEntity, i - positionAfterLastEntity); + append(out, entityMaps[m].reference); + positionAfterLastEntity = i + 1; + break; + } + } + } + out.append(content + positionAfterLastEntity, length - positionAfterLastEntity); +} typedef HashMap<AtomicStringImpl*, AtomicStringImpl*> Namespaces; @@ -113,12 +164,10 @@ public: String takeResults(); private: - void appendAttributeValue(Vector<UChar>& result, const String& attribute, bool escapeNBSP); - String escapeContentText(const String&, bool escapeNBSP); + void appendAttributeValue(Vector<UChar>& result, const String& attribute, bool documentIsHTML); void appendQuotedURLAttributeValue(Vector<UChar>& result, const String& urlString); String stringValueForRange(const Node*, const Range*); - pair<const UChar*, size_t> ucharRange(const Node*, const Range *); - void appendUCharRange(Vector<UChar>& result, const pair<const UChar*, size_t>& range); + void appendNodeValue(Vector<UChar>& out, const Node*, const Range*, EntityMask); String renderedText(const Node*, const Range*); bool shouldAddNamespaceElement(const Element*); bool shouldAddNamespaceAttribute(const Attribute*, Namespaces&); @@ -221,100 +270,10 @@ String MarkupAccumulator::takeResults() return String::adopt(result); } -void MarkupAccumulator::appendAttributeValue(Vector<UChar>& result, const String& attribute, bool escapeNBSP) +void MarkupAccumulator::appendAttributeValue(Vector<UChar>& result, const String& attribute, bool documentIsHTML) { - const UChar* uchars = attribute.characters(); - unsigned len = attribute.length(); - unsigned lastCopiedFrom = 0; - - DEFINE_STATIC_LOCAL(const String, ampEntity, ("&")); - DEFINE_STATIC_LOCAL(const String, gtEntity, (">")); - DEFINE_STATIC_LOCAL(const String, ltEntity, ("<")); - DEFINE_STATIC_LOCAL(const String, quotEntity, (""")); - DEFINE_STATIC_LOCAL(const String, nbspEntity, (" ")); - - for (unsigned i = 0; i < len; ++i) { - UChar c = uchars[i]; - switch (c) { - case '&': - result.append(uchars + lastCopiedFrom, i - lastCopiedFrom); - append(result, ampEntity); - lastCopiedFrom = i + 1; - break; - case '<': - result.append(uchars + lastCopiedFrom, i - lastCopiedFrom); - append(result, ltEntity); - lastCopiedFrom = i + 1; - break; - case '>': - result.append(uchars + lastCopiedFrom, i - lastCopiedFrom); - append(result, gtEntity); - lastCopiedFrom = i + 1; - break; - case '"': - result.append(uchars + lastCopiedFrom, i - lastCopiedFrom); - append(result, quotEntity); - lastCopiedFrom = i + 1; - break; - case noBreakSpace: - if (!escapeNBSP) - break; - result.append(uchars + lastCopiedFrom, i - lastCopiedFrom); - append(result, nbspEntity); - lastCopiedFrom = i + 1; - } - } - - result.append(uchars + lastCopiedFrom, len - lastCopiedFrom); -} - -static void appendEscapedContent(Vector<UChar>& result, pair<const UChar*, size_t> range, bool escapeNBSP) -{ - const UChar* uchars = range.first; - unsigned len = range.second; - unsigned lastCopiedFrom = 0; - - DEFINE_STATIC_LOCAL(const String, ampEntity, ("&")); - DEFINE_STATIC_LOCAL(const String, gtEntity, (">")); - DEFINE_STATIC_LOCAL(const String, ltEntity, ("<")); - DEFINE_STATIC_LOCAL(const String, nbspEntity, (" ")); - - for (unsigned i = 0; i < len; ++i) { - UChar c = uchars[i]; - switch (c) { - case '&': - result.append(uchars + lastCopiedFrom, i - lastCopiedFrom); - append(result, ampEntity); - lastCopiedFrom = i + 1; - break; - case '<': - result.append(uchars + lastCopiedFrom, i - lastCopiedFrom); - append(result, ltEntity); - lastCopiedFrom = i + 1; - break; - case '>': - result.append(uchars + lastCopiedFrom, i - lastCopiedFrom); - append(result, gtEntity); - lastCopiedFrom = i + 1; - break; - case noBreakSpace: - if (!escapeNBSP) - break; - result.append(uchars + lastCopiedFrom, i - lastCopiedFrom); - append(result, nbspEntity); - lastCopiedFrom = i + 1; - break; - } - } - - result.append(uchars + lastCopiedFrom, len - lastCopiedFrom); -} - -String MarkupAccumulator::escapeContentText(const String& in, bool escapeNBSP) -{ - Vector<UChar> buffer; - appendEscapedContent(buffer, make_pair(in.characters(), in.length()), escapeNBSP); - return String::adopt(buffer); + appendCharactersReplacingEntities(result, attribute.characters(), attribute.length(), + documentIsHTML ? EntityMaskInHTMLAttributeValue : EntityMaskInAttributeValue); } void MarkupAccumulator::appendQuotedURLAttributeValue(Vector<UChar>& result, const String& urlString) @@ -355,7 +314,7 @@ String MarkupAccumulator::stringValueForRange(const Node* node, const Range* ran return str; } -pair<const UChar*, size_t> MarkupAccumulator::ucharRange(const Node* node, const Range* range) +void MarkupAccumulator::appendNodeValue(Vector<UChar>& out, const Node* node, const Range* range, EntityMask entityMask) { String str = node->nodeValue(); const UChar* characters = str.characters(); @@ -372,12 +331,7 @@ pair<const UChar*, size_t> MarkupAccumulator::ucharRange(const Node* node, const } } - return make_pair(characters, length); -} - -void MarkupAccumulator::appendUCharRange(Vector<UChar>& result, const pair<const UChar*, size_t>& range) -{ - result.append(range.first, range.second); + appendCharactersReplacingEntities(out, characters, length, entityMask); } String MarkupAccumulator::renderedText(const Node* node, const Range* range) @@ -492,19 +446,20 @@ void MarkupAccumulator::appendText(Vector<UChar>& out, Text* text) parentName = &static_cast<Element*>(text->parentElement())->tagQName(); if (parentName && (*parentName == scriptTag || *parentName == styleTag || *parentName == xmpTag)) { - appendUCharRange(out, ucharRange(text, m_range)); + appendNodeValue(out, text, m_range, EntityMaskInCDATA); return; } if (!shouldAnnotate() || (parentName && *parentName == textareaTag)) { - appendEscapedContent(out, ucharRange(text, m_range), text->document()->isHTMLDocument()); + appendNodeValue(out, text, m_range, text->document()->isHTMLDocument() ? EntityMaskInHTMLPCDATA : EntityMaskInPCDATA); return; } bool useRenderedText = !enclosingNodeWithTag(Position(text, 0), selectTag); - String markup = escapeContentText(useRenderedText ? renderedText(text, m_range) : stringValueForRange(text, m_range), false); - markup = convertHTMLTextToInterchangeFormat(markup, text); - append(out, markup); + 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) @@ -1355,7 +1310,7 @@ String urlToMarkup(const KURL& url, const String& title) append(markup, "<a href=\""); append(markup, url.string()); append(markup, "\">"); - appendEscapedContent(markup, make_pair(title.characters(), title.length()), false); + appendCharactersReplacingEntities(markup, title.characters(), title.length(), EntityMaskInPCDATA); append(markup, "</a>"); return String::adopt(markup); } diff --git a/WebCore/fileapi/AsyncFileWriter.h b/WebCore/fileapi/AsyncFileWriter.h new file mode 100644 index 0000000..cdb815c --- /dev/null +++ b/WebCore/fileapi/AsyncFileWriter.h @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef AsyncFileWriter_h +#define AsyncFileWriter_h + +#if ENABLE(FILE_WRITER) + +#include "PlatformString.h" +#include <wtf/RefCounted.h> + +namespace WebCore { + +class Blob; +class FileWriterClient; + +class AsyncFileWriter { +public: + virtual ~AsyncFileWriter() {} + + virtual void setFileWriterClient(FileWriterClient* client) = 0; + + virtual void write(long long position, Blob* data) = 0; + virtual void truncate(long long length) = 0; + virtual void abort() = 0; +}; + +} // namespace + +#endif // ENABLE(FILE_WRITER) + +#endif // AsyncFileWriter_h + diff --git a/WebCore/html/Blob.cpp b/WebCore/fileapi/Blob.cpp index 3a62ab1..5fed327 100644 --- a/WebCore/html/Blob.cpp +++ b/WebCore/fileapi/Blob.cpp @@ -31,51 +31,19 @@ #include "config.h" #include "Blob.h" -#include "BlobData.h" -#include "BlobItem.h" #include "BlobURL.h" -#include "FileSystem.h" +#include "File.h" #include "ScriptExecutionContext.h" #include "ThreadableBlobRegistry.h" namespace WebCore { -// FIXME: To be removed when we switch to using BlobData. -Blob::Blob(ScriptExecutionContext* scriptExecutionContext, const String& type, const BlobItemList& items) - : m_scriptExecutionContext(scriptExecutionContext) - , m_type(type) - , m_size(0) -{ - m_scriptExecutionContext->addBlob(this); - for (size_t i = 0; i < items.size(); ++i) - m_items.append(items[i]); -} - -// FIXME: To be removed when we switch to using BlobData. -Blob::Blob(ScriptExecutionContext* scriptExecutionContext, const PassRefPtr<BlobItem>& item) - : m_scriptExecutionContext(scriptExecutionContext) - , m_size(0) -{ - m_scriptExecutionContext->addBlob(this); - m_items.append(item); -} - -// FIXME: To be removed when we switch to using BlobData. -Blob::Blob(ScriptExecutionContext* scriptExecutionContext, const String& path) - : m_scriptExecutionContext(scriptExecutionContext) - , m_size(0) -{ - m_scriptExecutionContext->addBlob(this); - // Note: this doesn't initialize the type unlike File(path). - m_items.append(FileBlobItem::create(path)); -} - Blob::Blob(ScriptExecutionContext* scriptExecutionContext, PassOwnPtr<BlobData> blobData, long long size) : m_scriptExecutionContext(scriptExecutionContext) , m_type(blobData->contentType()) , m_size(size) { - ASSERT(blobData.get() && !blobData->items().isEmpty()); + ASSERT(blobData); m_scriptExecutionContext->addBlob(this); @@ -89,11 +57,7 @@ Blob::Blob(ScriptExecutionContext* scriptExecutionContext, const KURL& srcURL, c , m_type(type) , m_size(size) { - m_scriptExecutionContext->addBlob(this); - - // FIXME: To be removed when we switch to using BlobData. - if (srcURL.isEmpty()) - return; + 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); @@ -118,50 +82,42 @@ void Blob::contextDestroyed() m_scriptExecutionContext = 0; } -unsigned long long Blob::size() const -{ - // FIXME: JavaScript cannot represent sizes as large as unsigned long long, we need to - // come up with an exception to throw if file size is not represetable. - unsigned long long size = 0; - for (size_t i = 0; i < m_items.size(); ++i) - size += m_items[i]->size(); - return size; -} - -// FIXME: To be removed when we switch to using BlobData. -const String& Blob::path() const -{ - ASSERT(m_items.size() == 1 && m_items[0]->toFileBlobItem()); - return m_items[0]->toFileBlobItem()->path(); -} - #if ENABLE(BLOB) PassRefPtr<Blob> Blob::slice(ScriptExecutionContext* scriptExecutionContext, 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. + long long size; + double modificationTime; + if (isFile()) + // FIXME: This involves synchronous file operation. We need to figure out how to make it asynchronous. + static_cast<const File*>(this)->captureSnapshot(size, modificationTime); + else { + ASSERT(m_size != -1); + size = m_size; + } + + // Clamp the range if it exceeds the size limit. if (start < 0) start = 0; if (length < 0) length = 0; - // Clamp the range if it exceeds the size limit. - unsigned long long totalSize = size(); - if (static_cast<unsigned long long>(start) > totalSize) { + if (start >= size) { start = 0; length = 0; - } else if (static_cast<unsigned long long>(start + length) > totalSize) - length = totalSize - start; - - size_t i = 0; - BlobItemList items; - for (; i < m_items.size() && static_cast<unsigned long long>(start) >= m_items[i]->size(); ++i) - start -= m_items[i]->size(); - for (; length > 0 && i < m_items.size(); ++i) { - items.append(m_items[i]->slice(start, length)); - length -= items.last()->size(); - start = 0; - } - return Blob::create(scriptExecutionContext, contentType, items); + } else if (start + length > size) + length = size - start; + + OwnPtr<BlobData> blobData = BlobData::create(); + blobData->setContentType(contentType); + if (isFile()) + blobData->appendFile(static_cast<const File*>(this)->path(), start, length, modificationTime); + else + blobData->appendBlob(m_url, start, length); + + return Blob::create(scriptExecutionContext, blobData.release(), length); } -#endif // ENABLE(BLOB) +#endif } // namespace WebCore diff --git a/WebCore/html/Blob.h b/WebCore/fileapi/Blob.h index 374a401..0d5649c 100644 --- a/WebCore/html/Blob.h +++ b/WebCore/fileapi/Blob.h @@ -31,7 +31,7 @@ #ifndef Blob_h #define Blob_h -#include "BlobItem.h" +#include "BlobData.h" #include "KURL.h" #include "PlatformString.h" #include <wtf/PassOwnPtr.h> @@ -41,15 +41,13 @@ namespace WebCore { -class BlobData; class ScriptExecutionContext; class Blob : public RefCounted<Blob> { public: - // FIXME: To be removed when we switch to using BlobData. - static PassRefPtr<Blob> create(ScriptExecutionContext* scriptExecutionContext, const String& type, const BlobItemList& items) + static PassRefPtr<Blob> create(ScriptExecutionContext* scriptExecutionContext, PassOwnPtr<BlobData> blobData, long long size) { - return adoptRef(new Blob(scriptExecutionContext, type, items)); + return adoptRef(new Blob(scriptExecutionContext, blobData, size)); } // For deserialization. @@ -63,38 +61,25 @@ public: void contextDestroyed(); const KURL& url() const { return m_url; } - unsigned long long size() const; const String& type() const { return m_type; } - virtual bool isFile() const { return false; } - - // FIXME: To be removed when we switch to using BlobData. - const String& path() const; - // FIXME: To be removed when we switch to using BlobData. - const BlobItemList& items() const { return m_items; } + 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; #endif protected: - // FIXME: To be removed when we switch to using BlobData. - Blob(ScriptExecutionContext*, const String& type, const BlobItemList&); - Blob(ScriptExecutionContext*, const PassRefPtr<BlobItem>&); - Blob(ScriptExecutionContext*, const String& path); - Blob(ScriptExecutionContext*, PassOwnPtr<BlobData>, long long size); // For deserialization. Blob(ScriptExecutionContext*, const KURL& srcURL, const String& type, long long size); - // FIXME: To be removed when we switch to using BlobData. - BlobItemList m_items; - // 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; - + ScriptExecutionContext* m_scriptExecutionContext; String m_type; long long m_size; diff --git a/WebCore/html/Blob.idl b/WebCore/fileapi/Blob.idl index e063b6d..b220233 100644 --- a/WebCore/html/Blob.idl +++ b/WebCore/fileapi/Blob.idl @@ -30,7 +30,9 @@ module html { - interface Blob { + interface [ + NoStaticTables + ] Blob { readonly attribute unsigned long long size; readonly attribute DOMString type; diff --git a/WebCore/html/BlobBuilder.cpp b/WebCore/fileapi/BlobBuilder.cpp index 29a7595..e10df6b 100644 --- a/WebCore/html/BlobBuilder.cpp +++ b/WebCore/fileapi/BlobBuilder.cpp @@ -34,6 +34,7 @@ #include "Blob.h" #include "ExceptionCode.h" +#include "File.h" #include "LineEnding.h" #include "TextEncoding.h" #include <wtf/text/AtomicString.h> @@ -56,13 +57,38 @@ static CString convertToCString(const String& text, const String& endingType, Ex return CString(); } +static CString concatenateTwoCStrings(const CString& a, const CString& b) +{ + if (a.isNull() && b.isNull()) + return CString(); + + char* q; + CString result = CString::newUninitialized(a.length() + b.length(), q); + if (a.length()) + memcpy(q, a.data(), a.length()); + if (b.length()) + memcpy(q + a.length(), b.data(), b.length()); + return result; +} + +BlobBuilder::BlobBuilder() + : m_size(0) +{ +} + bool BlobBuilder::append(const String& text, const String& endingType, ExceptionCode& ec) { CString cstr = convertToCString(text, endingType, ec); if (ec) return false; - m_items.append(StringBlobItem::create(cstr)); + m_size += cstr.length(); + + // If the last item is a string, concatenate it with current string. + if (!m_items.isEmpty() && m_items[m_items.size() - 1].type == BlobDataItem::Data) + m_items[m_items.size() - 1].data = concatenateTwoCStrings(m_items[m_items.size() - 1].data, cstr); + else + m_items.append(BlobDataItem(cstr)); return true; } @@ -73,17 +99,37 @@ bool BlobBuilder::append(const String& text, ExceptionCode& ec) bool BlobBuilder::append(PassRefPtr<Blob> blob) { - if (blob) { - for (size_t i = 0; i < blob->items().size(); ++i) - m_items.append(blob->items()[i]); - return true; + if (blob->isFile()) { + // If the blob is file that is not snapshoted, capture the snapshot now. + // FIXME: This involves synchronous file operation. We need to figure out how to make it asynchronous. + File* file = static_cast<File*>(blob.get()); + long long snapshotSize; + double snapshotModificationTime; + file->captureSnapshot(snapshotSize, snapshotModificationTime); + + m_size += snapshotSize; + m_items.append(BlobDataItem(file->path(), 0, snapshotSize, snapshotModificationTime)); + } else { + long long blobSize = static_cast<long long>(blob->size()); + m_size += blobSize; + m_items.append(BlobDataItem(blob->url(), 0, blobSize)); } - return false; + return true; } -PassRefPtr<Blob> BlobBuilder::getBlob(ScriptExecutionContext* scriptExecutionContext, const String& contentType) const +PassRefPtr<Blob> BlobBuilder::getBlob(ScriptExecutionContext* scriptExecutionContext, const String& contentType) { - return Blob::create(scriptExecutionContext, contentType, m_items); + OwnPtr<BlobData> blobData = BlobData::create(); + blobData->setContentType(contentType); + blobData->swapItems(m_items); + + RefPtr<Blob> blob = Blob::create(scriptExecutionContext, 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. + m_items.append(BlobDataItem(blob->url(), 0, m_size)); + + return blob; } } // namespace WebCore diff --git a/WebCore/html/BlobBuilder.h b/WebCore/fileapi/BlobBuilder.h index 5d1700f..20e510a 100644 --- a/WebCore/html/BlobBuilder.h +++ b/WebCore/fileapi/BlobBuilder.h @@ -31,14 +31,18 @@ #ifndef BlobBuilder_h #define BlobBuilder_h -#include "BlobItem.h" +#include "BlobData.h" +#include "PlatformString.h" #include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> +#include <wtf/Vector.h> +#include <wtf/text/CString.h> namespace WebCore { class Blob; class ScriptExecutionContext; +class TextEncoding; typedef int ExceptionCode; @@ -50,10 +54,13 @@ public: bool append(const String& text, ExceptionCode&); bool append(const String& text, const String& ending, ExceptionCode&); - PassRefPtr<Blob> getBlob(ScriptExecutionContext*, const String& contentType = String()) const; + PassRefPtr<Blob> getBlob(ScriptExecutionContext*, const String& contentType = String()); private: - BlobItemList m_items; + BlobBuilder(); + + long long m_size; + BlobDataItemList m_items; }; } // namespace WebCore diff --git a/WebCore/html/BlobBuilder.idl b/WebCore/fileapi/BlobBuilder.idl index 53c7add..53c7add 100644 --- a/WebCore/html/BlobBuilder.idl +++ b/WebCore/fileapi/BlobBuilder.idl diff --git a/WebCore/html/BlobURL.cpp b/WebCore/fileapi/BlobURL.cpp index 610aac4..c5571a7 100644 --- a/WebCore/html/BlobURL.cpp +++ b/WebCore/fileapi/BlobURL.cpp @@ -63,4 +63,12 @@ KURL BlobURL::getOrigin(const KURL& url) return KURL(ParsedURLString, decodeURLEscapeSequences(origin)); } +String BlobURL::getIdentifier(const KURL& url) +{ + ASSERT(url.protocolIs("blob")); + + unsigned startIndex = url.pathAfterLastSlash(); + return url.string().substring(startIndex); +} + } // namespace WebCore diff --git a/WebCore/html/BlobURL.h b/WebCore/fileapi/BlobURL.h index 2ce2c85..e73b771 100644 --- a/WebCore/html/BlobURL.h +++ b/WebCore/fileapi/BlobURL.h @@ -41,6 +41,7 @@ class BlobURL { public: static KURL createURL(ScriptExecutionContext*); static KURL getOrigin(const KURL&); + static String getIdentifier(const KURL& url); }; } diff --git a/WebCore/storage/DOMFilePath.cpp b/WebCore/fileapi/DOMFilePath.cpp index 2da057c..2da057c 100644 --- a/WebCore/storage/DOMFilePath.cpp +++ b/WebCore/fileapi/DOMFilePath.cpp diff --git a/WebCore/storage/DOMFilePath.h b/WebCore/fileapi/DOMFilePath.h index 2f2bb23..2f2bb23 100644 --- a/WebCore/storage/DOMFilePath.h +++ b/WebCore/fileapi/DOMFilePath.h diff --git a/WebCore/fileapi/DOMFileSystem.cpp b/WebCore/fileapi/DOMFileSystem.cpp new file mode 100644 index 0000000..f1b9342 --- /dev/null +++ b/WebCore/fileapi/DOMFileSystem.cpp @@ -0,0 +1,210 @@ +/* + * 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 "DOMFileSystem.h" + +#if ENABLE(FILE_SYSTEM) + +#include "AsyncFileSystem.h" +#include "DOMFilePath.h" +#include "DirectoryEntry.h" +#include "EntriesCallback.h" +#include "Entry.h" +#include "EntryCallback.h" +#include "ErrorCallback.h" +#include "FileError.h" +#include "FileSystemCallbacks.h" +#include "MetadataCallback.h" +#include "ScriptExecutionContext.h" +#include "VoidCallback.h" +#include <wtf/OwnPtr.h> + +namespace WebCore { + +DOMFileSystem::DOMFileSystem(ScriptExecutionContext* context, const String& name, PassOwnPtr<AsyncFileSystem> asyncFileSystem) + : ActiveDOMObject(context, this) + , m_name(name) + , m_asyncFileSystem(asyncFileSystem) +{ +} + +DOMFileSystem::~DOMFileSystem() +{ +} + +PassRefPtr<DirectoryEntry> DOMFileSystem::root() +{ + return DirectoryEntry::create(this, DOMFilePath::root); +} + +void DOMFileSystem::stop() +{ + m_asyncFileSystem->stop(); +} + +bool DOMFileSystem::hasPendingActivity() const +{ + return m_asyncFileSystem->hasPendingActivity(); +} + +void DOMFileSystem::contextDestroyed() +{ + m_asyncFileSystem->stop(); +} + +void DOMFileSystem::getMetadata(const Entry* entry, PassRefPtr<MetadataCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback) +{ + String platformPath = m_asyncFileSystem->virtualToPlatformPath(entry->fullPath()); + m_asyncFileSystem->readMetadata(platformPath, new MetadataCallbacks(successCallback, errorCallback)); +} + +static bool checkValidityForForCopyOrMove(const Entry* src, Entry* parent, const String& newName) +{ + ASSERT(src); + + if (!parent || !parent->isDirectory()) + return false; + + if (!newName.isEmpty() && !DOMFilePath::isValidName(newName)) + return false; + + // It is an error to try to copy or move an entry inside itself at any depth if it is a directory. + if (src->isDirectory() && DOMFilePath::isParentOf(src->fullPath(), parent->fullPath())) + return false; + + // It is an error to copy or move an entry into its parent if a name different from its current one isn't provided. + if ((newName.isEmpty() || src->name() == newName) && DOMFilePath::getDirectory(src->fullPath()) == parent->fullPath()) + return false; + + return true; +} + +void DOMFileSystem::move(const Entry* src, PassRefPtr<Entry> parent, const String& newName, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback) +{ + if (!checkValidityForForCopyOrMove(src, parent.get(), newName)) { + scheduleCallback(scriptExecutionContext(), errorCallback, FileError::create(INVALID_MODIFICATION_ERR)); + return; + } + + String destPath = parent->fullPath(); + if (!newName.isEmpty()) + destPath = DOMFilePath::append(destPath, newName); + else + destPath = DOMFilePath::append(destPath, src->name()); + + String srcPlatformPath = m_asyncFileSystem->virtualToPlatformPath(src->fullPath()); + String destPlatformPath = parent->filesystem()->asyncFileSystem()->virtualToPlatformPath(destPath); + m_asyncFileSystem->move(srcPlatformPath, destPlatformPath, new EntryCallbacks(successCallback, errorCallback, this, destPath, src->isDirectory())); +} + +void DOMFileSystem::copy(const Entry* src, PassRefPtr<Entry> parent, const String& newName, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback) +{ + if (!checkValidityForForCopyOrMove(src, parent.get(), newName)) { + scheduleCallback(scriptExecutionContext(), errorCallback, FileError::create(INVALID_MODIFICATION_ERR)); + return; + } + + String destPath = parent->fullPath(); + if (!newName.isEmpty()) + destPath = DOMFilePath::append(destPath, newName); + else + destPath = DOMFilePath::append(destPath, src->name()); + + String srcPlatformPath = m_asyncFileSystem->virtualToPlatformPath(src->fullPath()); + String destPlatformPath = parent->filesystem()->asyncFileSystem()->virtualToPlatformPath(destPath); + m_asyncFileSystem->copy(srcPlatformPath, destPlatformPath, new EntryCallbacks(successCallback, errorCallback, this, destPath, src->isDirectory())); +} + +void DOMFileSystem::remove(const Entry* entry, PassRefPtr<VoidCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback) +{ + ASSERT(entry); + String platformPath = m_asyncFileSystem->virtualToPlatformPath(entry->fullPath()); + m_asyncFileSystem->remove(platformPath, new VoidCallbacks(successCallback, errorCallback)); +} + +void DOMFileSystem::getParent(const Entry* entry, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback) +{ + ASSERT(entry); + String path = DOMFilePath::getDirectory(entry->fullPath()); + String platformPath = m_asyncFileSystem->virtualToPlatformPath(path); + m_asyncFileSystem->directoryExists(platformPath, new EntryCallbacks(successCallback, errorCallback, this, path, true)); +} + +void DOMFileSystem::getFile(const Entry* base, const String& path, PassRefPtr<Flags> flags, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback) +{ + ASSERT(base); + if (!DOMFilePath::isValidPath(path)) { + scheduleCallback(scriptExecutionContext(), errorCallback, FileError::create(INVALID_MODIFICATION_ERR)); + return; + } + + String absolutePath = path; + if (!DOMFilePath::isAbsolute(path)) + absolutePath = DOMFilePath::removeExtraParentReferences(DOMFilePath::append(base->fullPath(), path)); + String platformPath = m_asyncFileSystem->virtualToPlatformPath(absolutePath); + + OwnPtr<EntryCallbacks> callbacks = adoptPtr(new EntryCallbacks(successCallback, errorCallback, this, absolutePath, false)); + if (flags && flags->isCreate()) + m_asyncFileSystem->createFile(platformPath, flags->isExclusive(), callbacks.release()); + else + m_asyncFileSystem->fileExists(platformPath, callbacks.release()); +} + +void DOMFileSystem::getDirectory(const Entry* base, const String& path, PassRefPtr<Flags> flags, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback) +{ + ASSERT(base); + if (!DOMFilePath::isValidPath(path)) { + scheduleCallback(scriptExecutionContext(), errorCallback, FileError::create(INVALID_MODIFICATION_ERR)); + return; + } + + String absolutePath = path; + if (!DOMFilePath::isAbsolute(path)) + absolutePath = DOMFilePath::removeExtraParentReferences(DOMFilePath::append(base->fullPath(), path)); + String platformPath = m_asyncFileSystem->virtualToPlatformPath(absolutePath); + + OwnPtr<EntryCallbacks> callbacks = adoptPtr(new EntryCallbacks(successCallback, errorCallback, this, absolutePath, true)); + if (flags && flags->isCreate()) + m_asyncFileSystem->createDirectory(platformPath, flags->isExclusive(), callbacks.release()); + else + m_asyncFileSystem->directoryExists(platformPath, callbacks.release()); +} + +void DOMFileSystem::readDirectory(const String& path, PassRefPtr<EntriesCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback) +{ + ASSERT(DOMFilePath::isAbsolute(path)); + String platformPath = m_asyncFileSystem->virtualToPlatformPath(path); + m_asyncFileSystem->readDirectory(platformPath, new EntriesCallbacks(successCallback, errorCallback, this, path)); +} + +} // namespace + +#endif // ENABLE(FILE_SYSTEM) diff --git a/WebCore/fileapi/DOMFileSystem.h b/WebCore/fileapi/DOMFileSystem.h new file mode 100644 index 0000000..f779aba --- /dev/null +++ b/WebCore/fileapi/DOMFileSystem.h @@ -0,0 +1,126 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef DOMFileSystem_h +#define DOMFileSystem_h + +#if ENABLE(FILE_SYSTEM) + +#include "ActiveDOMObject.h" +#include "AsyncFileSystem.h" +#include "Flags.h" +#include "PlatformString.h" +#include "ScriptExecutionContext.h" +#include <wtf/PassRefPtr.h> +#include <wtf/RefCounted.h> + +namespace WebCore { + +class DirectoryEntry; +class Entry; +class EntryCallback; +class EntriesCallback; +class ErrorCallback; +class MetadataCallback; +class VoidCallback; + +class DOMFileSystem : public RefCounted<DOMFileSystem>, public ActiveDOMObject { +public: + static PassRefPtr<DOMFileSystem> create(ScriptExecutionContext* context, const String& name, PassOwnPtr<AsyncFileSystem> asyncFileSystem) + { + return adoptRef(new DOMFileSystem(context, name, asyncFileSystem)); + } + + virtual ~DOMFileSystem(); + + const String& name() const { return m_name; } + PassRefPtr<DirectoryEntry> root(); + + // ActiveDOMObject methods. + virtual void stop(); + virtual bool hasPendingActivity() const; + virtual void contextDestroyed(); + + // Actual FileSystem API implementations. All the validity checks on virtual paths are done at DOMFileSystem level. + void getMetadata(const Entry* entry, PassRefPtr<MetadataCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback); + void move(const Entry* src, PassRefPtr<Entry> parent, const String& name, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>); + void copy(const Entry* src, PassRefPtr<Entry> parent, const String& name, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>); + void remove(const Entry* entry, PassRefPtr<VoidCallback>, PassRefPtr<ErrorCallback>); + void getParent(const Entry* entry, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>); + void getFile(const Entry* base, const String& path, PassRefPtr<Flags>, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>); + void getDirectory(const Entry* base, const String& path, PassRefPtr<Flags>, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>); + void readDirectory(const String& path, PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>); + + // Schedule a callback. This should not cross threads (should be called on the same context thread). + template <typename CB, typename CBArg> + static void scheduleCallback(ScriptExecutionContext*, PassRefPtr<CB>, PassRefPtr<CBArg>); + +private: + DOMFileSystem(ScriptExecutionContext*, const String& name, PassOwnPtr<AsyncFileSystem>); + + AsyncFileSystem* asyncFileSystem() const { return m_asyncFileSystem.get(); } + + // A helper template to schedule a callback task. + // FIXME: move this to a more generic place. + template <typename CB, typename CBArg> + class DispatchCallbackTask : public ScriptExecutionContext::Task { + public: + DispatchCallbackTask(PassRefPtr<CB> callback, PassRefPtr<CBArg> arg) + : m_callback(callback) + , m_callbackArg(arg) + { + } + + virtual void performTask(ScriptExecutionContext*) + { + m_callback->handleEvent(m_callbackArg.get()); + } + + private: + RefPtr<CB> m_callback; + RefPtr<CBArg> m_callbackArg; + }; + + String m_name; + mutable OwnPtr<AsyncFileSystem> m_asyncFileSystem; +}; + +template <typename CB, typename CBArg> +void DOMFileSystem::scheduleCallback(ScriptExecutionContext* scriptExecutionContext, PassRefPtr<CB> callback, PassRefPtr<CBArg> arg) +{ + ASSERT(scriptExecutionContext->isContextThread()); + scriptExecutionContext->postTask(new DispatchCallbackTask<CB, CBArg>(callback, arg)); +} + +} // namespace + +#endif // ENABLE(FILE_SYSTEM) + +#endif // DOMFileSystem_h diff --git a/WebCore/storage/DOMFileSystem.idl b/WebCore/fileapi/DOMFileSystem.idl index b7307e2..b7307e2 100644 --- a/WebCore/storage/DOMFileSystem.idl +++ b/WebCore/fileapi/DOMFileSystem.idl diff --git a/WebCore/storage/DirectoryEntry.cpp b/WebCore/fileapi/DirectoryEntry.cpp index 60dcace..95c12e4 100644 --- a/WebCore/storage/DirectoryEntry.cpp +++ b/WebCore/fileapi/DirectoryEntry.cpp @@ -39,7 +39,7 @@ namespace WebCore { -DirectoryEntry::DirectoryEntry(PassRefPtr<DOMFileSystem> fileSystem, const String& fullPath) +DirectoryEntry::DirectoryEntry(DOMFileSystem* fileSystem, const String& fullPath) : Entry(fileSystem, fullPath) { } @@ -49,16 +49,14 @@ PassRefPtr<DirectoryReader> DirectoryEntry::createReader() return DirectoryReader::create(m_fileSystem, m_fullPath); } -void DirectoryEntry::getFile(const String&, PassRefPtr<Flags>, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>) +void DirectoryEntry::getFile(const String& path, PassRefPtr<Flags> flags, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback) { - // FIXME: to be implemented. - ASSERT_NOT_REACHED(); + m_fileSystem->getFile(this, path, flags, successCallback, errorCallback); } -void DirectoryEntry::getDirectory(const String&, PassRefPtr<Flags>, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>) +void DirectoryEntry::getDirectory(const String& path, PassRefPtr<Flags> flags, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback) { - // FIXME: to be implemented. - ASSERT_NOT_REACHED(); + m_fileSystem->getDirectory(this, path, flags, successCallback, errorCallback); } } // namespace diff --git a/WebCore/storage/DirectoryEntry.h b/WebCore/fileapi/DirectoryEntry.h index 2ae4fb5..3cd8ab5 100644 --- a/WebCore/storage/DirectoryEntry.h +++ b/WebCore/fileapi/DirectoryEntry.h @@ -47,7 +47,7 @@ class ErrorCallback; class DirectoryEntry : public Entry { public: - static PassRefPtr<DirectoryEntry> create(PassRefPtr<DOMFileSystem> fileSystem, const String& fullPath) + static PassRefPtr<DirectoryEntry> create(DOMFileSystem* fileSystem, const String& fullPath) { return adoptRef(new DirectoryEntry(fileSystem, fullPath)); } @@ -58,7 +58,7 @@ public: void getDirectory(const String& path, PassRefPtr<Flags> options = 0, PassRefPtr<EntryCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0); private: - DirectoryEntry(PassRefPtr<DOMFileSystem> fileSystem, const String& fullPath); + DirectoryEntry(DOMFileSystem* fileSystem, const String& fullPath); }; } // namespace diff --git a/WebCore/storage/DirectoryEntry.idl b/WebCore/fileapi/DirectoryEntry.idl index ac30c7f..ac30c7f 100644 --- a/WebCore/storage/DirectoryEntry.idl +++ b/WebCore/fileapi/DirectoryEntry.idl diff --git a/WebCore/storage/DirectoryReader.cpp b/WebCore/fileapi/DirectoryReader.cpp index 0b30f70..b0eef1c 100644 --- a/WebCore/storage/DirectoryReader.cpp +++ b/WebCore/fileapi/DirectoryReader.cpp @@ -39,16 +39,15 @@ namespace WebCore { -DirectoryReader::DirectoryReader(PassRefPtr<DOMFileSystem> fileSystem, const String& path) +DirectoryReader::DirectoryReader(PassRefPtr<DOMFileSystem> fileSystem, const String& fullPath) : m_fileSystem(fileSystem) - , m_path(path) + , m_fullPath(fullPath) { } -void DirectoryReader::readEntries(PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>) +void DirectoryReader::readEntries(PassRefPtr<EntriesCallback> entriesCallback, PassRefPtr<ErrorCallback> errorCallback) { - // FIXME: to be implemented. - ASSERT_NOT_REACHED(); + m_fileSystem->readDirectory(m_fullPath, entriesCallback, errorCallback); } } // namespace diff --git a/WebCore/storage/DirectoryReader.h b/WebCore/fileapi/DirectoryReader.h index cf5da8f..0e2ef0f 100644 --- a/WebCore/storage/DirectoryReader.h +++ b/WebCore/fileapi/DirectoryReader.h @@ -56,7 +56,7 @@ private: DirectoryReader(PassRefPtr<DOMFileSystem> fileSystem, const String& path); RefPtr<DOMFileSystem> m_fileSystem; - String m_path; + String m_fullPath; }; } // namespace diff --git a/WebCore/storage/DirectoryReader.idl b/WebCore/fileapi/DirectoryReader.idl index c3c7012..c3c7012 100644 --- a/WebCore/storage/DirectoryReader.idl +++ b/WebCore/fileapi/DirectoryReader.idl diff --git a/WebCore/storage/EntriesCallback.h b/WebCore/fileapi/EntriesCallback.h index 9f812e9..9f812e9 100644 --- a/WebCore/storage/EntriesCallback.h +++ b/WebCore/fileapi/EntriesCallback.h diff --git a/WebCore/storage/EntriesCallback.idl b/WebCore/fileapi/EntriesCallback.idl index 73b374d..73b374d 100644 --- a/WebCore/storage/EntriesCallback.idl +++ b/WebCore/fileapi/EntriesCallback.idl diff --git a/WebCore/storage/Entry.cpp b/WebCore/fileapi/Entry.cpp index 6783291..fbbedf2 100644 --- a/WebCore/storage/Entry.cpp +++ b/WebCore/fileapi/Entry.cpp @@ -32,15 +32,17 @@ #if ENABLE(FILE_SYSTEM) +#include "DOMFilePath.h" #include "DOMFileSystem.h" #include "EntryCallback.h" #include "ErrorCallback.h" +#include "FileError.h" #include "MetadataCallback.h" #include "VoidCallback.h" namespace WebCore { -Entry::Entry(PassRefPtr<DOMFileSystem> fileSystem, const String& fullPath) +Entry::Entry(DOMFileSystem* fileSystem, const String& fullPath) : m_fileSystem(fileSystem) , m_fullPath(fullPath) { @@ -51,34 +53,29 @@ Entry::Entry(PassRefPtr<DOMFileSystem> fileSystem, const String& fullPath) m_name = fullPath; } -void Entry::getMetadata(PassRefPtr<MetadataCallback>, PassRefPtr<ErrorCallback>) +void Entry::getMetadata(PassRefPtr<MetadataCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback) { - // FIXME: to be implemented. - ASSERT_NOT_REACHED(); + m_fileSystem->getMetadata(this, successCallback, errorCallback); } -void Entry::moveTo(PassRefPtr<Entry>, const String&, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>) +void Entry::moveTo(PassRefPtr<Entry> parent, const String& name, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback) const { - // FIXME: to be implemented. - ASSERT_NOT_REACHED(); + m_fileSystem->move(this, parent, name, successCallback, errorCallback); } -void Entry::copyTo(PassRefPtr<Entry>, const String&, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>) +void Entry::copyTo(PassRefPtr<Entry> parent, const String& name, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback) const { - // FIXME: to be implemented. - ASSERT_NOT_REACHED(); + m_fileSystem->copy(this, parent, name, successCallback, errorCallback); } -void Entry::remove(PassRefPtr<VoidCallback>, PassRefPtr<ErrorCallback>) +void Entry::remove(PassRefPtr<VoidCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback) const { - // FIXME: to be implemented. - ASSERT_NOT_REACHED(); + m_fileSystem->remove(this, successCallback, errorCallback); } -void Entry::getParent(PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>) +void Entry::getParent(PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback) const { - // FIXME: to be implemented. - ASSERT_NOT_REACHED(); + m_fileSystem->getParent(this, successCallback, errorCallback); } String Entry::toURI(const String&) diff --git a/WebCore/storage/Entry.h b/WebCore/fileapi/Entry.h index 7bbb265..9af532f 100644 --- a/WebCore/storage/Entry.h +++ b/WebCore/fileapi/Entry.h @@ -54,22 +54,21 @@ public: const String& fullPath() const { return m_fullPath; } const String& name() const { return m_name; } - DOMFileSystem* filesystem() const { return m_fileSystem.get(); } + DOMFileSystem* filesystem() const { return m_fileSystem; } virtual void getMetadata(PassRefPtr<MetadataCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0); - - virtual void moveTo(PassRefPtr<Entry> parent, const String& name = String(), PassRefPtr<EntryCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0); - virtual void copyTo(PassRefPtr<Entry> parent, const String& name = String(), PassRefPtr<EntryCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0); - virtual void remove(PassRefPtr<VoidCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0); - virtual void getParent(PassRefPtr<EntryCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0); + virtual void moveTo(PassRefPtr<Entry> parent, const String& name = String(), PassRefPtr<EntryCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0) const; + virtual void copyTo(PassRefPtr<Entry> parent, const String& name = String(), PassRefPtr<EntryCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0) const; + virtual void remove(PassRefPtr<VoidCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0) const; + virtual void getParent(PassRefPtr<EntryCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0) const; virtual String toURI(const String& mimeType = String()); protected: - Entry(PassRefPtr<DOMFileSystem> fileSystem, const String& fullPath); + Entry(DOMFileSystem* fileSystem, const String& fullPath); - RefPtr<DOMFileSystem> m_fileSystem; - String m_fullPath; // virtual path + DOMFileSystem* m_fileSystem; + String m_fullPath; String m_name; }; diff --git a/WebCore/storage/Entry.idl b/WebCore/fileapi/Entry.idl index 7d4ffee..7d4ffee 100644 --- a/WebCore/storage/Entry.idl +++ b/WebCore/fileapi/Entry.idl diff --git a/WebCore/storage/EntryArray.cpp b/WebCore/fileapi/EntryArray.cpp index 6c4f74f..6c4f74f 100644 --- a/WebCore/storage/EntryArray.cpp +++ b/WebCore/fileapi/EntryArray.cpp diff --git a/WebCore/storage/EntryArray.h b/WebCore/fileapi/EntryArray.h index e5957ab..e5957ab 100644 --- a/WebCore/storage/EntryArray.h +++ b/WebCore/fileapi/EntryArray.h diff --git a/WebCore/storage/EntryArray.idl b/WebCore/fileapi/EntryArray.idl index e987ece..e987ece 100644 --- a/WebCore/storage/EntryArray.idl +++ b/WebCore/fileapi/EntryArray.idl diff --git a/WebCore/storage/EntryCallback.h b/WebCore/fileapi/EntryCallback.h index 9580eda..9580eda 100644 --- a/WebCore/storage/EntryCallback.h +++ b/WebCore/fileapi/EntryCallback.h diff --git a/WebCore/storage/EntryCallback.idl b/WebCore/fileapi/EntryCallback.idl index bea3fd1..bea3fd1 100644 --- a/WebCore/storage/EntryCallback.idl +++ b/WebCore/fileapi/EntryCallback.idl diff --git a/WebCore/storage/ErrorCallback.h b/WebCore/fileapi/ErrorCallback.h index 91143e8..91143e8 100644 --- a/WebCore/storage/ErrorCallback.h +++ b/WebCore/fileapi/ErrorCallback.h diff --git a/WebCore/storage/ErrorCallback.idl b/WebCore/fileapi/ErrorCallback.idl index fc7fa85..fc7fa85 100644 --- a/WebCore/storage/ErrorCallback.idl +++ b/WebCore/fileapi/ErrorCallback.idl diff --git a/WebCore/fileapi/File.cpp b/WebCore/fileapi/File.cpp new file mode 100644 index 0000000..150a05b --- /dev/null +++ b/WebCore/fileapi/File.cpp @@ -0,0 +1,95 @@ +/* + * Copyright (C) 2008 Apple Inc. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "File.h" + +#include "BlobRegistry.h" +#include "FileSystem.h" +#include "MIMETypeRegistry.h" + +namespace WebCore { + +static PassOwnPtr<BlobData> createBlobDataForFile(const String& path) +{ + String type; + int index = path.reverseFind('.'); + if (index != -1) + type = MIMETypeRegistry::getMIMETypeForExtension(path.substring(index + 1)); + + OwnPtr<BlobData> blobData = BlobData::create(); + blobData->setContentType(type); + blobData->appendFile(path); + return blobData.release(); +} + +File::File(ScriptExecutionContext* scriptExecutionContext, const String& path) + : Blob(scriptExecutionContext, 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) + , 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) + , m_path(path) + , m_relativePath(relativePath) +{ + m_name = pathGetFileName(path); +} +#endif + +unsigned long long File::size() const +{ + // FIXME: JavaScript cannot represent sizes as large as unsigned long long, we need to + // come up with an exception to throw if file size is not representable. + long long size; + if (!getFileSize(m_path, size)) + return 0; + return static_cast<unsigned long long>(size); +} + +void File::captureSnapshot(long long& snapshotSize, double& snapshotModificationTime) const +{ + // Obtains a snapshot of the file by capturing its current size and modification time. This is used when we slice a file for the first time. + // If we fail to retrieve the size or modification time, probably due to that the file has been deleted, 0 size is returned. + // FIXME: Combine getFileSize and getFileModificationTime into one file system call. + time_t modificationTime; + if (!getFileSize(m_path, snapshotSize) || !getFileModificationTime(m_path, modificationTime)) { + snapshotSize = 0; + snapshotModificationTime = 0; + } else + snapshotModificationTime = modificationTime; +} + +} // namespace WebCore diff --git a/WebCore/html/File.h b/WebCore/fileapi/File.h index 06a73c5..d6446d3 100644 --- a/WebCore/html/File.h +++ b/WebCore/fileapi/File.h @@ -27,11 +27,15 @@ #define File_h #include "Blob.h" +#include "PlatformString.h" #include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> namespace WebCore { +class KURL; +class ScriptExecutionContext; + class File : public Blob { public: static PassRefPtr<File> create(ScriptExecutionContext* scriptExecutionContext, const String& path) @@ -40,9 +44,9 @@ public: } // For deserialization. - static PassRefPtr<File> create(ScriptExecutionContext* scriptExecutionContext, const String& path, const KURL& url, const String& type) + static PassRefPtr<File> create(ScriptExecutionContext* scriptExecutionContext, const String& path, const KURL& srcURL, const String& type) { - return adoptRef(new File(scriptExecutionContext, path, url, type)); + return adoptRef(new File(scriptExecutionContext, path, srcURL, type)); } #if ENABLE(DIRECTORY_UPLOAD) @@ -52,29 +56,38 @@ public: } #endif + virtual unsigned long long size() const; virtual bool isFile() const { return true; } - const String& name() const; + const String& path() const { return m_path; } + const String& name() const { return m_name; } #if ENABLE(DIRECTORY_UPLOAD) // Returns the relative path of this file in the context of a directory selection. - const String& webkitRelativePath() const; + const String& webkitRelativePath() const { return m_relativePath; } #endif + // Note that this involves synchronous file operation. Think twice before calling this function. + void captureSnapshot(long long& snapshotSize, double& snapshotModificationTime) const; + // FIXME: obsolete attributes. To be removed. const String& fileName() const { return name(); } unsigned long long fileSize() const { return size(); } private: File(ScriptExecutionContext*, const String& path); - + // For deserialization. - File(ScriptExecutionContext*, const String& path, const KURL&, const String& type); + File(ScriptExecutionContext*, const String& path, const KURL& srcURL, const String& type); #if ENABLE(DIRECTORY_UPLOAD) File(ScriptExecutionContext*, const String& relativePath, const String& path); #endif - void Init(); + String m_path; + String m_name; +#if ENABLE(DIRECTORY_UPLOAD) + String m_relativePath; +#endif }; } // namespace WebCore diff --git a/WebCore/html/File.idl b/WebCore/fileapi/File.idl index 5626c8e..1937901 100644 --- a/WebCore/html/File.idl +++ b/WebCore/fileapi/File.idl @@ -27,7 +27,8 @@ module html { interface [ GenerateNativeConverter, - GenerateToJS + GenerateToJS, + NoStaticTables ] File : Blob { readonly attribute DOMString name; #if defined(ENABLE_DIRECTORY_UPLOAD) && ENABLE_DIRECTORY_UPLOAD diff --git a/WebCore/storage/FileEntry.cpp b/WebCore/fileapi/FileEntry.cpp index 4bec01d..e2a583c 100644 --- a/WebCore/storage/FileEntry.cpp +++ b/WebCore/fileapi/FileEntry.cpp @@ -35,7 +35,7 @@ namespace WebCore { -FileEntry::FileEntry(PassRefPtr<DOMFileSystem> fileSystem, const String& fullPath) +FileEntry::FileEntry(DOMFileSystem* fileSystem, const String& fullPath) : Entry(fileSystem, fullPath) { } diff --git a/WebCore/storage/FileEntry.h b/WebCore/fileapi/FileEntry.h index b02b5c7..abcc6bb 100644 --- a/WebCore/storage/FileEntry.h +++ b/WebCore/fileapi/FileEntry.h @@ -34,9 +34,6 @@ #if ENABLE(FILE_SYSTEM) #include "Entry.h" -#include "PlatformString.h" -#include <wtf/PassRefPtr.h> -#include <wtf/RefCounted.h> namespace WebCore { @@ -44,14 +41,14 @@ class DOMFileSystem; class FileEntry : public Entry { public: - static PassRefPtr<FileEntry> create(PassRefPtr<DOMFileSystem> fileSystem, const String& fullPath) + static PassRefPtr<FileEntry> create(DOMFileSystem* fileSystem, const String& fullPath) { return adoptRef(new FileEntry(fileSystem, fullPath)); } virtual bool isFile() const { return true; } private: - FileEntry(PassRefPtr<DOMFileSystem> fileSystem, const String& fullPath); + FileEntry(DOMFileSystem* fileSystem, const String& fullPath); }; } // namespace diff --git a/WebCore/storage/FileEntry.idl b/WebCore/fileapi/FileEntry.idl index af3b807..af3b807 100644 --- a/WebCore/storage/FileEntry.idl +++ b/WebCore/fileapi/FileEntry.idl diff --git a/WebCore/html/FileError.h b/WebCore/fileapi/FileError.h index 1c74c07..1c74c07 100644 --- a/WebCore/html/FileError.h +++ b/WebCore/fileapi/FileError.h diff --git a/WebCore/html/FileError.idl b/WebCore/fileapi/FileError.idl index 3423e72..a5e2bac 100644 --- a/WebCore/html/FileError.idl +++ b/WebCore/fileapi/FileError.idl @@ -31,14 +31,19 @@ module html { interface [ Conditional=BLOB|FILE_WRITER, - DontCheckEnums + DontCheckEnums, + NoStaticTables ] FileError { #if !defined(LANGUAGE_OBJECTIVE_C) const unsigned short NO_MODIFICATION_ALLOWED_ERR = 7; const unsigned short NOT_FOUND_ERR = 8; + const unsigned short INVALID_STATE_ERR = 11; + const unsigned short SYNTAX_ERR = 12; + const unsigned short INVALID_MODIFICATION_ERR = 13; #endif const unsigned short SECURITY_ERR = 18; const unsigned short ABORT_ERR = 20; + const unsigned short QUOTA_EXCEEDED_ERR = 22; const unsigned short NOT_READABLE_ERR = 24; const unsigned short ENCODING_ERR = 26; readonly attribute unsigned short code; diff --git a/WebCore/html/FileWriter.cpp b/WebCore/fileapi/FileException.h index 7d112e2..4419eb7 100644 --- a/WebCore/html/FileWriter.cpp +++ b/WebCore/fileapi/FileException.h @@ -28,59 +28,39 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "config.h" +#ifndef FileException_h +#define FileException_h -#if ENABLE(FILE_WRITER) +#if ENABLE(BLOB) || ENABLE(FILE_WRITER) -#include "FileWriter.h" +#include "ExceptionBase.h" namespace WebCore { -FileWriter::FileWriter(ScriptExecutionContext* context) - : ActiveDOMObject(context, this) -{ -} +class FileException : public ExceptionBase { +public: + static PassRefPtr<FileException> create(const ExceptionCodeDescription& description) + { + return adoptRef(new FileException(description)); + } -FileWriter::~FileWriter() -{ -} + static const int FileExceptionOffset = 100; + static const int FileExceptionMax = 199; -bool FileWriter::hasPendingActivity() const -{ - return false; -} + enum EventExceptionCode { + UNSPECIFIED_EVENT_TYPE_ERR = FileExceptionOffset + }; -bool FileWriter::canSuspend() const -{ - // FIXME: It is not currently possible to suspend a FileWriter, so pages with FileWriter can not go into page cache. - return false; -} +private: + FileException(const ExceptionCodeDescription& description) + : ExceptionBase(description) + { + } +}; -void FileWriter::stop() -{ -} - -void FileWriter::write(Blob*) -{ -} - -void FileWriter::seek(long long) -{ -} - -void FileWriter::truncate(long long) -{ -} +} // namespace WebCore -void FileWriter::abort() -{ -} +#endif // ENABLE(BLOB) || ENABLE(FILE_WRITER) -FileWriter::ReadyState FileWriter::readyState() const -{ - return EMPTY; -} +#endif // FileException_h -} // namespace WebCore - -#endif // ENABLE(FILE_WRITER) diff --git a/WebCore/fileapi/FileException.idl b/WebCore/fileapi/FileException.idl new file mode 100644 index 0000000..cd53a7e --- /dev/null +++ b/WebCore/fileapi/FileException.idl @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +module html { + interface [ + Conditional=BLOB|FILE_WRITER, + DontCheckEnums, + NoStaticTables + ] FileException { + + readonly attribute unsigned short code; + readonly attribute DOMString name; + readonly attribute DOMString message; + +#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT + // Override in a Mozilla compatible format + [DontEnum] DOMString toString(); +#endif + + // FileExceptionCode + const unsigned short NO_MODIFICATION_ALLOWED_ERR = 7; + const unsigned short NOT_FOUND_ERR = 8; + const unsigned short INVALID_STATE_ERR = 11; + const unsigned short SYNTAX_ERR = 12; + const unsigned short INVALID_MODIFICATION_ERR = 13; + const unsigned short SECURITY_ERR = 18; + const unsigned short ABORT_ERR = 20; + const unsigned short QUOTA_EXCEEDED_ERR = 22; + const unsigned short NOT_READABLE_ERR = 24; + const unsigned short ENCODING_ERR = 26; + }; +} diff --git a/WebCore/html/FileList.cpp b/WebCore/fileapi/FileList.cpp index ba81087..ba81087 100644 --- a/WebCore/html/FileList.cpp +++ b/WebCore/fileapi/FileList.cpp diff --git a/WebCore/html/FileList.h b/WebCore/fileapi/FileList.h index e078191..e078191 100644 --- a/WebCore/html/FileList.h +++ b/WebCore/fileapi/FileList.h diff --git a/WebCore/html/FileList.idl b/WebCore/fileapi/FileList.idl index 6baf3e1..0d0b046 100644 --- a/WebCore/html/FileList.idl +++ b/WebCore/fileapi/FileList.idl @@ -26,7 +26,8 @@ module html { interface [ - HasIndexGetter + HasIndexGetter, + NoStaticTables ] FileList { readonly attribute unsigned long length; File item(in [IsIndex] unsigned long index); diff --git a/WebCore/html/FileReader.cpp b/WebCore/fileapi/FileReader.cpp index d600d40..747b6ff 100644 --- a/WebCore/html/FileReader.cpp +++ b/WebCore/fileapi/FileReader.cpp @@ -36,17 +36,19 @@ #include "Base64.h" #include "Blob.h" +#include "CrossThreadTask.h" #include "File.h" -#include "FileStreamProxy.h" #include "Logging.h" #include "ProgressEvent.h" +#include "ResourceError.h" +#include "ResourceRequest.h" #include "ScriptExecutionContext.h" #include "TextResourceDecoder.h" +#include "ThreadableLoader.h" #include <wtf/CurrentTime.h> namespace WebCore { -const unsigned bufferSize = 1024; const double progressNotificationIntervalMS = 50; FileReader::FileReader(ScriptExecutionContext* context) @@ -59,7 +61,6 @@ FileReader::FileReader(ScriptExecutionContext* context) , m_totalBytes(0) , m_lastProgressNotificationTimeMS(0) { - m_buffer.resize(bufferSize); } FileReader::~FileReader() @@ -83,55 +84,56 @@ void FileReader::stop() terminate(); } -void FileReader::readAsBinaryString(Blob* fileBlob) +void FileReader::readAsBinaryString(Blob* blob) { - if (!fileBlob) + if (!blob) return; - // FIXME: needs to handle non-file blobs. - LOG(FileAPI, "FileReader: reading as binary: %s\n", fileBlob->path().utf8().data()); + LOG(FileAPI, "FileReader: reading as binary: %s %s\n", blob->url().string().utf8().data(), blob->isFile() ? static_cast<File*>(blob)->path().utf8().data() : ""); - readInternal(fileBlob, ReadFileAsBinaryString); + readInternal(blob, ReadFileAsBinaryString); } -void FileReader::readAsText(Blob* fileBlob, const String& encoding) +void FileReader::readAsText(Blob* blob, const String& encoding) { - if (!fileBlob) + if (!blob) return; - // FIXME: needs to handle non-file blobs. - LOG(FileAPI, "FileReader: reading as text: %s\n", fileBlob->path().utf8().data()); + LOG(FileAPI, "FileReader: reading as text: %s %s\n", blob->url().string().utf8().data(), blob->isFile() ? static_cast<File*>(blob)->path().utf8().data() : ""); if (!encoding.isEmpty()) m_encoding = TextEncoding(encoding); - readInternal(fileBlob, ReadFileAsText); + readInternal(blob, ReadFileAsText); } -void FileReader::readAsDataURL(File* file) +void FileReader::readAsDataURL(Blob* blob) { - if (!file) + if (!blob) return; - LOG(FileAPI, "FileReader: reading as data URL: %s\n", file->path().utf8().data()); + LOG(FileAPI, "FileReader: reading as data URL: %s %s\n", blob->url().string().utf8().data(), blob->isFile() ? static_cast<File*>(blob)->path().utf8().data() : ""); - m_fileType = file->type(); - readInternal(file, ReadFileAsDataURL); + m_fileType = blob->type(); + readInternal(blob, ReadFileAsDataURL); } -void FileReader::readInternal(Blob* fileBlob, ReadType type) +static void delayedStart(ScriptExecutionContext*, FileReader* reader) +{ + reader->start(); +} + +void FileReader::readInternal(Blob* blob, ReadType type) { // readAs*** methods() can be called multiple times. Only the last call before the actual reading happens is processed. if (m_state != None && m_state != Starting) return; - m_fileBlob = fileBlob; + if (m_state == None) + scriptExecutionContext()->postTask(createCallbackTask(&delayedStart, this)); + + m_blob = blob; m_readType = type; m_state = Starting; - - // When FileStreamProxy is created, FileReader::didStart() will get notified on the File thread and we will start - // opening and reading the file since then. - if (!m_streamProxy.get()) - m_streamProxy = FileStreamProxy::create(scriptExecutionContext(), this); } void FileReader::abort() @@ -150,87 +152,66 @@ void FileReader::abort() void FileReader::terminate() { - if (m_streamProxy) { - m_streamProxy->stop(); - m_streamProxy = 0; + if (m_loader) { + m_loader->cancel(); + m_loader = 0; } m_state = Completed; } -void FileReader::didStart() +void FileReader::start() { m_state = Opening; - ASSERT(m_fileBlob->items().size() == 1 && m_fileBlob->items().at(0)->toFileBlobItem()); - const FileRangeBlobItem* fileRangeItem = m_fileBlob->items().at(0)->toFileRangeBlobItem(); - double expectedModificationTime = fileRangeItem ? fileRangeItem->snapshotModificationTime() : 0; + // The blob is read by routing through the request handling layer given the blob url. + ResourceRequest request(m_blob->url()); + request.setHTTPMethod("GET"); + + ThreadableLoaderOptions options; + options.sendLoadCallbacks = true; + options.sniffContent = false; + options.forcePreflight = false; + options.allowCredentials = true; + options.crossOriginRequestPolicy = DenyCrossOriginRequests; - m_streamProxy->getSize(m_fileBlob->path(), expectedModificationTime); + m_loader = ThreadableLoader::create(scriptExecutionContext(), this, request, options); } -void FileReader::didGetSize(long long size) +void FileReader::didReceiveResponse(const ResourceResponse& response) { - // If the size is -1, it means the file has been moved or changed. Fail now. - if (size == -1) { - didFail(NOT_FOUND_ERR); + if (response.httpStatusCode() != 200) { + failed(response.httpStatusCode()); return; } m_state = Reading; fireEvent(eventNames().loadstartEvent); - ASSERT(m_fileBlob->items().size() == 1 && m_fileBlob->items().at(0)->toFileBlobItem()); - const FileRangeBlobItem* fileRangeItem = m_fileBlob->items().at(0)->toFileRangeBlobItem(); - long long start = fileRangeItem ? fileRangeItem->start() : 0; - - // The size passed back is the size of the whole file. If the underlying item is a sliced file, we need to use the slice length. - m_totalBytes = fileRangeItem ? fileRangeItem->size() : size; - - m_streamProxy->openForRead(m_fileBlob->path(), start, m_totalBytes); + m_totalBytes = response.expectedContentLength(); } -void FileReader::didOpen(bool success) +void FileReader::didReceiveData(const char* data, int lengthReceived) { - if (!success) { - didFail(NOT_READABLE_ERR); - return; - } - - m_streamProxy->read(m_buffer.data(), m_buffer.size()); -} + ASSERT(data && lengthReceived); -void FileReader::didRead(int bytesRead) -{ // Bail out if we have aborted the reading. if (m_state == Completed) return; - // If bytesRead is -1, it means an error happens. - if (bytesRead == -1) { - didFail(NOT_READABLE_ERR); - return; - } - - // If bytesRead is 0, it means the reading is done. - if (!bytesRead) { - didFinish(); - return; - } - switch (m_readType) { case ReadFileAsBinaryString: - m_result += String(m_buffer.data(), static_cast<unsigned>(bytesRead)); + m_result += String(data, static_cast<unsigned>(lengthReceived)); break; case ReadFileAsText: case ReadFileAsDataURL: - m_rawData.append(m_buffer.data(), static_cast<unsigned>(bytesRead)); + m_rawData.append(data, static_cast<unsigned>(lengthReceived)); m_isRawDataConverted = false; break; default: ASSERT_NOT_REACHED(); } - m_bytesLoaded += bytesRead; + m_bytesLoaded += lengthReceived; // Fire the progress event at least every 50ms. double now = WTF::currentTimeMS(); @@ -240,30 +221,45 @@ void FileReader::didRead(int bytesRead) fireEvent(eventNames().progressEvent); m_lastProgressNotificationTimeMS = now; } - - // Continue reading. - m_streamProxy->read(m_buffer.data(), m_buffer.size()); } -void FileReader::didFinish() +void FileReader::didFinishLoading(unsigned long) { m_state = Completed; - m_streamProxy->close(); - fireEvent(eventNames().loadEvent); fireEvent(eventNames().loadendEvent); + + m_loader = 0; } -void FileReader::didFail(ExceptionCode ec) +void FileReader::didFail(const ResourceError&) { - m_state = Completed; - m_error = FileError::create(ec); + // Treat as internal error. + failed(500); +} - m_streamProxy->close(); +void FileReader::failed(int httpStatusCode) +{ + m_state = Completed; + m_error = FileError::create(httpStatusCodeToExceptionCode(httpStatusCode)); fireEvent(eventNames().errorEvent); fireEvent(eventNames().loadendEvent); + + m_loader = 0; +} + +ExceptionCode FileReader::httpStatusCodeToExceptionCode(int httpStatusCode) +{ + switch (httpStatusCode) { + case 403: + return SECURITY_ERR; + case 404: + return NOT_FOUND_ERR; + default: + return NOT_READABLE_ERR; + } } void FileReader::fireEvent(const AtomicString& type) @@ -303,7 +299,7 @@ const ScriptString& FileReader::result() convertToText(); // For data URL, we only do the coversion until we receive all the raw data. else if (m_readType == ReadFileAsDataURL && m_state == Completed) - convertToDataURL(); + convertToDataURL(m_rawData, m_fileType, m_result); return m_result; } @@ -328,22 +324,22 @@ void FileReader::convertToText() m_result += m_decoder->flush(); } -void FileReader::convertToDataURL() +void FileReader::convertToDataURL(const Vector<char>& rawData, const String& fileType, ScriptString& result) { - m_result = "data:"; + result = "data:"; - if (!m_rawData.size()) + if (!rawData.size()) return; - m_result += m_fileType; - if (!m_fileType.isEmpty()) - m_result += ";"; - m_result += "base64,"; + result += fileType; + if (!fileType.isEmpty()) + result += ";"; + result += "base64,"; Vector<char> out; - base64Encode(m_rawData, out); + base64Encode(rawData, out); out.append('\0'); - m_result += out.data(); + result += out.data(); } } // namespace WebCore diff --git a/WebCore/html/FileReader.h b/WebCore/fileapi/FileReader.h index ee15968..48ce229 100644 --- a/WebCore/html/FileReader.h +++ b/WebCore/fileapi/FileReader.h @@ -36,10 +36,10 @@ #include "ActiveDOMObject.h" #include "EventTarget.h" #include "FileError.h" -#include "FileStreamClient.h" #include "PlatformString.h" #include "ScriptString.h" #include "TextEncoding.h" +#include "ThreadableLoaderClient.h" #include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> #include <wtf/RefPtr.h> @@ -48,12 +48,11 @@ namespace WebCore { class Blob; -class File; -class FileStreamProxy; class ScriptExecutionContext; class TextResourceDecoder; +class ThreadableLoader; -class FileReader : public RefCounted<FileReader>, public ActiveDOMObject, public EventTarget, public FileStreamClient { +class FileReader : public RefCounted<FileReader>, public ActiveDOMObject, public EventTarget, public ThreadableLoaderClient { public: static PassRefPtr<FileReader> create(ScriptExecutionContext* context) { @@ -70,13 +69,19 @@ public: void readAsBinaryString(Blob*); void readAsText(Blob*, const String& encoding = ""); - void readAsDataURL(File*); + void readAsDataURL(Blob*); void abort(); + void start(); + ReadyState readyState() const; PassRefPtr<FileError> error() { return m_error; } const ScriptString& result(); + // Helper methods, also used by FileReaderSync. + static ExceptionCode httpStatusCodeToExceptionCode(int httpStatusCode); + static void convertToDataURL(const Vector<char>& rawData, const String& fileType, ScriptString& result); + // ActiveDOMObject virtual bool canSuspend() const; virtual void stop(); @@ -86,11 +91,11 @@ public: virtual FileReader* toFileReader() { return this; } virtual ScriptExecutionContext* scriptExecutionContext() const { return ActiveDOMObject::scriptExecutionContext(); } - // FileStreamClient - virtual void didStart(); - virtual void didGetSize(long long); - virtual void didOpen(bool); - virtual void didRead(int); + // ThreadableLoaderClient + virtual void didReceiveResponse(const ResourceResponse&); + virtual void didReceiveData(const char*, int); + virtual void didFinishLoading(unsigned long identifier); + virtual void didFail(const ResourceError&); using RefCounted<FileReader>::ref; using RefCounted<FileReader>::deref; @@ -126,16 +131,16 @@ private: void terminate(); void readInternal(Blob*, ReadType); + void failed(int httpStatusCode); + void fireErrorEvent(int httpStatusCode); void fireEvent(const AtomicString& type); void convertToText(); void convertToDataURL(); - void didFinish(); - void didFail(ExceptionCode); InternalState m_state; EventTargetData m_eventTargetData; - RefPtr<Blob> m_fileBlob; + RefPtr<Blob> m_blob; ReadType m_readType; TextEncoding m_encoding; @@ -157,8 +162,7 @@ private: // Needed to create data URL. String m_fileType; - RefPtr<FileStreamProxy> m_streamProxy; - Vector<char> m_buffer; + RefPtr<ThreadableLoader> m_loader; RefPtr<FileError> m_error; long long m_bytesLoaded; long long m_totalBytes; diff --git a/WebCore/html/FileReader.idl b/WebCore/fileapi/FileReader.idl index b36e9d3..b36e9d3 100644 --- a/WebCore/html/FileReader.idl +++ b/WebCore/fileapi/FileReader.idl diff --git a/WebCore/fileapi/FileReaderSync.cpp b/WebCore/fileapi/FileReaderSync.cpp new file mode 100644 index 0000000..a907044 --- /dev/null +++ b/WebCore/fileapi/FileReaderSync.cpp @@ -0,0 +1,193 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" + +#if ENABLE(BLOB) + +#include "FileReaderSync.h" + +#include "Base64.h" +#include "Blob.h" +#include "FileReader.h" +#include "ResourceRequest.h" +#include "ScriptExecutionContext.h" +#include "TextEncoding.h" +#include "TextResourceDecoder.h" +#include "ThreadableLoader.h" + +namespace WebCore { + +class FileReaderSyncLoader : public ThreadableLoaderClient { +public: + // If the output result is provided, use it. Otherwise, save it as the raw data. + FileReaderSyncLoader(ScriptString* result); + + // Returns the http status code. + void start(ScriptExecutionContext*, const ResourceRequest&, ExceptionCode&); + + // ThreadableLoaderClient + virtual void didReceiveResponse(const ResourceResponse&); + virtual void didReceiveData(const char*, int); + virtual void didFinishLoading(unsigned long identifier); + virtual void didFail(const ResourceError&); + + const Vector<char>& rawData() const { return m_rawData; } + +private: + // The output result. The caller provides this in order to load the binary data directly. + ScriptString* m_result; + + // The raw data. The caller does not provide the above output result and we need to save it here. + Vector<char> m_rawData; + + int m_httpStatusCode; +}; + +FileReaderSyncLoader::FileReaderSyncLoader(ScriptString* result) + : m_result(result) + , m_httpStatusCode(0) +{ +} + +void FileReaderSyncLoader::start(ScriptExecutionContext* scriptExecutionContext, const ResourceRequest& request, ExceptionCode& ec) +{ + ThreadableLoaderOptions options; + options.sendLoadCallbacks = true; + options.sniffContent = false; + options.forcePreflight = false; + options.allowCredentials = true; + options.crossOriginRequestPolicy = DenyCrossOriginRequests; + + ThreadableLoader::loadResourceSynchronously(scriptExecutionContext, request, *this, options); + + ec = (m_httpStatusCode == 200) ? 0 : FileReader::httpStatusCodeToExceptionCode(m_httpStatusCode); +} + +void FileReaderSyncLoader::didReceiveResponse(const ResourceResponse& response) +{ + m_httpStatusCode = response.httpStatusCode(); +} + +void FileReaderSyncLoader::didReceiveData(const char* data, int lengthReceived) +{ + if (m_result) + *m_result += String(data, static_cast<unsigned>(lengthReceived)); + else + m_rawData.append(data, static_cast<unsigned>(lengthReceived)); +} + +void FileReaderSyncLoader::didFinishLoading(unsigned long) +{ +} + +void FileReaderSyncLoader::didFail(const ResourceError&) +{ + // Treat as internal error. + m_httpStatusCode = 500; +} + +FileReaderSync::FileReaderSync() + : m_result("") +{ +} + +const ScriptString& FileReaderSync::readAsBinaryString(ScriptExecutionContext* scriptExecutionContext, Blob* blob, ExceptionCode& ec) +{ + if (!blob) + return m_result; + + read(scriptExecutionContext, blob, ReadAsBinaryString, ec); + return m_result; +} + +const ScriptString& FileReaderSync::readAsText(ScriptExecutionContext* scriptExecutionContext, Blob* blob, const String& encoding, ExceptionCode& ec) +{ + if (!blob) + return m_result; + + m_encoding = encoding; + read(scriptExecutionContext, blob, ReadAsText, ec); + return m_result; +} + +const ScriptString& FileReaderSync::readAsDataURL(ScriptExecutionContext* scriptExecutionContext, Blob* blob, ExceptionCode& ec) +{ + if (!blob) + return m_result; + + read(scriptExecutionContext, blob, ReadAsDataURL, ec); + return m_result; +} + +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()); + request.setHTTPMethod("GET"); + + FileReaderSyncLoader loader((readType == ReadAsBinaryString) ? &m_result : 0); + loader.start(scriptExecutionContext, request, ec); + if (ec) + return; + + switch (readType) { + case ReadAsBinaryString: + // Nothing to do since we need no conversion. + return; + case ReadAsText: + convertToText(loader.rawData().data(), loader.rawData().size(), m_result); + return; + case ReadAsDataURL: + FileReader::convertToDataURL(loader.rawData(), blob->type(), m_result); + return; + } + + ASSERT_NOT_REACHED(); +} + +void FileReaderSync::convertToText(const char* data, int size, ScriptString& result) +{ + if (!size) + return; + + // Decode the data. + // The File API spec says that we should use the supplied encoding if it is valid. However, we choose to ignore this + // requirement in order to be consistent with how WebKit decodes the web content: always have the BOM override the + // provided encoding. + // FIXME: consider supporting incremental decoding to improve the perf. + RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("text/plain", m_encoding.isEmpty() ? UTF8Encoding() : TextEncoding(m_encoding)); + result = decoder->decode(data, size); + result += decoder->flush(); +} + +} // namespace WebCore + +#endif // ENABLE(BLOB) diff --git a/WebCore/fileapi/FileReaderSync.h b/WebCore/fileapi/FileReaderSync.h new file mode 100644 index 0000000..a517cab --- /dev/null +++ b/WebCore/fileapi/FileReaderSync.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 FileReaderSync_h +#define FileReaderSync_h + +#if ENABLE(BLOB) + +#include "ExceptionCode.h" +#include "ScriptString.h" +#include <wtf/PassRefPtr.h> +#include <wtf/RefCounted.h> + +namespace WebCore { + +class Blob; +class ScriptExecutionContext; + +class FileReaderSync : public RefCounted<FileReaderSync> { +public: + static PassRefPtr<FileReaderSync> create() + { + return adoptRef(new FileReaderSync()); + } + + virtual ~FileReaderSync() { } + + const ScriptString& readAsBinaryString(ScriptExecutionContext*, Blob*, ExceptionCode&); + const ScriptString& readAsText(ScriptExecutionContext* scriptExecutionContext, Blob* blob, ExceptionCode& ec) + { + return readAsText(scriptExecutionContext, blob, "", ec); + } + const ScriptString& readAsText(ScriptExecutionContext*, Blob*, const String& encoding, ExceptionCode&); + const ScriptString& readAsDataURL(ScriptExecutionContext*, Blob*, ExceptionCode&); + +private: + enum ReadType { + ReadAsBinaryString, + ReadAsText, + ReadAsDataURL + }; + + FileReaderSync(); + + void read(ScriptExecutionContext*, Blob*, ReadType, ExceptionCode&); + void convertToText(const char* data, int size, ScriptString& result); + + // Like XMLHttpRequest.m_responseText, we keep this as a ScriptString, not a WTF::String. + // That's because these strings can easily get huge (they are filled from the file) and + // because JS can easily observe many intermediate states, so it's very useful to be + // able to share the buffer with JavaScript versions of the whole or partial string. + // In contrast, this string doesn't interact much with the rest of the engine so it's not that + // big a cost that it isn't a String. + ScriptString m_result; + + String m_encoding; +}; + +} // namespace WebCore + +#endif // ENABLE(BLOB) + +#endif // FileReaderSync_h diff --git a/WebCore/fileapi/FileReaderSync.idl b/WebCore/fileapi/FileReaderSync.idl new file mode 100644 index 0000000..72818b1 --- /dev/null +++ b/WebCore/fileapi/FileReaderSync.idl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +module html { + interface [ + Conditional=BLOB, + CanBeConstructed, + NoStaticTables + ] FileReaderSync { + [CallWith=ScriptExecutionContext, ConvertScriptString] DOMString readAsBinaryString(in Blob blob) + raises(FileException); + [CallWith=ScriptExecutionContext, ConvertScriptString] DOMString readAsText(in Blob blob, in [Optional] DOMString encoding) + raises(FileException); + [CallWith=ScriptExecutionContext, ConvertScriptString] DOMString readAsDataURL(in Blob blob) + raises(FileException); + }; +} diff --git a/WebCore/html/FileStreamProxy.cpp b/WebCore/fileapi/FileStreamProxy.cpp index 30813d3..30813d3 100644 --- a/WebCore/html/FileStreamProxy.cpp +++ b/WebCore/fileapi/FileStreamProxy.cpp diff --git a/WebCore/html/FileStreamProxy.h b/WebCore/fileapi/FileStreamProxy.h index 35a3af8..35a3af8 100644 --- a/WebCore/html/FileStreamProxy.h +++ b/WebCore/fileapi/FileStreamProxy.h diff --git a/WebCore/storage/FileSystemCallback.h b/WebCore/fileapi/FileSystemCallback.h index 63f8416..63f8416 100644 --- a/WebCore/storage/FileSystemCallback.h +++ b/WebCore/fileapi/FileSystemCallback.h diff --git a/WebCore/storage/FileSystemCallback.idl b/WebCore/fileapi/FileSystemCallback.idl index cf686ff..cf686ff 100644 --- a/WebCore/storage/FileSystemCallback.idl +++ b/WebCore/fileapi/FileSystemCallback.idl diff --git a/WebCore/storage/FileSystemCallbacks.cpp b/WebCore/fileapi/FileSystemCallbacks.cpp index ec352dd..741df78 100644 --- a/WebCore/storage/FileSystemCallbacks.cpp +++ b/WebCore/fileapi/FileSystemCallbacks.cpp @@ -33,6 +33,8 @@ #if ENABLE(FILE_SYSTEM) +#include "AsyncFileSystem.h" +#include "DOMFilePath.h" #include "DOMFileSystem.h" #include "DirectoryEntry.h" #include "EntriesCallback.h" @@ -65,7 +67,7 @@ void FileSystemCallbacksBase::didSucceed() ASSERT_NOT_REACHED(); } -void FileSystemCallbacksBase::didOpenFileSystem(const String&, const String&) +void FileSystemCallbacksBase::didOpenFileSystem(const String&, PassOwnPtr<AsyncFileSystem>) { // Each subclass must implement an appropriate one. ASSERT_NOT_REACHED(); @@ -77,7 +79,7 @@ void FileSystemCallbacksBase::didReadMetadata(double) ASSERT_NOT_REACHED(); } -void FileSystemCallbacksBase::didReadDirectoryChunkDone(bool) +void FileSystemCallbacksBase::didReadDirectoryEntries(bool) { // Each subclass must implement an appropriate one. ASSERT_NOT_REACHED(); @@ -89,7 +91,7 @@ void FileSystemCallbacksBase::didReadDirectoryEntry(const String&, bool) ASSERT_NOT_REACHED(); } -void FileSystemCallbacksBase::didFail(ExceptionCode code) +void FileSystemCallbacksBase::didFail(int code) { if (m_errorCallback) { m_errorCallback->handleEvent(FileError::create(code).get()); @@ -131,14 +133,17 @@ EntriesCallbacks::EntriesCallbacks(PassRefPtr<EntriesCallback> successCallback, void EntriesCallbacks::didReadDirectoryEntry(const String& name, bool isDirectory) { + if (!m_entries) + m_entries = EntryArray::create(); if (isDirectory) - m_entries->append(DirectoryEntry::create(m_fileSystem, m_basePath + "/" + name)); + m_entries->append(DirectoryEntry::create(m_fileSystem, DOMFilePath::append(m_basePath, name))); else - m_entries->append(FileEntry::create(m_fileSystem, m_basePath + "/" + name)); + m_entries->append(FileEntry::create(m_fileSystem, DOMFilePath::append(m_basePath, name))); } -void EntriesCallbacks::didReadDirectoryChunkDone(bool hasMore) +void EntriesCallbacks::didReadDirectoryEntries(bool hasMore) { + ASSERT(m_entries); if (m_successCallback) { m_successCallback->handleEvent(m_entries.get()); m_entries->clear(); @@ -152,16 +157,20 @@ void EntriesCallbacks::didReadDirectoryChunkDone(bool hasMore) // FileSystemCallbacks -------------------------------------------------------- -FileSystemCallbacks::FileSystemCallbacks(PassRefPtr<FileSystemCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback) +FileSystemCallbacks::FileSystemCallbacks(PassRefPtr<FileSystemCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, ScriptExecutionContext* context) : FileSystemCallbacksBase(errorCallback) , m_successCallback(successCallback) + , m_scriptExecutionContext(context) { } -void FileSystemCallbacks::didOpenFileSystem(const String& name, const String& rootPath) +void FileSystemCallbacks::didOpenFileSystem(const String& name, PassOwnPtr<AsyncFileSystem> asyncFileSystem) { - if (m_successCallback) - m_successCallback->handleEvent(DOMFileSystem::create(name, rootPath).get()); + if (m_successCallback) { + ASSERT(asyncFileSystem); + m_successCallback->handleEvent(DOMFileSystem::create(m_scriptExecutionContext.get(), name, asyncFileSystem.leakPtr()).get()); + m_scriptExecutionContext.clear(); + } m_successCallback.clear(); } diff --git a/WebCore/storage/FileSystemCallbacks.h b/WebCore/fileapi/FileSystemCallbacks.h index e0e78d3..31a2a0c 100644 --- a/WebCore/storage/FileSystemCallbacks.h +++ b/WebCore/fileapi/FileSystemCallbacks.h @@ -33,6 +33,7 @@ #if ENABLE(FILE_SYSTEM) +#include "AsyncFileSystemCallbacks.h" #include "PlatformString.h" #include <wtf/PassRefPtr.h> #include <wtf/Vector.h> @@ -49,10 +50,7 @@ class MetadataCallback; class ScriptExecutionContext; class VoidCallback; -typedef int ExceptionCode; - -// A base class for FileSystem callbacks that bundles successCallback, errorCallback and some closure data for the callbacks. -class FileSystemCallbacksBase : public Noncopyable { +class FileSystemCallbacksBase : public AsyncFileSystemCallbacks { public: virtual ~FileSystemCallbacksBase(); @@ -60,17 +58,17 @@ public: virtual void didSucceed(); // For FileSystemCallbacks. - virtual void didOpenFileSystem(const String& name, const String& rootPath); + virtual void didOpenFileSystem(const String& name, PassOwnPtr<AsyncFileSystem>); // For MetadataCallbacks. virtual void didReadMetadata(double modificationTime); // For EntriesCallbacks. didReadDirectoryEntry is called each time the API reads an entry, and didReadDirectoryDone is called when a chunk of entries have been read (i.e. good time to call back to the application). If hasMore is true there can be more chunks. virtual void didReadDirectoryEntry(const String& name, bool isDirectory); - virtual void didReadDirectoryChunkDone(bool hasMore); + virtual void didReadDirectoryEntries(bool hasMore); // For ErrorCallback. - virtual void didFail(ExceptionCode code); + virtual void didFail(int code); protected: FileSystemCallbacksBase(PassRefPtr<ErrorCallback> errorCallback); @@ -95,7 +93,7 @@ class EntriesCallbacks : public FileSystemCallbacksBase { public: EntriesCallbacks(PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>, DOMFileSystem*, const String& basePath); virtual void didReadDirectoryEntry(const String& name, bool isDirectory); - virtual void didReadDirectoryChunkDone(bool hasMore); + virtual void didReadDirectoryEntries(bool hasMore); private: RefPtr<EntriesCallback> m_successCallback; @@ -106,11 +104,12 @@ private: class FileSystemCallbacks : public FileSystemCallbacksBase { public: - FileSystemCallbacks(PassRefPtr<FileSystemCallback>, PassRefPtr<ErrorCallback>); - virtual void didOpenFileSystem(const String& name, const String& rootPath); + FileSystemCallbacks(PassRefPtr<FileSystemCallback>, PassRefPtr<ErrorCallback>, ScriptExecutionContext*); + virtual void didOpenFileSystem(const String& name, PassOwnPtr<AsyncFileSystem>); private: RefPtr<FileSystemCallback> m_successCallback; + RefPtr<ScriptExecutionContext> m_scriptExecutionContext; }; class MetadataCallbacks : public FileSystemCallbacksBase { diff --git a/WebCore/html/FileThread.cpp b/WebCore/fileapi/FileThread.cpp index 4e48cfb..4e48cfb 100644 --- a/WebCore/html/FileThread.cpp +++ b/WebCore/fileapi/FileThread.cpp diff --git a/WebCore/html/FileThread.h b/WebCore/fileapi/FileThread.h index 16acacc..16acacc 100644 --- a/WebCore/html/FileThread.h +++ b/WebCore/fileapi/FileThread.h diff --git a/WebCore/html/FileThreadTask.h b/WebCore/fileapi/FileThreadTask.h index 8a8ffcb..8a8ffcb 100644 --- a/WebCore/html/FileThreadTask.h +++ b/WebCore/fileapi/FileThreadTask.h diff --git a/WebCore/fileapi/FileWriter.cpp b/WebCore/fileapi/FileWriter.cpp new file mode 100644 index 0000000..7ead354 --- /dev/null +++ b/WebCore/fileapi/FileWriter.cpp @@ -0,0 +1,199 @@ +/* + * 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_WRITER) + +#include "FileWriter.h" + +#include "AsyncFileWriter.h" +#include "Blob.h" +#include "ExceptionCode.h" +#include "FileError.h" +#include "ProgressEvent.h" + +namespace WebCore { + +FileWriter::FileWriter(ScriptExecutionContext* context) + : ActiveDOMObject(context, this) + , m_readyState(INIT) + , m_position(0) + , m_bytesWritten(0) + , m_bytesToWrite(0) +{ +} + +void FileWriter::initialize(PassOwnPtr<AsyncFileWriter> writer, long long length) +{ + ASSERT(!m_writer); + ASSERT(length >= 0); + m_writer = writer; + m_length = length; +} + +FileWriter::~FileWriter() +{ + if (m_readyState == WRITING) + stop(); +} + +bool FileWriter::hasPendingActivity() const +{ + return m_readyState == WRITING || ActiveDOMObject::hasPendingActivity(); +} + +bool FileWriter::canSuspend() const +{ + // FIXME: It is not currently possible to suspend a FileWriter, so pages with FileWriter can not go into page cache. + return false; +} + +void FileWriter::stop() +{ + if (m_writer && m_readyState == WRITING) + m_writer->abort(); + m_readyState = DONE; +} + +void FileWriter::write(Blob* data, ExceptionCode& ec) +{ + ASSERT(m_writer); + if (m_readyState == WRITING) { + ec = INVALID_STATE_ERR; + m_error = FileError::create(ec); + return; + } + + m_readyState = WRITING; + m_bytesWritten = 0; + m_bytesToWrite = data->size(); + fireEvent(eventNames().writestartEvent); + m_writer->write(m_position, data); +} + +void FileWriter::seek(long long position, ExceptionCode& ec) +{ + ASSERT(m_writer); + if (m_readyState == WRITING) { + ec = INVALID_STATE_ERR; + m_error = FileError::create(ec); + return; + } + + m_bytesWritten = 0; + m_bytesToWrite = 0; + if (position > m_length) + position = m_length; + else if (position < 0) + position = m_length + position; + if (position < 0) + position = 0; + m_position = position; +} + +void FileWriter::truncate(long long position, ExceptionCode& ec) +{ + ASSERT(m_writer); + if (m_readyState == WRITING || position >= m_length) { + ec = INVALID_STATE_ERR; + m_error = FileError::create(ec); + return; + } + m_readyState = WRITING; + m_bytesWritten = 0; + m_bytesToWrite = 0; + fireEvent(eventNames().writestartEvent); + m_writer->truncate(position); +} + +void FileWriter::abort(ExceptionCode& ec) +{ + ASSERT(m_writer); + if (m_readyState != WRITING) { + ec = INVALID_STATE_ERR; + m_error = FileError::create(ec); + return; + } + m_error = FileError::create(ABORT_ERR); + m_readyState = DONE; + fireEvent(eventNames().errorEvent); + fireEvent(eventNames().abortEvent); + fireEvent(eventNames().writeendEvent); + m_writer->abort(); +} + +void FileWriter::didWrite(long long bytes, bool complete) +{ + ASSERT(bytes > 0); + ASSERT(bytes + m_bytesWritten > 0); + ASSERT(bytes + m_bytesWritten <= m_bytesToWrite); + m_bytesWritten += bytes; + ASSERT((m_bytesWritten == m_bytesToWrite) == complete); + m_position += bytes; + if (m_position > m_length) + m_length = m_position; + if (complete) + m_readyState = DONE; + fireEvent(eventNames().writeEvent); + if (complete) + fireEvent(eventNames().writeendEvent); +} + +void FileWriter::didTruncate(long long length) +{ + ASSERT(length > 0); + ASSERT(length >= 0); + ASSERT(length < m_length); + m_length = length; + if (m_position > m_length) + m_position = m_length; + m_readyState = DONE; + fireEvent(eventNames().writeEvent); + fireEvent(eventNames().writeendEvent); +} + +void FileWriter::didFail(ExceptionCode ec) +{ + m_error = FileError::create(ec); + m_readyState = DONE; + fireEvent(eventNames().errorEvent); + fireEvent(eventNames().writeendEvent); +} + +void FileWriter::fireEvent(const AtomicString& type) +{ + // FIXME: the current ProgressEvent uses "unsigned long" for total and loaded attributes. Need to talk with the spec writer to resolve the issue. + dispatchEvent(ProgressEvent::create(type, true, static_cast<unsigned>(m_bytesWritten), static_cast<unsigned>(m_bytesToWrite))); +} + +} // namespace WebCore + +#endif // ENABLE(FILE_WRITER) diff --git a/WebCore/html/FileWriter.h b/WebCore/fileapi/FileWriter.h index fd5babf..b0af7ea 100644 --- a/WebCore/html/FileWriter.h +++ b/WebCore/fileapi/FileWriter.h @@ -35,44 +35,54 @@ #include "ActiveDOMObject.h" #include "EventTarget.h" +#include "FileWriterClient.h" +#include <wtf/OwnPtr.h> +#include <wtf/PassOwnPtr.h> #include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> #include <wtf/RefPtr.h> namespace WebCore { +class AsyncFileWriter; class Blob; class FileError; class ScriptExecutionContext; -// FIXME: This is an empty, do-nothing placeholder for implementation yet to come. -class FileWriter : public RefCounted<FileWriter>, public ActiveDOMObject, public EventTarget { +class FileWriter : public RefCounted<FileWriter>, public ActiveDOMObject, public EventTarget, public FileWriterClient { public: static PassRefPtr<FileWriter> create(ScriptExecutionContext* context) { return adoptRef(new FileWriter(context)); } + void initialize(PassOwnPtr<AsyncFileWriter> writer, long long length); + enum ReadyState { - EMPTY = 0, + INIT = 0, WRITING = 1, DONE = 2 }; - void write(Blob*); - void seek(long long position); - void truncate(long long length); - void abort(); + void write(Blob* data, ExceptionCode& ec); + void seek(long long position, ExceptionCode& ec); + void truncate(long long length, ExceptionCode& ec); + void abort(ExceptionCode& ec); + + ReadyState readyState() const { return m_readyState; } + FileError* error() const { return m_error.get(); } + long long position() const { return m_position; } + long long length() const { return m_length; } - ReadyState readyState() const; - FileError* error() const { return m_error; }; - long long position() const { return 0; }; - long long length() const { return 0; }; + // FileWriterClient + void didWrite(long long bytes, bool complete); + void didTruncate(long long length); + void didFail(ExceptionCode ec); // ActiveDOMObject virtual bool canSuspend() const; - virtual void stop(); virtual bool hasPendingActivity() const; + virtual void stop(); // EventTarget virtual FileWriter* toFileWriter() { return this; } @@ -87,7 +97,7 @@ public: DEFINE_ATTRIBUTE_EVENT_LISTENER(abort); DEFINE_ATTRIBUTE_EVENT_LISTENER(error); DEFINE_ATTRIBUTE_EVENT_LISTENER(writeend); - + private: FileWriter(ScriptExecutionContext*); @@ -101,8 +111,16 @@ private: virtual EventTargetData* eventTargetData() { return &m_eventTargetData; } virtual EventTargetData* ensureEventTargetData() { return &m_eventTargetData; } - RefPtr<FileError*> m_error; + void fireEvent(const AtomicString& type); + + RefPtr<FileError> m_error; EventTargetData m_eventTargetData; + OwnPtr<AsyncFileWriter> m_writer; + ReadyState m_readyState; + long long m_position; + long long m_length; + long long m_bytesWritten; + long long m_bytesToWrite; }; } // namespace WebCore diff --git a/WebCore/html/FileWriter.idl b/WebCore/fileapi/FileWriter.idl index bb95ee1..bb95ee1 100644 --- a/WebCore/html/FileWriter.idl +++ b/WebCore/fileapi/FileWriter.idl diff --git a/WebCore/fileapi/FileWriterClient.h b/WebCore/fileapi/FileWriterClient.h new file mode 100644 index 0000000..091b1c1 --- /dev/null +++ b/WebCore/fileapi/FileWriterClient.h @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef FileWriterClient_h +#define FileWriterClient_h + +#if ENABLE(FILE_WRITER) + +#include "ExceptionCode.h" + +namespace WebCore { + +class FileWriterClient { +public: + virtual ~FileWriterClient() {} + + virtual void didWrite(long long bytes, bool complete) = 0; + virtual void didTruncate(long long position) = 0; + virtual void didFail(ExceptionCode) = 0; +}; + +} // namespace + +#endif // ENABLE(FILE_WRITER) + +#endif // FileWriterClient_h diff --git a/WebCore/storage/Flags.h b/WebCore/fileapi/Flags.h index ffe3403..30884fc 100644 --- a/WebCore/storage/Flags.h +++ b/WebCore/fileapi/Flags.h @@ -33,6 +33,7 @@ #if ENABLE(FILE_SYSTEM) +#include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> namespace WebCore { diff --git a/WebCore/storage/Flags.idl b/WebCore/fileapi/Flags.idl index cfe73d2..cfe73d2 100644 --- a/WebCore/storage/Flags.idl +++ b/WebCore/fileapi/Flags.idl diff --git a/WebCore/fileapi/LocalFileSystem.cpp b/WebCore/fileapi/LocalFileSystem.cpp new file mode 100644 index 0000000..59ec2a1 --- /dev/null +++ b/WebCore/fileapi/LocalFileSystem.cpp @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "LocalFileSystem.h" + +#if PLATFORM(CHROMIUM) +#error "Chromium should not compile this file and instead define its own version of these factories." +#endif + +#if ENABLE(FILE_SYSTEM) + +#include "CrossThreadTask.h" +#include "DOMFileSystem.h" +#include "ErrorCallback.h" +#include "ExceptionCode.h" +#include "FileError.h" +#include "FileSystemCallback.h" +#include "FileSystemCallbacks.h" +#include "ScriptExecutionContext.h" +#include "SecurityOrigin.h" +#include <wtf/PassRefPtr.h> + +namespace WebCore { + +PassRefPtr<LocalFileSystem> LocalFileSystem::create(const String& basePath) +{ + return adoptRef(new LocalFileSystem(basePath)); +} + +static void openFileSystem(ScriptExecutionContext*, const String& basePath, const String& identifier, AsyncFileSystem::Type type, PassOwnPtr<FileSystemCallbacks> callbacks) +{ + AsyncFileSystem::openFileSystem(basePath, identifier, type, callbacks); +} + +void LocalFileSystem::requestFileSystem(ScriptExecutionContext* context, AsyncFileSystem::Type type, long long, PassRefPtr<FileSystemCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback) +{ + if (type != AsyncFileSystem::Temporary && type != AsyncFileSystem::Persistent) { + DOMFileSystem::scheduleCallback(context, errorCallback, FileError::create(INVALID_MODIFICATION_ERR)); + return; + } + + // AsyncFileSystem::openFileSystem calls callbacks synchronously, so the method needs to be called asynchronously. + context->postTask(createCallbackTask(&openFileSystem, m_basePath, context->securityOrigin()->databaseIdentifier(), type, new FileSystemCallbacks(successCallback, errorCallback, context))); +} + +} // namespace + +#endif // ENABLE(FILE_SYSTEM) diff --git a/WebCore/storage/DOMFileSystem.h b/WebCore/fileapi/LocalFileSystem.h index b87aaaf..48cfa8f 100644 --- a/WebCore/storage/DOMFileSystem.h +++ b/WebCore/fileapi/LocalFileSystem.h @@ -28,38 +28,40 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef DOMFileSystem_h -#define DOMFileSystem_h +#ifndef LocalFileSystem_h +#define LocalFileSystem_h #if ENABLE(FILE_SYSTEM) +#include "AsyncFileSystem.h" #include "PlatformString.h" #include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> namespace WebCore { -class DirectoryEntry; +class ErrorCallback; +class FileSystemCallback; +class ScriptExecutionContext; -class DOMFileSystem : public RefCounted<DOMFileSystem> { +class LocalFileSystem : public RefCounted<LocalFileSystem> { public: - static PassRefPtr<DOMFileSystem> create(const String& name, const String& rootPath) - { - return adoptRef(new DOMFileSystem(name, rootPath)); - } + static PassRefPtr<LocalFileSystem> create(const String& basePath); + virtual ~LocalFileSystem() { } - const String& name() const { return m_name; } - PassRefPtr<DirectoryEntry> root(); + void requestFileSystem(ScriptExecutionContext*, AsyncFileSystem::Type, long long size, PassRefPtr<FileSystemCallback>, PassRefPtr<ErrorCallback>); -private: - DOMFileSystem(const String& name, const String& rootPath); +protected: + LocalFileSystem(const String& basePath) + : m_basePath(basePath) + { + } - String m_rootPath; - String m_name; + String m_basePath; }; } // namespace #endif // ENABLE(FILE_SYSTEM) -#endif // DOMFileSystem_h +#endif // LocalFileSystem_h diff --git a/WebCore/storage/Metadata.h b/WebCore/fileapi/Metadata.h index 0b06f90..1fec943 100644 --- a/WebCore/storage/Metadata.h +++ b/WebCore/fileapi/Metadata.h @@ -43,7 +43,9 @@ public: { return adoptRef(new Metadata(modificationTime)); } - double modificationTime() const { return m_modificationTime; } + + // Needs to return epoch time in milliseconds for Date. + double modificationTime() const { return m_modificationTime * 1000.0; } private: Metadata(double modificationTime) diff --git a/WebCore/storage/Metadata.idl b/WebCore/fileapi/Metadata.idl index 711fae8..a5a90bc 100644 --- a/WebCore/storage/Metadata.idl +++ b/WebCore/fileapi/Metadata.idl @@ -32,6 +32,6 @@ module storage { interface [ Conditional=FILE_SYSTEM ] Metadata { - readonly attribute double modificationTime; + readonly attribute Date modificationTime; }; } diff --git a/WebCore/storage/MetadataCallback.h b/WebCore/fileapi/MetadataCallback.h index 3d57400..3d57400 100644 --- a/WebCore/storage/MetadataCallback.h +++ b/WebCore/fileapi/MetadataCallback.h diff --git a/WebCore/storage/MetadataCallback.idl b/WebCore/fileapi/MetadataCallback.idl index 44ca180..44ca180 100644 --- a/WebCore/storage/MetadataCallback.idl +++ b/WebCore/fileapi/MetadataCallback.idl diff --git a/WebCore/fileapi/ThreadableBlobRegistry.cpp b/WebCore/fileapi/ThreadableBlobRegistry.cpp new file mode 100644 index 0000000..034557b --- /dev/null +++ b/WebCore/fileapi/ThreadableBlobRegistry.cpp @@ -0,0 +1,130 @@ +/* + * 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 "ThreadableBlobRegistry.h" + +#include "BlobData.h" +#include "BlobRegistry.h" +#include "ScriptExecutionContext.h" +#include <wtf/MainThread.h> + +namespace WebCore { + +struct BlobRegistryContext { + BlobRegistryContext(const KURL& url, PassOwnPtr<BlobData> blobData) + : url(url.copy()) + , blobData(blobData) + { + } + + BlobRegistryContext(const KURL& url, const KURL& srcURL) + : url(url.copy()) + , srcURL(srcURL.copy()) + { + } + + BlobRegistryContext(const KURL& url) + : url(url.copy()) + { + } + + KURL url; + KURL srcURL; + OwnPtr<BlobData> blobData; +}; + +#if ENABLE(BLOB) + +static void registerBlobURLTask(void* context) +{ + OwnPtr<BlobRegistryContext> blobRegistryContext = adoptPtr(static_cast<BlobRegistryContext*>(context)); + blobRegistry().registerBlobURL(blobRegistryContext->url, blobRegistryContext->blobData.release()); +} + +void ThreadableBlobRegistry::registerBlobURL(ScriptExecutionContext*, const KURL& url, PassOwnPtr<BlobData> blobData) +{ + if (isMainThread()) + blobRegistry().registerBlobURL(url, blobData); + else { + OwnPtr<BlobRegistryContext> context = adoptPtr(new BlobRegistryContext(url, blobData)); + callOnMainThread(®isterBlobURLTask, context.leakPtr()); + } +} + +static void registerBlobURLFromTask(void* context) +{ + OwnPtr<BlobRegistryContext> blobRegistryContext = adoptPtr(static_cast<BlobRegistryContext*>(context)); + blobRegistry().registerBlobURL(blobRegistryContext->url, blobRegistryContext->srcURL); +} + +void ThreadableBlobRegistry::registerBlobURL(ScriptExecutionContext*, const KURL& url, const KURL& srcURL) +{ + if (isMainThread()) + blobRegistry().registerBlobURL(url, srcURL); + else { + OwnPtr<BlobRegistryContext> context = adoptPtr(new BlobRegistryContext(url, srcURL)); + callOnMainThread(®isterBlobURLFromTask, context.leakPtr()); + } +} + +static void unregisterBlobURLTask(void* context) +{ + OwnPtr<BlobRegistryContext> blobRegistryContext = adoptPtr(static_cast<BlobRegistryContext*>(context)); + blobRegistry().unregisterBlobURL(blobRegistryContext->url); +} + +void ThreadableBlobRegistry::unregisterBlobURL(ScriptExecutionContext*, const KURL& url) +{ + if (isMainThread()) + blobRegistry().unregisterBlobURL(url); + else { + OwnPtr<BlobRegistryContext> context = adoptPtr(new BlobRegistryContext(url)); + callOnMainThread(&unregisterBlobURLTask, context.leakPtr()); + } +} + +#else + +void ThreadableBlobRegistry::registerBlobURL(ScriptExecutionContext*, const KURL&, PassOwnPtr<BlobData>) +{ +} + +void ThreadableBlobRegistry::registerBlobURL(ScriptExecutionContext*, const KURL&, const KURL&) +{ +} + +void ThreadableBlobRegistry::unregisterBlobURL(ScriptExecutionContext*, const KURL&) +{ +} +#endif // ENABL(BLOB) + +} // namespace WebCore diff --git a/WebCore/html/ThreadableBlobRegistry.h b/WebCore/fileapi/ThreadableBlobRegistry.h index 7dce6bb..7dce6bb 100644 --- a/WebCore/html/ThreadableBlobRegistry.h +++ b/WebCore/fileapi/ThreadableBlobRegistry.h diff --git a/WebCore/history/CachedFrame.cpp b/WebCore/history/CachedFrame.cpp index 1f4895f..f0a4fed 100644 --- a/WebCore/history/CachedFrame.cpp +++ b/WebCore/history/CachedFrame.cpp @@ -33,6 +33,7 @@ #include "Frame.h" #include "FrameLoaderClient.h" #include "FrameView.h" +#include "HistoryItem.h" #include "Logging.h" #include "PageTransitionEvent.h" #include <wtf/text/CString.h> @@ -106,6 +107,10 @@ void CachedFrameBase::restore() m_childFrames[i]->open(); m_document->enqueuePageshowEvent(PageshowEventPersisted); + + HistoryItem* historyItem = frame->loader()->history()->currentItem(); + m_document->enqueuePopstateEvent(historyItem && historyItem->stateObject() ? historyItem->stateObject() : SerializedScriptValue::nullValue()); + #if ENABLE(TOUCH_EVENTS) if (m_document->hasListenerType(Document::TOUCH_LISTENER)) m_document->page()->chrome()->client()->needTouchEvents(true); diff --git a/WebCore/history/HistoryItem.cpp b/WebCore/history/HistoryItem.cpp index 42adcfb..8a84e2e 100644 --- a/WebCore/history/HistoryItem.cpp +++ b/WebCore/history/HistoryItem.cpp @@ -446,6 +446,16 @@ HistoryItem* HistoryItem::childItemWithTarget(const String& target) const return 0; } +HistoryItem* HistoryItem::childItemWithDocumentSequenceNumber(long long number) const +{ + unsigned size = m_children.size(); + for (unsigned i = 0; i < size; ++i) { + if (m_children[i]->documentSequenceNumber() == number) + return m_children[i].get(); + } + return 0; +} + // <rdar://problem/4895849> HistoryItem::findTargetItem() should be replaced with a non-recursive method. HistoryItem* HistoryItem::findTargetItem() { @@ -480,6 +490,8 @@ void HistoryItem::clearChildren() m_children.clear(); } +// Does a recursive check that this item and its descendants have the same +// document sequence numbers as the other item. bool HistoryItem::hasSameDocuments(HistoryItem* otherItem) { if (documentSequenceNumber() != otherItem->documentSequenceNumber()) @@ -487,12 +499,32 @@ bool HistoryItem::hasSameDocuments(HistoryItem* otherItem) if (children().size() != otherItem->children().size()) return false; - + for (size_t i = 0; i < children().size(); i++) { - if (!children()[i]->hasSameDocuments(otherItem->children()[i].get())) + HistoryItem* child = children()[i].get(); + HistoryItem* otherChild = otherItem->childItemWithDocumentSequenceNumber(child->documentSequenceNumber()); + if (!otherChild || !child->hasSameDocuments(otherChild)) return false; } - + + return true; +} + +// Does a non-recursive check that this item and its immediate children have the +// same frames as the other item. +bool HistoryItem::hasSameFrames(HistoryItem* otherItem) +{ + if (target() != otherItem->target()) + return false; + + if (children().size() != otherItem->children().size()) + return false; + + for (size_t i = 0; i < children().size(); i++) { + if (!otherItem->childItemWithTarget(children()[i]->target())) + return false; + } + return true; } diff --git a/WebCore/history/HistoryItem.h b/WebCore/history/HistoryItem.h index dfdbc43..b11a92e 100644 --- a/WebCore/history/HistoryItem.h +++ b/WebCore/history/HistoryItem.h @@ -155,12 +155,14 @@ public: void addChildItem(PassRefPtr<HistoryItem>); void setChildItem(PassRefPtr<HistoryItem>); HistoryItem* childItemWithTarget(const String&) const; + HistoryItem* childItemWithDocumentSequenceNumber(long long number) const; HistoryItem* targetItem(); const HistoryItemVector& children() const; bool hasChildren() const; void clearChildren(); bool hasSameDocuments(HistoryItem* otherItem); + bool hasSameFrames(HistoryItem* otherItem); // This should not be called directly for HistoryItems that are already included // in GlobalHistory. The WebKit api for this is to use -[WebHistory setLastVisitedTimeInterval:forItem:] instead. diff --git a/WebCore/html/DateComponents.cpp b/WebCore/html/DateComponents.cpp index 39dd733..8dced1d 100644 --- a/WebCore/html/DateComponents.cpp +++ b/WebCore/html/DateComponents.cpp @@ -41,10 +41,15 @@ using namespace std; namespace WebCore { -// The oldest day of Gregorian Calendar is 1582-10-15. We don't support dates older than it. -static const int gregorianStartYear = 1582; -static const int gregorianStartMonth = 9; // This is October, since months are 0 based. -static const int gregorianStartDay = 15; +// HTML5 uses ISO-8601 format with year >= 1. Gregorian calendar started in +// 1582. However, we need to support 0001-01-01 in Gregorian calendar rule. +static const int minimumYear = 1; +// Date in ECMAScript can't represent dates later than 275760-09-13T00:00Z. +// So, we have the same upper limit in HTML5 dates. +static const int maximumYear = 275760; +static const int maximumMonthInMaximumYear = 8; // This is September, since months are 0 based. +static const int maximumDayInMaximumMonth = 13; +static const int maximumWeekInMaximumYear = 37; // The week of 275760-09-13 static const int daysInMonth[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; @@ -134,19 +139,47 @@ bool DateComponents::parseYear(const UChar* src, unsigned length, unsigned start int year; if (!toInt(src, length, start, digitsLength, year)) return false; - // No support for years before Gregorian calendar. - if (year < gregorianStartYear) + if (year < minimumYear || year > maximumYear) return false; m_year = year; end = start + digitsLength; return true; } -static bool beforeGregorianStartDate(int year, int month, int monthDay) +static bool withinHTMLDateLimits(int year, int month) { - return year < gregorianStartYear - || (year == gregorianStartYear && month < gregorianStartMonth) - || (year == gregorianStartYear && month == gregorianStartMonth && monthDay < gregorianStartDay); + if (year < minimumYear) + return false; + if (year < maximumYear) + return true; + return month <= maximumMonthInMaximumYear; +} + +static bool withinHTMLDateLimits(int year, int month, int monthDay) +{ + if (year < minimumYear) + return false; + if (year < maximumYear) + return true; + if (month < maximumMonthInMaximumYear) + return true; + return monthDay <= maximumDayInMaximumMonth; +} + +static bool withinHTMLDateLimits(int year, int month, int monthDay, int hour, int minute, int second, int millisecond) +{ + if (year < minimumYear) + return false; + if (year < maximumYear) + return true; + if (month < maximumMonthInMaximumYear) + return true; + if (monthDay < maximumDayInMaximumMonth) + return true; + if (monthDay > maximumDayInMaximumMonth) + return false; + // (year, month, monthDay) = (maximumYear, maximumMonthInMaximumYear, maximumDayInMaximumMonth) + return !hour && !minute && !second && !millisecond; } bool DateComponents::addDay(int dayDiff) @@ -167,12 +200,12 @@ bool DateComponents::addDay(int dayDiff) if (month >= 12) { // month is 0-origin. month = 0; ++year; - if (year < 0) // Check for overflow. - return false; } maxDay = maxDayOfMonth(year, month); } } + if (!withinHTMLDateLimits(year, month, day)) + return false; m_year = year; m_month = month; } else if (day < 1) { @@ -189,11 +222,14 @@ bool DateComponents::addDay(int dayDiff) } day = maxDayOfMonth(year, month); } - if (beforeGregorianStartDate(year, month, day)) - return false; } + if (!withinHTMLDateLimits(year, month, day)) + return false; m_year = year; m_month = month; + } else { + if (!withinHTMLDateLimits(m_year, m_month, day)) + return false; } m_monthDay = day; return true; @@ -201,8 +237,12 @@ bool DateComponents::addDay(int dayDiff) bool DateComponents::addMinute(int minute) { + // This function is used to adjust timezone offset. So m_year, m_month, + // m_monthDay have values between the lower and higher limits. + ASSERT(withinHTMLDateLimits(m_year, m_month, m_monthDay)); + int carry; - // min can be negative or greater than 59. + // minute can be negative or greater than 59. minute += m_minute; if (minute > 59) { carry = minute / 60; @@ -213,6 +253,8 @@ bool DateComponents::addMinute(int minute) carry = -carry; ASSERT(minute >= 0 && minute <= 59); } else { + if (!withinHTMLDateLimits(m_year, m_month, m_monthDay, m_hour, minute, m_second, m_millisecond)) + return false; m_minute = minute; return true; } @@ -227,12 +269,16 @@ bool DateComponents::addMinute(int minute) carry = -carry; ASSERT(hour >= 0 && hour <= 23); } else { + if (!withinHTMLDateLimits(m_year, m_month, m_monthDay, hour, minute, m_second, m_millisecond)) + return false; m_minute = minute; m_hour = hour; return true; } if (!addDay(carry)) return false; + if (!withinHTMLDateLimits(m_year, m_month, m_monthDay, hour, minute, m_second, m_millisecond)) + return false; m_minute = minute; m_hour = hour; return true; @@ -298,8 +344,7 @@ bool DateComponents::parseMonth(const UChar* src, unsigned length, unsigned star if (!toInt(src, length, index, 2, month) || month < 1 || month > 12) return false; --month; - // No support for months before Gregorian calendar. - if (beforeGregorianStartDate(m_year, month, gregorianStartDay)) + if (!withinHTMLDateLimits(m_year, month)) return false; m_month = month; end = index + 2; @@ -323,8 +368,7 @@ bool DateComponents::parseDate(const UChar* src, unsigned length, unsigned start int day; if (!toInt(src, length, index, 2, day) || day < 1 || day > maxDayOfMonth(m_year, m_month)) return false; - // No support for dates before Gregorian calendar. - if (m_year == gregorianStartYear && m_month == gregorianStartMonth && day < gregorianStartDay) + if (!withinHTMLDateLimits(m_year, m_month, day)) return false; m_monthDay = day; end = index + 2; @@ -352,8 +396,7 @@ bool DateComponents::parseWeek(const UChar* src, unsigned length, unsigned start int week; if (!toInt(src, length, index, 2, week) || week < 1 || week > maxWeekNumberInYear()) return false; - // No support for years older than or equals to Gregorian calendar start year. - if (m_year <= gregorianStartYear) + if (m_year == maximumYear && week > maximumWeekInMaximumYear) return false; m_week = week; end = index + 2; @@ -429,6 +472,8 @@ bool DateComponents::parseDateTimeLocal(const UChar* src, unsigned length, unsig ++index; if (!parseTime(src, length, index, end)) return false; + if (!withinHTMLDateLimits(m_year, m_month, m_monthDay, m_hour, m_minute, m_second, m_millisecond)) + return false; m_type = DateTimeLocal; return true; } @@ -448,6 +493,8 @@ bool DateComponents::parseDateTime(const UChar* src, unsigned length, unsigned s return false; if (!parseTimeZone(src, length, index, end)) return false; + if (!withinHTMLDateLimits(m_year, m_month, m_monthDay, m_hour, m_minute, m_second, m_millisecond)) + return false; m_type = DateTime; return true; } @@ -485,7 +532,7 @@ bool DateComponents::setMillisecondsSinceEpochForDate(double ms) return false; if (!setMillisecondsSinceEpochForDateInternal(round(ms))) return false; - if (beforeGregorianStartDate(m_year, m_month, m_monthDay)) + if (!withinHTMLDateLimits(m_year, m_month, m_monthDay)) return false; m_type = Date; return true; @@ -500,7 +547,7 @@ bool DateComponents::setMillisecondsSinceEpochForDateTime(double ms) setMillisecondsSinceMidnightInternal(positiveFmod(ms, msPerDay)); if (!setMillisecondsSinceEpochForDateInternal(ms)) return false; - if (beforeGregorianStartDate(m_year, m_month, m_monthDay)) + if (!withinHTMLDateLimits(m_year, m_month, m_monthDay, m_hour, m_minute, m_second, m_millisecond)) return false; m_type = DateTime; return true; @@ -522,8 +569,7 @@ bool DateComponents::setMillisecondsSinceEpochForMonth(double ms) return false; if (!setMillisecondsSinceEpochForDateInternal(round(ms))) return false; - // Ignore m_monthDay updated by setMillisecondsSinceEpochForDateInternal(). - if (beforeGregorianStartDate(m_year, m_month, gregorianStartDay)) + if (!withinHTMLDateLimits(m_year, m_month)) return false; m_type = Month; return true; @@ -546,11 +592,11 @@ bool DateComponents::setMonthsSinceEpoch(double months) months = round(months); double doubleMonth = positiveFmod(months, 12); double doubleYear = 1970 + (months - doubleMonth) / 12; - if (doubleYear < gregorianStartYear || numeric_limits<int>::max() < doubleYear) + if (doubleYear < minimumYear || maximumYear < doubleYear) return false; int year = static_cast<int>(doubleYear); int month = static_cast<int>(doubleMonth); - if (beforeGregorianStartDate(year, month, gregorianStartDay)) + if (!withinHTMLDateLimits(year, month)) return false; m_year = year; m_month = month; @@ -576,8 +622,7 @@ bool DateComponents::setMillisecondsSinceEpochForWeek(double ms) ms = round(ms); m_year = msToYear(ms); - // We don't support gregorianStartYear. Week numbers are undefined in that year. - if (m_year <= gregorianStartYear) + if (m_year < minimumYear || m_year > maximumYear) return false; int yearDay = dayInYear(ms, m_year); @@ -585,7 +630,7 @@ bool DateComponents::setMillisecondsSinceEpochForWeek(double ms) if (yearDay < offset) { // The day belongs to the last week of the previous year. m_year--; - if (m_year <= gregorianStartYear) + if (m_year <= minimumYear) return false; m_week = maxWeekNumberInYear(); } else { @@ -594,6 +639,8 @@ bool DateComponents::setMillisecondsSinceEpochForWeek(double ms) m_year++; m_week = 1; } + if (m_year > maximumYear || (m_year == maximumYear && m_week > maximumWeekInMaximumYear)) + return false; } m_type = Week; return true; diff --git a/WebCore/html/DateComponents.h b/WebCore/html/DateComponents.h index efc3248..9bce0c3 100644 --- a/WebCore/html/DateComponents.h +++ b/WebCore/html/DateComponents.h @@ -137,17 +137,16 @@ public: // Minimum and maxmimum limits for setMillisecondsSince*(), // setMonthsSinceEpoch(), millisecondsSinceEpoch(), and monthsSinceEpoch(). - static inline double minimumDate() { return -12219292800000.0; } // This means 1582-10-15T00:00Z. - static inline double minimumDateTime() { return -12219292800000.0; } // ditto. - static inline double minimumMonth() { return (1582.0 - 1970) * 12 + 10 - 1; } // 1582-10 + static inline double minimumDate() { return -62135596800000.0; } // 0001-01-01T00:00Z + static inline double minimumDateTime() { return -62135596800000.0; } // ditto. + static inline double minimumMonth() { return (1 - 1970) * 12.0 + 1 - 1; } // 0001-01 static inline double minimumTime() { return 0; } // 00:00:00.000 - static inline double minimumWeek() { return -12212380800000.0; } // 1583-01-03, the first Monday of 1583. - static inline double maximumDate() { return std::numeric_limits<double>::max(); } - static inline double maximumDateTime() { return std::numeric_limits<double>::max(); } - // DateComponents::m_year can't represent a year greater than INT_MAX. - static inline double maximumMonth() { return (std::numeric_limits<int>::max() - 1970) * 12.0 + 12 - 1; } + static inline double minimumWeek() { return -62135596800000.0; } // 0001-01-01, the first Monday of 0001. + static inline double maximumDate() { return 8640000000000000.0; } // 275760-09-13T00:00Z + static inline double maximumDateTime() { return 8640000000000000.0; } // ditto. + static inline double maximumMonth() { return (275760 - 1970) * 12.0 + 9 - 1; } // 275760-09 static inline double maximumTime() { return 86399999; } // 23:59:59.999 - static inline double maximumWeek() { return std::numeric_limits<double>::max(); } + static inline double maximumWeek() { return 8639999568000000.0; } // 275760-09-08, the Monday of the week including 275760-09-13. private: // Returns the maximum week number in this DateComponents's year. diff --git a/WebCore/html/File.cpp b/WebCore/html/File.cpp deleted file mode 100644 index 253cb4d..0000000 --- a/WebCore/html/File.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2008 Apple Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include "File.h" - -#include "BlobData.h" -#include "FileSystem.h" -#include "MIMETypeRegistry.h" - -namespace WebCore { - -File::File(ScriptExecutionContext* scriptExecutionContext, const String& path) - : Blob(scriptExecutionContext, path) -{ - Init(); -} - -File::File(ScriptExecutionContext* scriptExecutionContext, const String& path, const KURL& url, const String& type) - : Blob(scriptExecutionContext, url, type, BlobDataItem::toEndOfFile) -{ - // FIXME: To be removed when we switch to using BlobData. - m_items.append(FileBlobItem::create(path)); -} - -#if ENABLE(DIRECTORY_UPLOAD) -File::File(ScriptExecutionContext* scriptExecutionContext, const String& relativePath, const String& filePath) - : Blob(scriptExecutionContext, FileBlobItem::create(filePath, relativePath)) -{ - Init(); -} -#endif - -void File::Init() -{ - // We don't use MIMETypeRegistry::getMIMETypeForPath() because it returns "application/octet-stream" upon failure. - const String& fileName = name(); - size_t index = fileName.reverseFind('.'); - if (index != notFound) - m_type = MIMETypeRegistry::getMIMETypeForExtension(fileName.substring(index + 1)); -} - -const String& File::name() const -{ - return items().at(0)->toFileBlobItem()->name(); -} - -#if ENABLE(DIRECTORY_UPLOAD) -const String& File::webkitRelativePath() const -{ - return items().at(0)->toFileBlobItem()->relativePath(); -} -#endif - -} // namespace WebCore diff --git a/WebCore/html/FormDataList.cpp b/WebCore/html/FormDataList.cpp index 94d0031..4503fd2 100644 --- a/WebCore/html/FormDataList.cpp +++ b/WebCore/html/FormDataList.cpp @@ -33,20 +33,17 @@ FormDataList::FormDataList(const TextEncoding& c) void FormDataList::appendString(const String& s) { CString cstr = m_encoding.encode(s.characters(), s.length(), EntitiesForUnencodables); - m_items.append(StringBlobItem::create(normalizeLineEndingsToCRLF(cstr))); + m_items.append(normalizeLineEndingsToCRLF(cstr)); } void FormDataList::appendString(const CString& s) { - m_items.append(StringBlobItem::create(s)); + m_items.append(s); } -void FormDataList::appendBlob(const String& key, PassRefPtr<Blob> blob) +void FormDataList::appendBlob(PassRefPtr<Blob> blob) { - appendString(key); - const BlobItemList& items = blob->items(); - for (size_t i = 0; i < items.size(); ++i) - m_items.append(items.at(i)); + m_items.append(blob); } } // namespace diff --git a/WebCore/html/FormDataList.h b/WebCore/html/FormDataList.h index 38b07f9..8e1a937 100644 --- a/WebCore/html/FormDataList.h +++ b/WebCore/html/FormDataList.h @@ -30,6 +30,20 @@ namespace WebCore { class FormDataList { public: + class Item { + public: + Item() { } + Item(const WTF::CString& data) : m_data(data) { } + Item(PassRefPtr<Blob> blob) : m_blob(blob) { } + + const WTF::CString& data() const { return m_data; } + Blob* blob() const { return m_blob.get(); } + + private: + WTF::CString m_data; + RefPtr<Blob> m_blob; + }; + FormDataList(const TextEncoding&); void appendData(const String& key, const String& value) @@ -47,17 +61,22 @@ public: appendString(key); appendString(String::number(value)); } - void appendBlob(const String& key, PassRefPtr<Blob>); + void appendBlob(const String& key, PassRefPtr<Blob> blob) + { + appendString(key); + appendBlob(blob); + } - const BlobItemList& items() const { return m_items; } + const Vector<Item>& items() const { return m_items; } const TextEncoding& encoding() const { return m_encoding; } private: void appendString(const CString&); void appendString(const String&); + void appendBlob(PassRefPtr<Blob>); TextEncoding m_encoding; - BlobItemList m_items; + Vector<Item> m_items; }; } // namespace WebCore diff --git a/WebCore/html/HTMLAnchorElement.idl b/WebCore/html/HTMLAnchorElement.idl index d57fcb6..f5e1bd9 100644 --- a/WebCore/html/HTMLAnchorElement.idl +++ b/WebCore/html/HTMLAnchorElement.idl @@ -24,7 +24,7 @@ module html { attribute [Reflect] DOMString accessKey; attribute [Reflect] DOMString charset; attribute [Reflect] DOMString coords; - attribute [Reflect,URL] DOMString href; + attribute [Reflect, URL] DOMString href; attribute [Reflect] DOMString hreflang; attribute [Reflect] DOMString name; attribute [Reflect] DOMString rel; diff --git a/WebCore/html/HTMLAreaElement.idl b/WebCore/html/HTMLAreaElement.idl index 64c6468..a77e615 100644 --- a/WebCore/html/HTMLAreaElement.idl +++ b/WebCore/html/HTMLAreaElement.idl @@ -24,7 +24,7 @@ module html { attribute [Reflect] DOMString accessKey; attribute [Reflect] DOMString alt; attribute [Reflect] DOMString coords; - attribute [Reflect,URL] DOMString href; + attribute [Reflect, URL] DOMString href; attribute [Reflect] boolean noHref; attribute [Reflect] DOMString shape; attribute [Reflect] DOMString target; diff --git a/WebCore/html/HTMLAttributeNames.in b/WebCore/html/HTMLAttributeNames.in index b4cdb02..103d2c6 100644 --- a/WebCore/html/HTMLAttributeNames.in +++ b/WebCore/html/HTMLAttributeNames.in @@ -223,6 +223,7 @@ onwebkitanimationiteration onwebkitanimationend onwebkitbeginfullscreen onwebkitendfullscreen +onwebkitfullscreenchange onwebkittransitionend optimum pattern diff --git a/WebCore/html/HTMLBaseElement.cpp b/WebCore/html/HTMLBaseElement.cpp index a3095d1..0dd16fa 100644 --- a/WebCore/html/HTMLBaseElement.cpp +++ b/WebCore/html/HTMLBaseElement.cpp @@ -24,11 +24,8 @@ #include "HTMLBaseElement.h" #include "Attribute.h" -#include "CSSHelper.h" #include "Document.h" -#include "Frame.h" #include "HTMLNames.h" -#include "XSSAuditor.h" namespace WebCore { @@ -45,47 +42,34 @@ PassRefPtr<HTMLBaseElement> HTMLBaseElement::create(const QualifiedName& tagName return adoptRef(new HTMLBaseElement(tagName, document)); } -void HTMLBaseElement::parseMappedAttribute(Attribute* attr) +void HTMLBaseElement::parseMappedAttribute(Attribute* attribute) { - if (attr->name() == hrefAttr) { - m_hrefAttrValue = attr->value(); - m_href = deprecatedParseURL(attr->value()); - process(); - } else if (attr->name() == targetAttr) { - m_target = attr->value(); - process(); - } else - HTMLElement::parseMappedAttribute(attr); + if (attribute->name() == hrefAttr || attribute->name() == targetAttr) + document()->processBaseElement(); + else + HTMLElement::parseMappedAttribute(attribute); } void HTMLBaseElement::insertedIntoDocument() { HTMLElement::insertedIntoDocument(); - process(); + document()->processBaseElement(); } void HTMLBaseElement::removedFromDocument() { HTMLElement::removedFromDocument(); - - // Since the document doesn't have a base element, clear the base URL and target. - // FIXME: This does not handle the case of multiple base elements correctly. - document()->setBaseElementURL(KURL()); - document()->setBaseElementTarget(String()); + document()->processBaseElement(); } -void HTMLBaseElement::process() +bool HTMLBaseElement::isURLAttribute(Attribute* attribute) const { - if (!inDocument()) - return; - - if (!m_href.isEmpty() && (!document()->frame() || document()->frame()->script()->xssAuditor()->canSetBaseElementURL(m_hrefAttrValue))) - document()->setBaseElementURL(KURL(document()->url(), m_href)); - - if (!m_target.isEmpty()) - document()->setBaseElementTarget(m_target); + return attribute->name() == hrefAttr; +} - // FIXME: Changing a document's base URL should probably automatically update the resolved relative URLs of all images, stylesheets, etc. +String HTMLBaseElement::target() const +{ + return fastGetAttribute(targetAttr); } } diff --git a/WebCore/html/HTMLBaseElement.h b/WebCore/html/HTMLBaseElement.h index aa1454f..fd3cef6 100644 --- a/WebCore/html/HTMLBaseElement.h +++ b/WebCore/html/HTMLBaseElement.h @@ -34,20 +34,11 @@ public: private: HTMLBaseElement(const QualifiedName&, Document*); - virtual String target() const { return m_target; } - + virtual String target() const; + virtual bool isURLAttribute(Attribute*) const; virtual void parseMappedAttribute(Attribute*); virtual void insertedIntoDocument(); virtual void removedFromDocument(); - - void process(); - - void setHref(const String&); - void setTarget(const String&); - - String m_hrefAttrValue; - String m_href; - String m_target; }; } // namespace diff --git a/WebCore/html/HTMLBaseElement.idl b/WebCore/html/HTMLBaseElement.idl index 8bf82a9..2750c9e 100644 --- a/WebCore/html/HTMLBaseElement.idl +++ b/WebCore/html/HTMLBaseElement.idl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006, 2009 Apple Inc. All rights reserved. + * Copyright (C) 2006, 2009, 2010 Apple Inc. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -20,7 +20,7 @@ module html { interface HTMLBaseElement : HTMLElement { - attribute [Reflect] DOMString href; + attribute [Reflect, URL] DOMString href; attribute [Reflect] DOMString target; }; diff --git a/WebCore/html/HTMLBlockquoteElement.cpp b/WebCore/html/HTMLBlockquoteElement.cpp index cacd8b4..726bc0f 100644 --- a/WebCore/html/HTMLBlockquoteElement.cpp +++ b/WebCore/html/HTMLBlockquoteElement.cpp @@ -45,4 +45,9 @@ PassRefPtr<HTMLBlockquoteElement> HTMLBlockquoteElement::create(const QualifiedN return adoptRef(new HTMLBlockquoteElement(tagName, document)); } +bool HTMLBlockquoteElement::isURLAttribute(Attribute* attribute) const +{ + return attribute->name() == citeAttr; +} + } diff --git a/WebCore/html/HTMLBlockquoteElement.h b/WebCore/html/HTMLBlockquoteElement.h index 194fe54..6566117 100644 --- a/WebCore/html/HTMLBlockquoteElement.h +++ b/WebCore/html/HTMLBlockquoteElement.h @@ -34,6 +34,8 @@ public: private: HTMLBlockquoteElement(const QualifiedName&, Document*); + + virtual bool isURLAttribute(Attribute*) const; }; } // namespace WebCore diff --git a/WebCore/html/HTMLBlockquoteElement.idl b/WebCore/html/HTMLBlockquoteElement.idl index f0045c7..5a319a3 100644 --- a/WebCore/html/HTMLBlockquoteElement.idl +++ b/WebCore/html/HTMLBlockquoteElement.idl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006, 2009 Apple Inc. All rights reserved. + * Copyright (C) 2006, 2009, 2010 Apple Inc. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -20,7 +20,7 @@ module html { interface HTMLBlockquoteElement : HTMLElement { - attribute [Reflect] DOMString cite; + attribute [Reflect, URL] DOMString cite; }; } diff --git a/WebCore/html/HTMLBodyElement.cpp b/WebCore/html/HTMLBodyElement.cpp index 35dbd9d..98e0d6f 100644 --- a/WebCore/html/HTMLBodyElement.cpp +++ b/WebCore/html/HTMLBodyElement.cpp @@ -73,7 +73,7 @@ void HTMLBodyElement::createLinkDecl() m_linkDecl = CSSMutableStyleDeclaration::create(); m_linkDecl->setParent(document()->elementSheet()); m_linkDecl->setNode(this); - m_linkDecl->setStrictParsing(!document()->inCompatMode()); + m_linkDecl->setStrictParsing(!document()->inQuirksMode()); } bool HTMLBodyElement::mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const diff --git a/WebCore/html/HTMLCanvasElement.cpp b/WebCore/html/HTMLCanvasElement.cpp index 7463551..3838f14 100644 --- a/WebCore/html/HTMLCanvasElement.cpp +++ b/WebCore/html/HTMLCanvasElement.cpp @@ -146,7 +146,7 @@ CanvasRenderingContext* HTMLCanvasElement::getContext(const String& type, Canvas if (Settings* settings = document()->settings()) usesDashbardCompatibilityMode = settings->usesDashboardBackwardCompatibilityMode(); #endif - m_context = adoptPtr(new CanvasRenderingContext2D(this, document()->inCompatMode(), usesDashbardCompatibilityMode)); + m_context = adoptPtr(new CanvasRenderingContext2D(this, document()->inQuirksMode(), usesDashbardCompatibilityMode)); #if ENABLE(ACCELERATED_2D_CANVAS) && USE(ACCELERATED_COMPOSITING) if (m_context) { // Need to make sure a RenderLayer and compositing layer get created for the Canvas @@ -185,7 +185,7 @@ CanvasRenderingContext* HTMLCanvasElement::getContext(const String& type, Canvas return 0; } -void HTMLCanvasElement::willDraw(const FloatRect& rect) +void HTMLCanvasElement::didDraw(const FloatRect& rect) { m_copiedImage.clear(); // Clear our image snapshot if we have one. @@ -394,8 +394,14 @@ ImageBuffer* HTMLCanvasElement::buffer() const Image* HTMLCanvasElement::copiedImage() const { - if (!m_copiedImage && buffer()) + if (!m_copiedImage && buffer()) { + if (m_context) { + // If we're not rendering to the ImageBuffer, copy the rendering results to it. + if (!m_context->paintsIntoCanvasBuffer()) + m_context->paintRenderingResultsToCanvas(); + } m_copiedImage = buffer()->copyImage(); + } return m_copiedImage.get(); } diff --git a/WebCore/html/HTMLCanvasElement.h b/WebCore/html/HTMLCanvasElement.h index c9b258d..01665c8 100644 --- a/WebCore/html/HTMLCanvasElement.h +++ b/WebCore/html/HTMLCanvasElement.h @@ -85,7 +85,7 @@ public: String toDataURL(const String& mimeType, ExceptionCode& ec) { return toDataURL(mimeType, 0, ec); } // Used for rendering - void willDraw(const FloatRect&); + void didDraw(const FloatRect&); void paint(GraphicsContext*, const IntRect&); diff --git a/WebCore/html/HTMLDocument.cpp b/WebCore/html/HTMLDocument.cpp index 5e11ad2..26e8314 100644 --- a/WebCore/html/HTMLDocument.cpp +++ b/WebCore/html/HTMLDocument.cpp @@ -84,7 +84,6 @@ HTMLDocument::HTMLDocument(Frame* frame, const KURL& url) : Document(frame, url, false, true) { clearXMLVersion(); - setParseMode(Compat); } HTMLDocument::~HTMLDocument() @@ -139,7 +138,7 @@ void HTMLDocument::setDesignMode(const String& value) String HTMLDocument::compatMode() const { - return inCompatMode() ? "BackCompat" : "CSS1Compat"; + return inQuirksMode() ? "BackCompat" : "CSS1Compat"; } Element* HTMLDocument::activeElement() @@ -343,65 +342,97 @@ void HTMLDocument::removeExtraNamedItem(const AtomicString& name) removeItemFromMap(m_extraNamedItemCounts, name); } -void HTMLDocument::determineParseMode() +void HTMLDocument::setCompatibilityModeFromDoctype() { - // FIXME: It's terrible that this code runs separately and isn't just built in to the - // HTML tokenizer/parser. - - // This code more or less mimics Mozilla's implementation (specifically the - // doctype parsing implemented by David Baron in Mozilla's nsParser.cpp). - // - // There are three possible parse modes: - // COMPAT - quirks mode emulates WinIE and NS4. CSS parsing is also relaxed in this mode, e.g., unit types can + // There are three possible compatibility modes: + // Quirks - quirks mode emulates WinIE and NS4. CSS parsing is also relaxed in this mode, e.g., unit types can // be omitted from numbers. - // ALMOST STRICT - This mode is identical to strict mode except for its treatment of line-height in the inline box model. For - // now (until the inline box model is re-written), this mode is identical to STANDARDS mode. - // STRICT - no quirks apply. Web pages will obey the specifications to the letter. - bool wasInCompatMode = inCompatMode(); + // Limited Quirks - This mode is identical to no-quirks mode except for its treatment of line-height in the inline box model. + // No Quirks - no quirks apply. Web pages will obey the specifications to the letter. DocumentType* docType = doctype(); - if (!docType || !equalIgnoringCase(docType->name(), "html")) - // No doctype found at all or the doctype is not HTML. Default to quirks mode and Html4. - setParseMode(Compat); - else if (!doctype()->systemId().isEmpty() && equalIgnoringCase(docType->systemId(), "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd")) - // Assume quirks mode for this particular system ID. In the HTML5 spec, this is the only - // system identifier that is examined. - setParseMode(Compat); - else if (docType->publicId().isEmpty()) - // A doctype without a public ID means use strict mode. - setParseMode(Strict); - else { - // We have to check a list of public IDs to see what we - // should do. - String lowerPubID = docType->publicId().lower(); - CString pubIDStr = lowerPubID.latin1(); - - // Look up the entry in our gperf-generated table. - const PubIDInfo* doctypeEntry = findDoctypeEntry(pubIDStr.data(), pubIDStr.length()); - if (!doctypeEntry) - // The DOCTYPE is not in the list. Assume strict mode. - setParseMode(Strict); - else { - switch (docType->systemId().isEmpty() ? - doctypeEntry->mode_if_no_sysid : - doctypeEntry->mode_if_sysid) { - case PubIDInfo::eQuirks3: - case PubIDInfo::eQuirks: - setParseMode(Compat); - break; - case PubIDInfo::eAlmostStandards: - setParseMode(AlmostStrict); - break; - default: - ASSERT(false); - } - } + if (!docType) + return; + + // Check for Quirks Mode. + const String& publicId = docType->publicId(); + if (docType->name() != "html" + || publicId.startsWith("+//Silmaril//dtd html Pro v0r11 19970101//", false) + || publicId.startsWith("-//AdvaSoft Ltd//DTD HTML 3.0 asWedit + extensions//", false) + || publicId.startsWith("-//AS//DTD HTML 3.0 asWedit + extensions//", false) + || publicId.startsWith("-//IETF//DTD HTML 2.0 Level 1//", false) + || publicId.startsWith("-//IETF//DTD HTML 2.0 Level 2//", false) + || publicId.startsWith("-//IETF//DTD HTML 2.0 Strict Level 1//", false) + || publicId.startsWith("-//IETF//DTD HTML 2.0 Strict Level 2//", false) + || publicId.startsWith("-//IETF//DTD HTML 2.0 Strict//", false) + || publicId.startsWith("-//IETF//DTD HTML 2.0//", false) + || publicId.startsWith("-//IETF//DTD HTML 2.1E//", false) + || publicId.startsWith("-//IETF//DTD HTML 3.0//", false) + || publicId.startsWith("-//IETF//DTD HTML 3.2 Final//", false) + || publicId.startsWith("-//IETF//DTD HTML 3.2//", false) + || publicId.startsWith("-//IETF//DTD HTML 3//", false) + || publicId.startsWith("-//IETF//DTD HTML Level 0//", false) + || publicId.startsWith("-//IETF//DTD HTML Level 1//", false) + || publicId.startsWith("-//IETF//DTD HTML Level 2//", false) + || publicId.startsWith("-//IETF//DTD HTML Level 3//", false) + || publicId.startsWith("-//IETF//DTD HTML Strict Level 0//", false) + || publicId.startsWith("-//IETF//DTD HTML Strict Level 1//", false) + || publicId.startsWith("-//IETF//DTD HTML Strict Level 2//", false) + || publicId.startsWith("-//IETF//DTD HTML Strict Level 3//", false) + || publicId.startsWith("-//IETF//DTD HTML Strict//", false) + || publicId.startsWith("-//IETF//DTD HTML//", false) + || publicId.startsWith("-//Metrius//DTD Metrius Presentational//", false) + || publicId.startsWith("-//Microsoft//DTD Internet Explorer 2.0 HTML Strict//", false) + || publicId.startsWith("-//Microsoft//DTD Internet Explorer 2.0 HTML//", false) + || publicId.startsWith("-//Microsoft//DTD Internet Explorer 2.0 Tables//", false) + || publicId.startsWith("-//Microsoft//DTD Internet Explorer 3.0 HTML Strict//", false) + || publicId.startsWith("-//Microsoft//DTD Internet Explorer 3.0 HTML//", false) + || publicId.startsWith("-//Microsoft//DTD Internet Explorer 3.0 Tables//", false) + || publicId.startsWith("-//Netscape Comm. Corp.//DTD HTML//", false) + || publicId.startsWith("-//Netscape Comm. Corp.//DTD Strict HTML//", false) + || publicId.startsWith("-//O'Reilly and Associates//DTD HTML 2.0//", false) + || publicId.startsWith("-//O'Reilly and Associates//DTD HTML Extended 1.0//", false) + || publicId.startsWith("-//O'Reilly and Associates//DTD HTML Extended Relaxed 1.0//", false) + || publicId.startsWith("-//SoftQuad Software//DTD HoTMetaL PRO 6.0::19990601::extensions to HTML 4.0//", false) + || publicId.startsWith("-//SoftQuad//DTD HoTMetaL PRO 4.0::19971010::extensions to HTML 4.0//", false) + || publicId.startsWith("-//Spyglass//DTD HTML 2.0 Extended//", false) + || publicId.startsWith("-//SQ//DTD HTML 2.0 HoTMetaL + extensions//", false) + || publicId.startsWith("-//Sun Microsystems Corp.//DTD HotJava HTML//", false) + || publicId.startsWith("-//Sun Microsystems Corp.//DTD HotJava Strict HTML//", false) + || publicId.startsWith("-//W3C//DTD HTML 3 1995-03-24//", false) + || publicId.startsWith("-//W3C//DTD HTML 3.2 Draft//", false) + || publicId.startsWith("-//W3C//DTD HTML 3.2 Final//", false) + || publicId.startsWith("-//W3C//DTD HTML 3.2//", false) + || publicId.startsWith("-//W3C//DTD HTML 3.2S Draft//", false) + || publicId.startsWith("-//W3C//DTD HTML 4.0 Frameset//", false) + || publicId.startsWith("-//W3C//DTD HTML 4.0 Transitional//", false) + || publicId.startsWith("-//W3C//DTD HTML Experimental 19960712//", false) + || publicId.startsWith("-//W3C//DTD HTML Experimental 970421//", false) + || publicId.startsWith("-//W3C//DTD W3 HTML//", false) + || publicId.startsWith("-//W3O//DTD W3 HTML 3.0//", false) + || equalIgnoringCase(publicId, "-//W3O//DTD W3 HTML Strict 3.0//EN//") + || publicId.startsWith("-//WebTechs//DTD Mozilla HTML 2.0//", false) + || publicId.startsWith("-//WebTechs//DTD Mozilla HTML//", false) + || equalIgnoringCase(publicId, "-/W3C/DTD HTML 4.0 Transitional/EN") + || equalIgnoringCase(publicId, "HTML") + || equalIgnoringCase(docType->systemId(), "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd") + || (docType->systemId().isEmpty() && publicId.startsWith("-//W3C//DTD HTML 4.01 Frameset//", false)) + || (docType->systemId().isEmpty() && publicId.startsWith("-//W3C//DTD HTML 4.01 Transitional//", false))) { + setCompatibilityMode(QuirksMode); + return; } - - if (inCompatMode() != wasInCompatMode) { - clearPageUserSheet(); - clearPageGroupUserSheets(); - updateStyleSelector(); + + // Check for Limited Quirks Mode. + if (publicId.startsWith("-//W3C//DTD XHTML 1.0 Frameset//", false) + || publicId.startsWith("-//W3C//DTD XHTML 1.0 Transitional//", false) + || (!docType->systemId().isEmpty() && publicId.startsWith("-//W3C//DTD HTML 4.01 Frameset//", false)) + || (!docType->systemId().isEmpty() && publicId.startsWith("-//W3C//DTD HTML 4.01 Transitional//", false))) { + setCompatibilityMode(LimitedQuirksMode); + return; } + + // Otherwise we are No Quirks Mode. + setCompatibilityMode(NoQuirksMode); + return; } void HTMLDocument::clear() diff --git a/WebCore/html/HTMLDocument.h b/WebCore/html/HTMLDocument.h index 583cdcc..ae65d42 100644 --- a/WebCore/html/HTMLDocument.h +++ b/WebCore/html/HTMLDocument.h @@ -51,6 +51,7 @@ public: void setDesignMode(const String&); String compatMode() const; + virtual void setCompatibilityModeFromDoctype(); Element* activeElement(); bool hasFocus(); @@ -95,7 +96,6 @@ private: virtual bool isFrameSet() const; virtual PassRefPtr<DocumentParser> createParser(); - virtual void determineParseMode(); void addItemToMap(HashCountedSet<AtomicStringImpl*>&, const AtomicString&); void removeItemFromMap(HashCountedSet<AtomicStringImpl*>&, const AtomicString&); diff --git a/WebCore/html/HTMLElement.cpp b/WebCore/html/HTMLElement.cpp index f40489b..0862130 100644 --- a/WebCore/html/HTMLElement.cpp +++ b/WebCore/html/HTMLElement.cpp @@ -249,6 +249,10 @@ void HTMLElement::parseMappedAttribute(Attribute* attr) setAttributeEventListener(eventNames().touchendEvent, createAttributeEventListener(this, attr)); } else if (attr->name() == ontouchcancelAttr) { setAttributeEventListener(eventNames().touchcancelEvent, createAttributeEventListener(this, attr)); +#if ENABLE(FULLSCREEN_API) + } else if (attr->name() == onwebkitfullscreenchangeAttr) { + setAttributeEventListener(eventNames().webkitfullscreenchangeEvent, createAttributeEventListener(this, attr)); +#endif } } diff --git a/WebCore/html/HTMLEmbedElement.cpp b/WebCore/html/HTMLEmbedElement.cpp index 0a15321..eeb28e7 100644 --- a/WebCore/html/HTMLEmbedElement.cpp +++ b/WebCore/html/HTMLEmbedElement.cpp @@ -42,16 +42,15 @@ namespace WebCore { using namespace HTMLNames; -inline HTMLEmbedElement::HTMLEmbedElement(const QualifiedName& tagName, Document* document) - : HTMLPlugInImageElement(tagName, document) - , m_needWidgetUpdate(false) +inline HTMLEmbedElement::HTMLEmbedElement(const QualifiedName& tagName, Document* document, bool createdByParser) + : HTMLPlugInImageElement(tagName, document, createdByParser) { ASSERT(hasTagName(embedTag)); } -PassRefPtr<HTMLEmbedElement> HTMLEmbedElement::create(const QualifiedName& tagName, Document* document) +PassRefPtr<HTMLEmbedElement> HTMLEmbedElement::create(const QualifiedName& tagName, Document* document, bool createdByParser) { - return adoptRef(new HTMLEmbedElement(tagName, document)); + return adoptRef(new HTMLEmbedElement(tagName, document, createdByParser)); } static inline RenderWidget* findWidgetRenderer(const Node* n) @@ -80,7 +79,7 @@ bool HTMLEmbedElement::mapToEntry(const QualifiedName& attrName, MappedAttribute return false; } - return HTMLPlugInElement::mapToEntry(attrName, result); + return HTMLPlugInImageElement::mapToEntry(attrName, result); } void HTMLEmbedElement::parseMappedAttribute(Attribute* attr) @@ -118,22 +117,27 @@ void HTMLEmbedElement::parseMappedAttribute(Attribute* attr) } m_name = value; } else - HTMLPlugInElement::parseMappedAttribute(attr); + HTMLPlugInImageElement::parseMappedAttribute(attr); } bool HTMLEmbedElement::rendererIsNeeded(RenderStyle* style) { if (isImageType()) - return HTMLPlugInElement::rendererIsNeeded(style); + return HTMLPlugInImageElement::rendererIsNeeded(style); Frame* frame = document()->frame(); if (!frame) return false; + // If my parent is an <object> and is not set to use fallback content, I + // should be ignored and not get a renderer. Node* p = parentNode(); if (p && p->hasTagName(objectTag)) { ASSERT(p->renderer()); - return false; + if (!static_cast<HTMLObjectElement*>(p)->useFallbackContent()) { + ASSERT(!p->renderer()->isEmbeddedObject()); + return false; + } } #if ENABLE(DASHBOARD_SUPPORT) @@ -144,42 +148,7 @@ bool HTMLEmbedElement::rendererIsNeeded(RenderStyle* style) } #endif - return HTMLPlugInElement::rendererIsNeeded(style); -} - -RenderObject* HTMLEmbedElement::createRenderer(RenderArena* arena, RenderStyle*) -{ - if (isImageType()) - return new (arena) RenderImage(this); - return new (arena) RenderEmbeddedObject(this); -} - -void HTMLEmbedElement::attach() -{ - m_needWidgetUpdate = true; - - bool isImage = isImageType(); - - if (!isImage) - queuePostAttachCallback(&HTMLPlugInElement::updateWidgetCallback, this); - - HTMLPlugInElement::attach(); - - if (isImage && renderer()) { - if (!m_imageLoader) - m_imageLoader = adoptPtr(new HTMLImageLoader(this)); - m_imageLoader->updateFromElement(); - - if (renderer()) - toRenderImage(renderer())->setCachedImage(m_imageLoader->image()); - } -} - -void HTMLEmbedElement::updateWidget() -{ - document()->updateStyleIfNeeded(); - if (m_needWidgetUpdate && renderer() && !isImageType()) - toRenderEmbeddedObject(renderer())->updateWidget(true); + return HTMLPlugInImageElement::rendererIsNeeded(style); } void HTMLEmbedElement::insertedIntoDocument() @@ -201,7 +170,7 @@ void HTMLEmbedElement::insertedIntoDocument() } } - HTMLPlugInElement::insertedIntoDocument(); + HTMLPlugInImageElement::insertedIntoDocument(); } void HTMLEmbedElement::removedFromDocument() @@ -209,12 +178,12 @@ void HTMLEmbedElement::removedFromDocument() if (document()->isHTMLDocument()) static_cast<HTMLDocument*>(document())->removeNamedItem(m_name); - HTMLPlugInElement::removedFromDocument(); + HTMLPlugInImageElement::removedFromDocument(); } void HTMLEmbedElement::attributeChanged(Attribute* attr, bool preserveDecls) { - HTMLPlugInElement::attributeChanged(attr, preserveDecls); + HTMLPlugInImageElement::attributeChanged(attr, preserveDecls); if ((attr->name() == widthAttr || attr->name() == heightAttr) && !attr->isEmpty()) { Node* n = parent(); diff --git a/WebCore/html/HTMLEmbedElement.h b/WebCore/html/HTMLEmbedElement.h index 5f4df67..e27b717 100644 --- a/WebCore/html/HTMLEmbedElement.h +++ b/WebCore/html/HTMLEmbedElement.h @@ -29,20 +29,15 @@ namespace WebCore { class HTMLEmbedElement : public HTMLPlugInImageElement { public: - static PassRefPtr<HTMLEmbedElement> create(const QualifiedName&, Document*); - - void setNeedWidgetUpdate(bool needWidgetUpdate) { m_needWidgetUpdate = needWidgetUpdate; } + static PassRefPtr<HTMLEmbedElement> create(const QualifiedName&, Document*, bool createdByParser); private: - HTMLEmbedElement(const QualifiedName&, Document*); + HTMLEmbedElement(const QualifiedName&, Document*, bool createdByParser); virtual bool mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const; virtual void parseMappedAttribute(Attribute*); - virtual void attach(); - virtual bool canLazyAttach() { return false; } virtual bool rendererIsNeeded(RenderStyle*); - virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); virtual void insertedIntoDocument(); virtual void removedFromDocument(); virtual void attributeChanged(Attribute*, bool preserveDecls = false); @@ -50,13 +45,9 @@ private: virtual bool isURLAttribute(Attribute*) const; virtual const QualifiedName& imageSourceAttributeName() const; - virtual void updateWidget(); - virtual RenderWidget* renderWidgetForJSBindings() const; virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const; - - bool m_needWidgetUpdate; }; } diff --git a/WebCore/html/HTMLEmbedElement.idl b/WebCore/html/HTMLEmbedElement.idl index 4997210..e395fc6 100644 --- a/WebCore/html/HTMLEmbedElement.idl +++ b/WebCore/html/HTMLEmbedElement.idl @@ -32,7 +32,7 @@ module html { attribute [Reflect] long height; #endif attribute [Reflect] DOMString name; - attribute [Reflect] DOMString src; + attribute [Reflect, URL] DOMString src; attribute [Reflect] DOMString type; #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT attribute [Reflect] DOMString width; diff --git a/WebCore/html/HTMLEntityNames.json b/WebCore/html/HTMLEntityNames.json deleted file mode 100644 index da3b881..0000000 --- a/WebCore/html/HTMLEntityNames.json +++ /dev/null @@ -1,8554 +0,0 @@ -[ - { - "entity": "AElig;", - "value": "U+000C6" - }, - { - "entity": "AElig", - "value": "U+000C6" - }, - { - "entity": "AMP;", - "value": "U+00026" - }, - { - "entity": "AMP", - "value": "U+00026" - }, - { - "entity": "Aacute;", - "value": "U+000C1" - }, - { - "entity": "Aacute", - "value": "U+000C1" - }, - { - "entity": "Abreve;", - "value": "U+00102" - }, - { - "entity": "Acirc;", - "value": "U+000C2" - }, - { - "entity": "Acirc", - "value": "U+000C2" - }, - { - "entity": "Acy;", - "value": "U+00410" - }, - { - "entity": "Afr;", - "value": "U+1D504" - }, - { - "entity": "Agrave;", - "value": "U+000C0" - }, - { - "entity": "Agrave", - "value": "U+000C0" - }, - { - "entity": "Alpha;", - "value": "U+00391" - }, - { - "entity": "Amacr;", - "value": "U+00100" - }, - { - "entity": "And;", - "value": "U+02A53" - }, - { - "entity": "Aogon;", - "value": "U+00104" - }, - { - "entity": "Aopf;", - "value": "U+1D538" - }, - { - "entity": "ApplyFunction;", - "value": "U+02061" - }, - { - "entity": "Aring;", - "value": "U+000C5" - }, - { - "entity": "Aring", - "value": "U+000C5" - }, - { - "entity": "Ascr;", - "value": "U+1D49C" - }, - { - "entity": "Assign;", - "value": "U+02254" - }, - { - "entity": "Atilde;", - "value": "U+000C3" - }, - { - "entity": "Atilde", - "value": "U+000C3" - }, - { - "entity": "Auml;", - "value": "U+000C4" - }, - { - "entity": "Auml", - "value": "U+000C4" - }, - { - "entity": "Backslash;", - "value": "U+02216" - }, - { - "entity": "Barv;", - "value": "U+02AE7" - }, - { - "entity": "Barwed;", - "value": "U+02306" - }, - { - "entity": "Bcy;", - "value": "U+00411" - }, - { - "entity": "Because;", - "value": "U+02235" - }, - { - "entity": "Bernoullis;", - "value": "U+0212C" - }, - { - "entity": "Beta;", - "value": "U+00392" - }, - { - "entity": "Bfr;", - "value": "U+1D505" - }, - { - "entity": "Bopf;", - "value": "U+1D539" - }, - { - "entity": "Breve;", - "value": "U+002D8" - }, - { - "entity": "Bscr;", - "value": "U+0212C" - }, - { - "entity": "Bumpeq;", - "value": "U+0224E" - }, - { - "entity": "CHcy;", - "value": "U+00427" - }, - { - "entity": "COPY;", - "value": "U+000A9" - }, - { - "entity": "COPY", - "value": "U+000A9" - }, - { - "entity": "Cacute;", - "value": "U+00106" - }, - { - "entity": "Cap;", - "value": "U+022D2" - }, - { - "entity": "CapitalDifferentialD;", - "value": "U+02145" - }, - { - "entity": "Cayleys;", - "value": "U+0212D" - }, - { - "entity": "Ccaron;", - "value": "U+0010C" - }, - { - "entity": "Ccedil;", - "value": "U+000C7" - }, - { - "entity": "Ccedil", - "value": "U+000C7" - }, - { - "entity": "Ccirc;", - "value": "U+00108" - }, - { - "entity": "Cconint;", - "value": "U+02230" - }, - { - "entity": "Cdot;", - "value": "U+0010A" - }, - { - "entity": "Cedilla;", - "value": "U+000B8" - }, - { - "entity": "CenterDot;", - "value": "U+000B7" - }, - { - "entity": "Cfr;", - "value": "U+0212D" - }, - { - "entity": "Chi;", - "value": "U+003A7" - }, - { - "entity": "CircleDot;", - "value": "U+02299" - }, - { - "entity": "CircleMinus;", - "value": "U+02296" - }, - { - "entity": "CirclePlus;", - "value": "U+02295" - }, - { - "entity": "CircleTimes;", - "value": "U+02297" - }, - { - "entity": "ClockwiseContourIntegral;", - "value": "U+02232" - }, - { - "entity": "CloseCurlyDoubleQuote;", - "value": "U+0201D" - }, - { - "entity": "CloseCurlyQuote;", - "value": "U+02019" - }, - { - "entity": "Colon;", - "value": "U+02237" - }, - { - "entity": "Colone;", - "value": "U+02A74" - }, - { - "entity": "Congruent;", - "value": "U+02261" - }, - { - "entity": "Conint;", - "value": "U+0222F" - }, - { - "entity": "ContourIntegral;", - "value": "U+0222E" - }, - { - "entity": "Copf;", - "value": "U+02102" - }, - { - "entity": "Coproduct;", - "value": "U+02210" - }, - { - "entity": "CounterClockwiseContourIntegral;", - "value": "U+02233" - }, - { - "entity": "Cross;", - "value": "U+02A2F" - }, - { - "entity": "Cscr;", - "value": "U+1D49E" - }, - { - "entity": "Cup;", - "value": "U+022D3" - }, - { - "entity": "CupCap;", - "value": "U+0224D" - }, - { - "entity": "DD;", - "value": "U+02145" - }, - { - "entity": "DDotrahd;", - "value": "U+02911" - }, - { - "entity": "DJcy;", - "value": "U+00402" - }, - { - "entity": "DScy;", - "value": "U+00405" - }, - { - "entity": "DZcy;", - "value": "U+0040F" - }, - { - "entity": "Dagger;", - "value": "U+02021" - }, - { - "entity": "Darr;", - "value": "U+021A1" - }, - { - "entity": "Dashv;", - "value": "U+02AE4" - }, - { - "entity": "Dcaron;", - "value": "U+0010E" - }, - { - "entity": "Dcy;", - "value": "U+00414" - }, - { - "entity": "Del;", - "value": "U+02207" - }, - { - "entity": "Delta;", - "value": "U+00394" - }, - { - "entity": "Dfr;", - "value": "U+1D507" - }, - { - "entity": "DiacriticalAcute;", - "value": "U+000B4" - }, - { - "entity": "DiacriticalDot;", - "value": "U+002D9" - }, - { - "entity": "DiacriticalDoubleAcute;", - "value": "U+002DD" - }, - { - "entity": "DiacriticalGrave;", - "value": "U+00060" - }, - { - "entity": "DiacriticalTilde;", - "value": "U+002DC" - }, - { - "entity": "Diamond;", - "value": "U+022C4" - }, - { - "entity": "DifferentialD;", - "value": "U+02146" - }, - { - "entity": "Dopf;", - "value": "U+1D53B" - }, - { - "entity": "Dot;", - "value": "U+000A8" - }, - { - "entity": "DotDot;", - "value": "U+020DC" - }, - { - "entity": "DotEqual;", - "value": "U+02250" - }, - { - "entity": "DoubleContourIntegral;", - "value": "U+0222F" - }, - { - "entity": "DoubleDot;", - "value": "U+000A8" - }, - { - "entity": "DoubleDownArrow;", - "value": "U+021D3" - }, - { - "entity": "DoubleLeftArrow;", - "value": "U+021D0" - }, - { - "entity": "DoubleLeftRightArrow;", - "value": "U+021D4" - }, - { - "entity": "DoubleLeftTee;", - "value": "U+02AE4" - }, - { - "entity": "DoubleLongLeftArrow;", - "value": "U+027F8" - }, - { - "entity": "DoubleLongLeftRightArrow;", - "value": "U+027FA" - }, - { - "entity": "DoubleLongRightArrow;", - "value": "U+027F9" - }, - { - "entity": "DoubleRightArrow;", - "value": "U+021D2" - }, - { - "entity": "DoubleRightTee;", - "value": "U+022A8" - }, - { - "entity": "DoubleUpArrow;", - "value": "U+021D1" - }, - { - "entity": "DoubleUpDownArrow;", - "value": "U+021D5" - }, - { - "entity": "DoubleVerticalBar;", - "value": "U+02225" - }, - { - "entity": "DownArrow;", - "value": "U+02193" - }, - { - "entity": "DownArrowBar;", - "value": "U+02913" - }, - { - "entity": "DownArrowUpArrow;", - "value": "U+021F5" - }, - { - "entity": "DownBreve;", - "value": "U+00311" - }, - { - "entity": "DownLeftRightVector;", - "value": "U+02950" - }, - { - "entity": "DownLeftTeeVector;", - "value": "U+0295E" - }, - { - "entity": "DownLeftVector;", - "value": "U+021BD" - }, - { - "entity": "DownLeftVectorBar;", - "value": "U+02956" - }, - { - "entity": "DownRightTeeVector;", - "value": "U+0295F" - }, - { - "entity": "DownRightVector;", - "value": "U+021C1" - }, - { - "entity": "DownRightVectorBar;", - "value": "U+02957" - }, - { - "entity": "DownTee;", - "value": "U+022A4" - }, - { - "entity": "DownTeeArrow;", - "value": "U+021A7" - }, - { - "entity": "Downarrow;", - "value": "U+021D3" - }, - { - "entity": "Dscr;", - "value": "U+1D49F" - }, - { - "entity": "Dstrok;", - "value": "U+00110" - }, - { - "entity": "ENG;", - "value": "U+0014A" - }, - { - "entity": "ETH;", - "value": "U+000D0" - }, - { - "entity": "ETH", - "value": "U+000D0" - }, - { - "entity": "Eacute;", - "value": "U+000C9" - }, - { - "entity": "Eacute", - "value": "U+000C9" - }, - { - "entity": "Ecaron;", - "value": "U+0011A" - }, - { - "entity": "Ecirc;", - "value": "U+000CA" - }, - { - "entity": "Ecirc", - "value": "U+000CA" - }, - { - "entity": "Ecy;", - "value": "U+0042D" - }, - { - "entity": "Edot;", - "value": "U+00116" - }, - { - "entity": "Efr;", - "value": "U+1D508" - }, - { - "entity": "Egrave;", - "value": "U+000C8" - }, - { - "entity": "Egrave", - "value": "U+000C8" - }, - { - "entity": "Element;", - "value": "U+02208" - }, - { - "entity": "Emacr;", - "value": "U+00112" - }, - { - "entity": "EmptySmallSquare;", - "value": "U+025FB" - }, - { - "entity": "EmptyVerySmallSquare;", - "value": "U+025AB" - }, - { - "entity": "Eogon;", - "value": "U+00118" - }, - { - "entity": "Eopf;", - "value": "U+1D53C" - }, - { - "entity": "Epsilon;", - "value": "U+00395" - }, - { - "entity": "Equal;", - "value": "U+02A75" - }, - { - "entity": "EqualTilde;", - "value": "U+02242" - }, - { - "entity": "Equilibrium;", - "value": "U+021CC" - }, - { - "entity": "Escr;", - "value": "U+02130" - }, - { - "entity": "Esim;", - "value": "U+02A73" - }, - { - "entity": "Eta;", - "value": "U+00397" - }, - { - "entity": "Euml;", - "value": "U+000CB" - }, - { - "entity": "Euml", - "value": "U+000CB" - }, - { - "entity": "Exists;", - "value": "U+02203" - }, - { - "entity": "ExponentialE;", - "value": "U+02147" - }, - { - "entity": "Fcy;", - "value": "U+00424" - }, - { - "entity": "Ffr;", - "value": "U+1D509" - }, - { - "entity": "FilledSmallSquare;", - "value": "U+025FC" - }, - { - "entity": "FilledVerySmallSquare;", - "value": "U+025AA" - }, - { - "entity": "Fopf;", - "value": "U+1D53D" - }, - { - "entity": "ForAll;", - "value": "U+02200" - }, - { - "entity": "Fouriertrf;", - "value": "U+02131" - }, - { - "entity": "Fscr;", - "value": "U+02131" - }, - { - "entity": "GJcy;", - "value": "U+00403" - }, - { - "entity": "GT;", - "value": "U+0003E" - }, - { - "entity": "GT", - "value": "U+0003E" - }, - { - "entity": "Gamma;", - "value": "U+00393" - }, - { - "entity": "Gammad;", - "value": "U+003DC" - }, - { - "entity": "Gbreve;", - "value": "U+0011E" - }, - { - "entity": "Gcedil;", - "value": "U+00122" - }, - { - "entity": "Gcirc;", - "value": "U+0011C" - }, - { - "entity": "Gcy;", - "value": "U+00413" - }, - { - "entity": "Gdot;", - "value": "U+00120" - }, - { - "entity": "Gfr;", - "value": "U+1D50A" - }, - { - "entity": "Gg;", - "value": "U+022D9" - }, - { - "entity": "Gopf;", - "value": "U+1D53E" - }, - { - "entity": "GreaterEqual;", - "value": "U+02265" - }, - { - "entity": "GreaterEqualLess;", - "value": "U+022DB" - }, - { - "entity": "GreaterFullEqual;", - "value": "U+02267" - }, - { - "entity": "GreaterGreater;", - "value": "U+02AA2" - }, - { - "entity": "GreaterLess;", - "value": "U+02277" - }, - { - "entity": "GreaterSlantEqual;", - "value": "U+02A7E" - }, - { - "entity": "GreaterTilde;", - "value": "U+02273" - }, - { - "entity": "Gscr;", - "value": "U+1D4A2" - }, - { - "entity": "Gt;", - "value": "U+0226B" - }, - { - "entity": "HARDcy;", - "value": "U+0042A" - }, - { - "entity": "Hacek;", - "value": "U+002C7" - }, - { - "entity": "Hat;", - "value": "U+0005E" - }, - { - "entity": "Hcirc;", - "value": "U+00124" - }, - { - "entity": "Hfr;", - "value": "U+0210C" - }, - { - "entity": "HilbertSpace;", - "value": "U+0210B" - }, - { - "entity": "Hopf;", - "value": "U+0210D" - }, - { - "entity": "HorizontalLine;", - "value": "U+02500" - }, - { - "entity": "Hscr;", - "value": "U+0210B" - }, - { - "entity": "Hstrok;", - "value": "U+00126" - }, - { - "entity": "HumpDownHump;", - "value": "U+0224E" - }, - { - "entity": "HumpEqual;", - "value": "U+0224F" - }, - { - "entity": "IEcy;", - "value": "U+00415" - }, - { - "entity": "IJlig;", - "value": "U+00132" - }, - { - "entity": "IOcy;", - "value": "U+00401" - }, - { - "entity": "Iacute;", - "value": "U+000CD" - }, - { - "entity": "Iacute", - "value": "U+000CD" - }, - { - "entity": "Icirc;", - "value": "U+000CE" - }, - { - "entity": "Icirc", - "value": "U+000CE" - }, - { - "entity": "Icy;", - "value": "U+00418" - }, - { - "entity": "Idot;", - "value": "U+00130" - }, - { - "entity": "Ifr;", - "value": "U+02111" - }, - { - "entity": "Igrave;", - "value": "U+000CC" - }, - { - "entity": "Igrave", - "value": "U+000CC" - }, - { - "entity": "Im;", - "value": "U+02111" - }, - { - "entity": "Imacr;", - "value": "U+0012A" - }, - { - "entity": "ImaginaryI;", - "value": "U+02148" - }, - { - "entity": "Implies;", - "value": "U+021D2" - }, - { - "entity": "Int;", - "value": "U+0222C" - }, - { - "entity": "Integral;", - "value": "U+0222B" - }, - { - "entity": "Intersection;", - "value": "U+022C2" - }, - { - "entity": "InvisibleComma;", - "value": "U+02063" - }, - { - "entity": "InvisibleTimes;", - "value": "U+02062" - }, - { - "entity": "Iogon;", - "value": "U+0012E" - }, - { - "entity": "Iopf;", - "value": "U+1D540" - }, - { - "entity": "Iota;", - "value": "U+00399" - }, - { - "entity": "Iscr;", - "value": "U+02110" - }, - { - "entity": "Itilde;", - "value": "U+00128" - }, - { - "entity": "Iukcy;", - "value": "U+00406" - }, - { - "entity": "Iuml;", - "value": "U+000CF" - }, - { - "entity": "Iuml", - "value": "U+000CF" - }, - { - "entity": "Jcirc;", - "value": "U+00134" - }, - { - "entity": "Jcy;", - "value": "U+00419" - }, - { - "entity": "Jfr;", - "value": "U+1D50D" - }, - { - "entity": "Jopf;", - "value": "U+1D541" - }, - { - "entity": "Jscr;", - "value": "U+1D4A5" - }, - { - "entity": "Jsercy;", - "value": "U+00408" - }, - { - "entity": "Jukcy;", - "value": "U+00404" - }, - { - "entity": "KHcy;", - "value": "U+00425" - }, - { - "entity": "KJcy;", - "value": "U+0040C" - }, - { - "entity": "Kappa;", - "value": "U+0039A" - }, - { - "entity": "Kcedil;", - "value": "U+00136" - }, - { - "entity": "Kcy;", - "value": "U+0041A" - }, - { - "entity": "Kfr;", - "value": "U+1D50E" - }, - { - "entity": "Kopf;", - "value": "U+1D542" - }, - { - "entity": "Kscr;", - "value": "U+1D4A6" - }, - { - "entity": "LJcy;", - "value": "U+00409" - }, - { - "entity": "LT;", - "value": "U+0003C" - }, - { - "entity": "LT", - "value": "U+0003C" - }, - { - "entity": "Lacute;", - "value": "U+00139" - }, - { - "entity": "Lambda;", - "value": "U+0039B" - }, - { - "entity": "Lang;", - "value": "U+027EA" - }, - { - "entity": "Laplacetrf;", - "value": "U+02112" - }, - { - "entity": "Larr;", - "value": "U+0219E" - }, - { - "entity": "Lcaron;", - "value": "U+0013D" - }, - { - "entity": "Lcedil;", - "value": "U+0013B" - }, - { - "entity": "Lcy;", - "value": "U+0041B" - }, - { - "entity": "LeftAngleBracket;", - "value": "U+027E8" - }, - { - "entity": "LeftArrow;", - "value": "U+02190" - }, - { - "entity": "LeftArrowBar;", - "value": "U+021E4" - }, - { - "entity": "LeftArrowRightArrow;", - "value": "U+021C6" - }, - { - "entity": "LeftCeiling;", - "value": "U+02308" - }, - { - "entity": "LeftDoubleBracket;", - "value": "U+027E6" - }, - { - "entity": "LeftDownTeeVector;", - "value": "U+02961" - }, - { - "entity": "LeftDownVector;", - "value": "U+021C3" - }, - { - "entity": "LeftDownVectorBar;", - "value": "U+02959" - }, - { - "entity": "LeftFloor;", - "value": "U+0230A" - }, - { - "entity": "LeftRightArrow;", - "value": "U+02194" - }, - { - "entity": "LeftRightVector;", - "value": "U+0294E" - }, - { - "entity": "LeftTee;", - "value": "U+022A3" - }, - { - "entity": "LeftTeeArrow;", - "value": "U+021A4" - }, - { - "entity": "LeftTeeVector;", - "value": "U+0295A" - }, - { - "entity": "LeftTriangle;", - "value": "U+022B2" - }, - { - "entity": "LeftTriangleBar;", - "value": "U+029CF" - }, - { - "entity": "LeftTriangleEqual;", - "value": "U+022B4" - }, - { - "entity": "LeftUpDownVector;", - "value": "U+02951" - }, - { - "entity": "LeftUpTeeVector;", - "value": "U+02960" - }, - { - "entity": "LeftUpVector;", - "value": "U+021BF" - }, - { - "entity": "LeftUpVectorBar;", - "value": "U+02958" - }, - { - "entity": "LeftVector;", - "value": "U+021BC" - }, - { - "entity": "LeftVectorBar;", - "value": "U+02952" - }, - { - "entity": "Leftarrow;", - "value": "U+021D0" - }, - { - "entity": "Leftrightarrow;", - "value": "U+021D4" - }, - { - "entity": "LessEqualGreater;", - "value": "U+022DA" - }, - { - "entity": "LessFullEqual;", - "value": "U+02266" - }, - { - "entity": "LessGreater;", - "value": "U+02276" - }, - { - "entity": "LessLess;", - "value": "U+02AA1" - }, - { - "entity": "LessSlantEqual;", - "value": "U+02A7D" - }, - { - "entity": "LessTilde;", - "value": "U+02272" - }, - { - "entity": "Lfr;", - "value": "U+1D50F" - }, - { - "entity": "Ll;", - "value": "U+022D8" - }, - { - "entity": "Lleftarrow;", - "value": "U+021DA" - }, - { - "entity": "Lmidot;", - "value": "U+0013F" - }, - { - "entity": "LongLeftArrow;", - "value": "U+027F5" - }, - { - "entity": "LongLeftRightArrow;", - "value": "U+027F7" - }, - { - "entity": "LongRightArrow;", - "value": "U+027F6" - }, - { - "entity": "Longleftarrow;", - "value": "U+027F8" - }, - { - "entity": "Longleftrightarrow;", - "value": "U+027FA" - }, - { - "entity": "Longrightarrow;", - "value": "U+027F9" - }, - { - "entity": "Lopf;", - "value": "U+1D543" - }, - { - "entity": "LowerLeftArrow;", - "value": "U+02199" - }, - { - "entity": "LowerRightArrow;", - "value": "U+02198" - }, - { - "entity": "Lscr;", - "value": "U+02112" - }, - { - "entity": "Lsh;", - "value": "U+021B0" - }, - { - "entity": "Lstrok;", - "value": "U+00141" - }, - { - "entity": "Lt;", - "value": "U+0226A" - }, - { - "entity": "Map;", - "value": "U+02905" - }, - { - "entity": "Mcy;", - "value": "U+0041C" - }, - { - "entity": "MediumSpace;", - "value": "U+0205F" - }, - { - "entity": "Mellintrf;", - "value": "U+02133" - }, - { - "entity": "Mfr;", - "value": "U+1D510" - }, - { - "entity": "MinusPlus;", - "value": "U+02213" - }, - { - "entity": "Mopf;", - "value": "U+1D544" - }, - { - "entity": "Mscr;", - "value": "U+02133" - }, - { - "entity": "Mu;", - "value": "U+0039C" - }, - { - "entity": "NJcy;", - "value": "U+0040A" - }, - { - "entity": "Nacute;", - "value": "U+00143" - }, - { - "entity": "Ncaron;", - "value": "U+00147" - }, - { - "entity": "Ncedil;", - "value": "U+00145" - }, - { - "entity": "Ncy;", - "value": "U+0041D" - }, - { - "entity": "NegativeMediumSpace;", - "value": "U+0200B" - }, - { - "entity": "NegativeThickSpace;", - "value": "U+0200B" - }, - { - "entity": "NegativeThinSpace;", - "value": "U+0200B" - }, - { - "entity": "NegativeVeryThinSpace;", - "value": "U+0200B" - }, - { - "entity": "NestedGreaterGreater;", - "value": "U+0226B" - }, - { - "entity": "NestedLessLess;", - "value": "U+0226A" - }, - { - "entity": "NewLine;", - "value": "U+0000A" - }, - { - "entity": "Nfr;", - "value": "U+1D511" - }, - { - "entity": "NoBreak;", - "value": "U+02060" - }, - { - "entity": "NonBreakingSpace;", - "value": "U+000A0" - }, - { - "entity": "Nopf;", - "value": "U+02115" - }, - { - "entity": "Not;", - "value": "U+02AEC" - }, - { - "entity": "NotCongruent;", - "value": "U+02262" - }, - { - "entity": "NotCupCap;", - "value": "U+0226D" - }, - { - "entity": "NotDoubleVerticalBar;", - "value": "U+02226" - }, - { - "entity": "NotElement;", - "value": "U+02209" - }, - { - "entity": "NotEqual;", - "value": "U+02260" - }, - { - "entity": "NotExists;", - "value": "U+02204" - }, - { - "entity": "NotGreater;", - "value": "U+0226F" - }, - { - "entity": "NotGreaterEqual;", - "value": "U+02271" - }, - { - "entity": "NotGreaterLess;", - "value": "U+02279" - }, - { - "entity": "NotGreaterTilde;", - "value": "U+02275" - }, - { - "entity": "NotLeftTriangle;", - "value": "U+022EA" - }, - { - "entity": "NotLeftTriangleEqual;", - "value": "U+022EC" - }, - { - "entity": "NotLess;", - "value": "U+0226E" - }, - { - "entity": "NotLessEqual;", - "value": "U+02270" - }, - { - "entity": "NotLessGreater;", - "value": "U+02278" - }, - { - "entity": "NotLessTilde;", - "value": "U+02274" - }, - { - "entity": "NotPrecedes;", - "value": "U+02280" - }, - { - "entity": "NotPrecedesSlantEqual;", - "value": "U+022E0" - }, - { - "entity": "NotReverseElement;", - "value": "U+0220C" - }, - { - "entity": "NotRightTriangle;", - "value": "U+022EB" - }, - { - "entity": "NotRightTriangleEqual;", - "value": "U+022ED" - }, - { - "entity": "NotSquareSubsetEqual;", - "value": "U+022E2" - }, - { - "entity": "NotSquareSupersetEqual;", - "value": "U+022E3" - }, - { - "entity": "NotSubsetEqual;", - "value": "U+02288" - }, - { - "entity": "NotSucceeds;", - "value": "U+02281" - }, - { - "entity": "NotSucceedsSlantEqual;", - "value": "U+022E1" - }, - { - "entity": "NotSupersetEqual;", - "value": "U+02289" - }, - { - "entity": "NotTilde;", - "value": "U+02241" - }, - { - "entity": "NotTildeEqual;", - "value": "U+02244" - }, - { - "entity": "NotTildeFullEqual;", - "value": "U+02247" - }, - { - "entity": "NotTildeTilde;", - "value": "U+02249" - }, - { - "entity": "NotVerticalBar;", - "value": "U+02224" - }, - { - "entity": "Nscr;", - "value": "U+1D4A9" - }, - { - "entity": "Ntilde;", - "value": "U+000D1" - }, - { - "entity": "Ntilde", - "value": "U+000D1" - }, - { - "entity": "Nu;", - "value": "U+0039D" - }, - { - "entity": "OElig;", - "value": "U+00152" - }, - { - "entity": "Oacute;", - "value": "U+000D3" - }, - { - "entity": "Oacute", - "value": "U+000D3" - }, - { - "entity": "Ocirc;", - "value": "U+000D4" - }, - { - "entity": "Ocirc", - "value": "U+000D4" - }, - { - "entity": "Ocy;", - "value": "U+0041E" - }, - { - "entity": "Odblac;", - "value": "U+00150" - }, - { - "entity": "Ofr;", - "value": "U+1D512" - }, - { - "entity": "Ograve;", - "value": "U+000D2" - }, - { - "entity": "Ograve", - "value": "U+000D2" - }, - { - "entity": "Omacr;", - "value": "U+0014C" - }, - { - "entity": "Omega;", - "value": "U+003A9" - }, - { - "entity": "Omicron;", - "value": "U+0039F" - }, - { - "entity": "Oopf;", - "value": "U+1D546" - }, - { - "entity": "OpenCurlyDoubleQuote;", - "value": "U+0201C" - }, - { - "entity": "OpenCurlyQuote;", - "value": "U+02018" - }, - { - "entity": "Or;", - "value": "U+02A54" - }, - { - "entity": "Oscr;", - "value": "U+1D4AA" - }, - { - "entity": "Oslash;", - "value": "U+000D8" - }, - { - "entity": "Oslash", - "value": "U+000D8" - }, - { - "entity": "Otilde;", - "value": "U+000D5" - }, - { - "entity": "Otilde", - "value": "U+000D5" - }, - { - "entity": "Otimes;", - "value": "U+02A37" - }, - { - "entity": "Ouml;", - "value": "U+000D6" - }, - { - "entity": "Ouml", - "value": "U+000D6" - }, - { - "entity": "OverBar;", - "value": "U+0203E" - }, - { - "entity": "OverBrace;", - "value": "U+023DE" - }, - { - "entity": "OverBracket;", - "value": "U+023B4" - }, - { - "entity": "OverParenthesis;", - "value": "U+023DC" - }, - { - "entity": "PartialD;", - "value": "U+02202" - }, - { - "entity": "Pcy;", - "value": "U+0041F" - }, - { - "entity": "Pfr;", - "value": "U+1D513" - }, - { - "entity": "Phi;", - "value": "U+003A6" - }, - { - "entity": "Pi;", - "value": "U+003A0" - }, - { - "entity": "PlusMinus;", - "value": "U+000B1" - }, - { - "entity": "Poincareplane;", - "value": "U+0210C" - }, - { - "entity": "Popf;", - "value": "U+02119" - }, - { - "entity": "Pr;", - "value": "U+02ABB" - }, - { - "entity": "Precedes;", - "value": "U+0227A" - }, - { - "entity": "PrecedesEqual;", - "value": "U+02AAF" - }, - { - "entity": "PrecedesSlantEqual;", - "value": "U+0227C" - }, - { - "entity": "PrecedesTilde;", - "value": "U+0227E" - }, - { - "entity": "Prime;", - "value": "U+02033" - }, - { - "entity": "Product;", - "value": "U+0220F" - }, - { - "entity": "Proportion;", - "value": "U+02237" - }, - { - "entity": "Proportional;", - "value": "U+0221D" - }, - { - "entity": "Pscr;", - "value": "U+1D4AB" - }, - { - "entity": "Psi;", - "value": "U+003A8" - }, - { - "entity": "QUOT;", - "value": "U+00022" - }, - { - "entity": "QUOT", - "value": "U+00022" - }, - { - "entity": "Qfr;", - "value": "U+1D514" - }, - { - "entity": "Qopf;", - "value": "U+0211A" - }, - { - "entity": "Qscr;", - "value": "U+1D4AC" - }, - { - "entity": "RBarr;", - "value": "U+02910" - }, - { - "entity": "REG;", - "value": "U+000AE" - }, - { - "entity": "REG", - "value": "U+000AE" - }, - { - "entity": "Racute;", - "value": "U+00154" - }, - { - "entity": "Rang;", - "value": "U+027EB" - }, - { - "entity": "Rarr;", - "value": "U+021A0" - }, - { - "entity": "Rarrtl;", - "value": "U+02916" - }, - { - "entity": "Rcaron;", - "value": "U+00158" - }, - { - "entity": "Rcedil;", - "value": "U+00156" - }, - { - "entity": "Rcy;", - "value": "U+00420" - }, - { - "entity": "Re;", - "value": "U+0211C" - }, - { - "entity": "ReverseElement;", - "value": "U+0220B" - }, - { - "entity": "ReverseEquilibrium;", - "value": "U+021CB" - }, - { - "entity": "ReverseUpEquilibrium;", - "value": "U+0296F" - }, - { - "entity": "Rfr;", - "value": "U+0211C" - }, - { - "entity": "Rho;", - "value": "U+003A1" - }, - { - "entity": "RightAngleBracket;", - "value": "U+027E9" - }, - { - "entity": "RightArrow;", - "value": "U+02192" - }, - { - "entity": "RightArrowBar;", - "value": "U+021E5" - }, - { - "entity": "RightArrowLeftArrow;", - "value": "U+021C4" - }, - { - "entity": "RightCeiling;", - "value": "U+02309" - }, - { - "entity": "RightDoubleBracket;", - "value": "U+027E7" - }, - { - "entity": "RightDownTeeVector;", - "value": "U+0295D" - }, - { - "entity": "RightDownVector;", - "value": "U+021C2" - }, - { - "entity": "RightDownVectorBar;", - "value": "U+02955" - }, - { - "entity": "RightFloor;", - "value": "U+0230B" - }, - { - "entity": "RightTee;", - "value": "U+022A2" - }, - { - "entity": "RightTeeArrow;", - "value": "U+021A6" - }, - { - "entity": "RightTeeVector;", - "value": "U+0295B" - }, - { - "entity": "RightTriangle;", - "value": "U+022B3" - }, - { - "entity": "RightTriangleBar;", - "value": "U+029D0" - }, - { - "entity": "RightTriangleEqual;", - "value": "U+022B5" - }, - { - "entity": "RightUpDownVector;", - "value": "U+0294F" - }, - { - "entity": "RightUpTeeVector;", - "value": "U+0295C" - }, - { - "entity": "RightUpVector;", - "value": "U+021BE" - }, - { - "entity": "RightUpVectorBar;", - "value": "U+02954" - }, - { - "entity": "RightVector;", - "value": "U+021C0" - }, - { - "entity": "RightVectorBar;", - "value": "U+02953" - }, - { - "entity": "Rightarrow;", - "value": "U+021D2" - }, - { - "entity": "Ropf;", - "value": "U+0211D" - }, - { - "entity": "RoundImplies;", - "value": "U+02970" - }, - { - "entity": "Rrightarrow;", - "value": "U+021DB" - }, - { - "entity": "Rscr;", - "value": "U+0211B" - }, - { - "entity": "Rsh;", - "value": "U+021B1" - }, - { - "entity": "RuleDelayed;", - "value": "U+029F4" - }, - { - "entity": "SHCHcy;", - "value": "U+00429" - }, - { - "entity": "SHcy;", - "value": "U+00428" - }, - { - "entity": "SOFTcy;", - "value": "U+0042C" - }, - { - "entity": "Sacute;", - "value": "U+0015A" - }, - { - "entity": "Sc;", - "value": "U+02ABC" - }, - { - "entity": "Scaron;", - "value": "U+00160" - }, - { - "entity": "Scedil;", - "value": "U+0015E" - }, - { - "entity": "Scirc;", - "value": "U+0015C" - }, - { - "entity": "Scy;", - "value": "U+00421" - }, - { - "entity": "Sfr;", - "value": "U+1D516" - }, - { - "entity": "ShortDownArrow;", - "value": "U+02193" - }, - { - "entity": "ShortLeftArrow;", - "value": "U+02190" - }, - { - "entity": "ShortRightArrow;", - "value": "U+02192" - }, - { - "entity": "ShortUpArrow;", - "value": "U+02191" - }, - { - "entity": "Sigma;", - "value": "U+003A3" - }, - { - "entity": "SmallCircle;", - "value": "U+02218" - }, - { - "entity": "Sopf;", - "value": "U+1D54A" - }, - { - "entity": "Sqrt;", - "value": "U+0221A" - }, - { - "entity": "Square;", - "value": "U+025A1" - }, - { - "entity": "SquareIntersection;", - "value": "U+02293" - }, - { - "entity": "SquareSubset;", - "value": "U+0228F" - }, - { - "entity": "SquareSubsetEqual;", - "value": "U+02291" - }, - { - "entity": "SquareSuperset;", - "value": "U+02290" - }, - { - "entity": "SquareSupersetEqual;", - "value": "U+02292" - }, - { - "entity": "SquareUnion;", - "value": "U+02294" - }, - { - "entity": "Sscr;", - "value": "U+1D4AE" - }, - { - "entity": "Star;", - "value": "U+022C6" - }, - { - "entity": "Sub;", - "value": "U+022D0" - }, - { - "entity": "Subset;", - "value": "U+022D0" - }, - { - "entity": "SubsetEqual;", - "value": "U+02286" - }, - { - "entity": "Succeeds;", - "value": "U+0227B" - }, - { - "entity": "SucceedsEqual;", - "value": "U+02AB0" - }, - { - "entity": "SucceedsSlantEqual;", - "value": "U+0227D" - }, - { - "entity": "SucceedsTilde;", - "value": "U+0227F" - }, - { - "entity": "SuchThat;", - "value": "U+0220B" - }, - { - "entity": "Sum;", - "value": "U+02211" - }, - { - "entity": "Sup;", - "value": "U+022D1" - }, - { - "entity": "Superset;", - "value": "U+02283" - }, - { - "entity": "SupersetEqual;", - "value": "U+02287" - }, - { - "entity": "Supset;", - "value": "U+022D1" - }, - { - "entity": "THORN;", - "value": "U+000DE" - }, - { - "entity": "THORN", - "value": "U+000DE" - }, - { - "entity": "TRADE;", - "value": "U+02122" - }, - { - "entity": "TSHcy;", - "value": "U+0040B" - }, - { - "entity": "TScy;", - "value": "U+00426" - }, - { - "entity": "Tab;", - "value": "U+00009" - }, - { - "entity": "Tau;", - "value": "U+003A4" - }, - { - "entity": "Tcaron;", - "value": "U+00164" - }, - { - "entity": "Tcedil;", - "value": "U+00162" - }, - { - "entity": "Tcy;", - "value": "U+00422" - }, - { - "entity": "Tfr;", - "value": "U+1D517" - }, - { - "entity": "Therefore;", - "value": "U+02234" - }, - { - "entity": "Theta;", - "value": "U+00398" - }, - { - "entity": "ThinSpace;", - "value": "U+02009" - }, - { - "entity": "Tilde;", - "value": "U+0223C" - }, - { - "entity": "TildeEqual;", - "value": "U+02243" - }, - { - "entity": "TildeFullEqual;", - "value": "U+02245" - }, - { - "entity": "TildeTilde;", - "value": "U+02248" - }, - { - "entity": "Topf;", - "value": "U+1D54B" - }, - { - "entity": "TripleDot;", - "value": "U+020DB" - }, - { - "entity": "Tscr;", - "value": "U+1D4AF" - }, - { - "entity": "Tstrok;", - "value": "U+00166" - }, - { - "entity": "Uacute;", - "value": "U+000DA" - }, - { - "entity": "Uacute", - "value": "U+000DA" - }, - { - "entity": "Uarr;", - "value": "U+0219F" - }, - { - "entity": "Uarrocir;", - "value": "U+02949" - }, - { - "entity": "Ubrcy;", - "value": "U+0040E" - }, - { - "entity": "Ubreve;", - "value": "U+0016C" - }, - { - "entity": "Ucirc;", - "value": "U+000DB" - }, - { - "entity": "Ucirc", - "value": "U+000DB" - }, - { - "entity": "Ucy;", - "value": "U+00423" - }, - { - "entity": "Udblac;", - "value": "U+00170" - }, - { - "entity": "Ufr;", - "value": "U+1D518" - }, - { - "entity": "Ugrave;", - "value": "U+000D9" - }, - { - "entity": "Ugrave", - "value": "U+000D9" - }, - { - "entity": "Umacr;", - "value": "U+0016A" - }, - { - "entity": "UnderBar;", - "value": "U+0005F" - }, - { - "entity": "UnderBrace;", - "value": "U+023DF" - }, - { - "entity": "UnderBracket;", - "value": "U+023B5" - }, - { - "entity": "UnderParenthesis;", - "value": "U+023DD" - }, - { - "entity": "Union;", - "value": "U+022C3" - }, - { - "entity": "UnionPlus;", - "value": "U+0228E" - }, - { - "entity": "Uogon;", - "value": "U+00172" - }, - { - "entity": "Uopf;", - "value": "U+1D54C" - }, - { - "entity": "UpArrow;", - "value": "U+02191" - }, - { - "entity": "UpArrowBar;", - "value": "U+02912" - }, - { - "entity": "UpArrowDownArrow;", - "value": "U+021C5" - }, - { - "entity": "UpDownArrow;", - "value": "U+02195" - }, - { - "entity": "UpEquilibrium;", - "value": "U+0296E" - }, - { - "entity": "UpTee;", - "value": "U+022A5" - }, - { - "entity": "UpTeeArrow;", - "value": "U+021A5" - }, - { - "entity": "Uparrow;", - "value": "U+021D1" - }, - { - "entity": "Updownarrow;", - "value": "U+021D5" - }, - { - "entity": "UpperLeftArrow;", - "value": "U+02196" - }, - { - "entity": "UpperRightArrow;", - "value": "U+02197" - }, - { - "entity": "Upsi;", - "value": "U+003D2" - }, - { - "entity": "Upsilon;", - "value": "U+003A5" - }, - { - "entity": "Uring;", - "value": "U+0016E" - }, - { - "entity": "Uscr;", - "value": "U+1D4B0" - }, - { - "entity": "Utilde;", - "value": "U+00168" - }, - { - "entity": "Uuml;", - "value": "U+000DC" - }, - { - "entity": "Uuml", - "value": "U+000DC" - }, - { - "entity": "VDash;", - "value": "U+022AB" - }, - { - "entity": "Vbar;", - "value": "U+02AEB" - }, - { - "entity": "Vcy;", - "value": "U+00412" - }, - { - "entity": "Vdash;", - "value": "U+022A9" - }, - { - "entity": "Vdashl;", - "value": "U+02AE6" - }, - { - "entity": "Vee;", - "value": "U+022C1" - }, - { - "entity": "Verbar;", - "value": "U+02016" - }, - { - "entity": "Vert;", - "value": "U+02016" - }, - { - "entity": "VerticalBar;", - "value": "U+02223" - }, - { - "entity": "VerticalLine;", - "value": "U+0007C" - }, - { - "entity": "VerticalSeparator;", - "value": "U+02758" - }, - { - "entity": "VerticalTilde;", - "value": "U+02240" - }, - { - "entity": "VeryThinSpace;", - "value": "U+0200A" - }, - { - "entity": "Vfr;", - "value": "U+1D519" - }, - { - "entity": "Vopf;", - "value": "U+1D54D" - }, - { - "entity": "Vscr;", - "value": "U+1D4B1" - }, - { - "entity": "Vvdash;", - "value": "U+022AA" - }, - { - "entity": "Wcirc;", - "value": "U+00174" - }, - { - "entity": "Wedge;", - "value": "U+022C0" - }, - { - "entity": "Wfr;", - "value": "U+1D51A" - }, - { - "entity": "Wopf;", - "value": "U+1D54E" - }, - { - "entity": "Wscr;", - "value": "U+1D4B2" - }, - { - "entity": "Xfr;", - "value": "U+1D51B" - }, - { - "entity": "Xi;", - "value": "U+0039E" - }, - { - "entity": "Xopf;", - "value": "U+1D54F" - }, - { - "entity": "Xscr;", - "value": "U+1D4B3" - }, - { - "entity": "YAcy;", - "value": "U+0042F" - }, - { - "entity": "YIcy;", - "value": "U+00407" - }, - { - "entity": "YUcy;", - "value": "U+0042E" - }, - { - "entity": "Yacute;", - "value": "U+000DD" - }, - { - "entity": "Yacute", - "value": "U+000DD" - }, - { - "entity": "Ycirc;", - "value": "U+00176" - }, - { - "entity": "Ycy;", - "value": "U+0042B" - }, - { - "entity": "Yfr;", - "value": "U+1D51C" - }, - { - "entity": "Yopf;", - "value": "U+1D550" - }, - { - "entity": "Yscr;", - "value": "U+1D4B4" - }, - { - "entity": "Yuml;", - "value": "U+00178" - }, - { - "entity": "ZHcy;", - "value": "U+00416" - }, - { - "entity": "Zacute;", - "value": "U+00179" - }, - { - "entity": "Zcaron;", - "value": "U+0017D" - }, - { - "entity": "Zcy;", - "value": "U+00417" - }, - { - "entity": "Zdot;", - "value": "U+0017B" - }, - { - "entity": "ZeroWidthSpace;", - "value": "U+0200B" - }, - { - "entity": "Zeta;", - "value": "U+00396" - }, - { - "entity": "Zfr;", - "value": "U+02128" - }, - { - "entity": "Zopf;", - "value": "U+02124" - }, - { - "entity": "Zscr;", - "value": "U+1D4B5" - }, - { - "entity": "aacute;", - "value": "U+000E1" - }, - { - "entity": "aacute", - "value": "U+000E1" - }, - { - "entity": "abreve;", - "value": "U+00103" - }, - { - "entity": "ac;", - "value": "U+0223E" - }, - { - "entity": "acd;", - "value": "U+0223F" - }, - { - "entity": "acirc;", - "value": "U+000E2" - }, - { - "entity": "acirc", - "value": "U+000E2" - }, - { - "entity": "acute;", - "value": "U+000B4" - }, - { - "entity": "acute", - "value": "U+000B4" - }, - { - "entity": "acy;", - "value": "U+00430" - }, - { - "entity": "aelig;", - "value": "U+000E6" - }, - { - "entity": "aelig", - "value": "U+000E6" - }, - { - "entity": "af;", - "value": "U+02061" - }, - { - "entity": "afr;", - "value": "U+1D51E" - }, - { - "entity": "agrave;", - "value": "U+000E0" - }, - { - "entity": "agrave", - "value": "U+000E0" - }, - { - "entity": "alefsym;", - "value": "U+02135" - }, - { - "entity": "aleph;", - "value": "U+02135" - }, - { - "entity": "alpha;", - "value": "U+003B1" - }, - { - "entity": "amacr;", - "value": "U+00101" - }, - { - "entity": "amalg;", - "value": "U+02A3F" - }, - { - "entity": "amp;", - "value": "U+00026" - }, - { - "entity": "amp", - "value": "U+00026" - }, - { - "entity": "and;", - "value": "U+02227" - }, - { - "entity": "andand;", - "value": "U+02A55" - }, - { - "entity": "andd;", - "value": "U+02A5C" - }, - { - "entity": "andslope;", - "value": "U+02A58" - }, - { - "entity": "andv;", - "value": "U+02A5A" - }, - { - "entity": "ang;", - "value": "U+02220" - }, - { - "entity": "ange;", - "value": "U+029A4" - }, - { - "entity": "angle;", - "value": "U+02220" - }, - { - "entity": "angmsd;", - "value": "U+02221" - }, - { - "entity": "angmsdaa;", - "value": "U+029A8" - }, - { - "entity": "angmsdab;", - "value": "U+029A9" - }, - { - "entity": "angmsdac;", - "value": "U+029AA" - }, - { - "entity": "angmsdad;", - "value": "U+029AB" - }, - { - "entity": "angmsdae;", - "value": "U+029AC" - }, - { - "entity": "angmsdaf;", - "value": "U+029AD" - }, - { - "entity": "angmsdag;", - "value": "U+029AE" - }, - { - "entity": "angmsdah;", - "value": "U+029AF" - }, - { - "entity": "angrt;", - "value": "U+0221F" - }, - { - "entity": "angrtvb;", - "value": "U+022BE" - }, - { - "entity": "angrtvbd;", - "value": "U+0299D" - }, - { - "entity": "angsph;", - "value": "U+02222" - }, - { - "entity": "angst;", - "value": "U+000C5" - }, - { - "entity": "angzarr;", - "value": "U+0237C" - }, - { - "entity": "aogon;", - "value": "U+00105" - }, - { - "entity": "aopf;", - "value": "U+1D552" - }, - { - "entity": "ap;", - "value": "U+02248" - }, - { - "entity": "apE;", - "value": "U+02A70" - }, - { - "entity": "apacir;", - "value": "U+02A6F" - }, - { - "entity": "ape;", - "value": "U+0224A" - }, - { - "entity": "apid;", - "value": "U+0224B" - }, - { - "entity": "apos;", - "value": "U+00027" - }, - { - "entity": "approx;", - "value": "U+02248" - }, - { - "entity": "approxeq;", - "value": "U+0224A" - }, - { - "entity": "aring;", - "value": "U+000E5" - }, - { - "entity": "aring", - "value": "U+000E5" - }, - { - "entity": "ascr;", - "value": "U+1D4B6" - }, - { - "entity": "ast;", - "value": "U+0002A" - }, - { - "entity": "asymp;", - "value": "U+02248" - }, - { - "entity": "asympeq;", - "value": "U+0224D" - }, - { - "entity": "atilde;", - "value": "U+000E3" - }, - { - "entity": "atilde", - "value": "U+000E3" - }, - { - "entity": "auml;", - "value": "U+000E4" - }, - { - "entity": "auml", - "value": "U+000E4" - }, - { - "entity": "awconint;", - "value": "U+02233" - }, - { - "entity": "awint;", - "value": "U+02A11" - }, - { - "entity": "bNot;", - "value": "U+02AED" - }, - { - "entity": "backcong;", - "value": "U+0224C" - }, - { - "entity": "backepsilon;", - "value": "U+003F6" - }, - { - "entity": "backprime;", - "value": "U+02035" - }, - { - "entity": "backsim;", - "value": "U+0223D" - }, - { - "entity": "backsimeq;", - "value": "U+022CD" - }, - { - "entity": "barvee;", - "value": "U+022BD" - }, - { - "entity": "barwed;", - "value": "U+02305" - }, - { - "entity": "barwedge;", - "value": "U+02305" - }, - { - "entity": "bbrk;", - "value": "U+023B5" - }, - { - "entity": "bbrktbrk;", - "value": "U+023B6" - }, - { - "entity": "bcong;", - "value": "U+0224C" - }, - { - "entity": "bcy;", - "value": "U+00431" - }, - { - "entity": "bdquo;", - "value": "U+0201E" - }, - { - "entity": "becaus;", - "value": "U+02235" - }, - { - "entity": "because;", - "value": "U+02235" - }, - { - "entity": "bemptyv;", - "value": "U+029B0" - }, - { - "entity": "bepsi;", - "value": "U+003F6" - }, - { - "entity": "bernou;", - "value": "U+0212C" - }, - { - "entity": "beta;", - "value": "U+003B2" - }, - { - "entity": "beth;", - "value": "U+02136" - }, - { - "entity": "between;", - "value": "U+0226C" - }, - { - "entity": "bfr;", - "value": "U+1D51F" - }, - { - "entity": "bigcap;", - "value": "U+022C2" - }, - { - "entity": "bigcirc;", - "value": "U+025EF" - }, - { - "entity": "bigcup;", - "value": "U+022C3" - }, - { - "entity": "bigodot;", - "value": "U+02A00" - }, - { - "entity": "bigoplus;", - "value": "U+02A01" - }, - { - "entity": "bigotimes;", - "value": "U+02A02" - }, - { - "entity": "bigsqcup;", - "value": "U+02A06" - }, - { - "entity": "bigstar;", - "value": "U+02605" - }, - { - "entity": "bigtriangledown;", - "value": "U+025BD" - }, - { - "entity": "bigtriangleup;", - "value": "U+025B3" - }, - { - "entity": "biguplus;", - "value": "U+02A04" - }, - { - "entity": "bigvee;", - "value": "U+022C1" - }, - { - "entity": "bigwedge;", - "value": "U+022C0" - }, - { - "entity": "bkarow;", - "value": "U+0290D" - }, - { - "entity": "blacklozenge;", - "value": "U+029EB" - }, - { - "entity": "blacksquare;", - "value": "U+025AA" - }, - { - "entity": "blacktriangle;", - "value": "U+025B4" - }, - { - "entity": "blacktriangledown;", - "value": "U+025BE" - }, - { - "entity": "blacktriangleleft;", - "value": "U+025C2" - }, - { - "entity": "blacktriangleright;", - "value": "U+025B8" - }, - { - "entity": "blank;", - "value": "U+02423" - }, - { - "entity": "blk12;", - "value": "U+02592" - }, - { - "entity": "blk14;", - "value": "U+02591" - }, - { - "entity": "blk34;", - "value": "U+02593" - }, - { - "entity": "block;", - "value": "U+02588" - }, - { - "entity": "bnot;", - "value": "U+02310" - }, - { - "entity": "bopf;", - "value": "U+1D553" - }, - { - "entity": "bot;", - "value": "U+022A5" - }, - { - "entity": "bottom;", - "value": "U+022A5" - }, - { - "entity": "bowtie;", - "value": "U+022C8" - }, - { - "entity": "boxDL;", - "value": "U+02557" - }, - { - "entity": "boxDR;", - "value": "U+02554" - }, - { - "entity": "boxDl;", - "value": "U+02556" - }, - { - "entity": "boxDr;", - "value": "U+02553" - }, - { - "entity": "boxH;", - "value": "U+02550" - }, - { - "entity": "boxHD;", - "value": "U+02566" - }, - { - "entity": "boxHU;", - "value": "U+02569" - }, - { - "entity": "boxHd;", - "value": "U+02564" - }, - { - "entity": "boxHu;", - "value": "U+02567" - }, - { - "entity": "boxUL;", - "value": "U+0255D" - }, - { - "entity": "boxUR;", - "value": "U+0255A" - }, - { - "entity": "boxUl;", - "value": "U+0255C" - }, - { - "entity": "boxUr;", - "value": "U+02559" - }, - { - "entity": "boxV;", - "value": "U+02551" - }, - { - "entity": "boxVH;", - "value": "U+0256C" - }, - { - "entity": "boxVL;", - "value": "U+02563" - }, - { - "entity": "boxVR;", - "value": "U+02560" - }, - { - "entity": "boxVh;", - "value": "U+0256B" - }, - { - "entity": "boxVl;", - "value": "U+02562" - }, - { - "entity": "boxVr;", - "value": "U+0255F" - }, - { - "entity": "boxbox;", - "value": "U+029C9" - }, - { - "entity": "boxdL;", - "value": "U+02555" - }, - { - "entity": "boxdR;", - "value": "U+02552" - }, - { - "entity": "boxdl;", - "value": "U+02510" - }, - { - "entity": "boxdr;", - "value": "U+0250C" - }, - { - "entity": "boxh;", - "value": "U+02500" - }, - { - "entity": "boxhD;", - "value": "U+02565" - }, - { - "entity": "boxhU;", - "value": "U+02568" - }, - { - "entity": "boxhd;", - "value": "U+0252C" - }, - { - "entity": "boxhu;", - "value": "U+02534" - }, - { - "entity": "boxminus;", - "value": "U+0229F" - }, - { - "entity": "boxplus;", - "value": "U+0229E" - }, - { - "entity": "boxtimes;", - "value": "U+022A0" - }, - { - "entity": "boxuL;", - "value": "U+0255B" - }, - { - "entity": "boxuR;", - "value": "U+02558" - }, - { - "entity": "boxul;", - "value": "U+02518" - }, - { - "entity": "boxur;", - "value": "U+02514" - }, - { - "entity": "boxv;", - "value": "U+02502" - }, - { - "entity": "boxvH;", - "value": "U+0256A" - }, - { - "entity": "boxvL;", - "value": "U+02561" - }, - { - "entity": "boxvR;", - "value": "U+0255E" - }, - { - "entity": "boxvh;", - "value": "U+0253C" - }, - { - "entity": "boxvl;", - "value": "U+02524" - }, - { - "entity": "boxvr;", - "value": "U+0251C" - }, - { - "entity": "bprime;", - "value": "U+02035" - }, - { - "entity": "breve;", - "value": "U+002D8" - }, - { - "entity": "brvbar;", - "value": "U+000A6" - }, - { - "entity": "brvbar", - "value": "U+000A6" - }, - { - "entity": "bscr;", - "value": "U+1D4B7" - }, - { - "entity": "bsemi;", - "value": "U+0204F" - }, - { - "entity": "bsim;", - "value": "U+0223D" - }, - { - "entity": "bsime;", - "value": "U+022CD" - }, - { - "entity": "bsol;", - "value": "U+0005C" - }, - { - "entity": "bsolb;", - "value": "U+029C5" - }, - { - "entity": "bsolhsub;", - "value": "U+027C8" - }, - { - "entity": "bull;", - "value": "U+02022" - }, - { - "entity": "bullet;", - "value": "U+02022" - }, - { - "entity": "bump;", - "value": "U+0224E" - }, - { - "entity": "bumpE;", - "value": "U+02AAE" - }, - { - "entity": "bumpe;", - "value": "U+0224F" - }, - { - "entity": "bumpeq;", - "value": "U+0224F" - }, - { - "entity": "cacute;", - "value": "U+00107" - }, - { - "entity": "cap;", - "value": "U+02229" - }, - { - "entity": "capand;", - "value": "U+02A44" - }, - { - "entity": "capbrcup;", - "value": "U+02A49" - }, - { - "entity": "capcap;", - "value": "U+02A4B" - }, - { - "entity": "capcup;", - "value": "U+02A47" - }, - { - "entity": "capdot;", - "value": "U+02A40" - }, - { - "entity": "caret;", - "value": "U+02041" - }, - { - "entity": "caron;", - "value": "U+002C7" - }, - { - "entity": "ccaps;", - "value": "U+02A4D" - }, - { - "entity": "ccaron;", - "value": "U+0010D" - }, - { - "entity": "ccedil;", - "value": "U+000E7" - }, - { - "entity": "ccedil", - "value": "U+000E7" - }, - { - "entity": "ccirc;", - "value": "U+00109" - }, - { - "entity": "ccups;", - "value": "U+02A4C" - }, - { - "entity": "ccupssm;", - "value": "U+02A50" - }, - { - "entity": "cdot;", - "value": "U+0010B" - }, - { - "entity": "cedil;", - "value": "U+000B8" - }, - { - "entity": "cedil", - "value": "U+000B8" - }, - { - "entity": "cemptyv;", - "value": "U+029B2" - }, - { - "entity": "cent;", - "value": "U+000A2" - }, - { - "entity": "cent", - "value": "U+000A2" - }, - { - "entity": "centerdot;", - "value": "U+000B7" - }, - { - "entity": "cfr;", - "value": "U+1D520" - }, - { - "entity": "chcy;", - "value": "U+00447" - }, - { - "entity": "check;", - "value": "U+02713" - }, - { - "entity": "checkmark;", - "value": "U+02713" - }, - { - "entity": "chi;", - "value": "U+003C7" - }, - { - "entity": "cir;", - "value": "U+025CB" - }, - { - "entity": "cirE;", - "value": "U+029C3" - }, - { - "entity": "circ;", - "value": "U+002C6" - }, - { - "entity": "circeq;", - "value": "U+02257" - }, - { - "entity": "circlearrowleft;", - "value": "U+021BA" - }, - { - "entity": "circlearrowright;", - "value": "U+021BB" - }, - { - "entity": "circledR;", - "value": "U+000AE" - }, - { - "entity": "circledS;", - "value": "U+024C8" - }, - { - "entity": "circledast;", - "value": "U+0229B" - }, - { - "entity": "circledcirc;", - "value": "U+0229A" - }, - { - "entity": "circleddash;", - "value": "U+0229D" - }, - { - "entity": "cire;", - "value": "U+02257" - }, - { - "entity": "cirfnint;", - "value": "U+02A10" - }, - { - "entity": "cirmid;", - "value": "U+02AEF" - }, - { - "entity": "cirscir;", - "value": "U+029C2" - }, - { - "entity": "clubs;", - "value": "U+02663" - }, - { - "entity": "clubsuit;", - "value": "U+02663" - }, - { - "entity": "colon;", - "value": "U+0003A" - }, - { - "entity": "colone;", - "value": "U+02254" - }, - { - "entity": "coloneq;", - "value": "U+02254" - }, - { - "entity": "comma;", - "value": "U+0002C" - }, - { - "entity": "commat;", - "value": "U+00040" - }, - { - "entity": "comp;", - "value": "U+02201" - }, - { - "entity": "compfn;", - "value": "U+02218" - }, - { - "entity": "complement;", - "value": "U+02201" - }, - { - "entity": "complexes;", - "value": "U+02102" - }, - { - "entity": "cong;", - "value": "U+02245" - }, - { - "entity": "congdot;", - "value": "U+02A6D" - }, - { - "entity": "conint;", - "value": "U+0222E" - }, - { - "entity": "copf;", - "value": "U+1D554" - }, - { - "entity": "coprod;", - "value": "U+02210" - }, - { - "entity": "copy;", - "value": "U+000A9" - }, - { - "entity": "copy", - "value": "U+000A9" - }, - { - "entity": "copysr;", - "value": "U+02117" - }, - { - "entity": "crarr;", - "value": "U+021B5" - }, - { - "entity": "cross;", - "value": "U+02717" - }, - { - "entity": "cscr;", - "value": "U+1D4B8" - }, - { - "entity": "csub;", - "value": "U+02ACF" - }, - { - "entity": "csube;", - "value": "U+02AD1" - }, - { - "entity": "csup;", - "value": "U+02AD0" - }, - { - "entity": "csupe;", - "value": "U+02AD2" - }, - { - "entity": "ctdot;", - "value": "U+022EF" - }, - { - "entity": "cudarrl;", - "value": "U+02938" - }, - { - "entity": "cudarrr;", - "value": "U+02935" - }, - { - "entity": "cuepr;", - "value": "U+022DE" - }, - { - "entity": "cuesc;", - "value": "U+022DF" - }, - { - "entity": "cularr;", - "value": "U+021B6" - }, - { - "entity": "cularrp;", - "value": "U+0293D" - }, - { - "entity": "cup;", - "value": "U+0222A" - }, - { - "entity": "cupbrcap;", - "value": "U+02A48" - }, - { - "entity": "cupcap;", - "value": "U+02A46" - }, - { - "entity": "cupcup;", - "value": "U+02A4A" - }, - { - "entity": "cupdot;", - "value": "U+0228D" - }, - { - "entity": "cupor;", - "value": "U+02A45" - }, - { - "entity": "curarr;", - "value": "U+021B7" - }, - { - "entity": "curarrm;", - "value": "U+0293C" - }, - { - "entity": "curlyeqprec;", - "value": "U+022DE" - }, - { - "entity": "curlyeqsucc;", - "value": "U+022DF" - }, - { - "entity": "curlyvee;", - "value": "U+022CE" - }, - { - "entity": "curlywedge;", - "value": "U+022CF" - }, - { - "entity": "curren;", - "value": "U+000A4" - }, - { - "entity": "curren", - "value": "U+000A4" - }, - { - "entity": "curvearrowleft;", - "value": "U+021B6" - }, - { - "entity": "curvearrowright;", - "value": "U+021B7" - }, - { - "entity": "cuvee;", - "value": "U+022CE" - }, - { - "entity": "cuwed;", - "value": "U+022CF" - }, - { - "entity": "cwconint;", - "value": "U+02232" - }, - { - "entity": "cwint;", - "value": "U+02231" - }, - { - "entity": "cylcty;", - "value": "U+0232D" - }, - { - "entity": "dArr;", - "value": "U+021D3" - }, - { - "entity": "dHar;", - "value": "U+02965" - }, - { - "entity": "dagger;", - "value": "U+02020" - }, - { - "entity": "daleth;", - "value": "U+02138" - }, - { - "entity": "darr;", - "value": "U+02193" - }, - { - "entity": "dash;", - "value": "U+02010" - }, - { - "entity": "dashv;", - "value": "U+022A3" - }, - { - "entity": "dbkarow;", - "value": "U+0290F" - }, - { - "entity": "dblac;", - "value": "U+002DD" - }, - { - "entity": "dcaron;", - "value": "U+0010F" - }, - { - "entity": "dcy;", - "value": "U+00434" - }, - { - "entity": "dd;", - "value": "U+02146" - }, - { - "entity": "ddagger;", - "value": "U+02021" - }, - { - "entity": "ddarr;", - "value": "U+021CA" - }, - { - "entity": "ddotseq;", - "value": "U+02A77" - }, - { - "entity": "deg;", - "value": "U+000B0" - }, - { - "entity": "deg", - "value": "U+000B0" - }, - { - "entity": "delta;", - "value": "U+003B4" - }, - { - "entity": "demptyv;", - "value": "U+029B1" - }, - { - "entity": "dfisht;", - "value": "U+0297F" - }, - { - "entity": "dfr;", - "value": "U+1D521" - }, - { - "entity": "dharl;", - "value": "U+021C3" - }, - { - "entity": "dharr;", - "value": "U+021C2" - }, - { - "entity": "diam;", - "value": "U+022C4" - }, - { - "entity": "diamond;", - "value": "U+022C4" - }, - { - "entity": "diamondsuit;", - "value": "U+02666" - }, - { - "entity": "diams;", - "value": "U+02666" - }, - { - "entity": "die;", - "value": "U+000A8" - }, - { - "entity": "digamma;", - "value": "U+003DD" - }, - { - "entity": "disin;", - "value": "U+022F2" - }, - { - "entity": "div;", - "value": "U+000F7" - }, - { - "entity": "divide;", - "value": "U+000F7" - }, - { - "entity": "divide", - "value": "U+000F7" - }, - { - "entity": "divideontimes;", - "value": "U+022C7" - }, - { - "entity": "divonx;", - "value": "U+022C7" - }, - { - "entity": "djcy;", - "value": "U+00452" - }, - { - "entity": "dlcorn;", - "value": "U+0231E" - }, - { - "entity": "dlcrop;", - "value": "U+0230D" - }, - { - "entity": "dollar;", - "value": "U+00024" - }, - { - "entity": "dopf;", - "value": "U+1D555" - }, - { - "entity": "dot;", - "value": "U+002D9" - }, - { - "entity": "doteq;", - "value": "U+02250" - }, - { - "entity": "doteqdot;", - "value": "U+02251" - }, - { - "entity": "dotminus;", - "value": "U+02238" - }, - { - "entity": "dotplus;", - "value": "U+02214" - }, - { - "entity": "dotsquare;", - "value": "U+022A1" - }, - { - "entity": "doublebarwedge;", - "value": "U+02306" - }, - { - "entity": "downarrow;", - "value": "U+02193" - }, - { - "entity": "downdownarrows;", - "value": "U+021CA" - }, - { - "entity": "downharpoonleft;", - "value": "U+021C3" - }, - { - "entity": "downharpoonright;", - "value": "U+021C2" - }, - { - "entity": "drbkarow;", - "value": "U+02910" - }, - { - "entity": "drcorn;", - "value": "U+0231F" - }, - { - "entity": "drcrop;", - "value": "U+0230C" - }, - { - "entity": "dscr;", - "value": "U+1D4B9" - }, - { - "entity": "dscy;", - "value": "U+00455" - }, - { - "entity": "dsol;", - "value": "U+029F6" - }, - { - "entity": "dstrok;", - "value": "U+00111" - }, - { - "entity": "dtdot;", - "value": "U+022F1" - }, - { - "entity": "dtri;", - "value": "U+025BF" - }, - { - "entity": "dtrif;", - "value": "U+025BE" - }, - { - "entity": "duarr;", - "value": "U+021F5" - }, - { - "entity": "duhar;", - "value": "U+0296F" - }, - { - "entity": "dwangle;", - "value": "U+029A6" - }, - { - "entity": "dzcy;", - "value": "U+0045F" - }, - { - "entity": "dzigrarr;", - "value": "U+027FF" - }, - { - "entity": "eDDot;", - "value": "U+02A77" - }, - { - "entity": "eDot;", - "value": "U+02251" - }, - { - "entity": "eacute;", - "value": "U+000E9" - }, - { - "entity": "eacute", - "value": "U+000E9" - }, - { - "entity": "easter;", - "value": "U+02A6E" - }, - { - "entity": "ecaron;", - "value": "U+0011B" - }, - { - "entity": "ecir;", - "value": "U+02256" - }, - { - "entity": "ecirc;", - "value": "U+000EA" - }, - { - "entity": "ecirc", - "value": "U+000EA" - }, - { - "entity": "ecolon;", - "value": "U+02255" - }, - { - "entity": "ecy;", - "value": "U+0044D" - }, - { - "entity": "edot;", - "value": "U+00117" - }, - { - "entity": "ee;", - "value": "U+02147" - }, - { - "entity": "efDot;", - "value": "U+02252" - }, - { - "entity": "efr;", - "value": "U+1D522" - }, - { - "entity": "eg;", - "value": "U+02A9A" - }, - { - "entity": "egrave;", - "value": "U+000E8" - }, - { - "entity": "egrave", - "value": "U+000E8" - }, - { - "entity": "egs;", - "value": "U+02A96" - }, - { - "entity": "egsdot;", - "value": "U+02A98" - }, - { - "entity": "el;", - "value": "U+02A99" - }, - { - "entity": "elinters;", - "value": "U+023E7" - }, - { - "entity": "ell;", - "value": "U+02113" - }, - { - "entity": "els;", - "value": "U+02A95" - }, - { - "entity": "elsdot;", - "value": "U+02A97" - }, - { - "entity": "emacr;", - "value": "U+00113" - }, - { - "entity": "empty;", - "value": "U+02205" - }, - { - "entity": "emptyset;", - "value": "U+02205" - }, - { - "entity": "emptyv;", - "value": "U+02205" - }, - { - "entity": "emsp13;", - "value": "U+02004" - }, - { - "entity": "emsp14;", - "value": "U+02005" - }, - { - "entity": "emsp;", - "value": "U+02003" - }, - { - "entity": "eng;", - "value": "U+0014B" - }, - { - "entity": "ensp;", - "value": "U+02002" - }, - { - "entity": "eogon;", - "value": "U+00119" - }, - { - "entity": "eopf;", - "value": "U+1D556" - }, - { - "entity": "epar;", - "value": "U+022D5" - }, - { - "entity": "eparsl;", - "value": "U+029E3" - }, - { - "entity": "eplus;", - "value": "U+02A71" - }, - { - "entity": "epsi;", - "value": "U+003B5" - }, - { - "entity": "epsilon;", - "value": "U+003B5" - }, - { - "entity": "epsiv;", - "value": "U+003F5" - }, - { - "entity": "eqcirc;", - "value": "U+02256" - }, - { - "entity": "eqcolon;", - "value": "U+02255" - }, - { - "entity": "eqsim;", - "value": "U+02242" - }, - { - "entity": "eqslantgtr;", - "value": "U+02A96" - }, - { - "entity": "eqslantless;", - "value": "U+02A95" - }, - { - "entity": "equals;", - "value": "U+0003D" - }, - { - "entity": "equest;", - "value": "U+0225F" - }, - { - "entity": "equiv;", - "value": "U+02261" - }, - { - "entity": "equivDD;", - "value": "U+02A78" - }, - { - "entity": "eqvparsl;", - "value": "U+029E5" - }, - { - "entity": "erDot;", - "value": "U+02253" - }, - { - "entity": "erarr;", - "value": "U+02971" - }, - { - "entity": "escr;", - "value": "U+0212F" - }, - { - "entity": "esdot;", - "value": "U+02250" - }, - { - "entity": "esim;", - "value": "U+02242" - }, - { - "entity": "eta;", - "value": "U+003B7" - }, - { - "entity": "eth;", - "value": "U+000F0" - }, - { - "entity": "eth", - "value": "U+000F0" - }, - { - "entity": "euml;", - "value": "U+000EB" - }, - { - "entity": "euml", - "value": "U+000EB" - }, - { - "entity": "euro;", - "value": "U+020AC" - }, - { - "entity": "excl;", - "value": "U+00021" - }, - { - "entity": "exist;", - "value": "U+02203" - }, - { - "entity": "expectation;", - "value": "U+02130" - }, - { - "entity": "exponentiale;", - "value": "U+02147" - }, - { - "entity": "fallingdotseq;", - "value": "U+02252" - }, - { - "entity": "fcy;", - "value": "U+00444" - }, - { - "entity": "female;", - "value": "U+02640" - }, - { - "entity": "ffilig;", - "value": "U+0FB03" - }, - { - "entity": "fflig;", - "value": "U+0FB00" - }, - { - "entity": "ffllig;", - "value": "U+0FB04" - }, - { - "entity": "ffr;", - "value": "U+1D523" - }, - { - "entity": "filig;", - "value": "U+0FB01" - }, - { - "entity": "flat;", - "value": "U+0266D" - }, - { - "entity": "fllig;", - "value": "U+0FB02" - }, - { - "entity": "fltns;", - "value": "U+025B1" - }, - { - "entity": "fnof;", - "value": "U+00192" - }, - { - "entity": "fopf;", - "value": "U+1D557" - }, - { - "entity": "forall;", - "value": "U+02200" - }, - { - "entity": "fork;", - "value": "U+022D4" - }, - { - "entity": "forkv;", - "value": "U+02AD9" - }, - { - "entity": "fpartint;", - "value": "U+02A0D" - }, - { - "entity": "frac12;", - "value": "U+000BD" - }, - { - "entity": "frac12", - "value": "U+000BD" - }, - { - "entity": "frac13;", - "value": "U+02153" - }, - { - "entity": "frac14;", - "value": "U+000BC" - }, - { - "entity": "frac14", - "value": "U+000BC" - }, - { - "entity": "frac15;", - "value": "U+02155" - }, - { - "entity": "frac16;", - "value": "U+02159" - }, - { - "entity": "frac18;", - "value": "U+0215B" - }, - { - "entity": "frac23;", - "value": "U+02154" - }, - { - "entity": "frac25;", - "value": "U+02156" - }, - { - "entity": "frac34;", - "value": "U+000BE" - }, - { - "entity": "frac34", - "value": "U+000BE" - }, - { - "entity": "frac35;", - "value": "U+02157" - }, - { - "entity": "frac38;", - "value": "U+0215C" - }, - { - "entity": "frac45;", - "value": "U+02158" - }, - { - "entity": "frac56;", - "value": "U+0215A" - }, - { - "entity": "frac58;", - "value": "U+0215D" - }, - { - "entity": "frac78;", - "value": "U+0215E" - }, - { - "entity": "frasl;", - "value": "U+02044" - }, - { - "entity": "frown;", - "value": "U+02322" - }, - { - "entity": "fscr;", - "value": "U+1D4BB" - }, - { - "entity": "gE;", - "value": "U+02267" - }, - { - "entity": "gEl;", - "value": "U+02A8C" - }, - { - "entity": "gacute;", - "value": "U+001F5" - }, - { - "entity": "gamma;", - "value": "U+003B3" - }, - { - "entity": "gammad;", - "value": "U+003DD" - }, - { - "entity": "gap;", - "value": "U+02A86" - }, - { - "entity": "gbreve;", - "value": "U+0011F" - }, - { - "entity": "gcirc;", - "value": "U+0011D" - }, - { - "entity": "gcy;", - "value": "U+00433" - }, - { - "entity": "gdot;", - "value": "U+00121" - }, - { - "entity": "ge;", - "value": "U+02265" - }, - { - "entity": "gel;", - "value": "U+022DB" - }, - { - "entity": "geq;", - "value": "U+02265" - }, - { - "entity": "geqq;", - "value": "U+02267" - }, - { - "entity": "geqslant;", - "value": "U+02A7E" - }, - { - "entity": "ges;", - "value": "U+02A7E" - }, - { - "entity": "gescc;", - "value": "U+02AA9" - }, - { - "entity": "gesdot;", - "value": "U+02A80" - }, - { - "entity": "gesdoto;", - "value": "U+02A82" - }, - { - "entity": "gesdotol;", - "value": "U+02A84" - }, - { - "entity": "gesles;", - "value": "U+02A94" - }, - { - "entity": "gfr;", - "value": "U+1D524" - }, - { - "entity": "gg;", - "value": "U+0226B" - }, - { - "entity": "ggg;", - "value": "U+022D9" - }, - { - "entity": "gimel;", - "value": "U+02137" - }, - { - "entity": "gjcy;", - "value": "U+00453" - }, - { - "entity": "gl;", - "value": "U+02277" - }, - { - "entity": "glE;", - "value": "U+02A92" - }, - { - "entity": "gla;", - "value": "U+02AA5" - }, - { - "entity": "glj;", - "value": "U+02AA4" - }, - { - "entity": "gnE;", - "value": "U+02269" - }, - { - "entity": "gnap;", - "value": "U+02A8A" - }, - { - "entity": "gnapprox;", - "value": "U+02A8A" - }, - { - "entity": "gne;", - "value": "U+02A88" - }, - { - "entity": "gneq;", - "value": "U+02A88" - }, - { - "entity": "gneqq;", - "value": "U+02269" - }, - { - "entity": "gnsim;", - "value": "U+022E7" - }, - { - "entity": "gopf;", - "value": "U+1D558" - }, - { - "entity": "grave;", - "value": "U+00060" - }, - { - "entity": "gscr;", - "value": "U+0210A" - }, - { - "entity": "gsim;", - "value": "U+02273" - }, - { - "entity": "gsime;", - "value": "U+02A8E" - }, - { - "entity": "gsiml;", - "value": "U+02A90" - }, - { - "entity": "gt;", - "value": "U+0003E" - }, - { - "entity": "gt", - "value": "U+0003E" - }, - { - "entity": "gtcc;", - "value": "U+02AA7" - }, - { - "entity": "gtcir;", - "value": "U+02A7A" - }, - { - "entity": "gtdot;", - "value": "U+022D7" - }, - { - "entity": "gtlPar;", - "value": "U+02995" - }, - { - "entity": "gtquest;", - "value": "U+02A7C" - }, - { - "entity": "gtrapprox;", - "value": "U+02A86" - }, - { - "entity": "gtrarr;", - "value": "U+02978" - }, - { - "entity": "gtrdot;", - "value": "U+022D7" - }, - { - "entity": "gtreqless;", - "value": "U+022DB" - }, - { - "entity": "gtreqqless;", - "value": "U+02A8C" - }, - { - "entity": "gtrless;", - "value": "U+02277" - }, - { - "entity": "gtrsim;", - "value": "U+02273" - }, - { - "entity": "hArr;", - "value": "U+021D4" - }, - { - "entity": "hairsp;", - "value": "U+0200A" - }, - { - "entity": "half;", - "value": "U+000BD" - }, - { - "entity": "hamilt;", - "value": "U+0210B" - }, - { - "entity": "hardcy;", - "value": "U+0044A" - }, - { - "entity": "harr;", - "value": "U+02194" - }, - { - "entity": "harrcir;", - "value": "U+02948" - }, - { - "entity": "harrw;", - "value": "U+021AD" - }, - { - "entity": "hbar;", - "value": "U+0210F" - }, - { - "entity": "hcirc;", - "value": "U+00125" - }, - { - "entity": "hearts;", - "value": "U+02665" - }, - { - "entity": "heartsuit;", - "value": "U+02665" - }, - { - "entity": "hellip;", - "value": "U+02026" - }, - { - "entity": "hercon;", - "value": "U+022B9" - }, - { - "entity": "hfr;", - "value": "U+1D525" - }, - { - "entity": "hksearow;", - "value": "U+02925" - }, - { - "entity": "hkswarow;", - "value": "U+02926" - }, - { - "entity": "hoarr;", - "value": "U+021FF" - }, - { - "entity": "homtht;", - "value": "U+0223B" - }, - { - "entity": "hookleftarrow;", - "value": "U+021A9" - }, - { - "entity": "hookrightarrow;", - "value": "U+021AA" - }, - { - "entity": "hopf;", - "value": "U+1D559" - }, - { - "entity": "horbar;", - "value": "U+02015" - }, - { - "entity": "hscr;", - "value": "U+1D4BD" - }, - { - "entity": "hslash;", - "value": "U+0210F" - }, - { - "entity": "hstrok;", - "value": "U+00127" - }, - { - "entity": "hybull;", - "value": "U+02043" - }, - { - "entity": "hyphen;", - "value": "U+02010" - }, - { - "entity": "iacute;", - "value": "U+000ED" - }, - { - "entity": "iacute", - "value": "U+000ED" - }, - { - "entity": "ic;", - "value": "U+02063" - }, - { - "entity": "icirc;", - "value": "U+000EE" - }, - { - "entity": "icirc", - "value": "U+000EE" - }, - { - "entity": "icy;", - "value": "U+00438" - }, - { - "entity": "iecy;", - "value": "U+00435" - }, - { - "entity": "iexcl;", - "value": "U+000A1" - }, - { - "entity": "iexcl", - "value": "U+000A1" - }, - { - "entity": "iff;", - "value": "U+021D4" - }, - { - "entity": "ifr;", - "value": "U+1D526" - }, - { - "entity": "igrave;", - "value": "U+000EC" - }, - { - "entity": "igrave", - "value": "U+000EC" - }, - { - "entity": "ii;", - "value": "U+02148" - }, - { - "entity": "iiiint;", - "value": "U+02A0C" - }, - { - "entity": "iiint;", - "value": "U+0222D" - }, - { - "entity": "iinfin;", - "value": "U+029DC" - }, - { - "entity": "iiota;", - "value": "U+02129" - }, - { - "entity": "ijlig;", - "value": "U+00133" - }, - { - "entity": "imacr;", - "value": "U+0012B" - }, - { - "entity": "image;", - "value": "U+02111" - }, - { - "entity": "imagline;", - "value": "U+02110" - }, - { - "entity": "imagpart;", - "value": "U+02111" - }, - { - "entity": "imath;", - "value": "U+00131" - }, - { - "entity": "imof;", - "value": "U+022B7" - }, - { - "entity": "imped;", - "value": "U+001B5" - }, - { - "entity": "in;", - "value": "U+02208" - }, - { - "entity": "incare;", - "value": "U+02105" - }, - { - "entity": "infin;", - "value": "U+0221E" - }, - { - "entity": "infintie;", - "value": "U+029DD" - }, - { - "entity": "inodot;", - "value": "U+00131" - }, - { - "entity": "int;", - "value": "U+0222B" - }, - { - "entity": "intcal;", - "value": "U+022BA" - }, - { - "entity": "integers;", - "value": "U+02124" - }, - { - "entity": "intercal;", - "value": "U+022BA" - }, - { - "entity": "intlarhk;", - "value": "U+02A17" - }, - { - "entity": "intprod;", - "value": "U+02A3C" - }, - { - "entity": "iocy;", - "value": "U+00451" - }, - { - "entity": "iogon;", - "value": "U+0012F" - }, - { - "entity": "iopf;", - "value": "U+1D55A" - }, - { - "entity": "iota;", - "value": "U+003B9" - }, - { - "entity": "iprod;", - "value": "U+02A3C" - }, - { - "entity": "iquest;", - "value": "U+000BF" - }, - { - "entity": "iquest", - "value": "U+000BF" - }, - { - "entity": "iscr;", - "value": "U+1D4BE" - }, - { - "entity": "isin;", - "value": "U+02208" - }, - { - "entity": "isinE;", - "value": "U+022F9" - }, - { - "entity": "isindot;", - "value": "U+022F5" - }, - { - "entity": "isins;", - "value": "U+022F4" - }, - { - "entity": "isinsv;", - "value": "U+022F3" - }, - { - "entity": "isinv;", - "value": "U+02208" - }, - { - "entity": "it;", - "value": "U+02062" - }, - { - "entity": "itilde;", - "value": "U+00129" - }, - { - "entity": "iukcy;", - "value": "U+00456" - }, - { - "entity": "iuml;", - "value": "U+000EF" - }, - { - "entity": "iuml", - "value": "U+000EF" - }, - { - "entity": "jcirc;", - "value": "U+00135" - }, - { - "entity": "jcy;", - "value": "U+00439" - }, - { - "entity": "jfr;", - "value": "U+1D527" - }, - { - "entity": "jmath;", - "value": "U+00237" - }, - { - "entity": "jopf;", - "value": "U+1D55B" - }, - { - "entity": "jscr;", - "value": "U+1D4BF" - }, - { - "entity": "jsercy;", - "value": "U+00458" - }, - { - "entity": "jukcy;", - "value": "U+00454" - }, - { - "entity": "kappa;", - "value": "U+003BA" - }, - { - "entity": "kappav;", - "value": "U+003F0" - }, - { - "entity": "kcedil;", - "value": "U+00137" - }, - { - "entity": "kcy;", - "value": "U+0043A" - }, - { - "entity": "kfr;", - "value": "U+1D528" - }, - { - "entity": "kgreen;", - "value": "U+00138" - }, - { - "entity": "khcy;", - "value": "U+00445" - }, - { - "entity": "kjcy;", - "value": "U+0045C" - }, - { - "entity": "kopf;", - "value": "U+1D55C" - }, - { - "entity": "kscr;", - "value": "U+1D4C0" - }, - { - "entity": "lAarr;", - "value": "U+021DA" - }, - { - "entity": "lArr;", - "value": "U+021D0" - }, - { - "entity": "lAtail;", - "value": "U+0291B" - }, - { - "entity": "lBarr;", - "value": "U+0290E" - }, - { - "entity": "lE;", - "value": "U+02266" - }, - { - "entity": "lEg;", - "value": "U+02A8B" - }, - { - "entity": "lHar;", - "value": "U+02962" - }, - { - "entity": "lacute;", - "value": "U+0013A" - }, - { - "entity": "laemptyv;", - "value": "U+029B4" - }, - { - "entity": "lagran;", - "value": "U+02112" - }, - { - "entity": "lambda;", - "value": "U+003BB" - }, - { - "entity": "lang;", - "value": "U+027E8" - }, - { - "entity": "langd;", - "value": "U+02991" - }, - { - "entity": "langle;", - "value": "U+027E8" - }, - { - "entity": "lap;", - "value": "U+02A85" - }, - { - "entity": "laquo;", - "value": "U+000AB" - }, - { - "entity": "laquo", - "value": "U+000AB" - }, - { - "entity": "larr;", - "value": "U+02190" - }, - { - "entity": "larrb;", - "value": "U+021E4" - }, - { - "entity": "larrbfs;", - "value": "U+0291F" - }, - { - "entity": "larrfs;", - "value": "U+0291D" - }, - { - "entity": "larrhk;", - "value": "U+021A9" - }, - { - "entity": "larrlp;", - "value": "U+021AB" - }, - { - "entity": "larrpl;", - "value": "U+02939" - }, - { - "entity": "larrsim;", - "value": "U+02973" - }, - { - "entity": "larrtl;", - "value": "U+021A2" - }, - { - "entity": "lat;", - "value": "U+02AAB" - }, - { - "entity": "latail;", - "value": "U+02919" - }, - { - "entity": "late;", - "value": "U+02AAD" - }, - { - "entity": "lbarr;", - "value": "U+0290C" - }, - { - "entity": "lbbrk;", - "value": "U+02772" - }, - { - "entity": "lbrace;", - "value": "U+0007B" - }, - { - "entity": "lbrack;", - "value": "U+0005B" - }, - { - "entity": "lbrke;", - "value": "U+0298B" - }, - { - "entity": "lbrksld;", - "value": "U+0298F" - }, - { - "entity": "lbrkslu;", - "value": "U+0298D" - }, - { - "entity": "lcaron;", - "value": "U+0013E" - }, - { - "entity": "lcedil;", - "value": "U+0013C" - }, - { - "entity": "lceil;", - "value": "U+02308" - }, - { - "entity": "lcub;", - "value": "U+0007B" - }, - { - "entity": "lcy;", - "value": "U+0043B" - }, - { - "entity": "ldca;", - "value": "U+02936" - }, - { - "entity": "ldquo;", - "value": "U+0201C" - }, - { - "entity": "ldquor;", - "value": "U+0201E" - }, - { - "entity": "ldrdhar;", - "value": "U+02967" - }, - { - "entity": "ldrushar;", - "value": "U+0294B" - }, - { - "entity": "ldsh;", - "value": "U+021B2" - }, - { - "entity": "le;", - "value": "U+02264" - }, - { - "entity": "leftarrow;", - "value": "U+02190" - }, - { - "entity": "leftarrowtail;", - "value": "U+021A2" - }, - { - "entity": "leftharpoondown;", - "value": "U+021BD" - }, - { - "entity": "leftharpoonup;", - "value": "U+021BC" - }, - { - "entity": "leftleftarrows;", - "value": "U+021C7" - }, - { - "entity": "leftrightarrow;", - "value": "U+02194" - }, - { - "entity": "leftrightarrows;", - "value": "U+021C6" - }, - { - "entity": "leftrightharpoons;", - "value": "U+021CB" - }, - { - "entity": "leftrightsquigarrow;", - "value": "U+021AD" - }, - { - "entity": "leftthreetimes;", - "value": "U+022CB" - }, - { - "entity": "leg;", - "value": "U+022DA" - }, - { - "entity": "leq;", - "value": "U+02264" - }, - { - "entity": "leqq;", - "value": "U+02266" - }, - { - "entity": "leqslant;", - "value": "U+02A7D" - }, - { - "entity": "les;", - "value": "U+02A7D" - }, - { - "entity": "lescc;", - "value": "U+02AA8" - }, - { - "entity": "lesdot;", - "value": "U+02A7F" - }, - { - "entity": "lesdoto;", - "value": "U+02A81" - }, - { - "entity": "lesdotor;", - "value": "U+02A83" - }, - { - "entity": "lesges;", - "value": "U+02A93" - }, - { - "entity": "lessapprox;", - "value": "U+02A85" - }, - { - "entity": "lessdot;", - "value": "U+022D6" - }, - { - "entity": "lesseqgtr;", - "value": "U+022DA" - }, - { - "entity": "lesseqqgtr;", - "value": "U+02A8B" - }, - { - "entity": "lessgtr;", - "value": "U+02276" - }, - { - "entity": "lesssim;", - "value": "U+02272" - }, - { - "entity": "lfisht;", - "value": "U+0297C" - }, - { - "entity": "lfloor;", - "value": "U+0230A" - }, - { - "entity": "lfr;", - "value": "U+1D529" - }, - { - "entity": "lg;", - "value": "U+02276" - }, - { - "entity": "lgE;", - "value": "U+02A91" - }, - { - "entity": "lhard;", - "value": "U+021BD" - }, - { - "entity": "lharu;", - "value": "U+021BC" - }, - { - "entity": "lharul;", - "value": "U+0296A" - }, - { - "entity": "lhblk;", - "value": "U+02584" - }, - { - "entity": "ljcy;", - "value": "U+00459" - }, - { - "entity": "ll;", - "value": "U+0226A" - }, - { - "entity": "llarr;", - "value": "U+021C7" - }, - { - "entity": "llcorner;", - "value": "U+0231E" - }, - { - "entity": "llhard;", - "value": "U+0296B" - }, - { - "entity": "lltri;", - "value": "U+025FA" - }, - { - "entity": "lmidot;", - "value": "U+00140" - }, - { - "entity": "lmoust;", - "value": "U+023B0" - }, - { - "entity": "lmoustache;", - "value": "U+023B0" - }, - { - "entity": "lnE;", - "value": "U+02268" - }, - { - "entity": "lnap;", - "value": "U+02A89" - }, - { - "entity": "lnapprox;", - "value": "U+02A89" - }, - { - "entity": "lne;", - "value": "U+02A87" - }, - { - "entity": "lneq;", - "value": "U+02A87" - }, - { - "entity": "lneqq;", - "value": "U+02268" - }, - { - "entity": "lnsim;", - "value": "U+022E6" - }, - { - "entity": "loang;", - "value": "U+027EC" - }, - { - "entity": "loarr;", - "value": "U+021FD" - }, - { - "entity": "lobrk;", - "value": "U+027E6" - }, - { - "entity": "longleftarrow;", - "value": "U+027F5" - }, - { - "entity": "longleftrightarrow;", - "value": "U+027F7" - }, - { - "entity": "longmapsto;", - "value": "U+027FC" - }, - { - "entity": "longrightarrow;", - "value": "U+027F6" - }, - { - "entity": "looparrowleft;", - "value": "U+021AB" - }, - { - "entity": "looparrowright;", - "value": "U+021AC" - }, - { - "entity": "lopar;", - "value": "U+02985" - }, - { - "entity": "lopf;", - "value": "U+1D55D" - }, - { - "entity": "loplus;", - "value": "U+02A2D" - }, - { - "entity": "lotimes;", - "value": "U+02A34" - }, - { - "entity": "lowast;", - "value": "U+02217" - }, - { - "entity": "lowbar;", - "value": "U+0005F" - }, - { - "entity": "loz;", - "value": "U+025CA" - }, - { - "entity": "lozenge;", - "value": "U+025CA" - }, - { - "entity": "lozf;", - "value": "U+029EB" - }, - { - "entity": "lpar;", - "value": "U+00028" - }, - { - "entity": "lparlt;", - "value": "U+02993" - }, - { - "entity": "lrarr;", - "value": "U+021C6" - }, - { - "entity": "lrcorner;", - "value": "U+0231F" - }, - { - "entity": "lrhar;", - "value": "U+021CB" - }, - { - "entity": "lrhard;", - "value": "U+0296D" - }, - { - "entity": "lrm;", - "value": "U+0200E" - }, - { - "entity": "lrtri;", - "value": "U+022BF" - }, - { - "entity": "lsaquo;", - "value": "U+02039" - }, - { - "entity": "lscr;", - "value": "U+1D4C1" - }, - { - "entity": "lsh;", - "value": "U+021B0" - }, - { - "entity": "lsim;", - "value": "U+02272" - }, - { - "entity": "lsime;", - "value": "U+02A8D" - }, - { - "entity": "lsimg;", - "value": "U+02A8F" - }, - { - "entity": "lsqb;", - "value": "U+0005B" - }, - { - "entity": "lsquo;", - "value": "U+02018" - }, - { - "entity": "lsquor;", - "value": "U+0201A" - }, - { - "entity": "lstrok;", - "value": "U+00142" - }, - { - "entity": "lt;", - "value": "U+0003C" - }, - { - "entity": "lt", - "value": "U+0003C" - }, - { - "entity": "ltcc;", - "value": "U+02AA6" - }, - { - "entity": "ltcir;", - "value": "U+02A79" - }, - { - "entity": "ltdot;", - "value": "U+022D6" - }, - { - "entity": "lthree;", - "value": "U+022CB" - }, - { - "entity": "ltimes;", - "value": "U+022C9" - }, - { - "entity": "ltlarr;", - "value": "U+02976" - }, - { - "entity": "ltquest;", - "value": "U+02A7B" - }, - { - "entity": "ltrPar;", - "value": "U+02996" - }, - { - "entity": "ltri;", - "value": "U+025C3" - }, - { - "entity": "ltrie;", - "value": "U+022B4" - }, - { - "entity": "ltrif;", - "value": "U+025C2" - }, - { - "entity": "lurdshar;", - "value": "U+0294A" - }, - { - "entity": "luruhar;", - "value": "U+02966" - }, - { - "entity": "mDDot;", - "value": "U+0223A" - }, - { - "entity": "macr;", - "value": "U+000AF" - }, - { - "entity": "macr", - "value": "U+000AF" - }, - { - "entity": "male;", - "value": "U+02642" - }, - { - "entity": "malt;", - "value": "U+02720" - }, - { - "entity": "maltese;", - "value": "U+02720" - }, - { - "entity": "map;", - "value": "U+021A6" - }, - { - "entity": "mapsto;", - "value": "U+021A6" - }, - { - "entity": "mapstodown;", - "value": "U+021A7" - }, - { - "entity": "mapstoleft;", - "value": "U+021A4" - }, - { - "entity": "mapstoup;", - "value": "U+021A5" - }, - { - "entity": "marker;", - "value": "U+025AE" - }, - { - "entity": "mcomma;", - "value": "U+02A29" - }, - { - "entity": "mcy;", - "value": "U+0043C" - }, - { - "entity": "mdash;", - "value": "U+02014" - }, - { - "entity": "measuredangle;", - "value": "U+02221" - }, - { - "entity": "mfr;", - "value": "U+1D52A" - }, - { - "entity": "mho;", - "value": "U+02127" - }, - { - "entity": "micro;", - "value": "U+000B5" - }, - { - "entity": "micro", - "value": "U+000B5" - }, - { - "entity": "mid;", - "value": "U+02223" - }, - { - "entity": "midast;", - "value": "U+0002A" - }, - { - "entity": "midcir;", - "value": "U+02AF0" - }, - { - "entity": "middot;", - "value": "U+000B7" - }, - { - "entity": "middot", - "value": "U+000B7" - }, - { - "entity": "minus;", - "value": "U+02212" - }, - { - "entity": "minusb;", - "value": "U+0229F" - }, - { - "entity": "minusd;", - "value": "U+02238" - }, - { - "entity": "minusdu;", - "value": "U+02A2A" - }, - { - "entity": "mlcp;", - "value": "U+02ADB" - }, - { - "entity": "mldr;", - "value": "U+02026" - }, - { - "entity": "mnplus;", - "value": "U+02213" - }, - { - "entity": "models;", - "value": "U+022A7" - }, - { - "entity": "mopf;", - "value": "U+1D55E" - }, - { - "entity": "mp;", - "value": "U+02213" - }, - { - "entity": "mscr;", - "value": "U+1D4C2" - }, - { - "entity": "mstpos;", - "value": "U+0223E" - }, - { - "entity": "mu;", - "value": "U+003BC" - }, - { - "entity": "multimap;", - "value": "U+022B8" - }, - { - "entity": "mumap;", - "value": "U+022B8" - }, - { - "entity": "nLeftarrow;", - "value": "U+021CD" - }, - { - "entity": "nLeftrightarrow;", - "value": "U+021CE" - }, - { - "entity": "nRightarrow;", - "value": "U+021CF" - }, - { - "entity": "nVDash;", - "value": "U+022AF" - }, - { - "entity": "nVdash;", - "value": "U+022AE" - }, - { - "entity": "nabla;", - "value": "U+02207" - }, - { - "entity": "nacute;", - "value": "U+00144" - }, - { - "entity": "nap;", - "value": "U+02249" - }, - { - "entity": "napos;", - "value": "U+00149" - }, - { - "entity": "napprox;", - "value": "U+02249" - }, - { - "entity": "natur;", - "value": "U+0266E" - }, - { - "entity": "natural;", - "value": "U+0266E" - }, - { - "entity": "naturals;", - "value": "U+02115" - }, - { - "entity": "nbsp;", - "value": "U+000A0" - }, - { - "entity": "nbsp", - "value": "U+000A0" - }, - { - "entity": "ncap;", - "value": "U+02A43" - }, - { - "entity": "ncaron;", - "value": "U+00148" - }, - { - "entity": "ncedil;", - "value": "U+00146" - }, - { - "entity": "ncong;", - "value": "U+02247" - }, - { - "entity": "ncup;", - "value": "U+02A42" - }, - { - "entity": "ncy;", - "value": "U+0043D" - }, - { - "entity": "ndash;", - "value": "U+02013" - }, - { - "entity": "ne;", - "value": "U+02260" - }, - { - "entity": "neArr;", - "value": "U+021D7" - }, - { - "entity": "nearhk;", - "value": "U+02924" - }, - { - "entity": "nearr;", - "value": "U+02197" - }, - { - "entity": "nearrow;", - "value": "U+02197" - }, - { - "entity": "nequiv;", - "value": "U+02262" - }, - { - "entity": "nesear;", - "value": "U+02928" - }, - { - "entity": "nexist;", - "value": "U+02204" - }, - { - "entity": "nexists;", - "value": "U+02204" - }, - { - "entity": "nfr;", - "value": "U+1D52B" - }, - { - "entity": "nge;", - "value": "U+02271" - }, - { - "entity": "ngeq;", - "value": "U+02271" - }, - { - "entity": "ngsim;", - "value": "U+02275" - }, - { - "entity": "ngt;", - "value": "U+0226F" - }, - { - "entity": "ngtr;", - "value": "U+0226F" - }, - { - "entity": "nhArr;", - "value": "U+021CE" - }, - { - "entity": "nharr;", - "value": "U+021AE" - }, - { - "entity": "nhpar;", - "value": "U+02AF2" - }, - { - "entity": "ni;", - "value": "U+0220B" - }, - { - "entity": "nis;", - "value": "U+022FC" - }, - { - "entity": "nisd;", - "value": "U+022FA" - }, - { - "entity": "niv;", - "value": "U+0220B" - }, - { - "entity": "njcy;", - "value": "U+0045A" - }, - { - "entity": "nlArr;", - "value": "U+021CD" - }, - { - "entity": "nlarr;", - "value": "U+0219A" - }, - { - "entity": "nldr;", - "value": "U+02025" - }, - { - "entity": "nle;", - "value": "U+02270" - }, - { - "entity": "nleftarrow;", - "value": "U+0219A" - }, - { - "entity": "nleftrightarrow;", - "value": "U+021AE" - }, - { - "entity": "nleq;", - "value": "U+02270" - }, - { - "entity": "nless;", - "value": "U+0226E" - }, - { - "entity": "nlsim;", - "value": "U+02274" - }, - { - "entity": "nlt;", - "value": "U+0226E" - }, - { - "entity": "nltri;", - "value": "U+022EA" - }, - { - "entity": "nltrie;", - "value": "U+022EC" - }, - { - "entity": "nmid;", - "value": "U+02224" - }, - { - "entity": "nopf;", - "value": "U+1D55F" - }, - { - "entity": "not;", - "value": "U+000AC" - }, - { - "entity": "not", - "value": "U+000AC" - }, - { - "entity": "notin;", - "value": "U+02209" - }, - { - "entity": "notinva;", - "value": "U+02209" - }, - { - "entity": "notinvb;", - "value": "U+022F7" - }, - { - "entity": "notinvc;", - "value": "U+022F6" - }, - { - "entity": "notni;", - "value": "U+0220C" - }, - { - "entity": "notniva;", - "value": "U+0220C" - }, - { - "entity": "notnivb;", - "value": "U+022FE" - }, - { - "entity": "notnivc;", - "value": "U+022FD" - }, - { - "entity": "npar;", - "value": "U+02226" - }, - { - "entity": "nparallel;", - "value": "U+02226" - }, - { - "entity": "npolint;", - "value": "U+02A14" - }, - { - "entity": "npr;", - "value": "U+02280" - }, - { - "entity": "nprcue;", - "value": "U+022E0" - }, - { - "entity": "nprec;", - "value": "U+02280" - }, - { - "entity": "nrArr;", - "value": "U+021CF" - }, - { - "entity": "nrarr;", - "value": "U+0219B" - }, - { - "entity": "nrightarrow;", - "value": "U+0219B" - }, - { - "entity": "nrtri;", - "value": "U+022EB" - }, - { - "entity": "nrtrie;", - "value": "U+022ED" - }, - { - "entity": "nsc;", - "value": "U+02281" - }, - { - "entity": "nsccue;", - "value": "U+022E1" - }, - { - "entity": "nscr;", - "value": "U+1D4C3" - }, - { - "entity": "nshortmid;", - "value": "U+02224" - }, - { - "entity": "nshortparallel;", - "value": "U+02226" - }, - { - "entity": "nsim;", - "value": "U+02241" - }, - { - "entity": "nsime;", - "value": "U+02244" - }, - { - "entity": "nsimeq;", - "value": "U+02244" - }, - { - "entity": "nsmid;", - "value": "U+02224" - }, - { - "entity": "nspar;", - "value": "U+02226" - }, - { - "entity": "nsqsube;", - "value": "U+022E2" - }, - { - "entity": "nsqsupe;", - "value": "U+022E3" - }, - { - "entity": "nsub;", - "value": "U+02284" - }, - { - "entity": "nsube;", - "value": "U+02288" - }, - { - "entity": "nsubseteq;", - "value": "U+02288" - }, - { - "entity": "nsucc;", - "value": "U+02281" - }, - { - "entity": "nsup;", - "value": "U+02285" - }, - { - "entity": "nsupe;", - "value": "U+02289" - }, - { - "entity": "nsupseteq;", - "value": "U+02289" - }, - { - "entity": "ntgl;", - "value": "U+02279" - }, - { - "entity": "ntilde;", - "value": "U+000F1" - }, - { - "entity": "ntilde", - "value": "U+000F1" - }, - { - "entity": "ntlg;", - "value": "U+02278" - }, - { - "entity": "ntriangleleft;", - "value": "U+022EA" - }, - { - "entity": "ntrianglelefteq;", - "value": "U+022EC" - }, - { - "entity": "ntriangleright;", - "value": "U+022EB" - }, - { - "entity": "ntrianglerighteq;", - "value": "U+022ED" - }, - { - "entity": "nu;", - "value": "U+003BD" - }, - { - "entity": "num;", - "value": "U+00023" - }, - { - "entity": "numero;", - "value": "U+02116" - }, - { - "entity": "numsp;", - "value": "U+02007" - }, - { - "entity": "nvDash;", - "value": "U+022AD" - }, - { - "entity": "nvHarr;", - "value": "U+02904" - }, - { - "entity": "nvdash;", - "value": "U+022AC" - }, - { - "entity": "nvinfin;", - "value": "U+029DE" - }, - { - "entity": "nvlArr;", - "value": "U+02902" - }, - { - "entity": "nvrArr;", - "value": "U+02903" - }, - { - "entity": "nwArr;", - "value": "U+021D6" - }, - { - "entity": "nwarhk;", - "value": "U+02923" - }, - { - "entity": "nwarr;", - "value": "U+02196" - }, - { - "entity": "nwarrow;", - "value": "U+02196" - }, - { - "entity": "nwnear;", - "value": "U+02927" - }, - { - "entity": "oS;", - "value": "U+024C8" - }, - { - "entity": "oacute;", - "value": "U+000F3" - }, - { - "entity": "oacute", - "value": "U+000F3" - }, - { - "entity": "oast;", - "value": "U+0229B" - }, - { - "entity": "ocir;", - "value": "U+0229A" - }, - { - "entity": "ocirc;", - "value": "U+000F4" - }, - { - "entity": "ocirc", - "value": "U+000F4" - }, - { - "entity": "ocy;", - "value": "U+0043E" - }, - { - "entity": "odash;", - "value": "U+0229D" - }, - { - "entity": "odblac;", - "value": "U+00151" - }, - { - "entity": "odiv;", - "value": "U+02A38" - }, - { - "entity": "odot;", - "value": "U+02299" - }, - { - "entity": "odsold;", - "value": "U+029BC" - }, - { - "entity": "oelig;", - "value": "U+00153" - }, - { - "entity": "ofcir;", - "value": "U+029BF" - }, - { - "entity": "ofr;", - "value": "U+1D52C" - }, - { - "entity": "ogon;", - "value": "U+002DB" - }, - { - "entity": "ograve;", - "value": "U+000F2" - }, - { - "entity": "ograve", - "value": "U+000F2" - }, - { - "entity": "ogt;", - "value": "U+029C1" - }, - { - "entity": "ohbar;", - "value": "U+029B5" - }, - { - "entity": "ohm;", - "value": "U+003A9" - }, - { - "entity": "oint;", - "value": "U+0222E" - }, - { - "entity": "olarr;", - "value": "U+021BA" - }, - { - "entity": "olcir;", - "value": "U+029BE" - }, - { - "entity": "olcross;", - "value": "U+029BB" - }, - { - "entity": "oline;", - "value": "U+0203E" - }, - { - "entity": "olt;", - "value": "U+029C0" - }, - { - "entity": "omacr;", - "value": "U+0014D" - }, - { - "entity": "omega;", - "value": "U+003C9" - }, - { - "entity": "omicron;", - "value": "U+003BF" - }, - { - "entity": "omid;", - "value": "U+029B6" - }, - { - "entity": "ominus;", - "value": "U+02296" - }, - { - "entity": "oopf;", - "value": "U+1D560" - }, - { - "entity": "opar;", - "value": "U+029B7" - }, - { - "entity": "operp;", - "value": "U+029B9" - }, - { - "entity": "oplus;", - "value": "U+02295" - }, - { - "entity": "or;", - "value": "U+02228" - }, - { - "entity": "orarr;", - "value": "U+021BB" - }, - { - "entity": "ord;", - "value": "U+02A5D" - }, - { - "entity": "order;", - "value": "U+02134" - }, - { - "entity": "orderof;", - "value": "U+02134" - }, - { - "entity": "ordf;", - "value": "U+000AA" - }, - { - "entity": "ordf", - "value": "U+000AA" - }, - { - "entity": "ordm;", - "value": "U+000BA" - }, - { - "entity": "ordm", - "value": "U+000BA" - }, - { - "entity": "origof;", - "value": "U+022B6" - }, - { - "entity": "oror;", - "value": "U+02A56" - }, - { - "entity": "orslope;", - "value": "U+02A57" - }, - { - "entity": "orv;", - "value": "U+02A5B" - }, - { - "entity": "oscr;", - "value": "U+02134" - }, - { - "entity": "oslash;", - "value": "U+000F8" - }, - { - "entity": "oslash", - "value": "U+000F8" - }, - { - "entity": "osol;", - "value": "U+02298" - }, - { - "entity": "otilde;", - "value": "U+000F5" - }, - { - "entity": "otilde", - "value": "U+000F5" - }, - { - "entity": "otimes;", - "value": "U+02297" - }, - { - "entity": "otimesas;", - "value": "U+02A36" - }, - { - "entity": "ouml;", - "value": "U+000F6" - }, - { - "entity": "ouml", - "value": "U+000F6" - }, - { - "entity": "ovbar;", - "value": "U+0233D" - }, - { - "entity": "par;", - "value": "U+02225" - }, - { - "entity": "para;", - "value": "U+000B6" - }, - { - "entity": "para", - "value": "U+000B6" - }, - { - "entity": "parallel;", - "value": "U+02225" - }, - { - "entity": "parsim;", - "value": "U+02AF3" - }, - { - "entity": "parsl;", - "value": "U+02AFD" - }, - { - "entity": "part;", - "value": "U+02202" - }, - { - "entity": "pcy;", - "value": "U+0043F" - }, - { - "entity": "percnt;", - "value": "U+00025" - }, - { - "entity": "period;", - "value": "U+0002E" - }, - { - "entity": "permil;", - "value": "U+02030" - }, - { - "entity": "perp;", - "value": "U+022A5" - }, - { - "entity": "pertenk;", - "value": "U+02031" - }, - { - "entity": "pfr;", - "value": "U+1D52D" - }, - { - "entity": "phi;", - "value": "U+003C6" - }, - { - "entity": "phiv;", - "value": "U+003D5" - }, - { - "entity": "phmmat;", - "value": "U+02133" - }, - { - "entity": "phone;", - "value": "U+0260E" - }, - { - "entity": "pi;", - "value": "U+003C0" - }, - { - "entity": "pitchfork;", - "value": "U+022D4" - }, - { - "entity": "piv;", - "value": "U+003D6" - }, - { - "entity": "planck;", - "value": "U+0210F" - }, - { - "entity": "planckh;", - "value": "U+0210E" - }, - { - "entity": "plankv;", - "value": "U+0210F" - }, - { - "entity": "plus;", - "value": "U+0002B" - }, - { - "entity": "plusacir;", - "value": "U+02A23" - }, - { - "entity": "plusb;", - "value": "U+0229E" - }, - { - "entity": "pluscir;", - "value": "U+02A22" - }, - { - "entity": "plusdo;", - "value": "U+02214" - }, - { - "entity": "plusdu;", - "value": "U+02A25" - }, - { - "entity": "pluse;", - "value": "U+02A72" - }, - { - "entity": "plusmn;", - "value": "U+000B1" - }, - { - "entity": "plusmn", - "value": "U+000B1" - }, - { - "entity": "plussim;", - "value": "U+02A26" - }, - { - "entity": "plustwo;", - "value": "U+02A27" - }, - { - "entity": "pm;", - "value": "U+000B1" - }, - { - "entity": "pointint;", - "value": "U+02A15" - }, - { - "entity": "popf;", - "value": "U+1D561" - }, - { - "entity": "pound;", - "value": "U+000A3" - }, - { - "entity": "pound", - "value": "U+000A3" - }, - { - "entity": "pr;", - "value": "U+0227A" - }, - { - "entity": "prE;", - "value": "U+02AB3" - }, - { - "entity": "prap;", - "value": "U+02AB7" - }, - { - "entity": "prcue;", - "value": "U+0227C" - }, - { - "entity": "pre;", - "value": "U+02AAF" - }, - { - "entity": "prec;", - "value": "U+0227A" - }, - { - "entity": "precapprox;", - "value": "U+02AB7" - }, - { - "entity": "preccurlyeq;", - "value": "U+0227C" - }, - { - "entity": "preceq;", - "value": "U+02AAF" - }, - { - "entity": "precnapprox;", - "value": "U+02AB9" - }, - { - "entity": "precneqq;", - "value": "U+02AB5" - }, - { - "entity": "precnsim;", - "value": "U+022E8" - }, - { - "entity": "precsim;", - "value": "U+0227E" - }, - { - "entity": "prime;", - "value": "U+02032" - }, - { - "entity": "primes;", - "value": "U+02119" - }, - { - "entity": "prnE;", - "value": "U+02AB5" - }, - { - "entity": "prnap;", - "value": "U+02AB9" - }, - { - "entity": "prnsim;", - "value": "U+022E8" - }, - { - "entity": "prod;", - "value": "U+0220F" - }, - { - "entity": "profalar;", - "value": "U+0232E" - }, - { - "entity": "profline;", - "value": "U+02312" - }, - { - "entity": "profsurf;", - "value": "U+02313" - }, - { - "entity": "prop;", - "value": "U+0221D" - }, - { - "entity": "propto;", - "value": "U+0221D" - }, - { - "entity": "prsim;", - "value": "U+0227E" - }, - { - "entity": "prurel;", - "value": "U+022B0" - }, - { - "entity": "pscr;", - "value": "U+1D4C5" - }, - { - "entity": "psi;", - "value": "U+003C8" - }, - { - "entity": "puncsp;", - "value": "U+02008" - }, - { - "entity": "qfr;", - "value": "U+1D52E" - }, - { - "entity": "qint;", - "value": "U+02A0C" - }, - { - "entity": "qopf;", - "value": "U+1D562" - }, - { - "entity": "qprime;", - "value": "U+02057" - }, - { - "entity": "qscr;", - "value": "U+1D4C6" - }, - { - "entity": "quaternions;", - "value": "U+0210D" - }, - { - "entity": "quatint;", - "value": "U+02A16" - }, - { - "entity": "quest;", - "value": "U+0003F" - }, - { - "entity": "questeq;", - "value": "U+0225F" - }, - { - "entity": "quot;", - "value": "U+00022" - }, - { - "entity": "quot", - "value": "U+00022" - }, - { - "entity": "rAarr;", - "value": "U+021DB" - }, - { - "entity": "rArr;", - "value": "U+021D2" - }, - { - "entity": "rAtail;", - "value": "U+0291C" - }, - { - "entity": "rBarr;", - "value": "U+0290F" - }, - { - "entity": "rHar;", - "value": "U+02964" - }, - { - "entity": "racute;", - "value": "U+00155" - }, - { - "entity": "radic;", - "value": "U+0221A" - }, - { - "entity": "raemptyv;", - "value": "U+029B3" - }, - { - "entity": "rang;", - "value": "U+027E9" - }, - { - "entity": "rangd;", - "value": "U+02992" - }, - { - "entity": "range;", - "value": "U+029A5" - }, - { - "entity": "rangle;", - "value": "U+027E9" - }, - { - "entity": "raquo;", - "value": "U+000BB" - }, - { - "entity": "raquo", - "value": "U+000BB" - }, - { - "entity": "rarr;", - "value": "U+02192" - }, - { - "entity": "rarrap;", - "value": "U+02975" - }, - { - "entity": "rarrb;", - "value": "U+021E5" - }, - { - "entity": "rarrbfs;", - "value": "U+02920" - }, - { - "entity": "rarrc;", - "value": "U+02933" - }, - { - "entity": "rarrfs;", - "value": "U+0291E" - }, - { - "entity": "rarrhk;", - "value": "U+021AA" - }, - { - "entity": "rarrlp;", - "value": "U+021AC" - }, - { - "entity": "rarrpl;", - "value": "U+02945" - }, - { - "entity": "rarrsim;", - "value": "U+02974" - }, - { - "entity": "rarrtl;", - "value": "U+021A3" - }, - { - "entity": "rarrw;", - "value": "U+0219D" - }, - { - "entity": "ratail;", - "value": "U+0291A" - }, - { - "entity": "ratio;", - "value": "U+02236" - }, - { - "entity": "rationals;", - "value": "U+0211A" - }, - { - "entity": "rbarr;", - "value": "U+0290D" - }, - { - "entity": "rbbrk;", - "value": "U+02773" - }, - { - "entity": "rbrace;", - "value": "U+0007D" - }, - { - "entity": "rbrack;", - "value": "U+0005D" - }, - { - "entity": "rbrke;", - "value": "U+0298C" - }, - { - "entity": "rbrksld;", - "value": "U+0298E" - }, - { - "entity": "rbrkslu;", - "value": "U+02990" - }, - { - "entity": "rcaron;", - "value": "U+00159" - }, - { - "entity": "rcedil;", - "value": "U+00157" - }, - { - "entity": "rceil;", - "value": "U+02309" - }, - { - "entity": "rcub;", - "value": "U+0007D" - }, - { - "entity": "rcy;", - "value": "U+00440" - }, - { - "entity": "rdca;", - "value": "U+02937" - }, - { - "entity": "rdldhar;", - "value": "U+02969" - }, - { - "entity": "rdquo;", - "value": "U+0201D" - }, - { - "entity": "rdquor;", - "value": "U+0201D" - }, - { - "entity": "rdsh;", - "value": "U+021B3" - }, - { - "entity": "real;", - "value": "U+0211C" - }, - { - "entity": "realine;", - "value": "U+0211B" - }, - { - "entity": "realpart;", - "value": "U+0211C" - }, - { - "entity": "reals;", - "value": "U+0211D" - }, - { - "entity": "rect;", - "value": "U+025AD" - }, - { - "entity": "reg;", - "value": "U+000AE" - }, - { - "entity": "reg", - "value": "U+000AE" - }, - { - "entity": "rfisht;", - "value": "U+0297D" - }, - { - "entity": "rfloor;", - "value": "U+0230B" - }, - { - "entity": "rfr;", - "value": "U+1D52F" - }, - { - "entity": "rhard;", - "value": "U+021C1" - }, - { - "entity": "rharu;", - "value": "U+021C0" - }, - { - "entity": "rharul;", - "value": "U+0296C" - }, - { - "entity": "rho;", - "value": "U+003C1" - }, - { - "entity": "rhov;", - "value": "U+003F1" - }, - { - "entity": "rightarrow;", - "value": "U+02192" - }, - { - "entity": "rightarrowtail;", - "value": "U+021A3" - }, - { - "entity": "rightharpoondown;", - "value": "U+021C1" - }, - { - "entity": "rightharpoonup;", - "value": "U+021C0" - }, - { - "entity": "rightleftarrows;", - "value": "U+021C4" - }, - { - "entity": "rightleftharpoons;", - "value": "U+021CC" - }, - { - "entity": "rightrightarrows;", - "value": "U+021C9" - }, - { - "entity": "rightsquigarrow;", - "value": "U+0219D" - }, - { - "entity": "rightthreetimes;", - "value": "U+022CC" - }, - { - "entity": "ring;", - "value": "U+002DA" - }, - { - "entity": "risingdotseq;", - "value": "U+02253" - }, - { - "entity": "rlarr;", - "value": "U+021C4" - }, - { - "entity": "rlhar;", - "value": "U+021CC" - }, - { - "entity": "rlm;", - "value": "U+0200F" - }, - { - "entity": "rmoust;", - "value": "U+023B1" - }, - { - "entity": "rmoustache;", - "value": "U+023B1" - }, - { - "entity": "rnmid;", - "value": "U+02AEE" - }, - { - "entity": "roang;", - "value": "U+027ED" - }, - { - "entity": "roarr;", - "value": "U+021FE" - }, - { - "entity": "robrk;", - "value": "U+027E7" - }, - { - "entity": "ropar;", - "value": "U+02986" - }, - { - "entity": "ropf;", - "value": "U+1D563" - }, - { - "entity": "roplus;", - "value": "U+02A2E" - }, - { - "entity": "rotimes;", - "value": "U+02A35" - }, - { - "entity": "rpar;", - "value": "U+00029" - }, - { - "entity": "rpargt;", - "value": "U+02994" - }, - { - "entity": "rppolint;", - "value": "U+02A12" - }, - { - "entity": "rrarr;", - "value": "U+021C9" - }, - { - "entity": "rsaquo;", - "value": "U+0203A" - }, - { - "entity": "rscr;", - "value": "U+1D4C7" - }, - { - "entity": "rsh;", - "value": "U+021B1" - }, - { - "entity": "rsqb;", - "value": "U+0005D" - }, - { - "entity": "rsquo;", - "value": "U+02019" - }, - { - "entity": "rsquor;", - "value": "U+02019" - }, - { - "entity": "rthree;", - "value": "U+022CC" - }, - { - "entity": "rtimes;", - "value": "U+022CA" - }, - { - "entity": "rtri;", - "value": "U+025B9" - }, - { - "entity": "rtrie;", - "value": "U+022B5" - }, - { - "entity": "rtrif;", - "value": "U+025B8" - }, - { - "entity": "rtriltri;", - "value": "U+029CE" - }, - { - "entity": "ruluhar;", - "value": "U+02968" - }, - { - "entity": "rx;", - "value": "U+0211E" - }, - { - "entity": "sacute;", - "value": "U+0015B" - }, - { - "entity": "sbquo;", - "value": "U+0201A" - }, - { - "entity": "sc;", - "value": "U+0227B" - }, - { - "entity": "scE;", - "value": "U+02AB4" - }, - { - "entity": "scap;", - "value": "U+02AB8" - }, - { - "entity": "scaron;", - "value": "U+00161" - }, - { - "entity": "sccue;", - "value": "U+0227D" - }, - { - "entity": "sce;", - "value": "U+02AB0" - }, - { - "entity": "scedil;", - "value": "U+0015F" - }, - { - "entity": "scirc;", - "value": "U+0015D" - }, - { - "entity": "scnE;", - "value": "U+02AB6" - }, - { - "entity": "scnap;", - "value": "U+02ABA" - }, - { - "entity": "scnsim;", - "value": "U+022E9" - }, - { - "entity": "scpolint;", - "value": "U+02A13" - }, - { - "entity": "scsim;", - "value": "U+0227F" - }, - { - "entity": "scy;", - "value": "U+00441" - }, - { - "entity": "sdot;", - "value": "U+022C5" - }, - { - "entity": "sdotb;", - "value": "U+022A1" - }, - { - "entity": "sdote;", - "value": "U+02A66" - }, - { - "entity": "seArr;", - "value": "U+021D8" - }, - { - "entity": "searhk;", - "value": "U+02925" - }, - { - "entity": "searr;", - "value": "U+02198" - }, - { - "entity": "searrow;", - "value": "U+02198" - }, - { - "entity": "sect;", - "value": "U+000A7" - }, - { - "entity": "sect", - "value": "U+000A7" - }, - { - "entity": "semi;", - "value": "U+0003B" - }, - { - "entity": "seswar;", - "value": "U+02929" - }, - { - "entity": "setminus;", - "value": "U+02216" - }, - { - "entity": "setmn;", - "value": "U+02216" - }, - { - "entity": "sext;", - "value": "U+02736" - }, - { - "entity": "sfr;", - "value": "U+1D530" - }, - { - "entity": "sfrown;", - "value": "U+02322" - }, - { - "entity": "sharp;", - "value": "U+0266F" - }, - { - "entity": "shchcy;", - "value": "U+00449" - }, - { - "entity": "shcy;", - "value": "U+00448" - }, - { - "entity": "shortmid;", - "value": "U+02223" - }, - { - "entity": "shortparallel;", - "value": "U+02225" - }, - { - "entity": "shy;", - "value": "U+000AD " - }, - { - "entity": "shy", - "value": "U+000AD " - }, - { - "entity": "sigma;", - "value": "U+003C3" - }, - { - "entity": "sigmaf;", - "value": "U+003C2" - }, - { - "entity": "sigmav;", - "value": "U+003C2" - }, - { - "entity": "sim;", - "value": "U+0223C" - }, - { - "entity": "simdot;", - "value": "U+02A6A" - }, - { - "entity": "sime;", - "value": "U+02243" - }, - { - "entity": "simeq;", - "value": "U+02243" - }, - { - "entity": "simg;", - "value": "U+02A9E" - }, - { - "entity": "simgE;", - "value": "U+02AA0" - }, - { - "entity": "siml;", - "value": "U+02A9D" - }, - { - "entity": "simlE;", - "value": "U+02A9F" - }, - { - "entity": "simne;", - "value": "U+02246" - }, - { - "entity": "simplus;", - "value": "U+02A24" - }, - { - "entity": "simrarr;", - "value": "U+02972" - }, - { - "entity": "slarr;", - "value": "U+02190" - }, - { - "entity": "smallsetminus;", - "value": "U+02216" - }, - { - "entity": "smashp;", - "value": "U+02A33" - }, - { - "entity": "smeparsl;", - "value": "U+029E4" - }, - { - "entity": "smid;", - "value": "U+02223" - }, - { - "entity": "smile;", - "value": "U+02323" - }, - { - "entity": "smt;", - "value": "U+02AAA" - }, - { - "entity": "smte;", - "value": "U+02AAC" - }, - { - "entity": "softcy;", - "value": "U+0044C" - }, - { - "entity": "sol;", - "value": "U+0002F" - }, - { - "entity": "solb;", - "value": "U+029C4" - }, - { - "entity": "solbar;", - "value": "U+0233F" - }, - { - "entity": "sopf;", - "value": "U+1D564" - }, - { - "entity": "spades;", - "value": "U+02660" - }, - { - "entity": "spadesuit;", - "value": "U+02660" - }, - { - "entity": "spar;", - "value": "U+02225" - }, - { - "entity": "sqcap;", - "value": "U+02293" - }, - { - "entity": "sqcup;", - "value": "U+02294" - }, - { - "entity": "sqsub;", - "value": "U+0228F" - }, - { - "entity": "sqsube;", - "value": "U+02291" - }, - { - "entity": "sqsubset;", - "value": "U+0228F" - }, - { - "entity": "sqsubseteq;", - "value": "U+02291" - }, - { - "entity": "sqsup;", - "value": "U+02290" - }, - { - "entity": "sqsupe;", - "value": "U+02292" - }, - { - "entity": "sqsupset;", - "value": "U+02290" - }, - { - "entity": "sqsupseteq;", - "value": "U+02292" - }, - { - "entity": "squ;", - "value": "U+025A1" - }, - { - "entity": "square;", - "value": "U+025A1" - }, - { - "entity": "squarf;", - "value": "U+025AA" - }, - { - "entity": "squf;", - "value": "U+025AA" - }, - { - "entity": "srarr;", - "value": "U+02192" - }, - { - "entity": "sscr;", - "value": "U+1D4C8" - }, - { - "entity": "ssetmn;", - "value": "U+02216" - }, - { - "entity": "ssmile;", - "value": "U+02323" - }, - { - "entity": "sstarf;", - "value": "U+022C6" - }, - { - "entity": "star;", - "value": "U+02606" - }, - { - "entity": "starf;", - "value": "U+02605" - }, - { - "entity": "straightepsilon;", - "value": "U+003F5" - }, - { - "entity": "straightphi;", - "value": "U+003D5" - }, - { - "entity": "strns;", - "value": "U+000AF" - }, - { - "entity": "sub;", - "value": "U+02282" - }, - { - "entity": "subE;", - "value": "U+02AC5" - }, - { - "entity": "subdot;", - "value": "U+02ABD" - }, - { - "entity": "sube;", - "value": "U+02286" - }, - { - "entity": "subedot;", - "value": "U+02AC3" - }, - { - "entity": "submult;", - "value": "U+02AC1" - }, - { - "entity": "subnE;", - "value": "U+02ACB" - }, - { - "entity": "subne;", - "value": "U+0228A" - }, - { - "entity": "subplus;", - "value": "U+02ABF" - }, - { - "entity": "subrarr;", - "value": "U+02979" - }, - { - "entity": "subset;", - "value": "U+02282" - }, - { - "entity": "subseteq;", - "value": "U+02286" - }, - { - "entity": "subseteqq;", - "value": "U+02AC5" - }, - { - "entity": "subsetneq;", - "value": "U+0228A" - }, - { - "entity": "subsetneqq;", - "value": "U+02ACB" - }, - { - "entity": "subsim;", - "value": "U+02AC7" - }, - { - "entity": "subsub;", - "value": "U+02AD5" - }, - { - "entity": "subsup;", - "value": "U+02AD3" - }, - { - "entity": "succ;", - "value": "U+0227B" - }, - { - "entity": "succapprox;", - "value": "U+02AB8" - }, - { - "entity": "succcurlyeq;", - "value": "U+0227D" - }, - { - "entity": "succeq;", - "value": "U+02AB0" - }, - { - "entity": "succnapprox;", - "value": "U+02ABA" - }, - { - "entity": "succneqq;", - "value": "U+02AB6" - }, - { - "entity": "succnsim;", - "value": "U+022E9" - }, - { - "entity": "succsim;", - "value": "U+0227F" - }, - { - "entity": "sum;", - "value": "U+02211" - }, - { - "entity": "sung;", - "value": "U+0266A" - }, - { - "entity": "sup1;", - "value": "U+000B9" - }, - { - "entity": "sup1", - "value": "U+000B9" - }, - { - "entity": "sup2;", - "value": "U+000B2" - }, - { - "entity": "sup2", - "value": "U+000B2" - }, - { - "entity": "sup3;", - "value": "U+000B3" - }, - { - "entity": "sup3", - "value": "U+000B3" - }, - { - "entity": "sup;", - "value": "U+02283" - }, - { - "entity": "supE;", - "value": "U+02AC6" - }, - { - "entity": "supdot;", - "value": "U+02ABE" - }, - { - "entity": "supdsub;", - "value": "U+02AD8" - }, - { - "entity": "supe;", - "value": "U+02287" - }, - { - "entity": "supedot;", - "value": "U+02AC4" - }, - { - "entity": "suphsol;", - "value": "U+027C9" - }, - { - "entity": "suphsub;", - "value": "U+02AD7" - }, - { - "entity": "suplarr;", - "value": "U+0297B" - }, - { - "entity": "supmult;", - "value": "U+02AC2" - }, - { - "entity": "supnE;", - "value": "U+02ACC" - }, - { - "entity": "supne;", - "value": "U+0228B" - }, - { - "entity": "supplus;", - "value": "U+02AC0" - }, - { - "entity": "supset;", - "value": "U+02283" - }, - { - "entity": "supseteq;", - "value": "U+02287" - }, - { - "entity": "supseteqq;", - "value": "U+02AC6" - }, - { - "entity": "supsetneq;", - "value": "U+0228B" - }, - { - "entity": "supsetneqq;", - "value": "U+02ACC" - }, - { - "entity": "supsim;", - "value": "U+02AC8" - }, - { - "entity": "supsub;", - "value": "U+02AD4" - }, - { - "entity": "supsup;", - "value": "U+02AD6" - }, - { - "entity": "swArr;", - "value": "U+021D9" - }, - { - "entity": "swarhk;", - "value": "U+02926" - }, - { - "entity": "swarr;", - "value": "U+02199" - }, - { - "entity": "swarrow;", - "value": "U+02199" - }, - { - "entity": "swnwar;", - "value": "U+0292A" - }, - { - "entity": "szlig;", - "value": "U+000DF" - }, - { - "entity": "szlig", - "value": "U+000DF" - }, - { - "entity": "target;", - "value": "U+02316" - }, - { - "entity": "tau;", - "value": "U+003C4" - }, - { - "entity": "tbrk;", - "value": "U+023B4" - }, - { - "entity": "tcaron;", - "value": "U+00165" - }, - { - "entity": "tcedil;", - "value": "U+00163" - }, - { - "entity": "tcy;", - "value": "U+00442" - }, - { - "entity": "tdot;", - "value": "U+020DB" - }, - { - "entity": "telrec;", - "value": "U+02315" - }, - { - "entity": "tfr;", - "value": "U+1D531" - }, - { - "entity": "there4;", - "value": "U+02234" - }, - { - "entity": "therefore;", - "value": "U+02234" - }, - { - "entity": "theta;", - "value": "U+003B8" - }, - { - "entity": "thetasym;", - "value": "U+003D1" - }, - { - "entity": "thetav;", - "value": "U+003D1" - }, - { - "entity": "thickapprox;", - "value": "U+02248" - }, - { - "entity": "thicksim;", - "value": "U+0223C" - }, - { - "entity": "thinsp;", - "value": "U+02009" - }, - { - "entity": "thkap;", - "value": "U+02248" - }, - { - "entity": "thksim;", - "value": "U+0223C" - }, - { - "entity": "thorn;", - "value": "U+000FE" - }, - { - "entity": "thorn", - "value": "U+000FE" - }, - { - "entity": "tilde;", - "value": "U+002DC" - }, - { - "entity": "times;", - "value": "U+000D7" - }, - { - "entity": "times", - "value": "U+000D7" - }, - { - "entity": "timesb;", - "value": "U+022A0" - }, - { - "entity": "timesbar;", - "value": "U+02A31" - }, - { - "entity": "timesd;", - "value": "U+02A30" - }, - { - "entity": "tint;", - "value": "U+0222D" - }, - { - "entity": "toea;", - "value": "U+02928" - }, - { - "entity": "top;", - "value": "U+022A4" - }, - { - "entity": "topbot;", - "value": "U+02336" - }, - { - "entity": "topcir;", - "value": "U+02AF1" - }, - { - "entity": "topf;", - "value": "U+1D565" - }, - { - "entity": "topfork;", - "value": "U+02ADA" - }, - { - "entity": "tosa;", - "value": "U+02929" - }, - { - "entity": "tprime;", - "value": "U+02034" - }, - { - "entity": "trade;", - "value": "U+02122" - }, - { - "entity": "triangle;", - "value": "U+025B5" - }, - { - "entity": "triangledown;", - "value": "U+025BF" - }, - { - "entity": "triangleleft;", - "value": "U+025C3" - }, - { - "entity": "trianglelefteq;", - "value": "U+022B4" - }, - { - "entity": "triangleq;", - "value": "U+0225C" - }, - { - "entity": "triangleright;", - "value": "U+025B9" - }, - { - "entity": "trianglerighteq;", - "value": "U+022B5" - }, - { - "entity": "tridot;", - "value": "U+025EC" - }, - { - "entity": "trie;", - "value": "U+0225C" - }, - { - "entity": "triminus;", - "value": "U+02A3A" - }, - { - "entity": "triplus;", - "value": "U+02A39" - }, - { - "entity": "trisb;", - "value": "U+029CD" - }, - { - "entity": "tritime;", - "value": "U+02A3B" - }, - { - "entity": "trpezium;", - "value": "U+023E2" - }, - { - "entity": "tscr;", - "value": "U+1D4C9" - }, - { - "entity": "tscy;", - "value": "U+00446" - }, - { - "entity": "tshcy;", - "value": "U+0045B" - }, - { - "entity": "tstrok;", - "value": "U+00167" - }, - { - "entity": "twixt;", - "value": "U+0226C" - }, - { - "entity": "twoheadleftarrow;", - "value": "U+0219E" - }, - { - "entity": "twoheadrightarrow;", - "value": "U+021A0" - }, - { - "entity": "uArr;", - "value": "U+021D1" - }, - { - "entity": "uHar;", - "value": "U+02963" - }, - { - "entity": "uacute;", - "value": "U+000FA" - }, - { - "entity": "uacute", - "value": "U+000FA" - }, - { - "entity": "uarr;", - "value": "U+02191" - }, - { - "entity": "ubrcy;", - "value": "U+0045E" - }, - { - "entity": "ubreve;", - "value": "U+0016D" - }, - { - "entity": "ucirc;", - "value": "U+000FB" - }, - { - "entity": "ucirc", - "value": "U+000FB" - }, - { - "entity": "ucy;", - "value": "U+00443" - }, - { - "entity": "udarr;", - "value": "U+021C5" - }, - { - "entity": "udblac;", - "value": "U+00171" - }, - { - "entity": "udhar;", - "value": "U+0296E" - }, - { - "entity": "ufisht;", - "value": "U+0297E" - }, - { - "entity": "ufr;", - "value": "U+1D532" - }, - { - "entity": "ugrave;", - "value": "U+000F9" - }, - { - "entity": "ugrave", - "value": "U+000F9" - }, - { - "entity": "uharl;", - "value": "U+021BF" - }, - { - "entity": "uharr;", - "value": "U+021BE" - }, - { - "entity": "uhblk;", - "value": "U+02580" - }, - { - "entity": "ulcorn;", - "value": "U+0231C" - }, - { - "entity": "ulcorner;", - "value": "U+0231C" - }, - { - "entity": "ulcrop;", - "value": "U+0230F" - }, - { - "entity": "ultri;", - "value": "U+025F8" - }, - { - "entity": "umacr;", - "value": "U+0016B" - }, - { - "entity": "uml;", - "value": "U+000A8" - }, - { - "entity": "uml", - "value": "U+000A8" - }, - { - "entity": "uogon;", - "value": "U+00173" - }, - { - "entity": "uopf;", - "value": "U+1D566" - }, - { - "entity": "uparrow;", - "value": "U+02191" - }, - { - "entity": "updownarrow;", - "value": "U+02195" - }, - { - "entity": "upharpoonleft;", - "value": "U+021BF" - }, - { - "entity": "upharpoonright;", - "value": "U+021BE" - }, - { - "entity": "uplus;", - "value": "U+0228E" - }, - { - "entity": "upsi;", - "value": "U+003C5" - }, - { - "entity": "upsih;", - "value": "U+003D2" - }, - { - "entity": "upsilon;", - "value": "U+003C5" - }, - { - "entity": "upuparrows;", - "value": "U+021C8" - }, - { - "entity": "urcorn;", - "value": "U+0231D" - }, - { - "entity": "urcorner;", - "value": "U+0231D" - }, - { - "entity": "urcrop;", - "value": "U+0230E" - }, - { - "entity": "uring;", - "value": "U+0016F" - }, - { - "entity": "urtri;", - "value": "U+025F9" - }, - { - "entity": "uscr;", - "value": "U+1D4CA" - }, - { - "entity": "utdot;", - "value": "U+022F0" - }, - { - "entity": "utilde;", - "value": "U+00169" - }, - { - "entity": "utri;", - "value": "U+025B5" - }, - { - "entity": "utrif;", - "value": "U+025B4" - }, - { - "entity": "uuarr;", - "value": "U+021C8" - }, - { - "entity": "uuml;", - "value": "U+000FC" - }, - { - "entity": "uuml", - "value": "U+000FC" - }, - { - "entity": "uwangle;", - "value": "U+029A7" - }, - { - "entity": "vArr;", - "value": "U+021D5" - }, - { - "entity": "vBar;", - "value": "U+02AE8" - }, - { - "entity": "vBarv;", - "value": "U+02AE9" - }, - { - "entity": "vDash;", - "value": "U+022A8" - }, - { - "entity": "vangrt;", - "value": "U+0299C" - }, - { - "entity": "varepsilon;", - "value": "U+003F5" - }, - { - "entity": "varkappa;", - "value": "U+003F0" - }, - { - "entity": "varnothing;", - "value": "U+02205" - }, - { - "entity": "varphi;", - "value": "U+003D5" - }, - { - "entity": "varpi;", - "value": "U+003D6" - }, - { - "entity": "varpropto;", - "value": "U+0221D" - }, - { - "entity": "varr;", - "value": "U+02195" - }, - { - "entity": "varrho;", - "value": "U+003F1" - }, - { - "entity": "varsigma;", - "value": "U+003C2" - }, - { - "entity": "vartheta;", - "value": "U+003D1" - }, - { - "entity": "vartriangleleft;", - "value": "U+022B2" - }, - { - "entity": "vartriangleright;", - "value": "U+022B3" - }, - { - "entity": "vcy;", - "value": "U+00432" - }, - { - "entity": "vdash;", - "value": "U+022A2" - }, - { - "entity": "vee;", - "value": "U+02228" - }, - { - "entity": "veebar;", - "value": "U+022BB" - }, - { - "entity": "veeeq;", - "value": "U+0225A" - }, - { - "entity": "vellip;", - "value": "U+022EE" - }, - { - "entity": "verbar;", - "value": "U+0007C" - }, - { - "entity": "vert;", - "value": "U+0007C" - }, - { - "entity": "vfr;", - "value": "U+1D533" - }, - { - "entity": "vltri;", - "value": "U+022B2" - }, - { - "entity": "vopf;", - "value": "U+1D567" - }, - { - "entity": "vprop;", - "value": "U+0221D" - }, - { - "entity": "vrtri;", - "value": "U+022B3" - }, - { - "entity": "vscr;", - "value": "U+1D4CB" - }, - { - "entity": "vzigzag;", - "value": "U+0299A" - }, - { - "entity": "wcirc;", - "value": "U+00175" - }, - { - "entity": "wedbar;", - "value": "U+02A5F" - }, - { - "entity": "wedge;", - "value": "U+02227" - }, - { - "entity": "wedgeq;", - "value": "U+02259" - }, - { - "entity": "weierp;", - "value": "U+02118" - }, - { - "entity": "wfr;", - "value": "U+1D534" - }, - { - "entity": "wopf;", - "value": "U+1D568" - }, - { - "entity": "wp;", - "value": "U+02118" - }, - { - "entity": "wr;", - "value": "U+02240" - }, - { - "entity": "wreath;", - "value": "U+02240" - }, - { - "entity": "wscr;", - "value": "U+1D4CC" - }, - { - "entity": "xcap;", - "value": "U+022C2" - }, - { - "entity": "xcirc;", - "value": "U+025EF" - }, - { - "entity": "xcup;", - "value": "U+022C3" - }, - { - "entity": "xdtri;", - "value": "U+025BD" - }, - { - "entity": "xfr;", - "value": "U+1D535" - }, - { - "entity": "xhArr;", - "value": "U+027FA" - }, - { - "entity": "xharr;", - "value": "U+027F7" - }, - { - "entity": "xi;", - "value": "U+003BE" - }, - { - "entity": "xlArr;", - "value": "U+027F8" - }, - { - "entity": "xlarr;", - "value": "U+027F5" - }, - { - "entity": "xmap;", - "value": "U+027FC" - }, - { - "entity": "xnis;", - "value": "U+022FB" - }, - { - "entity": "xodot;", - "value": "U+02A00" - }, - { - "entity": "xopf;", - "value": "U+1D569" - }, - { - "entity": "xoplus;", - "value": "U+02A01" - }, - { - "entity": "xotime;", - "value": "U+02A02" - }, - { - "entity": "xrArr;", - "value": "U+027F9" - }, - { - "entity": "xrarr;", - "value": "U+027F6" - }, - { - "entity": "xscr;", - "value": "U+1D4CD" - }, - { - "entity": "xsqcup;", - "value": "U+02A06" - }, - { - "entity": "xuplus;", - "value": "U+02A04" - }, - { - "entity": "xutri;", - "value": "U+025B3" - }, - { - "entity": "xvee;", - "value": "U+022C1" - }, - { - "entity": "xwedge;", - "value": "U+022C0" - }, - { - "entity": "yacute;", - "value": "U+000FD" - }, - { - "entity": "yacute", - "value": "U+000FD" - }, - { - "entity": "yacy;", - "value": "U+0044F" - }, - { - "entity": "ycirc;", - "value": "U+00177" - }, - { - "entity": "ycy;", - "value": "U+0044B" - }, - { - "entity": "yen;", - "value": "U+000A5" - }, - { - "entity": "yen", - "value": "U+000A5" - }, - { - "entity": "yfr;", - "value": "U+1D536" - }, - { - "entity": "yicy;", - "value": "U+00457" - }, - { - "entity": "yopf;", - "value": "U+1D56A" - }, - { - "entity": "yscr;", - "value": "U+1D4CE" - }, - { - "entity": "yucy;", - "value": "U+0044E" - }, - { - "entity": "yuml;", - "value": "U+000FF" - }, - { - "entity": "yuml", - "value": "U+000FF" - }, - { - "entity": "zacute;", - "value": "U+0017A" - }, - { - "entity": "zcaron;", - "value": "U+0017E" - }, - { - "entity": "zcy;", - "value": "U+00437" - }, - { - "entity": "zdot;", - "value": "U+0017C" - }, - { - "entity": "zeetrf;", - "value": "U+02128" - }, - { - "entity": "zeta;", - "value": "U+003B6" - }, - { - "entity": "zfr;", - "value": "U+1D537" - }, - { - "entity": "zhcy;", - "value": "U+00436" - }, - { - "entity": "zigrarr;", - "value": "U+021DD" - }, - { - "entity": "zopf;", - "value": "U+1D56B" - }, - { - "entity": "zscr;", - "value": "U+1D4CF" - }, - { - "entity": "zwj;", - "value": "U+0200D" - }, - { - "entity": "zwnj;", - "value": "U+0200C" - } -] diff --git a/WebCore/html/HTMLFormControlElement.h b/WebCore/html/HTMLFormControlElement.h index 2352182..eae7f0a 100644 --- a/WebCore/html/HTMLFormControlElement.h +++ b/WebCore/html/HTMLFormControlElement.h @@ -88,9 +88,6 @@ public: // This must be called when a validation constraint or control value is changed. void setNeedsValidityCheck(); void setCustomValidity(const String&); - virtual bool valueMissing() const { return false; } - virtual bool patternMismatch() const { return false; } - virtual bool tooLong() const { return false; } void formDestroyed() { m_form = 0; } @@ -175,6 +172,9 @@ private: // FIXME: Give this class its own header file. class HTMLTextFormControlElement : public HTMLFormControlElementWithState { public: + // Common flag for HTMLInputElement::tooLong() and HTMLTextAreaElement::tooLong(). + enum NeedsToCheckDirtyFlag {CheckDirtyFlag, IgnoreDirtyFlag}; + virtual ~HTMLTextFormControlElement(); String strippedPlaceholder() const; diff --git a/WebCore/html/HTMLFormElement.cpp b/WebCore/html/HTMLFormElement.cpp index c53ea1d..56ffd0f 100644 --- a/WebCore/html/HTMLFormElement.cpp +++ b/WebCore/html/HTMLFormElement.cpp @@ -449,6 +449,9 @@ bool HTMLFormElement::noValidate() const return !getAttribute(novalidateAttr).isNull(); } +// FIXME: This function should be removed because it does not do the same thing as the +// JavaScript binding for action, which treats action as a URL attribute. Last time I +// (Darin Adler) removed this, someone added it back, so I am leaving it in for now. String HTMLFormElement::action() const { return getAttribute(actionAttr); diff --git a/WebCore/html/HTMLFormElement.idl b/WebCore/html/HTMLFormElement.idl index c5162f9..a9f8ea1 100644 --- a/WebCore/html/HTMLFormElement.idl +++ b/WebCore/html/HTMLFormElement.idl @@ -30,7 +30,7 @@ module html { attribute [Reflect] DOMString name; attribute [Reflect] boolean noValidate; attribute [Reflect=accept_charset] DOMString acceptCharset; - attribute [Reflect] DOMString action; + attribute [Reflect, URL] DOMString action; attribute [ConvertNullToNullString] DOMString encoding; /* Netscape/Firefox legacy attribute. Same as enctype. */ attribute [ConvertNullToNullString] DOMString enctype; attribute [Reflect] DOMString method; diff --git a/WebCore/html/HTMLFrameElement.idl b/WebCore/html/HTMLFrameElement.idl index 4a5268c..dfe4ef8 100644 --- a/WebCore/html/HTMLFrameElement.idl +++ b/WebCore/html/HTMLFrameElement.idl @@ -29,7 +29,7 @@ module html { attribute [Reflect] DOMString name; attribute [Reflect] boolean noResize; attribute [Reflect] DOMString scrolling; - attribute [Reflect,URL] DOMString src; + attribute [Reflect, URL] DOMString src; // Introduced in DOM Level 2: readonly attribute [CheckFrameSecurity] Document contentDocument; diff --git a/WebCore/html/HTMLFrameElementBase.cpp b/WebCore/html/HTMLFrameElementBase.cpp index 6cae891..b967926 100644 --- a/WebCore/html/HTMLFrameElementBase.cpp +++ b/WebCore/html/HTMLFrameElementBase.cpp @@ -37,6 +37,7 @@ #include "HTMLNames.h" #include "KURL.h" #include "Page.h" +#include "RenderEmbeddedObject.h" #include "RenderFrame.h" #include "ScriptController.h" #include "ScriptEventListener.h" @@ -210,10 +211,10 @@ void HTMLFrameElementBase::attach() setRemainsAliveOnRemovalFromTree(false); HTMLFrameOwnerElement::attach(); - - if (RenderPart* renderPart = toRenderPart(renderer())) { + + if (RenderPart* part = renderPart()) { if (Frame* frame = contentFrame()) - renderPart->setWidget(frame->view()); + part->setWidget(frame->view()); } } @@ -257,20 +258,20 @@ bool HTMLFrameElementBase::isURLAttribute(Attribute *attr) const int HTMLFrameElementBase::width() const { - if (!renderer()) + if (!renderBox()) return 0; - + document()->updateLayoutIgnorePendingStylesheets(); - return toRenderBox(renderer())->width(); + return renderBox()->width(); } int HTMLFrameElementBase::height() const { - if (!renderer()) + if (!renderBox()) return 0; - + document()->updateLayoutIgnorePendingStylesheets(); - return toRenderBox(renderer())->height(); + return renderBox()->height(); } void HTMLFrameElementBase::setRemainsAliveOnRemovalFromTree(bool value) diff --git a/WebCore/html/HTMLFrameOwnerElement.cpp b/WebCore/html/HTMLFrameOwnerElement.cpp index a1a69f3..3f946f0 100644 --- a/WebCore/html/HTMLFrameOwnerElement.cpp +++ b/WebCore/html/HTMLFrameOwnerElement.cpp @@ -24,6 +24,7 @@ #include "DOMWindow.h" #include "Frame.h" #include "FrameLoader.h" +#include "RenderPart.h" #if ENABLE(SVG) #include "ExceptionCode.h" @@ -39,6 +40,15 @@ HTMLFrameOwnerElement::HTMLFrameOwnerElement(const QualifiedName& tagName, Docum { } +RenderPart* HTMLFrameOwnerElement::renderPart() const +{ + // HTMLObjectElement and HTMLEmbedElement may return arbitrary renderers + // when using fallback content. + if (!renderer() || !renderer()->isRenderPart()) + return 0; + return toRenderPart(renderer()); +} + void HTMLFrameOwnerElement::willRemove() { if (Frame* frame = contentFrame()) { diff --git a/WebCore/html/HTMLFrameOwnerElement.h b/WebCore/html/HTMLFrameOwnerElement.h index 804ab22..c84d7bb 100644 --- a/WebCore/html/HTMLFrameOwnerElement.h +++ b/WebCore/html/HTMLFrameOwnerElement.h @@ -28,6 +28,7 @@ namespace WebCore { class DOMWindow; class Frame; +class RenderPart; #if ENABLE(SVG) class SVGDocument; @@ -41,6 +42,11 @@ public: DOMWindow* contentWindow() const; Document* contentDocument() const; + // Most subclasses use RenderPart (either RenderEmbeddedObject or RenderIFrame) + // except for HTMLObjectElement and HTMLEmbedElement which may return any + // RenderObject when using fallback content. + RenderPart* renderPart() const; + #if ENABLE(SVG) SVGDocument* getSVGDocument(ExceptionCode&) const; #endif diff --git a/WebCore/html/HTMLHtmlElement.cpp b/WebCore/html/HTMLHtmlElement.cpp index 6205d10..6007805 100644 --- a/WebCore/html/HTMLHtmlElement.cpp +++ b/WebCore/html/HTMLHtmlElement.cpp @@ -50,6 +50,11 @@ PassRefPtr<HTMLHtmlElement> HTMLHtmlElement::create(const QualifiedName& tagName return adoptRef(new HTMLHtmlElement(tagName, document)); } +bool HTMLHtmlElement::isURLAttribute(Attribute* attribute) const +{ + return attribute->name() == manifestAttr; +} + #if ENABLE(OFFLINE_WEB_APPLICATIONS) void HTMLHtmlElement::insertedIntoDocument() { @@ -68,8 +73,8 @@ void HTMLHtmlElement::insertedIntoDocument() // Check the manifest attribute // FIXME: Revisit this when we get a clarification from whatwg on how to handle empty // manifest attributes. As spec'd, and coded here, the system will initiate an update - // passing in the document url as the manifest url. That's not a good thing. - AtomicString manifest = getAttribute(manifestAttr); + // passing in the document URL as the manifest URL. That's not a good thing. + const AtomicString& manifest = getAttribute(manifestAttr); if (manifest.isNull()) documentLoader->applicationCacheHost()->selectCacheWithoutManifest(); else diff --git a/WebCore/html/HTMLHtmlElement.h b/WebCore/html/HTMLHtmlElement.h index e854fb1..47503f7 100644 --- a/WebCore/html/HTMLHtmlElement.h +++ b/WebCore/html/HTMLHtmlElement.h @@ -36,6 +36,8 @@ public: private: HTMLHtmlElement(const QualifiedName&, Document*); + virtual bool isURLAttribute(Attribute*) const; + #if ENABLE(OFFLINE_WEB_APPLICATIONS) virtual void insertedIntoDocument(); #endif diff --git a/WebCore/html/HTMLHtmlElement.idl b/WebCore/html/HTMLHtmlElement.idl index 42ba861..03c661c 100644 --- a/WebCore/html/HTMLHtmlElement.idl +++ b/WebCore/html/HTMLHtmlElement.idl @@ -21,6 +21,7 @@ module html { interface HTMLHtmlElement : HTMLElement { attribute [Reflect] DOMString version; + attribute [Reflect, URL] DOMString manifest; }; } diff --git a/WebCore/html/HTMLIFrameElement.idl b/WebCore/html/HTMLIFrameElement.idl index b21263e..7f9e25a 100644 --- a/WebCore/html/HTMLIFrameElement.idl +++ b/WebCore/html/HTMLIFrameElement.idl @@ -30,7 +30,7 @@ module html { attribute [Reflect] DOMString name; attribute [Reflect] DOMString sandbox; attribute [Reflect] DOMString scrolling; - attribute [Reflect] DOMString src; + attribute [Reflect, URL] DOMString src; attribute [Reflect] DOMString width; // Introduced in DOM Level 2: diff --git a/WebCore/html/HTMLImageElement.cpp b/WebCore/html/HTMLImageElement.cpp index 82eeab1..b7ece78 100644 --- a/WebCore/html/HTMLImageElement.cpp +++ b/WebCore/html/HTMLImageElement.cpp @@ -183,7 +183,9 @@ RenderObject* HTMLImageElement::createRenderer(RenderArena* arena, RenderStyle* if (style->contentData()) return RenderObject::createObject(this, style); - return new (arena) RenderImage(this); + RenderImage* image = new (arena) RenderImage(this); + image->setImageResource(RenderImageResource::create()); + return image; } void HTMLImageElement::attach() @@ -191,15 +193,16 @@ void HTMLImageElement::attach() HTMLElement::attach(); if (renderer() && renderer()->isImage() && m_imageLoader.haveFiredBeforeLoadEvent()) { - RenderImage* imageObj = toRenderImage(renderer()); - if (imageObj->hasImage()) + RenderImage* renderImage = toRenderImage(renderer()); + RenderImageResource* renderImageResource = renderImage->imageResource(); + if (renderImageResource->hasImage()) return; - imageObj->setCachedImage(m_imageLoader.image()); + renderImageResource->setCachedImage(m_imageLoader.image()); // If we have no image at all because we have no src attribute, set // image height and width for the alt text instead. - if (!m_imageLoader.image() && !imageObj->cachedImage()) - imageObj->setImageSizeForAltText(); + if (!m_imageLoader.image() && !renderImageResource->cachedImage()) + renderImage->setImageSizeForAltText(); } } diff --git a/WebCore/html/HTMLImageElement.idl b/WebCore/html/HTMLImageElement.idl index 1bf8a28..935b721 100644 --- a/WebCore/html/HTMLImageElement.idl +++ b/WebCore/html/HTMLImageElement.idl @@ -30,8 +30,8 @@ module html { attribute long height; attribute [Reflect] long hspace; attribute [Reflect] boolean isMap; - attribute [Reflect,URL] DOMString longDesc; - attribute [Reflect,URL] DOMString src; + attribute [Reflect, URL] DOMString longDesc; + attribute [Reflect, URL] DOMString src; attribute [Reflect] DOMString useMap; attribute [Reflect] long vspace; attribute long width; diff --git a/WebCore/html/HTMLInputElement.cpp b/WebCore/html/HTMLInputElement.cpp index f9c5162..c2e5416 100644 --- a/WebCore/html/HTMLInputElement.cpp +++ b/WebCore/html/HTMLInputElement.cpp @@ -111,12 +111,44 @@ static const double weekDefaultStepBase = -259200000.0; // The first day of 1970 static const double msecPerMinute = 60 * 1000; static const double msecPerSecond = 1000; +static const char emailPattern[] = + "[a-z0-9!#$%&'*+/=?^_`{|}~.-]+" // local part + "@" + "[a-z0-9-]+(\\.[a-z0-9-]+)+"; // domain part + static bool isNumberCharacter(UChar ch) { return ch == '+' || ch == '-' || ch == '.' || ch == 'e' || ch == 'E' || (ch >= '0' && ch <= '9'); } +static bool isValidColorString(const String& value) +{ + if (value.isEmpty()) + return false; + if (value[0] == '#') { + // We don't accept #rgb and #aarrggbb formats. + if (value.length() != 7) + return false; + } + Color color(value); // This accepts named colors such as "white". + return color.isValid() && !color.hasAlpha(); +} + +static bool isValidEmailAddress(const String& address) +{ + int addressLength = address.length(); + if (!addressLength) + return false; + + DEFINE_STATIC_LOCAL(const RegularExpression, regExp, (emailPattern, TextCaseInsensitive)); + + int matchLength; + int matchOffset = regExp.match(address, 0, &matchLength); + + return !matchOffset && matchLength == addressLength; +} + HTMLInputElement::HTMLInputElement(const QualifiedName& tagName, Document* document, HTMLFormElement* form) : HTMLTextFormControlElement(tagName, document, form) , m_xPos(0) @@ -208,7 +240,71 @@ void HTMLInputElement::updateCheckedRadioButtons() renderer()->theme()->stateChanged(renderer(), CheckedState); } -bool HTMLInputElement::valueMissing() const +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) { + ASSERT_NOT_REACHED(); + return false; + } + return !typeMismatch(value) + && !stepMismatch(value) + && !rangeUnderflow(value) + && !rangeOverflow(value) + && !tooLong(value, IgnoreDirtyFlag) + && !patternMismatch(value) + && !valueMissing(value); +} + +bool HTMLInputElement::typeMismatch(const String& value) const +{ + switch (inputType()) { + case COLOR: + return !isValidColorString(value); + case NUMBER: + return !parseToDoubleForNumberType(value, 0); + case URL: + return !KURL(KURL(), value).isValid(); + case EMAIL: { + if (!multiple()) + return !isValidEmailAddress(value); + Vector<String> addresses; + value.split(',', addresses); + for (unsigned i = 0; i < addresses.size(); ++i) { + if (!isValidEmailAddress(addresses[i])) + return true; + } + return false; + } + case DATE: + case DATETIME: + case DATETIMELOCAL: + case MONTH: + case TIME: + case WEEK: + return !parseToDateComponents(inputType(), value, 0); + case BUTTON: + case CHECKBOX: + case FILE: + case HIDDEN: + case IMAGE: + case ISINDEX: + case PASSWORD: + case RADIO: + case RANGE: + case RESET: + case SEARCH: + case SUBMIT: + case TELEPHONE: + case TEXT: + return false; + } + ASSERT_NOT_REACHED(); + return false; +} + +bool HTMLInputElement::valueMissing(const String& value) const { if (!isRequiredFormControl() || readOnly() || disabled()) return false; @@ -228,7 +324,7 @@ bool HTMLInputElement::valueMissing() const case TIME: case URL: case WEEK: - return value().isEmpty(); + return value.isEmpty(); case CHECKBOX: return !checked(); case RADIO: @@ -249,12 +345,11 @@ bool HTMLInputElement::valueMissing() const return false; } -bool HTMLInputElement::patternMismatch() const +bool HTMLInputElement::patternMismatch(const String& value) const { if (!isTextType()) return false; const AtomicString& pattern = getAttribute(patternAttr); - String value = this->value(); // Empty values can't be mismatched if (pattern.isEmpty() || value.isEmpty()) return false; @@ -265,7 +360,7 @@ bool HTMLInputElement::patternMismatch() const return matchOffset || matchLength != valueLength; } -bool HTMLInputElement::tooLong() const +bool HTMLInputElement::tooLong(const String& value, NeedsToCheckDirtyFlag check) const { // We use isTextType() instead of supportsMaxLength() because of the // 'virtual' overhead. @@ -274,14 +369,16 @@ bool HTMLInputElement::tooLong() const int max = maxLength(); if (max < 0) return false; - // Return false for the default value even if it is longer than maxLength. - bool userEdited = !m_data.value().isNull(); - if (!userEdited) - return false; - return numGraphemeClusters(value()) > static_cast<unsigned>(max); + if (check == CheckDirtyFlag) { + // Return false for the default value even if it is longer than maxLength. + bool userEdited = !m_data.value().isNull(); + if (!userEdited) + return false; + } + return numGraphemeClusters(value) > static_cast<unsigned>(max); } -bool HTMLInputElement::rangeUnderflow() const +bool HTMLInputElement::rangeUnderflow(const String& value) const { const double nan = numeric_limits<double>::quiet_NaN(); switch (inputType()) { @@ -292,11 +389,11 @@ bool HTMLInputElement::rangeUnderflow() const case NUMBER: case TIME: case WEEK: { - double doubleValue = parseToDouble(value(), nan); + double doubleValue = parseToDouble(value, nan); return isfinite(doubleValue) && doubleValue < minimum(); } case RANGE: // Guaranteed by sanitization. - ASSERT(parseToDouble(value(), nan) >= minimum()); + ASSERT(parseToDouble(value, nan) >= minimum()); case BUTTON: case CHECKBOX: case COLOR: @@ -318,7 +415,7 @@ bool HTMLInputElement::rangeUnderflow() const return false; } -bool HTMLInputElement::rangeOverflow() const +bool HTMLInputElement::rangeOverflow(const String& value) const { const double nan = numeric_limits<double>::quiet_NaN(); switch (inputType()) { @@ -329,11 +426,11 @@ bool HTMLInputElement::rangeOverflow() const case NUMBER: case TIME: case WEEK: { - double doubleValue = parseToDouble(value(), nan); + double doubleValue = parseToDouble(value, nan); return isfinite(doubleValue) && doubleValue > maximum(); } case RANGE: // Guaranteed by sanitization. - ASSERT(parseToDouble(value(), nan) <= maximum()); + ASSERT(parseToDouble(value, nan) <= maximum()); case BUTTON: case CHECKBOX: case COLOR: @@ -478,7 +575,7 @@ double HTMLInputElement::stepBase() const return 0.0; } -bool HTMLInputElement::stepMismatch() const +bool HTMLInputElement::stepMismatch(const String& value) const { double step; if (!getAllowedValueStep(&step)) @@ -491,7 +588,7 @@ bool HTMLInputElement::stepMismatch() const return false; case NUMBER: { double doubleValue; - if (!parseToDoubleForNumberType(value(), &doubleValue)) + if (!parseToDoubleForNumberType(value, &doubleValue)) return false; doubleValue = fabs(doubleValue - stepBase()); if (isinf(doubleValue)) @@ -513,7 +610,7 @@ bool HTMLInputElement::stepMismatch() const case TIME: case WEEK: { const double nan = numeric_limits<double>::quiet_NaN(); - double doubleValue = parseToDouble(value(), nan); + double doubleValue = parseToDouble(value, nan); doubleValue = fabs(doubleValue - stepBase()); if (!isfinite(doubleValue)) return false; @@ -1175,8 +1272,11 @@ RenderObject* HTMLInputElement::createRenderer(RenderArena *arena, RenderStyle * return new (arena) RenderFileUploadControl(this); case HIDDEN: break; - case IMAGE: - return new (arena) RenderImage(this); + case IMAGE: { + RenderImage* image = new (arena) RenderImage(this); + image->setImageResource(RenderImageResource::create()); + return image; + } case RANGE: return new (arena) RenderSlider(this); case COLOR: @@ -1215,13 +1315,14 @@ void HTMLInputElement::attach() m_imageLoader = adoptPtr(new HTMLImageLoader(this)); m_imageLoader->updateFromElement(); if (renderer() && m_imageLoader->haveFiredBeforeLoadEvent()) { - RenderImage* imageObj = toRenderImage(renderer()); - imageObj->setCachedImage(m_imageLoader->image()); - + RenderImage* renderImage = toRenderImage(renderer()); + RenderImageResource* renderImageResource = renderImage->imageResource(); + renderImageResource->setCachedImage(m_imageLoader->image()); + // If we have no image at all because we have no src attribute, set // image height and width for the alt text instead. - if (!m_imageLoader->image() && !imageObj->cachedImage()) - imageObj->setImageSizeForAltText(); + if (!m_imageLoader->image() && !renderImageResource->cachedImage()) + renderImage->setImageSizeForAltText(); } } @@ -1501,11 +1602,16 @@ void HTMLInputElement::copyNonAttributeProperties(const Element* source) String HTMLInputElement::value() const { - // 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 being able to get the file name as a value. if (inputType() == FILE) { - if (!m_fileList->isEmpty()) - return m_fileList->item(0)->fileName(); + 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 + // file path, but that's a privacy problem. Code on the web + // decided to try to parse the value by looking for backslashes + // (because that's what Windows file paths use). To be compatible + // with that code, we make up a fake path for the file. + return "C:\\fakepath\\" + m_fileList->item(0)->fileName(); + } return String(); } diff --git a/WebCore/html/HTMLInputElement.h b/WebCore/html/HTMLInputElement.h index e6cdda3..657b468 100644 --- a/WebCore/html/HTMLInputElement.h +++ b/WebCore/html/HTMLInputElement.h @@ -75,8 +75,13 @@ public: bool autoComplete() const; // For ValidityState - bool rangeUnderflow() const; - bool rangeOverflow() const; + bool typeMismatch(const String&) const; + // valueMissing() ignores the specified string value for CHECKBOX and RADIO. + bool valueMissing(const String&) const; + bool patternMismatch(const String&) const; + bool tooLong(const String&, NeedsToCheckDirtyFlag) const; + bool rangeUnderflow(const String&) const; + bool rangeOverflow(const String&) const; // Returns the minimum value for type=date, number, or range. Don't call this for other types. double minimum() const; // Returns the maximum value for type=date, number, or range. Don't call this for other types. @@ -86,7 +91,8 @@ public: // Returns false if there is no "allowed value step." bool getAllowedValueStep(double*) const; // For ValidityState. - bool stepMismatch() const; + bool stepMismatch(const String&) const; + // Implementations of HTMLInputElement::stepUp() and stepDown(). void stepUp(int, ExceptionCode&); void stepDown(int, ExceptionCode&); @@ -124,6 +130,9 @@ public: virtual String value() const; virtual void setValue(const String&, bool sendChangeEvent = false); virtual void setValueForUser(const String&); + // Checks if the specified string would be a valid value. + // We should not call this for types with no string value such as CHECKBOX and RADIO. + bool isValidValue(const String&) const; virtual const String& suggestedValue() const; void setSuggestedValue(const String&); @@ -233,10 +242,6 @@ private: virtual bool isTextFormControl() const { return isTextField(); } - virtual bool valueMissing() const; - virtual bool patternMismatch() const; - virtual bool tooLong() const; - 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 canTriggerImplicitSubmission() const { return isTextField(); } diff --git a/WebCore/html/HTMLInputElement.idl b/WebCore/html/HTMLInputElement.idl index c726caa..19e4226 100644 --- a/WebCore/html/HTMLInputElement.idl +++ b/WebCore/html/HTMLInputElement.idl @@ -54,7 +54,7 @@ module html { // FIXME: The spec says this should be a long, not an unsigned long. attribute unsigned long size; // Changed string -> long as part of DOM level 2 #endif - attribute [Reflect,URL] DOMString src; + attribute [Reflect, URL] DOMString src; attribute [Reflect] DOMString step; attribute [ConvertNullToNullString, JSCCustomGetter] DOMString type; // readonly dropped as part of DOM level 2 attribute [Reflect] DOMString useMap; diff --git a/WebCore/html/HTMLLinkElement.cpp b/WebCore/html/HTMLLinkElement.cpp index c778b6f..bc7b9a6 100644 --- a/WebCore/html/HTMLLinkElement.cpp +++ b/WebCore/html/HTMLLinkElement.cpp @@ -103,7 +103,7 @@ void HTMLLinkElement::setDisabledState(bool _disabled) if (!m_sheet && m_disabledState == EnabledViaScript) process(); else - document()->updateStyleSelector(); // Update the style selector. + document()->styleSelectorChanged(DeferRecalcStyle); // Update the style selector. } } @@ -211,7 +211,7 @@ void HTMLLinkElement::process() ResourceHandle::prepareForURL(m_url); #if ENABLE(LINK_PREFETCH) - if (m_relAttribute.m_isLinkPrefetch && m_url.isValid()) + if (m_relAttribute.m_isLinkPrefetch && m_url.isValid() && document()->frame()) document()->docLoader()->requestLinkPrefetch(m_url); #endif @@ -256,7 +256,7 @@ void HTMLLinkElement::process() } else if (m_sheet) { // we no longer contain a stylesheet, e.g. perhaps rel or type was changed m_sheet = 0; - document()->updateStyleSelector(); + document()->styleSelectorChanged(DeferRecalcStyle); } } @@ -274,9 +274,8 @@ void HTMLLinkElement::removedFromDocument() document()->removeStyleSheetCandidateNode(this); - // FIXME: It's terrible to do a synchronous update of the style selector just because a <style> or <link> element got removed. if (document()->renderer()) - document()->updateStyleSelector(); + document()->styleSelectorChanged(DeferRecalcStyle); } void HTMLLinkElement::finishParsingChildren() @@ -289,7 +288,7 @@ void HTMLLinkElement::setCSSStyleSheet(const String& href, const KURL& baseURL, { m_sheet = CSSStyleSheet::create(this, href, baseURL, charset); - bool strictParsing = !document()->inCompatMode(); + bool strictParsing = !document()->inQuirksMode(); bool enforceMIMEType = strictParsing; bool crossOriginCSS = false; bool validMIMEType = false; @@ -297,7 +296,7 @@ void HTMLLinkElement::setCSSStyleSheet(const String& href, const KURL& baseURL, // Check to see if we should enforce the MIME type of the CSS resource in strict mode. // Running in iWeb 2 is one example of where we don't want to - <rdar://problem/6099748> - if (enforceMIMEType && document()->page() && !document()->page()->settings()->enforceCSSMIMETypeInStrictMode()) + if (enforceMIMEType && document()->page() && !document()->page()->settings()->enforceCSSMIMETypeInNoQuirksMode()) enforceMIMEType = false; #if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) diff --git a/WebCore/html/HTMLLinkElement.idl b/WebCore/html/HTMLLinkElement.idl index dfec24b..734e8cc 100644 --- a/WebCore/html/HTMLLinkElement.idl +++ b/WebCore/html/HTMLLinkElement.idl @@ -23,7 +23,7 @@ module html { interface HTMLLinkElement : HTMLElement { attribute [Reflect] boolean disabled; attribute [Reflect] DOMString charset; - attribute [Reflect,URL] DOMString href; + attribute [Reflect, URL] DOMString href; attribute [Reflect] DOMString hreflang; attribute [Reflect] DOMString media; attribute [Reflect] DOMString rel; diff --git a/WebCore/html/HTMLMediaElement.cpp b/WebCore/html/HTMLMediaElement.cpp index 751735d..bc7960c 100644 --- a/WebCore/html/HTMLMediaElement.cpp +++ b/WebCore/html/HTMLMediaElement.cpp @@ -37,7 +37,6 @@ #include "ClientRect.h" #include "ClientRectList.h" #include "ContentType.h" -#include "DocLoader.h" #include "Event.h" #include "EventNames.h" #include "ExceptionCode.h" @@ -112,7 +111,8 @@ HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document* doc) , m_processingMediaPlayerCallback(0) , m_playing(false) , m_isWaitingUntilMediaCanStart(false) - , m_delayingTheLoadEvent(false) + , m_shouldDelayLoadEvent(false) + , m_isWaitingToDecrementLoadEventDelayCount(false) , m_haveFiredLoadedData(false) , m_inActiveDocument(true) , m_autoplaying(true) @@ -140,6 +140,7 @@ HTMLMediaElement::~HTMLMediaElement() { if (m_isWaitingUntilMediaCanStart) document()->removeMediaCanStartListener(this); + setShouldDelayLoadEvent(false); document()->unregisterForDocumentActivationCallbacks(this); document()->unregisterForMediaVolumeCallbacks(this); } @@ -148,6 +149,7 @@ void HTMLMediaElement::willMoveToNewOwnerDocument() { if (m_isWaitingUntilMediaCanStart) document()->removeMediaCanStartListener(this); + setShouldDelayLoadEvent(false); document()->unregisterForDocumentActivationCallbacks(this); document()->unregisterForMediaVolumeCallbacks(this); HTMLElement::willMoveToNewOwnerDocument(); @@ -157,6 +159,8 @@ void HTMLMediaElement::didMoveToNewOwnerDocument() { if (m_isWaitingUntilMediaCanStart) document()->addMediaCanStartListener(this); + if (m_readyState < HAVE_CURRENT_DATA) + setShouldDelayLoadEvent(true); document()->registerForDocumentActivationCallbacks(this); document()->registerForMediaVolumeCallbacks(this); HTMLElement::didMoveToNewOwnerDocument(); @@ -368,6 +372,15 @@ void HTMLMediaElement::scheduleEvent(const AtomicString& eventName) void HTMLMediaElement::asyncEventTimerFired(Timer<HTMLMediaElement>*) { + // If we are waiting to release our delay on the load event, do that first and post + // the pending events on the next go around. + if (m_isWaitingToDecrementLoadEventDelayCount) { + setShouldDelayLoadEvent(false); + if (!m_asyncEventTimer.isActive()) + m_asyncEventTimer.startOneShot(0); + return; + } + Vector<RefPtr<Event> > pendingEvents; ExceptionCode ec = 0; @@ -541,6 +554,11 @@ void HTMLMediaElement::prepareForLoad() m_playedTimeRanges = TimeRanges::create(); m_lastSeekTime = 0; m_closedCaptionsVisible = false; + + // The spec doesn't say to block the load event until we actually run the asynchronous section + // algorithm, but do it now because we won't start that until after the timer fires and the + // event may have already fired by then. + setShouldDelayLoadEvent(true); } void HTMLMediaElement::loadInternal() @@ -574,18 +592,19 @@ void HTMLMediaElement::selectMediaResource() if (!node) { m_loadState = WaitingForSource; + setShouldDelayLoadEvent(false); // ... set the networkState to NETWORK_EMPTY, and abort these steps m_networkState = NETWORK_EMPTY; - ASSERT(!m_delayingTheLoadEvent); return; } mode = children; } - // 4 - m_delayingTheLoadEvent = true; + // 4 - Set the media element's delaying-the-load-event flag to true (this delays the load event), + // and set its networkState to NETWORK_LOADING. + setShouldDelayLoadEvent(true); m_networkState = NETWORK_LOADING; // 5 @@ -715,7 +734,7 @@ void HTMLMediaElement::waitForSourceChange() m_networkState = NETWORK_NO_SOURCE; // 6.18 - Set the element's delaying-the-load-event flag to false. This stops delaying the load event. - m_delayingTheLoadEvent = false; + setShouldDelayLoadEvent(false); } void HTMLMediaElement::noneSupported() @@ -738,7 +757,7 @@ void HTMLMediaElement::noneSupported() scheduleEvent(eventNames().errorEvent); // 8 - Set the element's delaying-the-load-event flag to false. This stops delaying the load event. - m_delayingTheLoadEvent = false; + setShouldDelayLoadEvent(false); // 9 -Abort these steps. Until the load() method is invoked, the element won't attempt to load another resource. @@ -758,8 +777,7 @@ void HTMLMediaElement::mediaEngineError(PassRefPtr<MediaError> err) // set to MEDIA_ERR_NETWORK/MEDIA_ERR_DECODE. m_error = err; - // 3 - Queue a task to fire a progress event called error at the media element, in - // the context of the fetching process started by this instance of this algorithm. + // 3 - Queue a task to fire a simple event named error at the media element. scheduleEvent(eventNames().errorEvent); // 4 - Set the element's networkState attribute to the NETWORK_EMPTY value and queue a @@ -768,7 +786,7 @@ void HTMLMediaElement::mediaEngineError(PassRefPtr<MediaError> err) scheduleEvent(eventNames().emptiedEvent); // 5 - Set the element's delaying-the-load-event flag to false. This stops delaying the load event. - m_delayingTheLoadEvent = false; + setShouldDelayLoadEvent(false); // 6 - Abort the overall resource selection algorithm. m_currentSourceNode = 0; @@ -915,21 +933,16 @@ void HTMLMediaElement::setReadyState(MediaPlayer::ReadyState state) scheduleEvent(eventNames().loadedmetadataEvent); if (renderer()) renderer()->updateFromElement(); - m_delayingTheLoadEvent = false; m_player->seek(0); } bool shouldUpdateDisplayState = false; - // 4.8.10.7 says loadeddata is sent only when the new state *is* HAVE_CURRENT_DATA: "If the - // previous ready state was HAVE_METADATA and the new ready state is HAVE_CURRENT_DATA", - // but the event table at the end of the spec says it is sent when: "readyState newly - // increased to HAVE_CURRENT_DATA or greater for the first time" - // We go with the later because it seems useful to count on getting this event if (m_readyState >= HAVE_CURRENT_DATA && oldState < HAVE_CURRENT_DATA && !m_haveFiredLoadedData) { m_haveFiredLoadedData = true; shouldUpdateDisplayState = true; scheduleEvent(eventNames().loadeddataEvent); + setShouldDelayLoadEvent(false); } bool isPotentiallyPlaying = potentiallyPlaying(); @@ -1818,13 +1831,12 @@ void HTMLMediaElement::userCancelledLoad() // 2 - Set the error attribute to a new MediaError object whose code attribute is set to MEDIA_ERR_ABORTED. m_error = MediaError::create(MediaError::MEDIA_ERR_ABORTED); - // 3 - Queue a task to fire a progress event called abort at the media element, in the context - // of the fetching process started by this instance of this algorithm. + // 3 - Queue a task to fire a simple event named error at the media element. scheduleEvent(eventNames().abortEvent); - // 5 - If the media element's readyState attribute has a value equal to HAVE_NOTHING, set the - // element's networkState attribute to the NETWORK_EMPTY value and queue a task to fire a - // simple event called emptied at the element. Otherwise, set set the element's networkState + // 4 - If the media element's readyState attribute has a value equal to HAVE_NOTHING, set the + // element's networkState attribute to the NETWORK_EMPTY value and queue a task to fire a + // simple event named emptied at the element. Otherwise, set the element's networkState // attribute to the NETWORK_IDLE value. if (m_readyState == HAVE_NOTHING) { m_networkState = NETWORK_EMPTY; @@ -1833,10 +1845,10 @@ void HTMLMediaElement::userCancelledLoad() else m_networkState = NETWORK_IDLE; - // 6 - Set the element's delaying-the-load-event flag to false. This stops delaying the load event. - m_delayingTheLoadEvent = false; + // 5 - Set the element's delaying-the-load-event flag to false. This stops delaying the load event. + setShouldDelayLoadEvent(false); - // 7 - Abort the overall resource selection algorithm. + // 6 - Abort the overall resource selection algorithm. m_currentSourceNode = 0; // Reset m_readyState since m_player is gone. @@ -2087,6 +2099,33 @@ bool HTMLMediaElement::isURLAttribute(Attribute* attribute) const return attribute->name() == srcAttr; } +void HTMLMediaElement::setShouldDelayLoadEvent(bool shouldDelay) +{ + if (m_shouldDelayLoadEvent == shouldDelay) + return; + + // Don't decrement the load event delay if we are in the middle of a callback from + // the media engine. The load event is sent synchronously and may trigger a script that + // causes the document to be come inactive and that will clear the media engine, causing + // the return to be a rough one. + if (!shouldDelay && processingMediaPlayerCallback()) { + m_isWaitingToDecrementLoadEventDelayCount = true; + + // Instead of creating yet-another-timer, reuse the async event timer which is always + // used as a one-shot. + if (!m_asyncEventTimer.isActive()) + m_asyncEventTimer.startOneShot(0); + return; + } + + m_shouldDelayLoadEvent = shouldDelay; + m_isWaitingToDecrementLoadEventDelayCount = false; + if (shouldDelay) + document()->incrementLoadEventDelayCount(); + else + document()->decrementLoadEventDelayCount(); +} + } #endif diff --git a/WebCore/html/HTMLMediaElement.h b/WebCore/html/HTMLMediaElement.h index 4706178..3895fe3 100644 --- a/WebCore/html/HTMLMediaElement.h +++ b/WebCore/html/HTMLMediaElement.h @@ -280,6 +280,8 @@ private: virtual void mediaCanStart(); + void setShouldDelayLoadEvent(bool); + // Restrictions to change default behaviors. This is effectively a compile time choice at the moment // because there are no accessor functions. enum BehaviorRestrictions { @@ -339,7 +341,8 @@ private: bool m_playing : 1; bool m_isWaitingUntilMediaCanStart : 1; - bool m_delayingTheLoadEvent : 1; + bool m_shouldDelayLoadEvent : 1; + bool m_isWaitingToDecrementLoadEventDelayCount : 1; bool m_haveFiredLoadedData : 1; bool m_inActiveDocument : 1; bool m_autoplaying : 1; diff --git a/WebCore/html/HTMLMediaElement.idl b/WebCore/html/HTMLMediaElement.idl index 12a1464..d6ba79d 100644 --- a/WebCore/html/HTMLMediaElement.idl +++ b/WebCore/html/HTMLMediaElement.idl @@ -30,7 +30,7 @@ interface [Conditional=VIDEO] HTMLMediaElement : HTMLElement { readonly attribute MediaError error; // network state - attribute [Reflect,URL] DOMString src; + attribute [Reflect, URL] DOMString src; readonly attribute DOMString currentSrc; const unsigned short NETWORK_EMPTY = 0; diff --git a/WebCore/html/HTMLModElement.cpp b/WebCore/html/HTMLModElement.cpp index ab161d9..2d409b0 100644 --- a/WebCore/html/HTMLModElement.cpp +++ b/WebCore/html/HTMLModElement.cpp @@ -39,4 +39,9 @@ PassRefPtr<HTMLModElement> HTMLModElement::create(const QualifiedName& tagName, return adoptRef(new HTMLModElement(tagName, document)); } +bool HTMLModElement::isURLAttribute(Attribute* attribute) const +{ + return attribute->name() == citeAttr; +} + } diff --git a/WebCore/html/HTMLModElement.h b/WebCore/html/HTMLModElement.h index 2b09e21..cdb6dce 100644 --- a/WebCore/html/HTMLModElement.h +++ b/WebCore/html/HTMLModElement.h @@ -34,6 +34,8 @@ public: private: HTMLModElement(const QualifiedName&, Document*); + + virtual bool isURLAttribute(Attribute*) const; }; } //namespace diff --git a/WebCore/html/HTMLModElement.idl b/WebCore/html/HTMLModElement.idl index e9e996d..ad8281c 100644 --- a/WebCore/html/HTMLModElement.idl +++ b/WebCore/html/HTMLModElement.idl @@ -20,7 +20,7 @@ module html { interface HTMLModElement : HTMLElement { - attribute [Reflect] DOMString cite; + attribute [Reflect, URL] DOMString cite; attribute [Reflect] DOMString dateTime; }; diff --git a/WebCore/html/HTMLObjectElement.cpp b/WebCore/html/HTMLObjectElement.cpp index de1ed91..e8884ef 100644 --- a/WebCore/html/HTMLObjectElement.cpp +++ b/WebCore/html/HTMLObjectElement.cpp @@ -46,9 +46,8 @@ namespace WebCore { using namespace HTMLNames; inline HTMLObjectElement::HTMLObjectElement(const QualifiedName& tagName, Document* document, bool createdByParser) - : HTMLPlugInImageElement(tagName, document) + : HTMLPlugInImageElement(tagName, document, createdByParser) , m_docNamedItem(true) - , m_needWidgetUpdate(!createdByParser) , m_useFallbackContent(false) { ASSERT(hasTagName(objectTag)); @@ -62,37 +61,34 @@ PassRefPtr<HTMLObjectElement> HTMLObjectElement::create(const QualifiedName& tag RenderWidget* HTMLObjectElement::renderWidgetForJSBindings() const { document()->updateLayoutIgnorePendingStylesheets(); - if (!renderer() || !renderer()->isWidget()) - return 0; - return toRenderWidget(renderer()); + return renderPart(); // This will return 0 if the renderer is not a RenderPart. } void HTMLObjectElement::parseMappedAttribute(Attribute* attr) { - String val = attr->value(); - size_t pos; if (attr->name() == typeAttr) { - m_serviceType = val.lower(); - pos = m_serviceType.find(";"); + m_serviceType = attr->value().lower(); + size_t pos = m_serviceType.find(";"); if (pos != notFound) - m_serviceType = m_serviceType.left(pos); + m_serviceType = m_serviceType.left(pos); if (renderer()) - m_needWidgetUpdate = true; + setNeedsWidgetUpdate(true); if (!isImageType() && m_imageLoader) - m_imageLoader.clear(); + m_imageLoader.clear(); } else if (attr->name() == dataAttr) { - m_url = deprecatedParseURL(val); - if (renderer()) - m_needWidgetUpdate = true; - if (renderer() && isImageType()) { - if (!m_imageLoader) - m_imageLoader = adoptPtr(new HTMLImageLoader(this)); - m_imageLoader->updateFromElementIgnoringPreviousError(); + m_url = deprecatedParseURL(attr->value()); + if (renderer()) { + setNeedsWidgetUpdate(true); + if (isImageType()) { + if (!m_imageLoader) + m_imageLoader = adoptPtr(new HTMLImageLoader(this)); + m_imageLoader->updateFromElementIgnoringPreviousError(); + } } } else if (attr->name() == classidAttr) { - m_classId = val; + m_classId = attr->value(); if (renderer()) - m_needWidgetUpdate = true; + setNeedsWidgetUpdate(true); } else if (attr->name() == onloadAttr) setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, attr)); else if (attr->name() == onbeforeloadAttr) @@ -114,13 +110,14 @@ void HTMLObjectElement::parseMappedAttribute(Attribute* attr) } m_id = newId; // also call superclass - HTMLPlugInElement::parseMappedAttribute(attr); + HTMLPlugInImageElement::parseMappedAttribute(attr); } else - HTMLPlugInElement::parseMappedAttribute(attr); + HTMLPlugInImageElement::parseMappedAttribute(attr); } bool HTMLObjectElement::rendererIsNeeded(RenderStyle* style) { + // FIXME: This check should not be needed, detached documents never render! Frame* frame = document()->frame(); if (!frame) return false; @@ -129,57 +126,7 @@ bool HTMLObjectElement::rendererIsNeeded(RenderStyle* style) // Gears expects the plugin to be instantiated even if display:none is set // for the object element. bool isGearsPlugin = equalIgnoringCase(getAttribute(typeAttr), "application/x-googlegears"); - return isGearsPlugin || HTMLPlugInElement::rendererIsNeeded(style); -} - -RenderObject *HTMLObjectElement::createRenderer(RenderArena* arena, RenderStyle* style) -{ - if (m_useFallbackContent) - return RenderObject::createObject(this, style); - if (isImageType()) - return new (arena) RenderImage(this); - return new (arena) RenderEmbeddedObject(this); -} - -void HTMLObjectElement::attach() -{ - bool isImage = isImageType(); - - if (!isImage) - queuePostAttachCallback(&HTMLPlugInElement::updateWidgetCallback, this); - - HTMLPlugInElement::attach(); - - if (isImage && renderer() && !m_useFallbackContent) { - if (!m_imageLoader) - m_imageLoader = adoptPtr(new HTMLImageLoader(this)); - m_imageLoader->updateFromElement(); - } -} - -void HTMLObjectElement::updateWidget() -{ - document()->updateStyleIfNeeded(); - if (m_needWidgetUpdate && renderer() && !m_useFallbackContent && !isImageType()) - toRenderEmbeddedObject(renderer())->updateWidget(true); -} - -void HTMLObjectElement::finishParsingChildren() -{ - HTMLPlugInElement::finishParsingChildren(); - if (!m_useFallbackContent) { - m_needWidgetUpdate = true; - if (inDocument()) - setNeedsStyleRecalc(); - } -} - -void HTMLObjectElement::detach() -{ - if (attached() && renderer() && !m_useFallbackContent) - // Update the widget the next time we attach (detaching destroys the plugin). - m_needWidgetUpdate = true; - HTMLPlugInElement::detach(); + return isGearsPlugin || HTMLPlugInImageElement::rendererIsNeeded(style); } void HTMLObjectElement::insertedIntoDocument() @@ -190,7 +137,7 @@ void HTMLObjectElement::insertedIntoDocument() document->addExtraNamedItem(m_id); } - HTMLPlugInElement::insertedIntoDocument(); + HTMLPlugInImageElement::insertedIntoDocument(); } void HTMLObjectElement::removedFromDocument() @@ -201,26 +148,17 @@ void HTMLObjectElement::removedFromDocument() document->removeExtraNamedItem(m_id); } - HTMLPlugInElement::removedFromDocument(); -} - -void HTMLObjectElement::recalcStyle(StyleChange ch) -{ - if (!m_useFallbackContent && m_needWidgetUpdate && renderer() && !isImageType()) { - detach(); - attach(); - } - HTMLPlugInElement::recalcStyle(ch); + HTMLPlugInImageElement::removedFromDocument(); } void HTMLObjectElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) { updateDocNamedItem(); - if (inDocument() && !m_useFallbackContent) { - m_needWidgetUpdate = true; + if (inDocument() && !useFallbackContent()) { + setNeedsWidgetUpdate(true); setNeedsStyleRecalc(); } - HTMLPlugInElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta); + HTMLPlugInImageElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta); } bool HTMLObjectElement::isURLAttribute(Attribute *attr) const @@ -235,7 +173,7 @@ const QualifiedName& HTMLObjectElement::imageSourceAttributeName() const void HTMLObjectElement::renderFallbackContent() { - if (m_useFallbackContent) + if (useFallbackContent()) return; if (!inDocument()) @@ -253,10 +191,8 @@ void HTMLObjectElement::renderFallbackContent() } } - // Mark ourselves as using the fallback content. m_useFallbackContent = true; - // Now do a detach and reattach. // FIXME: Style gets recalculated which is suboptimal. detach(); attach(); diff --git a/WebCore/html/HTMLObjectElement.h b/WebCore/html/HTMLObjectElement.h index 8dc59be..9fafae9 100644 --- a/WebCore/html/HTMLObjectElement.h +++ b/WebCore/html/HTMLObjectElement.h @@ -31,8 +31,6 @@ class HTMLObjectElement : public HTMLPlugInImageElement { public: static PassRefPtr<HTMLObjectElement> create(const QualifiedName&, Document*, bool createdByParser); - void setNeedWidgetUpdate(bool needWidgetUpdate) { m_needWidgetUpdate = needWidgetUpdate; } - void renderFallbackContent(); bool isDocNamedItem() const { return m_docNamedItem; } @@ -41,28 +39,22 @@ public: bool containsJavaApplet() const; + virtual bool useFallbackContent() const { return m_useFallbackContent; } + private: HTMLObjectElement(const QualifiedName&, Document*, bool createdByParser); virtual void parseMappedAttribute(Attribute*); - virtual void attach(); - virtual bool canLazyAttach() { return false; } virtual bool rendererIsNeeded(RenderStyle*); - virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); - virtual void finishParsingChildren(); - virtual void detach(); virtual void insertedIntoDocument(); virtual void removedFromDocument(); - virtual void recalcStyle(StyleChange); virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); virtual bool isURLAttribute(Attribute*) const; virtual const QualifiedName& imageSourceAttributeName() const; - virtual void updateWidget(); - virtual RenderWidget* renderWidgetForJSBindings() const; virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const; @@ -72,7 +64,6 @@ private: AtomicString m_id; String m_classId; bool m_docNamedItem : 1; - bool m_needWidgetUpdate : 1; bool m_useFallbackContent : 1; }; diff --git a/WebCore/html/HTMLObjectElement.idl b/WebCore/html/HTMLObjectElement.idl index e4d85b3..82801ae 100644 --- a/WebCore/html/HTMLObjectElement.idl +++ b/WebCore/html/HTMLObjectElement.idl @@ -32,7 +32,7 @@ module html { attribute [Reflect] DOMString border; attribute [Reflect] DOMString codeBase; attribute [Reflect] DOMString codeType; - attribute [Reflect,URL] DOMString data; + attribute [Reflect, URL] DOMString data; attribute [Reflect] boolean declare; attribute [Reflect] DOMString height; attribute [Reflect] long hspace; diff --git a/WebCore/html/HTMLPlugInElement.cpp b/WebCore/html/HTMLPlugInElement.cpp index 9f479fb..88642f7 100644 --- a/WebCore/html/HTMLPlugInElement.cpp +++ b/WebCore/html/HTMLPlugInElement.cpp @@ -177,6 +177,7 @@ NPObject* HTMLPlugInElement::getNPObject() #endif /* ENABLE(NETSCAPE_PLUGIN_API) */ +<<<<<<< HEAD void HTMLPlugInElement::updateWidgetCallback(Node* n) { static_cast<HTMLPlugInElement*>(n)->updateWidget(); @@ -189,4 +190,6 @@ bool HTMLPlugInElement::supportsFocus() const } #endif +======= +>>>>>>> webkit.org at r66666 } diff --git a/WebCore/html/HTMLPlugInElement.h b/WebCore/html/HTMLPlugInElement.h index eadf38a..5467177 100644 --- a/WebCore/html/HTMLPlugInElement.h +++ b/WebCore/html/HTMLPlugInElement.h @@ -32,6 +32,7 @@ struct NPObject; namespace WebCore { +class RenderEmbeddedObject; class RenderWidget; class Widget; @@ -55,8 +56,6 @@ protected: virtual void detach(); - static void updateWidgetCallback(Node*); - virtual bool mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const; virtual void parseMappedAttribute(Attribute*); @@ -71,8 +70,6 @@ private: virtual RenderWidget* renderWidgetForJSBindings() const = 0; - virtual void updateWidget() { } - protected: AtomicString m_name; diff --git a/WebCore/html/HTMLPlugInImageElement.cpp b/WebCore/html/HTMLPlugInImageElement.cpp index e2898a2..75407dd 100644 --- a/WebCore/html/HTMLPlugInImageElement.cpp +++ b/WebCore/html/HTMLPlugInImageElement.cpp @@ -26,14 +26,30 @@ #include "FrameLoaderClient.h" #include "HTMLImageLoader.h" #include "Image.h" +#include "RenderEmbeddedObject.h" +#include "RenderImage.h" namespace WebCore { -HTMLPlugInImageElement::HTMLPlugInImageElement(const QualifiedName& tagName, Document* document) +HTMLPlugInImageElement::HTMLPlugInImageElement(const QualifiedName& tagName, Document* document, bool createdByParser) : HTMLPlugInElement(tagName, document) + // m_needsWidgetUpdate(!createdByParser) allows HTMLObjectElement to delay + // widget updates until after all children are parsed. For HTMLEmbedElement + // this delay is unnecessary, but it is simpler to make both classes share + // the same codepath in this class. + , m_needsWidgetUpdate(!createdByParser) { } +RenderEmbeddedObject* HTMLPlugInImageElement::renderEmbeddedObject() const +{ + // HTMLObjectElement and HTMLEmbedElement may return arbitrary renderers + // when using fallback content. + if (!renderer() || !renderer()->isEmbeddedObject()) + return 0; + return toRenderEmbeddedObject(renderer()); +} + bool HTMLPlugInImageElement::isImageType() { if (m_serviceType.isEmpty() && protocolIs(m_url, "data")) @@ -47,6 +63,76 @@ bool HTMLPlugInImageElement::isImageType() return Image::supportsType(m_serviceType); } +RenderObject* HTMLPlugInImageElement::createRenderer(RenderArena* arena, RenderStyle* style) +{ + // Fallback content breaks the DOM->Renderer class relationship of this + // class and all superclasses because createObject won't necessarily + // return a RenderEmbeddedObject, RenderPart or even RenderWidget. + if (useFallbackContent()) + return RenderObject::createObject(this, style); + if (isImageType()) { + RenderImage* image = new (arena) RenderImage(this); + image->setImageResource(RenderImageResource::create()); + return image; + } + return new (arena) RenderEmbeddedObject(this); +} + +void HTMLPlugInImageElement::recalcStyle(StyleChange ch) +{ + // FIXME: Why is this necessary? Manual re-attach is almost always wrong. + if (!useFallbackContent() && needsWidgetUpdate() && renderer() && !isImageType()) { + detach(); + attach(); + } + HTMLPlugInElement::recalcStyle(ch); +} + +void HTMLPlugInImageElement::attach() +{ + bool isImage = isImageType(); + + if (!isImage) + queuePostAttachCallback(&HTMLPlugInImageElement::updateWidgetCallback, this); + + HTMLPlugInElement::attach(); + + if (isImage && renderer() && !useFallbackContent()) { + if (!m_imageLoader) + m_imageLoader = adoptPtr(new HTMLImageLoader(this)); + m_imageLoader->updateFromElement(); + } +} + +void HTMLPlugInImageElement::detach() +{ + // FIXME: Because of the insanity that is HTMLObjectElement::recalcStyle, + // we can end up detaching during an attach() call, before we even have a + // renderer. In that case, don't mark the widget for update. + if (attached() && renderer() && !useFallbackContent()) + // Update the widget the next time we attach (detaching destroys the plugin). + setNeedsWidgetUpdate(true); + HTMLPlugInElement::detach(); +} + +void HTMLPlugInImageElement::updateWidget() +{ + document()->updateStyleIfNeeded(); + if (needsWidgetUpdate() && renderEmbeddedObject() && !useFallbackContent() && !isImageType()) + renderEmbeddedObject()->updateWidget(true); +} + +void HTMLPlugInImageElement::finishParsingChildren() +{ + HTMLPlugInElement::finishParsingChildren(); + if (useFallbackContent()) + return; + + setNeedsWidgetUpdate(true); + if (inDocument()) + setNeedsStyleRecalc(); +} + void HTMLPlugInImageElement::willMoveToNewOwnerDocument() { if (m_imageLoader) @@ -54,4 +140,9 @@ void HTMLPlugInImageElement::willMoveToNewOwnerDocument() HTMLPlugInElement::willMoveToNewOwnerDocument(); } +void HTMLPlugInImageElement::updateWidgetCallback(Node* n) +{ + static_cast<HTMLPlugInImageElement*>(n)->updateWidget(); +} + } // namespace WebCore diff --git a/WebCore/html/HTMLPlugInImageElement.h b/WebCore/html/HTMLPlugInImageElement.h index 6f8d305..65c5f37 100644 --- a/WebCore/html/HTMLPlugInImageElement.h +++ b/WebCore/html/HTMLPlugInImageElement.h @@ -28,22 +28,42 @@ namespace WebCore { class HTMLImageLoader; +// Base class for HTMLObjectElement and HTMLEmbedElement class HTMLPlugInImageElement : public HTMLPlugInElement { public: const String& serviceType() const { return m_serviceType; } const String& url() const { return m_url; } + bool needsWidgetUpdate() const { return m_needsWidgetUpdate; } + void setNeedsWidgetUpdate(bool needsWidgetUpdate) { m_needsWidgetUpdate = needsWidgetUpdate; } + + RenderEmbeddedObject* renderEmbeddedObject() const; + protected: - HTMLPlugInImageElement(const QualifiedName& tagName, Document*); + HTMLPlugInImageElement(const QualifiedName& tagName, Document*, bool createdByParser); bool isImageType(); OwnPtr<HTMLImageLoader> m_imageLoader; String m_serviceType; String m_url; + + static void updateWidgetCallback(Node*); + virtual void attach(); + virtual void detach(); private: + virtual bool canLazyAttach() { return false; } + virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); + virtual void recalcStyle(StyleChange); + + virtual void finishParsingChildren(); virtual void willMoveToNewOwnerDocument(); + + void updateWidget(); + virtual bool useFallbackContent() const { return false; } + + bool m_needsWidgetUpdate; }; } // namespace WebCore diff --git a/WebCore/html/HTMLQuoteElement.cpp b/WebCore/html/HTMLQuoteElement.cpp index 2a2440a..a58a504 100644 --- a/WebCore/html/HTMLQuoteElement.cpp +++ b/WebCore/html/HTMLQuoteElement.cpp @@ -48,4 +48,9 @@ void HTMLQuoteElement::insertedIntoDocument() HTMLElement::insertedIntoDocument(); } +bool HTMLQuoteElement::isURLAttribute(Attribute* attribute) const +{ + return attribute->name() == citeAttr; +} + } diff --git a/WebCore/html/HTMLQuoteElement.h b/WebCore/html/HTMLQuoteElement.h index 225dde8..d378de4 100644 --- a/WebCore/html/HTMLQuoteElement.h +++ b/WebCore/html/HTMLQuoteElement.h @@ -37,6 +37,7 @@ private: HTMLQuoteElement(const QualifiedName&, Document*); virtual void insertedIntoDocument(); + virtual bool isURLAttribute(Attribute*) const; }; } //namespace diff --git a/WebCore/html/HTMLQuoteElement.idl b/WebCore/html/HTMLQuoteElement.idl index a4e6005..fa1bcdb 100644 --- a/WebCore/html/HTMLQuoteElement.idl +++ b/WebCore/html/HTMLQuoteElement.idl @@ -20,6 +20,6 @@ module html { interface HTMLQuoteElement : HTMLElement { - attribute [Reflect] DOMString cite; + attribute [Reflect, URL] DOMString cite; }; } diff --git a/WebCore/html/HTMLScriptElement.idl b/WebCore/html/HTMLScriptElement.idl index 6b7c86d..20b7331 100644 --- a/WebCore/html/HTMLScriptElement.idl +++ b/WebCore/html/HTMLScriptElement.idl @@ -26,7 +26,7 @@ module html { attribute [Reflect] DOMString charset; attribute [Reflect] boolean async; attribute [Reflect] boolean defer; - attribute [Reflect,URL] DOMString src; + attribute [Reflect, URL] DOMString src; attribute [Reflect] DOMString type; }; } diff --git a/WebCore/html/HTMLSourceElement.idl b/WebCore/html/HTMLSourceElement.idl index 61dc4d0..dbd6d6a 100644 --- a/WebCore/html/HTMLSourceElement.idl +++ b/WebCore/html/HTMLSourceElement.idl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007 Apple Inc. All rights reserved. + * Copyright (C) 2007, 2010 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -25,7 +25,7 @@ module html { interface [Conditional=VIDEO] HTMLSourceElement : HTMLElement { - attribute [Reflect,URL] DOMString src; + attribute [Reflect, URL] DOMString src; attribute DOMString type; attribute DOMString media; }; diff --git a/WebCore/html/HTMLTagNames.in b/WebCore/html/HTMLTagNames.in index f844fa8..209636d 100644 --- a/WebCore/html/HTMLTagNames.in +++ b/WebCore/html/HTMLTagNames.in @@ -43,7 +43,7 @@ div dl interfaceName=HTMLDListElement dt interfaceName=HTMLElement em interfaceName=HTMLElement -embed +embed constructorNeedsCreatedByParser fieldset interfaceName=HTMLFieldSetElement, constructorNeedsFormElement figcaption interfaceName=HTMLElement figure interfaceName=HTMLElement diff --git a/WebCore/html/HTMLTextAreaElement.cpp b/WebCore/html/HTMLTextAreaElement.cpp index b528c19..3e34844 100644 --- a/WebCore/html/HTMLTextAreaElement.cpp +++ b/WebCore/html/HTMLTextAreaElement.cpp @@ -390,16 +390,21 @@ void HTMLTextAreaElement::setMaxLength(int newValue, ExceptionCode& ec) setAttribute(maxlengthAttr, String::number(newValue)); } -bool HTMLTextAreaElement::tooLong() const +bool HTMLTextAreaElement::tooLong(const String& value, NeedsToCheckDirtyFlag check) const { // Return false for the default value even if it is longer than maxLength. - if (!m_isDirty) + if (check == CheckDirtyFlag && !m_isDirty) return false; int max = maxLength(); if (max < 0) return false; - return numGraphemeClusters(value()) > static_cast<unsigned>(max); + return numGraphemeClusters(value) > static_cast<unsigned>(max); +} + +bool HTMLTextAreaElement::isValidValue(const String& candidate) const +{ + return !valueMissing(candidate) && !tooLong(candidate, IgnoreDirtyFlag); } void HTMLTextAreaElement::accessKeyAction(bool) diff --git a/WebCore/html/HTMLTextAreaElement.h b/WebCore/html/HTMLTextAreaElement.h index bb0039e..28d0b61 100644 --- a/WebCore/html/HTMLTextAreaElement.h +++ b/WebCore/html/HTMLTextAreaElement.h @@ -47,7 +47,9 @@ public: int textLength() const { return value().length(); } int maxLength() const; void setMaxLength(int, ExceptionCode&); - virtual bool tooLong() const; + bool valueMissing(const String& value) const { return isRequiredFormControl() && !disabled() && !readOnly() && value.isEmpty(); } + bool tooLong(const String&, NeedsToCheckDirtyFlag) const; + bool isValidValue(const String&) const; void rendererWillBeDestroyed(); @@ -85,8 +87,6 @@ private: virtual bool isTextFormControl() const { return true; } - virtual bool valueMissing() const { return isRequiredFormControl() && !disabled() && !readOnly() && value().isEmpty(); } - virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); virtual void parseMappedAttribute(Attribute*); virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); diff --git a/WebCore/html/HTMLVideoElement.cpp b/WebCore/html/HTMLVideoElement.cpp index cd9c7ec..219bb85 100644 --- a/WebCore/html/HTMLVideoElement.cpp +++ b/WebCore/html/HTMLVideoElement.cpp @@ -78,10 +78,8 @@ void HTMLVideoElement::attach() if (!m_imageLoader) m_imageLoader = adoptPtr(new HTMLImageLoader(this)); m_imageLoader->updateFromElement(); - if (renderer()) { - RenderImage* imageRenderer = toRenderImage(renderer()); - imageRenderer->setCachedImage(m_imageLoader->image()); - } + if (renderer()) + toRenderImage(renderer())->imageResource()->setCachedImage(m_imageLoader->image()); } #endif } @@ -111,7 +109,7 @@ void HTMLVideoElement::parseMappedAttribute(Attribute* attr) if (m_imageLoader) m_imageLoader.clear(); if (renderer()) - toRenderImage(renderer())->setCachedImage(0); + toRenderImage(renderer())->imageResource()->setCachedImage(0); } #endif } else if (attrName == widthAttr) diff --git a/WebCore/html/HTMLVideoElement.idl b/WebCore/html/HTMLVideoElement.idl index ca5db5e..770e4b2 100644 --- a/WebCore/html/HTMLVideoElement.idl +++ b/WebCore/html/HTMLVideoElement.idl @@ -32,7 +32,7 @@ module html { attribute [Reflect] unsigned long height; readonly attribute unsigned long videoWidth; readonly attribute unsigned long videoHeight; - attribute [Reflect,URL] DOMString poster; + attribute [Reflect, URL] DOMString poster; readonly attribute boolean webkitSupportsFullscreen; readonly attribute boolean webkitDisplayingFullscreen; diff --git a/WebCore/html/HTMLViewSourceDocument.cpp b/WebCore/html/HTMLViewSourceDocument.cpp index b307ea2..3299b27 100644 --- a/WebCore/html/HTMLViewSourceDocument.cpp +++ b/WebCore/html/HTMLViewSourceDocument.cpp @@ -28,6 +28,7 @@ #include "Attribute.h" #include "DOMImplementation.h" #include "HTMLAnchorElement.h" +#include "HTMLBaseElement.h" #include "HTMLBodyElement.h" #include "HTMLDivElement.h" #include "HTMLHtmlElement.h" @@ -51,6 +52,8 @@ HTMLViewSourceDocument::HTMLViewSourceDocument(Frame* frame, const KURL& url, co , m_type(mimeType) { setUsesBeforeAfterRules(true); + setCompatibilityMode(QuirksMode); + lockCompatibilityMode(); } PassRefPtr<DocumentParser> HTMLViewSourceDocument::createParser() @@ -138,8 +141,7 @@ void HTMLViewSourceDocument::processDoctypeToken(const String& source, HTMLToken void HTMLViewSourceDocument::processTagToken(const String& source, HTMLToken& token) { - String classNameStr = "webkit-html-tag"; - m_current = addSpanWithClassName(classNameStr); + m_current = addSpanWithClassName("webkit-html-tag"); AtomicString tagName(token.name().data(), token.name().size()); @@ -159,11 +161,8 @@ void HTMLViewSourceDocument::processTagToken(const String& source, HTMLToken& to index = addRange(source, index, iter->m_nameRange.m_start - token.startIndex(), ""); index = addRange(source, index, iter->m_nameRange.m_end - token.startIndex(), "webkit-html-attribute-name"); - if (tagName == baseTag && name == hrefAttr) { - // Catch the href attribute in the base element. It will be used - // for rendering anchors created by addLink() below. - setBaseElementURL(KURL(url(), value)); - } + if (tagName == baseTag && name == hrefAttr) + m_current = addBase(value); index = addRange(source, index, iter->m_valueRange.m_start - token.startIndex(), ""); @@ -187,7 +186,7 @@ void HTMLViewSourceDocument::processCharacterToken(const String& source, HTMLTok addText(source, ""); } -PassRefPtr<Element> HTMLViewSourceDocument::addSpanWithClassName(const String& className) +PassRefPtr<Element> HTMLViewSourceDocument::addSpanWithClassName(const AtomicString& className) { if (m_current == m_tbody) { addLine(className); @@ -203,7 +202,7 @@ PassRefPtr<Element> HTMLViewSourceDocument::addSpanWithClassName(const String& c return span.release(); } -void HTMLViewSourceDocument::addLine(const String& className) +void HTMLViewSourceDocument::addLine(const AtomicString& className) { // Create a table row. RefPtr<HTMLTableRowElement> trow = HTMLTableRowElement::create(this); @@ -241,7 +240,7 @@ void HTMLViewSourceDocument::addLine(const String& className) } } -void HTMLViewSourceDocument::addText(const String& text, const String& className) +void HTMLViewSourceDocument::addText(const String& text, const AtomicString& className) { if (text.isEmpty()) return; @@ -290,7 +289,18 @@ int HTMLViewSourceDocument::addRange(const String& source, int start, int end, c return end; } -PassRefPtr<Element> HTMLViewSourceDocument::addLink(const String& url, bool isAnchor) +PassRefPtr<Element> HTMLViewSourceDocument::addBase(const AtomicString& href) +{ + RefPtr<HTMLBaseElement> base = HTMLBaseElement::create(baseTag, this); + RefPtr<NamedNodeMap> attributeMap = NamedNodeMap::create(); + attributeMap->addAttribute(Attribute::createMapped(hrefAttr, href)); + base->setAttributeMap(attributeMap.release()); + m_current->parserAddChild(base); + base->attach(); + return base.release(); +} + +PassRefPtr<Element> HTMLViewSourceDocument::addLink(const AtomicString& url, bool isAnchor) { if (m_current == m_tbody) addLine("webkit-html-tag"); diff --git a/WebCore/html/HTMLViewSourceDocument.h b/WebCore/html/HTMLViewSourceDocument.h index f459016..445c95b 100644 --- a/WebCore/html/HTMLViewSourceDocument.h +++ b/WebCore/html/HTMLViewSourceDocument.h @@ -57,11 +57,12 @@ private: void processCharacterToken(const String& source, HTMLToken&); void createContainingTable(); - PassRefPtr<Element> addSpanWithClassName(const String&); - void addLine(const String& className); - void addText(const String& text, const String& className); + PassRefPtr<Element> addSpanWithClassName(const AtomicString&); + void addLine(const AtomicString& className); + void addText(const String& text, const AtomicString& className); int addRange(const String& source, int start, int end, const String& className, bool isLink = false, bool isAnchor = false); - PassRefPtr<Element> addLink(const String& url, bool isAnchor); + PassRefPtr<Element> addLink(const AtomicString& url, bool isAnchor); + PassRefPtr<Element> addBase(const AtomicString& href); String m_type; RefPtr<Element> m_current; diff --git a/WebCore/html/ThreadableBlobRegistry.cpp b/WebCore/html/ThreadableBlobRegistry.cpp deleted file mode 100644 index d92d570..0000000 --- a/WebCore/html/ThreadableBlobRegistry.cpp +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (C) 2010 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * 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 "ThreadableBlobRegistry.h" - -#include "BlobData.h" -#include "BlobRegistry.h" -#include "CrossThreadTask.h" -#include "NotImplemented.h" -#include "ScriptExecutionContext.h" -#include "WorkerContext.h" -#include "WorkerLoaderProxy.h" -#include "WorkerThread.h" - -namespace WebCore { - -static void postTaskToMainThread(ScriptExecutionContext* scriptExecutionContext, PassOwnPtr<ScriptExecutionContext::Task> task) -{ -#if ENABLE(WORKERS) - ASSERT(scriptExecutionContext->isWorkerContext()); - WorkerLoaderProxy& proxy = static_cast<WorkerContext*>(scriptExecutionContext)->thread()->workerLoaderProxy(); - proxy.postTaskToLoader(task); -#else - notImplemented(); -#endif -} - -static void registerBlobURLTask(ScriptExecutionContext*, const KURL& url, PassOwnPtr<BlobData> blobData) -{ - blobRegistry().registerBlobURL(url, blobData); -} - -void ThreadableBlobRegistry::registerBlobURL(ScriptExecutionContext* scriptExecutionContext, const KURL& url, PassOwnPtr<BlobData> blobData) -{ - if (scriptExecutionContext->isWorkerContext()) - postTaskToMainThread(scriptExecutionContext, createCallbackTask(®isterBlobURLTask, url, blobData)); - else - registerBlobURLTask(scriptExecutionContext, url, blobData); -} - -static void registerBlobURLFromTask(ScriptExecutionContext*, const KURL& url, const KURL& srcURL) -{ - blobRegistry().registerBlobURL(url, srcURL); -} - -void ThreadableBlobRegistry::registerBlobURL(ScriptExecutionContext* scriptExecutionContext, const KURL& url, const KURL& srcURL) -{ - if (scriptExecutionContext->isWorkerContext()) - postTaskToMainThread(scriptExecutionContext, createCallbackTask(®isterBlobURLFromTask, url, srcURL)); - else - registerBlobURLFromTask(scriptExecutionContext, url, srcURL); -} - -static void unregisterBlobURLTask(ScriptExecutionContext*, const KURL& url) -{ - blobRegistry().unregisterBlobURL(url); -} - -void ThreadableBlobRegistry::unregisterBlobURL(ScriptExecutionContext* scriptExecutionContext, const KURL& url) -{ - if (scriptExecutionContext->isWorkerContext()) - postTaskToMainThread(scriptExecutionContext, createCallbackTask(&unregisterBlobURLTask, url)); - else - unregisterBlobURLTask(scriptExecutionContext, url); -} - -} // namespace WebCore diff --git a/WebCore/html/ValidityState.cpp b/WebCore/html/ValidityState.cpp index 0c25dac..f18469e 100644 --- a/WebCore/html/ValidityState.cpp +++ b/WebCore/html/ValidityState.cpp @@ -26,21 +26,15 @@ #include "HTMLInputElement.h" #include "HTMLNames.h" +#include "HTMLTextAreaElement.h" #include "HTMLTreeBuilder.h" -#include "KURL.h" #include "LocalizedStrings.h" -#include "RegularExpression.h" #include <wtf/StdLibExtras.h> namespace WebCore { using namespace HTMLNames; -static const char emailPattern[] = - "[a-z0-9!#$%&'*+/=?^_`{|}~.-]+" // local part - "@" - "[a-z0-9-]+(\\.[a-z0-9-]+)+"; // domain part - String ValidityState::validationMessage() const { if (!m_control->willValidate()) @@ -72,6 +66,19 @@ void ValidityState::setCustomErrorMessage(const String& message) m_control->setNeedsValidityCheck(); } +bool ValidityState::valueMissing() const +{ + if (m_control->hasTagName(inputTag)) { + HTMLInputElement* input = static_cast<HTMLInputElement*>(m_control); + return input->valueMissing(input->value()); + } + if (m_control->hasTagName(textareaTag)) { + HTMLTextAreaElement* textArea = static_cast<HTMLTextAreaElement*>(m_control); + return textArea->valueMissing(textArea->value()); + } + return false; +} + bool ValidityState::typeMismatch() const { if (!m_control->hasTagName(inputTag)) @@ -79,53 +86,29 @@ bool ValidityState::typeMismatch() const HTMLInputElement* input = static_cast<HTMLInputElement*>(m_control); String value = input->value(); - if (value.isEmpty()) return false; + return input->typeMismatch(value); +} - switch (input->inputType()) { - case HTMLInputElement::COLOR: - return !isValidColorString(value); - case HTMLInputElement::NUMBER: - return !parseToDoubleForNumberType(value, 0); - case HTMLInputElement::URL: - return !KURL(KURL(), value).isValid(); - case HTMLInputElement::EMAIL: { - if (!input->multiple()) - return !isValidEmailAddress(value); - Vector<String> addresses; - value.split(',', addresses); - for (unsigned i = 0; i < addresses.size(); ++i) { - if (!isValidEmailAddress(addresses[i])) - return true; - } +bool ValidityState::patternMismatch() const +{ + if (!m_control->hasTagName(inputTag)) return false; + HTMLInputElement* input = static_cast<HTMLInputElement*>(m_control); + return input->patternMismatch(input->value()); +} + +bool ValidityState::tooLong() const +{ + if (m_control->hasTagName(inputTag)) { + HTMLInputElement* input = static_cast<HTMLInputElement*>(m_control); + return input->tooLong(input->value(), HTMLTextFormControlElement::CheckDirtyFlag); } - case HTMLInputElement::DATE: - case HTMLInputElement::DATETIME: - case HTMLInputElement::DATETIMELOCAL: - case HTMLInputElement::MONTH: - case HTMLInputElement::TIME: - case HTMLInputElement::WEEK: - return !HTMLInputElement::parseToDateComponents(input->inputType(), value, 0); - case HTMLInputElement::BUTTON: - case HTMLInputElement::CHECKBOX: - case HTMLInputElement::FILE: - case HTMLInputElement::HIDDEN: - case HTMLInputElement::IMAGE: - case HTMLInputElement::ISINDEX: - case HTMLInputElement::PASSWORD: - case HTMLInputElement::RADIO: - case HTMLInputElement::RANGE: - case HTMLInputElement::RESET: - case HTMLInputElement::SEARCH: - case HTMLInputElement::SUBMIT: - case HTMLInputElement::TELEPHONE: // FIXME: Is there validation for <input type=telephone>? - case HTMLInputElement::TEXT: - return false; + if (m_control->hasTagName(textareaTag)) { + HTMLTextAreaElement* textArea = static_cast<HTMLTextAreaElement*>(m_control); + return textArea->tooLong(textArea->value(), HTMLTextFormControlElement::CheckDirtyFlag); } - - ASSERT_NOT_REACHED(); return false; } @@ -133,21 +116,24 @@ bool ValidityState::rangeUnderflow() const { if (!m_control->hasTagName(inputTag)) return false; - return static_cast<HTMLInputElement*>(m_control)->rangeUnderflow(); + HTMLInputElement* input = static_cast<HTMLInputElement*>(m_control); + return input->rangeUnderflow(input->value()); } bool ValidityState::rangeOverflow() const { if (!m_control->hasTagName(inputTag)) return false; - return static_cast<HTMLInputElement*>(m_control)->rangeOverflow(); + HTMLInputElement* input = static_cast<HTMLInputElement*>(m_control); + return input->rangeOverflow(input->value()); } bool ValidityState::stepMismatch() const { if (!m_control->hasTagName(inputTag)) return false; - return static_cast<HTMLInputElement*>(m_control)->stepMismatch(); + HTMLInputElement* input = static_cast<HTMLInputElement*>(m_control); + return input->stepMismatch(input->value()); } bool ValidityState::valid() const @@ -157,31 +143,4 @@ bool ValidityState::valid() const return !someError; } -bool ValidityState::isValidColorString(const String& value) -{ - if (value.isEmpty()) - return false; - if (value[0] == '#') { - // We don't accept #rgb and #aarrggbb formats. - if (value.length() != 7) - return false; - } - Color color(value); // This accepts named colors such as "white". - return color.isValid() && !color.hasAlpha(); -} - -bool ValidityState::isValidEmailAddress(const String& address) -{ - int addressLength = address.length(); - if (!addressLength) - return false; - - DEFINE_STATIC_LOCAL(const RegularExpression, regExp, (emailPattern, TextCaseInsensitive)); - - int matchLength; - int matchOffset = regExp.match(address, 0, &matchLength); - - return matchOffset == 0 && matchLength == addressLength; -} - } // namespace diff --git a/WebCore/html/ValidityState.h b/WebCore/html/ValidityState.h index eecb9be..532ddb2 100644 --- a/WebCore/html/ValidityState.h +++ b/WebCore/html/ValidityState.h @@ -43,10 +43,10 @@ public: void setCustomErrorMessage(const String&); - bool valueMissing() const { return m_control->valueMissing(); } + bool valueMissing() const; bool typeMismatch() const; - bool patternMismatch() const { return m_control->patternMismatch(); } - bool tooLong() const { return m_control->tooLong(); } + bool patternMismatch() const; + bool tooLong() const; bool rangeUnderflow() const; bool rangeOverflow() const; bool stepMismatch() const; diff --git a/WebCore/html/canvas/CanvasRenderingContext2D.cpp b/WebCore/html/canvas/CanvasRenderingContext2D.cpp index 2a7b96a..6df6abf 100644 --- a/WebCore/html/canvas/CanvasRenderingContext2D.cpp +++ b/WebCore/html/canvas/CanvasRenderingContext2D.cpp @@ -804,8 +804,8 @@ void CanvasRenderingContext2D::fill() if (!m_path.isEmpty()) { c->beginPath(); c->addPath(m_path); - willDraw(m_path.boundingRect()); c->fillPath(); + didDraw(m_path.boundingRect()); } #if ENABLE(DASHBOARD_SUPPORT) @@ -835,9 +835,8 @@ void CanvasRenderingContext2D::stroke() CanvasStrokeStyleApplier strokeApplier(this); FloatRect boundingRect = m_path.strokeBoundingRect(&strokeApplier); #endif - willDraw(boundingRect); - c->strokePath(); + didDraw(boundingRect); } #if ENABLE(DASHBOARD_SUPPORT) @@ -885,8 +884,8 @@ void CanvasRenderingContext2D::clearRect(float x, float y, float width, float he save(); setAllAttributesToDefault(); - willDraw(rect); context->clearRect(rect); + didDraw(rect); restore(); } @@ -909,9 +908,9 @@ void CanvasRenderingContext2D::fillRect(float x, float y, float width, float hei return; FloatRect rect(x, y, width, height); - willDraw(rect); c->fillRect(rect); + didDraw(rect); } void CanvasRenderingContext2D::strokeRect(float x, float y, float width, float height) @@ -939,9 +938,9 @@ void CanvasRenderingContext2D::strokeRect(float x, float y, float width, float h FloatRect boundingRect = rect; boundingRect.inflate(lineWidth / 2); - willDraw(boundingRect); c->strokeRect(rect, lineWidth); + didDraw(boundingRect); } #if PLATFORM(CG) @@ -1198,8 +1197,8 @@ void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, const FloatRec FloatRect sourceRect = c->roundToDevicePixels(srcRect); FloatRect destRect = c->roundToDevicePixels(dstRect); - willDraw(destRect); c->drawImage(cachedImage->image(), DeviceColorSpace, destRect, sourceRect, state().m_globalComposite); + didDraw(destRect); } void CanvasRenderingContext2D::drawImage(HTMLCanvasElement* canvas, float x, float y, ExceptionCode& ec) @@ -1273,8 +1272,7 @@ void CanvasRenderingContext2D::drawImage(HTMLCanvasElement* sourceCanvas, const sourceCanvas->makeRenderingResultsAvailable(); c->drawImageBuffer(buffer, DeviceColorSpace, destRect, sourceRect, state().m_globalComposite); - willDraw(destRect); // This call comes after drawImage, since the buffer we draw into may be our own, and we need to make sure it is dirty. - // FIXME: Arguably willDraw should become didDraw and occur after drawing calls and not before them to avoid problems like this. + didDraw(destRect); } #if ENABLE(VIDEO) @@ -1342,7 +1340,6 @@ void CanvasRenderingContext2D::drawImage(HTMLVideoElement* video, const FloatRec FloatRect sourceRect = c->roundToDevicePixels(srcRect); FloatRect destRect = c->roundToDevicePixels(dstRect); - willDraw(destRect); c->save(); c->clip(destRect); @@ -1351,6 +1348,7 @@ void CanvasRenderingContext2D::drawImage(HTMLVideoElement* video, const FloatRec c->translate(-sourceRect.x(), -sourceRect.y()); video->paintCurrentFrameInContext(c, IntRect(IntPoint(), size(video))); c->restore(); + didDraw(destRect); } #endif @@ -1384,8 +1382,8 @@ void CanvasRenderingContext2D::drawImageFromRect(HTMLImageElement* image, op = CompositeSourceOver; FloatRect destRect = FloatRect(dx, dy, dw, dh); - willDraw(destRect); c->drawImage(cachedImage->image(), DeviceColorSpace, destRect, FloatRect(sx, sy, sw, sh), op); + didDraw(destRect); } void CanvasRenderingContext2D::setAlpha(float alpha) @@ -1475,7 +1473,7 @@ PassRefPtr<CanvasPattern> CanvasRenderingContext2D::createPattern(HTMLCanvasElem return CanvasPattern::create(canvas->copiedImage(), repeatX, repeatY, canvas->originClean()); } -void CanvasRenderingContext2D::willDraw(const FloatRect& r, unsigned options) +void CanvasRenderingContext2D::didDraw(const FloatRect& r, unsigned options) { GraphicsContext* c = drawingContext(); if (!c) @@ -1510,7 +1508,7 @@ void CanvasRenderingContext2D::willDraw(const FloatRect& r, unsigned options) renderBox->layer()->rendererContentChanged(); else #endif - canvas()->willDraw(dirtyRect); + canvas()->didDraw(dirtyRect); } GraphicsContext* CanvasRenderingContext2D::drawingContext() const @@ -1628,11 +1626,11 @@ void CanvasRenderingContext2D::putImageData(ImageData* data, float dx, float dy, sourceRect.intersect(IntRect(IntPoint(), buffer->size())); if (sourceRect.isEmpty()) return; - willDraw(sourceRect, 0); // ignore transform, shadow and clip sourceRect.move(-destOffset); IntPoint destPoint(destOffset.width(), destOffset.height()); buffer->putUnmultipliedImageData(data, sourceRect, destPoint); + didDraw(sourceRect, 0); // ignore transform, shadow and clip } String CanvasRenderingContext2D::font() const @@ -1809,14 +1807,6 @@ void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, flo if (!fill) textRect.inflate(c->strokeThickness() / 2); - if (fill) - canvas()->willDraw(textRect); - else { - // When stroking text, pointy miters can extend outside of textRect, so we - // punt and dirty the whole canvas. - canvas()->willDraw(FloatRect(0, 0, canvas()->width(), canvas()->height())); - } - #if PLATFORM(CG) CanvasStyle* drawStyle = fill ? state().m_fillStyle.get() : state().m_strokeStyle.get(); if (drawStyle->canvasGradient() || drawStyle->canvasPattern()) { @@ -1859,6 +1849,14 @@ void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, flo c->drawBidiText(font, textRun, location); + if (fill) + canvas()->didDraw(textRect); + else { + // When stroking text, pointy miters can extend outside of textRect, so we + // punt and dirty the whole canvas. + canvas()->didDraw(FloatRect(0, 0, canvas()->width(), canvas()->height())); + } + #if PLATFORM(QT) Font::setCodePath(oldCodePath); #endif diff --git a/WebCore/html/canvas/CanvasRenderingContext2D.h b/WebCore/html/canvas/CanvasRenderingContext2D.h index f610250..9857344 100644 --- a/WebCore/html/canvas/CanvasRenderingContext2D.h +++ b/WebCore/html/canvas/CanvasRenderingContext2D.h @@ -269,7 +269,7 @@ private: CanvasWillDrawApplyAll = 0xffffffff }; - void willDraw(const FloatRect&, unsigned options = CanvasWillDrawApplyAll); + void didDraw(const FloatRect&, unsigned options = CanvasWillDrawApplyAll); GraphicsContext* drawingContext() const; diff --git a/WebCore/html/canvas/WebGLRenderingContext.cpp b/WebCore/html/canvas/WebGLRenderingContext.cpp index 44d3e08..2a1464a 100644 --- a/WebCore/html/canvas/WebGLRenderingContext.cpp +++ b/WebCore/html/canvas/WebGLRenderingContext.cpp @@ -29,6 +29,7 @@ #include "WebGLRenderingContext.h" +#include "CachedImage.h" #include "CanvasPixelArray.h" #include "CheckedInt.h" #include "Console.h" @@ -86,7 +87,8 @@ private: PassOwnPtr<WebGLRenderingContext> WebGLRenderingContext::create(HTMLCanvasElement* canvas, WebGLContextAttributes* attrs) { HostWindow* hostWindow = canvas->document()->view()->root()->hostWindow(); - OwnPtr<GraphicsContext3D> context(GraphicsContext3D::create(attrs->attributes(), hostWindow)); + GraphicsContext3D::Attributes emptyAttributes; + OwnPtr<GraphicsContext3D> context(GraphicsContext3D::create(attrs ? attrs->attributes() : emptyAttributes, hostWindow)); if (!context) return 0; @@ -152,7 +154,7 @@ void WebGLRenderingContext::markContextChanged() else { #endif if (!m_markedCanvasDirty) - canvas()->willDraw(FloatRect(0, 0, canvas()->width(), canvas()->height())); + canvas()->didDraw(FloatRect(0, 0, canvas()->width(), canvas()->height())); #if USE(ACCELERATED_COMPOSITING) } #endif @@ -309,23 +311,14 @@ void WebGLRenderingContext::bindTexture(unsigned long target, WebGLTexture* text if (texture) texture->setTarget(target, maxLevel); - // FIXME: do we want to do this on all platforms? -#if PLATFORM(CHROMIUM) - // FIXME: GL_TEXTURE_WRAP_R isn't exposed in the OpenGL ES 2.0 - // API. On desktop OpenGL implementations it seems necessary to - // set this wrap mode to GL_CLAMP_TO_EDGE to get correct behavior - // of cube maps. - if (texture) { - if (target == GraphicsContext3D::TEXTURE_CUBE_MAP) { - if (!texture->isCubeMapRWrapModeInitialized()) { - static const int textureWrapR = 0x8072; - texParameteri(GraphicsContext3D::TEXTURE_CUBE_MAP, textureWrapR, GraphicsContext3D::CLAMP_TO_EDGE); - texture->setCubeMapRWrapModeInitialized(true); - } - } else - texture->setCubeMapRWrapModeInitialized(false); - } -#endif + // Note: previously we used to automatically set the TEXTURE_WRAP_R + // repeat mode to CLAMP_TO_EDGE for cube map textures, because OpenGL + // ES 2.0 doesn't expose this flag (a bug in the specification) and + // otherwise the application has no control over the seams in this + // dimension. However, it appears that supporting this properly on all + // platforms is fairly involved (will require a HashMap from texture ID + // in all ports), and we have not had any complaints, so the logic has + // been removed. cleanupAfterGraphicsCall(false); } diff --git a/WebCore/html/canvas/WebGLTexture.cpp b/WebCore/html/canvas/WebGLTexture.cpp index 7b2869f..7fc84ad 100644 --- a/WebCore/html/canvas/WebGLTexture.cpp +++ b/WebCore/html/canvas/WebGLTexture.cpp @@ -40,7 +40,6 @@ PassRefPtr<WebGLTexture> WebGLTexture::create(WebGLRenderingContext* ctx) WebGLTexture::WebGLTexture(WebGLRenderingContext* ctx) : WebGLObject(ctx) - , cubeMapRWrapModeInitialized(false) , m_target(0) , m_minFilter(GraphicsContext3D::NEAREST_MIPMAP_LINEAR) , m_magFilter(GraphicsContext3D::LINEAR) diff --git a/WebCore/html/canvas/WebGLTexture.h b/WebCore/html/canvas/WebGLTexture.h index a1ce348..191957d 100644 --- a/WebCore/html/canvas/WebGLTexture.h +++ b/WebCore/html/canvas/WebGLTexture.h @@ -40,16 +40,6 @@ public: static PassRefPtr<WebGLTexture> create(WebGLRenderingContext*); - bool isCubeMapRWrapModeInitialized() - { - return cubeMapRWrapModeInitialized; - } - - void setCubeMapRWrapModeInitialized(bool initialized) - { - cubeMapRWrapModeInitialized = initialized; - } - void setTarget(unsigned long target, int maxLevel); void setParameteri(unsigned long pname, int param); void setParameterf(unsigned long pname, float param); @@ -83,8 +73,6 @@ private: int mapTargetToIndex(unsigned long); - bool cubeMapRWrapModeInitialized; - unsigned long m_target; int m_minFilter; diff --git a/WebCore/html/CSSPreloadScanner.cpp b/WebCore/html/parser/CSSPreloadScanner.cpp index 729103e..729103e 100644 --- a/WebCore/html/CSSPreloadScanner.cpp +++ b/WebCore/html/parser/CSSPreloadScanner.cpp diff --git a/WebCore/html/CSSPreloadScanner.h b/WebCore/html/parser/CSSPreloadScanner.h index 7ac282f..7ac282f 100644 --- a/WebCore/html/CSSPreloadScanner.h +++ b/WebCore/html/parser/CSSPreloadScanner.h diff --git a/WebCore/html/HTMLConstructionSite.cpp b/WebCore/html/parser/HTMLConstructionSite.cpp index 8735cd2..975b1af 100644 --- a/WebCore/html/HTMLConstructionSite.cpp +++ b/WebCore/html/parser/HTMLConstructionSite.cpp @@ -203,10 +203,11 @@ void HTMLConstructionSite::insertDoctype(AtomicHTMLToken& token) { ASSERT(token.type() == HTMLToken::DOCTYPE); attach(m_document, DocumentType::create(m_document, token.name(), String::adopt(token.publicIdentifier()), String::adopt(token.systemIdentifier()))); - // FIXME: Move quirks mode detection from DocumentType element to here. - notImplemented(); + if (token.forceQuirks()) - m_document->setParseMode(Document::Compat); + m_document->setCompatibilityMode(Document::QuirksMode); + else + m_document->setCompatibilityModeFromDoctype(); } void HTMLConstructionSite::insertComment(AtomicHTMLToken& token) @@ -252,9 +253,13 @@ void HTMLConstructionSite::insertHTMLBodyElement(AtomicHTMLToken& token) m_openElements.pushHTMLBodyElement(attachToCurrent(createHTMLElement(token))); } -void HTMLConstructionSite::insertHTMLFormElement(AtomicHTMLToken& token) +void HTMLConstructionSite::insertHTMLFormElement(AtomicHTMLToken& token, bool isDemoted) { - insertHTMLElement(token); + RefPtr<Element> element = createHTMLElement(token); + ASSERT(element->hasTagName(formTag)); + RefPtr<HTMLFormElement> form = static_pointer_cast<HTMLFormElement>(element.release()); + form->setDemoted(isDemoted); + m_openElements.push(attachToCurrent(form.release())); ASSERT(currentElement()->isHTMLElement()); ASSERT(currentElement()->hasTagName(formTag)); m_form = static_cast<HTMLFormElement*>(currentElement()); diff --git a/WebCore/html/HTMLConstructionSite.h b/WebCore/html/parser/HTMLConstructionSite.h index 2e746b4..6bed6a7 100644 --- a/WebCore/html/HTMLConstructionSite.h +++ b/WebCore/html/parser/HTMLConstructionSite.h @@ -57,7 +57,7 @@ public: void insertHTMLHtmlElement(AtomicHTMLToken&); void insertHTMLHeadElement(AtomicHTMLToken&); void insertHTMLBodyElement(AtomicHTMLToken&); - void insertHTMLFormElement(AtomicHTMLToken&); + void insertHTMLFormElement(AtomicHTMLToken&, bool isDemoted = false); void insertScriptElement(AtomicHTMLToken&); void insertTextNode(const String&); void insertForeignElement(AtomicHTMLToken&, const AtomicString& namespaceURI); diff --git a/WebCore/html/HTMLDocumentParser.cpp b/WebCore/html/parser/HTMLDocumentParser.cpp index 0a1208d..0a1208d 100644 --- a/WebCore/html/HTMLDocumentParser.cpp +++ b/WebCore/html/parser/HTMLDocumentParser.cpp diff --git a/WebCore/html/HTMLDocumentParser.h b/WebCore/html/parser/HTMLDocumentParser.h index da21a2b..da21a2b 100644 --- a/WebCore/html/HTMLDocumentParser.h +++ b/WebCore/html/parser/HTMLDocumentParser.h diff --git a/WebCore/html/HTMLElementStack.cpp b/WebCore/html/parser/HTMLElementStack.cpp index b6f4111..b6f4111 100644 --- a/WebCore/html/HTMLElementStack.cpp +++ b/WebCore/html/parser/HTMLElementStack.cpp diff --git a/WebCore/html/HTMLElementStack.h b/WebCore/html/parser/HTMLElementStack.h index 73cfcb1..73cfcb1 100644 --- a/WebCore/html/HTMLElementStack.h +++ b/WebCore/html/parser/HTMLElementStack.h diff --git a/WebCore/html/parser/HTMLEntityNames.in b/WebCore/html/parser/HTMLEntityNames.in new file mode 100644 index 0000000..2d42ab2 --- /dev/null +++ b/WebCore/html/parser/HTMLEntityNames.in @@ -0,0 +1,2138 @@ +"AElig;","U+000C6" +"AElig","U+000C6" +"AMP;","U+00026" +"AMP","U+00026" +"Aacute;","U+000C1" +"Aacute","U+000C1" +"Abreve;","U+00102" +"Acirc;","U+000C2" +"Acirc","U+000C2" +"Acy;","U+00410" +"Afr;","U+1D504" +"Agrave;","U+000C0" +"Agrave","U+000C0" +"Alpha;","U+00391" +"Amacr;","U+00100" +"And;","U+02A53" +"Aogon;","U+00104" +"Aopf;","U+1D538" +"ApplyFunction;","U+02061" +"Aring;","U+000C5" +"Aring","U+000C5" +"Ascr;","U+1D49C" +"Assign;","U+02254" +"Atilde;","U+000C3" +"Atilde","U+000C3" +"Auml;","U+000C4" +"Auml","U+000C4" +"Backslash;","U+02216" +"Barv;","U+02AE7" +"Barwed;","U+02306" +"Bcy;","U+00411" +"Because;","U+02235" +"Bernoullis;","U+0212C" +"Beta;","U+00392" +"Bfr;","U+1D505" +"Bopf;","U+1D539" +"Breve;","U+002D8" +"Bscr;","U+0212C" +"Bumpeq;","U+0224E" +"CHcy;","U+00427" +"COPY;","U+000A9" +"COPY","U+000A9" +"Cacute;","U+00106" +"Cap;","U+022D2" +"CapitalDifferentialD;","U+02145" +"Cayleys;","U+0212D" +"Ccaron;","U+0010C" +"Ccedil;","U+000C7" +"Ccedil","U+000C7" +"Ccirc;","U+00108" +"Cconint;","U+02230" +"Cdot;","U+0010A" +"Cedilla;","U+000B8" +"CenterDot;","U+000B7" +"Cfr;","U+0212D" +"Chi;","U+003A7" +"CircleDot;","U+02299" +"CircleMinus;","U+02296" +"CirclePlus;","U+02295" +"CircleTimes;","U+02297" +"ClockwiseContourIntegral;","U+02232" +"CloseCurlyDoubleQuote;","U+0201D" +"CloseCurlyQuote;","U+02019" +"Colon;","U+02237" +"Colone;","U+02A74" +"Congruent;","U+02261" +"Conint;","U+0222F" +"ContourIntegral;","U+0222E" +"Copf;","U+02102" +"Coproduct;","U+02210" +"CounterClockwiseContourIntegral;","U+02233" +"Cross;","U+02A2F" +"Cscr;","U+1D49E" +"Cup;","U+022D3" +"CupCap;","U+0224D" +"DD;","U+02145" +"DDotrahd;","U+02911" +"DJcy;","U+00402" +"DScy;","U+00405" +"DZcy;","U+0040F" +"Dagger;","U+02021" +"Darr;","U+021A1" +"Dashv;","U+02AE4" +"Dcaron;","U+0010E" +"Dcy;","U+00414" +"Del;","U+02207" +"Delta;","U+00394" +"Dfr;","U+1D507" +"DiacriticalAcute;","U+000B4" +"DiacriticalDot;","U+002D9" +"DiacriticalDoubleAcute;","U+002DD" +"DiacriticalGrave;","U+00060" +"DiacriticalTilde;","U+002DC" +"Diamond;","U+022C4" +"DifferentialD;","U+02146" +"Dopf;","U+1D53B" +"Dot;","U+000A8" +"DotDot;","U+020DC" +"DotEqual;","U+02250" +"DoubleContourIntegral;","U+0222F" +"DoubleDot;","U+000A8" +"DoubleDownArrow;","U+021D3" +"DoubleLeftArrow;","U+021D0" +"DoubleLeftRightArrow;","U+021D4" +"DoubleLeftTee;","U+02AE4" +"DoubleLongLeftArrow;","U+027F8" +"DoubleLongLeftRightArrow;","U+027FA" +"DoubleLongRightArrow;","U+027F9" +"DoubleRightArrow;","U+021D2" +"DoubleRightTee;","U+022A8" +"DoubleUpArrow;","U+021D1" +"DoubleUpDownArrow;","U+021D5" +"DoubleVerticalBar;","U+02225" +"DownArrow;","U+02193" +"DownArrowBar;","U+02913" +"DownArrowUpArrow;","U+021F5" +"DownBreve;","U+00311" +"DownLeftRightVector;","U+02950" +"DownLeftTeeVector;","U+0295E" +"DownLeftVector;","U+021BD" +"DownLeftVectorBar;","U+02956" +"DownRightTeeVector;","U+0295F" +"DownRightVector;","U+021C1" +"DownRightVectorBar;","U+02957" +"DownTee;","U+022A4" +"DownTeeArrow;","U+021A7" +"Downarrow;","U+021D3" +"Dscr;","U+1D49F" +"Dstrok;","U+00110" +"ENG;","U+0014A" +"ETH;","U+000D0" +"ETH","U+000D0" +"Eacute;","U+000C9" +"Eacute","U+000C9" +"Ecaron;","U+0011A" +"Ecirc;","U+000CA" +"Ecirc","U+000CA" +"Ecy;","U+0042D" +"Edot;","U+00116" +"Efr;","U+1D508" +"Egrave;","U+000C8" +"Egrave","U+000C8" +"Element;","U+02208" +"Emacr;","U+00112" +"EmptySmallSquare;","U+025FB" +"EmptyVerySmallSquare;","U+025AB" +"Eogon;","U+00118" +"Eopf;","U+1D53C" +"Epsilon;","U+00395" +"Equal;","U+02A75" +"EqualTilde;","U+02242" +"Equilibrium;","U+021CC" +"Escr;","U+02130" +"Esim;","U+02A73" +"Eta;","U+00397" +"Euml;","U+000CB" +"Euml","U+000CB" +"Exists;","U+02203" +"ExponentialE;","U+02147" +"Fcy;","U+00424" +"Ffr;","U+1D509" +"FilledSmallSquare;","U+025FC" +"FilledVerySmallSquare;","U+025AA" +"Fopf;","U+1D53D" +"ForAll;","U+02200" +"Fouriertrf;","U+02131" +"Fscr;","U+02131" +"GJcy;","U+00403" +"GT;","U+0003E" +"GT","U+0003E" +"Gamma;","U+00393" +"Gammad;","U+003DC" +"Gbreve;","U+0011E" +"Gcedil;","U+00122" +"Gcirc;","U+0011C" +"Gcy;","U+00413" +"Gdot;","U+00120" +"Gfr;","U+1D50A" +"Gg;","U+022D9" +"Gopf;","U+1D53E" +"GreaterEqual;","U+02265" +"GreaterEqualLess;","U+022DB" +"GreaterFullEqual;","U+02267" +"GreaterGreater;","U+02AA2" +"GreaterLess;","U+02277" +"GreaterSlantEqual;","U+02A7E" +"GreaterTilde;","U+02273" +"Gscr;","U+1D4A2" +"Gt;","U+0226B" +"HARDcy;","U+0042A" +"Hacek;","U+002C7" +"Hat;","U+0005E" +"Hcirc;","U+00124" +"Hfr;","U+0210C" +"HilbertSpace;","U+0210B" +"Hopf;","U+0210D" +"HorizontalLine;","U+02500" +"Hscr;","U+0210B" +"Hstrok;","U+00126" +"HumpDownHump;","U+0224E" +"HumpEqual;","U+0224F" +"IEcy;","U+00415" +"IJlig;","U+00132" +"IOcy;","U+00401" +"Iacute;","U+000CD" +"Iacute","U+000CD" +"Icirc;","U+000CE" +"Icirc","U+000CE" +"Icy;","U+00418" +"Idot;","U+00130" +"Ifr;","U+02111" +"Igrave;","U+000CC" +"Igrave","U+000CC" +"Im;","U+02111" +"Imacr;","U+0012A" +"ImaginaryI;","U+02148" +"Implies;","U+021D2" +"Int;","U+0222C" +"Integral;","U+0222B" +"Intersection;","U+022C2" +"InvisibleComma;","U+02063" +"InvisibleTimes;","U+02062" +"Iogon;","U+0012E" +"Iopf;","U+1D540" +"Iota;","U+00399" +"Iscr;","U+02110" +"Itilde;","U+00128" +"Iukcy;","U+00406" +"Iuml;","U+000CF" +"Iuml","U+000CF" +"Jcirc;","U+00134" +"Jcy;","U+00419" +"Jfr;","U+1D50D" +"Jopf;","U+1D541" +"Jscr;","U+1D4A5" +"Jsercy;","U+00408" +"Jukcy;","U+00404" +"KHcy;","U+00425" +"KJcy;","U+0040C" +"Kappa;","U+0039A" +"Kcedil;","U+00136" +"Kcy;","U+0041A" +"Kfr;","U+1D50E" +"Kopf;","U+1D542" +"Kscr;","U+1D4A6" +"LJcy;","U+00409" +"LT;","U+0003C" +"LT","U+0003C" +"Lacute;","U+00139" +"Lambda;","U+0039B" +"Lang;","U+027EA" +"Laplacetrf;","U+02112" +"Larr;","U+0219E" +"Lcaron;","U+0013D" +"Lcedil;","U+0013B" +"Lcy;","U+0041B" +"LeftAngleBracket;","U+027E8" +"LeftArrow;","U+02190" +"LeftArrowBar;","U+021E4" +"LeftArrowRightArrow;","U+021C6" +"LeftCeiling;","U+02308" +"LeftDoubleBracket;","U+027E6" +"LeftDownTeeVector;","U+02961" +"LeftDownVector;","U+021C3" +"LeftDownVectorBar;","U+02959" +"LeftFloor;","U+0230A" +"LeftRightArrow;","U+02194" +"LeftRightVector;","U+0294E" +"LeftTee;","U+022A3" +"LeftTeeArrow;","U+021A4" +"LeftTeeVector;","U+0295A" +"LeftTriangle;","U+022B2" +"LeftTriangleBar;","U+029CF" +"LeftTriangleEqual;","U+022B4" +"LeftUpDownVector;","U+02951" +"LeftUpTeeVector;","U+02960" +"LeftUpVector;","U+021BF" +"LeftUpVectorBar;","U+02958" +"LeftVector;","U+021BC" +"LeftVectorBar;","U+02952" +"Leftarrow;","U+021D0" +"Leftrightarrow;","U+021D4" +"LessEqualGreater;","U+022DA" +"LessFullEqual;","U+02266" +"LessGreater;","U+02276" +"LessLess;","U+02AA1" +"LessSlantEqual;","U+02A7D" +"LessTilde;","U+02272" +"Lfr;","U+1D50F" +"Ll;","U+022D8" +"Lleftarrow;","U+021DA" +"Lmidot;","U+0013F" +"LongLeftArrow;","U+027F5" +"LongLeftRightArrow;","U+027F7" +"LongRightArrow;","U+027F6" +"Longleftarrow;","U+027F8" +"Longleftrightarrow;","U+027FA" +"Longrightarrow;","U+027F9" +"Lopf;","U+1D543" +"LowerLeftArrow;","U+02199" +"LowerRightArrow;","U+02198" +"Lscr;","U+02112" +"Lsh;","U+021B0" +"Lstrok;","U+00141" +"Lt;","U+0226A" +"Map;","U+02905" +"Mcy;","U+0041C" +"MediumSpace;","U+0205F" +"Mellintrf;","U+02133" +"Mfr;","U+1D510" +"MinusPlus;","U+02213" +"Mopf;","U+1D544" +"Mscr;","U+02133" +"Mu;","U+0039C" +"NJcy;","U+0040A" +"Nacute;","U+00143" +"Ncaron;","U+00147" +"Ncedil;","U+00145" +"Ncy;","U+0041D" +"NegativeMediumSpace;","U+0200B" +"NegativeThickSpace;","U+0200B" +"NegativeThinSpace;","U+0200B" +"NegativeVeryThinSpace;","U+0200B" +"NestedGreaterGreater;","U+0226B" +"NestedLessLess;","U+0226A" +"NewLine;","U+0000A" +"Nfr;","U+1D511" +"NoBreak;","U+02060" +"NonBreakingSpace;","U+000A0" +"Nopf;","U+02115" +"Not;","U+02AEC" +"NotCongruent;","U+02262" +"NotCupCap;","U+0226D" +"NotDoubleVerticalBar;","U+02226" +"NotElement;","U+02209" +"NotEqual;","U+02260" +"NotExists;","U+02204" +"NotGreater;","U+0226F" +"NotGreaterEqual;","U+02271" +"NotGreaterLess;","U+02279" +"NotGreaterTilde;","U+02275" +"NotLeftTriangle;","U+022EA" +"NotLeftTriangleEqual;","U+022EC" +"NotLess;","U+0226E" +"NotLessEqual;","U+02270" +"NotLessGreater;","U+02278" +"NotLessTilde;","U+02274" +"NotPrecedes;","U+02280" +"NotPrecedesSlantEqual;","U+022E0" +"NotReverseElement;","U+0220C" +"NotRightTriangle;","U+022EB" +"NotRightTriangleEqual;","U+022ED" +"NotSquareSubsetEqual;","U+022E2" +"NotSquareSupersetEqual;","U+022E3" +"NotSubsetEqual;","U+02288" +"NotSucceeds;","U+02281" +"NotSucceedsSlantEqual;","U+022E1" +"NotSupersetEqual;","U+02289" +"NotTilde;","U+02241" +"NotTildeEqual;","U+02244" +"NotTildeFullEqual;","U+02247" +"NotTildeTilde;","U+02249" +"NotVerticalBar;","U+02224" +"Nscr;","U+1D4A9" +"Ntilde;","U+000D1" +"Ntilde","U+000D1" +"Nu;","U+0039D" +"OElig;","U+00152" +"Oacute;","U+000D3" +"Oacute","U+000D3" +"Ocirc;","U+000D4" +"Ocirc","U+000D4" +"Ocy;","U+0041E" +"Odblac;","U+00150" +"Ofr;","U+1D512" +"Ograve;","U+000D2" +"Ograve","U+000D2" +"Omacr;","U+0014C" +"Omega;","U+003A9" +"Omicron;","U+0039F" +"Oopf;","U+1D546" +"OpenCurlyDoubleQuote;","U+0201C" +"OpenCurlyQuote;","U+02018" +"Or;","U+02A54" +"Oscr;","U+1D4AA" +"Oslash;","U+000D8" +"Oslash","U+000D8" +"Otilde;","U+000D5" +"Otilde","U+000D5" +"Otimes;","U+02A37" +"Ouml;","U+000D6" +"Ouml","U+000D6" +"OverBar;","U+0203E" +"OverBrace;","U+023DE" +"OverBracket;","U+023B4" +"OverParenthesis;","U+023DC" +"PartialD;","U+02202" +"Pcy;","U+0041F" +"Pfr;","U+1D513" +"Phi;","U+003A6" +"Pi;","U+003A0" +"PlusMinus;","U+000B1" +"Poincareplane;","U+0210C" +"Popf;","U+02119" +"Pr;","U+02ABB" +"Precedes;","U+0227A" +"PrecedesEqual;","U+02AAF" +"PrecedesSlantEqual;","U+0227C" +"PrecedesTilde;","U+0227E" +"Prime;","U+02033" +"Product;","U+0220F" +"Proportion;","U+02237" +"Proportional;","U+0221D" +"Pscr;","U+1D4AB" +"Psi;","U+003A8" +"QUOT;","U+00022" +"QUOT","U+00022" +"Qfr;","U+1D514" +"Qopf;","U+0211A" +"Qscr;","U+1D4AC" +"RBarr;","U+02910" +"REG;","U+000AE" +"REG","U+000AE" +"Racute;","U+00154" +"Rang;","U+027EB" +"Rarr;","U+021A0" +"Rarrtl;","U+02916" +"Rcaron;","U+00158" +"Rcedil;","U+00156" +"Rcy;","U+00420" +"Re;","U+0211C" +"ReverseElement;","U+0220B" +"ReverseEquilibrium;","U+021CB" +"ReverseUpEquilibrium;","U+0296F" +"Rfr;","U+0211C" +"Rho;","U+003A1" +"RightAngleBracket;","U+027E9" +"RightArrow;","U+02192" +"RightArrowBar;","U+021E5" +"RightArrowLeftArrow;","U+021C4" +"RightCeiling;","U+02309" +"RightDoubleBracket;","U+027E7" +"RightDownTeeVector;","U+0295D" +"RightDownVector;","U+021C2" +"RightDownVectorBar;","U+02955" +"RightFloor;","U+0230B" +"RightTee;","U+022A2" +"RightTeeArrow;","U+021A6" +"RightTeeVector;","U+0295B" +"RightTriangle;","U+022B3" +"RightTriangleBar;","U+029D0" +"RightTriangleEqual;","U+022B5" +"RightUpDownVector;","U+0294F" +"RightUpTeeVector;","U+0295C" +"RightUpVector;","U+021BE" +"RightUpVectorBar;","U+02954" +"RightVector;","U+021C0" +"RightVectorBar;","U+02953" +"Rightarrow;","U+021D2" +"Ropf;","U+0211D" +"RoundImplies;","U+02970" +"Rrightarrow;","U+021DB" +"Rscr;","U+0211B" +"Rsh;","U+021B1" +"RuleDelayed;","U+029F4" +"SHCHcy;","U+00429" +"SHcy;","U+00428" +"SOFTcy;","U+0042C" +"Sacute;","U+0015A" +"Sc;","U+02ABC" +"Scaron;","U+00160" +"Scedil;","U+0015E" +"Scirc;","U+0015C" +"Scy;","U+00421" +"Sfr;","U+1D516" +"ShortDownArrow;","U+02193" +"ShortLeftArrow;","U+02190" +"ShortRightArrow;","U+02192" +"ShortUpArrow;","U+02191" +"Sigma;","U+003A3" +"SmallCircle;","U+02218" +"Sopf;","U+1D54A" +"Sqrt;","U+0221A" +"Square;","U+025A1" +"SquareIntersection;","U+02293" +"SquareSubset;","U+0228F" +"SquareSubsetEqual;","U+02291" +"SquareSuperset;","U+02290" +"SquareSupersetEqual;","U+02292" +"SquareUnion;","U+02294" +"Sscr;","U+1D4AE" +"Star;","U+022C6" +"Sub;","U+022D0" +"Subset;","U+022D0" +"SubsetEqual;","U+02286" +"Succeeds;","U+0227B" +"SucceedsEqual;","U+02AB0" +"SucceedsSlantEqual;","U+0227D" +"SucceedsTilde;","U+0227F" +"SuchThat;","U+0220B" +"Sum;","U+02211" +"Sup;","U+022D1" +"Superset;","U+02283" +"SupersetEqual;","U+02287" +"Supset;","U+022D1" +"THORN;","U+000DE" +"THORN","U+000DE" +"TRADE;","U+02122" +"TSHcy;","U+0040B" +"TScy;","U+00426" +"Tab;","U+00009" +"Tau;","U+003A4" +"Tcaron;","U+00164" +"Tcedil;","U+00162" +"Tcy;","U+00422" +"Tfr;","U+1D517" +"Therefore;","U+02234" +"Theta;","U+00398" +"ThinSpace;","U+02009" +"Tilde;","U+0223C" +"TildeEqual;","U+02243" +"TildeFullEqual;","U+02245" +"TildeTilde;","U+02248" +"Topf;","U+1D54B" +"TripleDot;","U+020DB" +"Tscr;","U+1D4AF" +"Tstrok;","U+00166" +"Uacute;","U+000DA" +"Uacute","U+000DA" +"Uarr;","U+0219F" +"Uarrocir;","U+02949" +"Ubrcy;","U+0040E" +"Ubreve;","U+0016C" +"Ucirc;","U+000DB" +"Ucirc","U+000DB" +"Ucy;","U+00423" +"Udblac;","U+00170" +"Ufr;","U+1D518" +"Ugrave;","U+000D9" +"Ugrave","U+000D9" +"Umacr;","U+0016A" +"UnderBar;","U+0005F" +"UnderBrace;","U+023DF" +"UnderBracket;","U+023B5" +"UnderParenthesis;","U+023DD" +"Union;","U+022C3" +"UnionPlus;","U+0228E" +"Uogon;","U+00172" +"Uopf;","U+1D54C" +"UpArrow;","U+02191" +"UpArrowBar;","U+02912" +"UpArrowDownArrow;","U+021C5" +"UpDownArrow;","U+02195" +"UpEquilibrium;","U+0296E" +"UpTee;","U+022A5" +"UpTeeArrow;","U+021A5" +"Uparrow;","U+021D1" +"Updownarrow;","U+021D5" +"UpperLeftArrow;","U+02196" +"UpperRightArrow;","U+02197" +"Upsi;","U+003D2" +"Upsilon;","U+003A5" +"Uring;","U+0016E" +"Uscr;","U+1D4B0" +"Utilde;","U+00168" +"Uuml;","U+000DC" +"Uuml","U+000DC" +"VDash;","U+022AB" +"Vbar;","U+02AEB" +"Vcy;","U+00412" +"Vdash;","U+022A9" +"Vdashl;","U+02AE6" +"Vee;","U+022C1" +"Verbar;","U+02016" +"Vert;","U+02016" +"VerticalBar;","U+02223" +"VerticalLine;","U+0007C" +"VerticalSeparator;","U+02758" +"VerticalTilde;","U+02240" +"VeryThinSpace;","U+0200A" +"Vfr;","U+1D519" +"Vopf;","U+1D54D" +"Vscr;","U+1D4B1" +"Vvdash;","U+022AA" +"Wcirc;","U+00174" +"Wedge;","U+022C0" +"Wfr;","U+1D51A" +"Wopf;","U+1D54E" +"Wscr;","U+1D4B2" +"Xfr;","U+1D51B" +"Xi;","U+0039E" +"Xopf;","U+1D54F" +"Xscr;","U+1D4B3" +"YAcy;","U+0042F" +"YIcy;","U+00407" +"YUcy;","U+0042E" +"Yacute;","U+000DD" +"Yacute","U+000DD" +"Ycirc;","U+00176" +"Ycy;","U+0042B" +"Yfr;","U+1D51C" +"Yopf;","U+1D550" +"Yscr;","U+1D4B4" +"Yuml;","U+00178" +"ZHcy;","U+00416" +"Zacute;","U+00179" +"Zcaron;","U+0017D" +"Zcy;","U+00417" +"Zdot;","U+0017B" +"ZeroWidthSpace;","U+0200B" +"Zeta;","U+00396" +"Zfr;","U+02128" +"Zopf;","U+02124" +"Zscr;","U+1D4B5" +"aacute;","U+000E1" +"aacute","U+000E1" +"abreve;","U+00103" +"ac;","U+0223E" +"acd;","U+0223F" +"acirc;","U+000E2" +"acirc","U+000E2" +"acute;","U+000B4" +"acute","U+000B4" +"acy;","U+00430" +"aelig;","U+000E6" +"aelig","U+000E6" +"af;","U+02061" +"afr;","U+1D51E" +"agrave;","U+000E0" +"agrave","U+000E0" +"alefsym;","U+02135" +"aleph;","U+02135" +"alpha;","U+003B1" +"amacr;","U+00101" +"amalg;","U+02A3F" +"amp;","U+00026" +"amp","U+00026" +"and;","U+02227" +"andand;","U+02A55" +"andd;","U+02A5C" +"andslope;","U+02A58" +"andv;","U+02A5A" +"ang;","U+02220" +"ange;","U+029A4" +"angle;","U+02220" +"angmsd;","U+02221" +"angmsdaa;","U+029A8" +"angmsdab;","U+029A9" +"angmsdac;","U+029AA" +"angmsdad;","U+029AB" +"angmsdae;","U+029AC" +"angmsdaf;","U+029AD" +"angmsdag;","U+029AE" +"angmsdah;","U+029AF" +"angrt;","U+0221F" +"angrtvb;","U+022BE" +"angrtvbd;","U+0299D" +"angsph;","U+02222" +"angst;","U+000C5" +"angzarr;","U+0237C" +"aogon;","U+00105" +"aopf;","U+1D552" +"ap;","U+02248" +"apE;","U+02A70" +"apacir;","U+02A6F" +"ape;","U+0224A" +"apid;","U+0224B" +"apos;","U+00027" +"approx;","U+02248" +"approxeq;","U+0224A" +"aring;","U+000E5" +"aring","U+000E5" +"ascr;","U+1D4B6" +"ast;","U+0002A" +"asymp;","U+02248" +"asympeq;","U+0224D" +"atilde;","U+000E3" +"atilde","U+000E3" +"auml;","U+000E4" +"auml","U+000E4" +"awconint;","U+02233" +"awint;","U+02A11" +"bNot;","U+02AED" +"backcong;","U+0224C" +"backepsilon;","U+003F6" +"backprime;","U+02035" +"backsim;","U+0223D" +"backsimeq;","U+022CD" +"barvee;","U+022BD" +"barwed;","U+02305" +"barwedge;","U+02305" +"bbrk;","U+023B5" +"bbrktbrk;","U+023B6" +"bcong;","U+0224C" +"bcy;","U+00431" +"bdquo;","U+0201E" +"becaus;","U+02235" +"because;","U+02235" +"bemptyv;","U+029B0" +"bepsi;","U+003F6" +"bernou;","U+0212C" +"beta;","U+003B2" +"beth;","U+02136" +"between;","U+0226C" +"bfr;","U+1D51F" +"bigcap;","U+022C2" +"bigcirc;","U+025EF" +"bigcup;","U+022C3" +"bigodot;","U+02A00" +"bigoplus;","U+02A01" +"bigotimes;","U+02A02" +"bigsqcup;","U+02A06" +"bigstar;","U+02605" +"bigtriangledown;","U+025BD" +"bigtriangleup;","U+025B3" +"biguplus;","U+02A04" +"bigvee;","U+022C1" +"bigwedge;","U+022C0" +"bkarow;","U+0290D" +"blacklozenge;","U+029EB" +"blacksquare;","U+025AA" +"blacktriangle;","U+025B4" +"blacktriangledown;","U+025BE" +"blacktriangleleft;","U+025C2" +"blacktriangleright;","U+025B8" +"blank;","U+02423" +"blk12;","U+02592" +"blk14;","U+02591" +"blk34;","U+02593" +"block;","U+02588" +"bnot;","U+02310" +"bopf;","U+1D553" +"bot;","U+022A5" +"bottom;","U+022A5" +"bowtie;","U+022C8" +"boxDL;","U+02557" +"boxDR;","U+02554" +"boxDl;","U+02556" +"boxDr;","U+02553" +"boxH;","U+02550" +"boxHD;","U+02566" +"boxHU;","U+02569" +"boxHd;","U+02564" +"boxHu;","U+02567" +"boxUL;","U+0255D" +"boxUR;","U+0255A" +"boxUl;","U+0255C" +"boxUr;","U+02559" +"boxV;","U+02551" +"boxVH;","U+0256C" +"boxVL;","U+02563" +"boxVR;","U+02560" +"boxVh;","U+0256B" +"boxVl;","U+02562" +"boxVr;","U+0255F" +"boxbox;","U+029C9" +"boxdL;","U+02555" +"boxdR;","U+02552" +"boxdl;","U+02510" +"boxdr;","U+0250C" +"boxh;","U+02500" +"boxhD;","U+02565" +"boxhU;","U+02568" +"boxhd;","U+0252C" +"boxhu;","U+02534" +"boxminus;","U+0229F" +"boxplus;","U+0229E" +"boxtimes;","U+022A0" +"boxuL;","U+0255B" +"boxuR;","U+02558" +"boxul;","U+02518" +"boxur;","U+02514" +"boxv;","U+02502" +"boxvH;","U+0256A" +"boxvL;","U+02561" +"boxvR;","U+0255E" +"boxvh;","U+0253C" +"boxvl;","U+02524" +"boxvr;","U+0251C" +"bprime;","U+02035" +"breve;","U+002D8" +"brvbar;","U+000A6" +"brvbar","U+000A6" +"bscr;","U+1D4B7" +"bsemi;","U+0204F" +"bsim;","U+0223D" +"bsime;","U+022CD" +"bsol;","U+0005C" +"bsolb;","U+029C5" +"bsolhsub;","U+027C8" +"bull;","U+02022" +"bullet;","U+02022" +"bump;","U+0224E" +"bumpE;","U+02AAE" +"bumpe;","U+0224F" +"bumpeq;","U+0224F" +"cacute;","U+00107" +"cap;","U+02229" +"capand;","U+02A44" +"capbrcup;","U+02A49" +"capcap;","U+02A4B" +"capcup;","U+02A47" +"capdot;","U+02A40" +"caret;","U+02041" +"caron;","U+002C7" +"ccaps;","U+02A4D" +"ccaron;","U+0010D" +"ccedil;","U+000E7" +"ccedil","U+000E7" +"ccirc;","U+00109" +"ccups;","U+02A4C" +"ccupssm;","U+02A50" +"cdot;","U+0010B" +"cedil;","U+000B8" +"cedil","U+000B8" +"cemptyv;","U+029B2" +"cent;","U+000A2" +"cent","U+000A2" +"centerdot;","U+000B7" +"cfr;","U+1D520" +"chcy;","U+00447" +"check;","U+02713" +"checkmark;","U+02713" +"chi;","U+003C7" +"cir;","U+025CB" +"cirE;","U+029C3" +"circ;","U+002C6" +"circeq;","U+02257" +"circlearrowleft;","U+021BA" +"circlearrowright;","U+021BB" +"circledR;","U+000AE" +"circledS;","U+024C8" +"circledast;","U+0229B" +"circledcirc;","U+0229A" +"circleddash;","U+0229D" +"cire;","U+02257" +"cirfnint;","U+02A10" +"cirmid;","U+02AEF" +"cirscir;","U+029C2" +"clubs;","U+02663" +"clubsuit;","U+02663" +"colon;","U+0003A" +"colone;","U+02254" +"coloneq;","U+02254" +"comma;","U+0002C" +"commat;","U+00040" +"comp;","U+02201" +"compfn;","U+02218" +"complement;","U+02201" +"complexes;","U+02102" +"cong;","U+02245" +"congdot;","U+02A6D" +"conint;","U+0222E" +"copf;","U+1D554" +"coprod;","U+02210" +"copy;","U+000A9" +"copy","U+000A9" +"copysr;","U+02117" +"crarr;","U+021B5" +"cross;","U+02717" +"cscr;","U+1D4B8" +"csub;","U+02ACF" +"csube;","U+02AD1" +"csup;","U+02AD0" +"csupe;","U+02AD2" +"ctdot;","U+022EF" +"cudarrl;","U+02938" +"cudarrr;","U+02935" +"cuepr;","U+022DE" +"cuesc;","U+022DF" +"cularr;","U+021B6" +"cularrp;","U+0293D" +"cup;","U+0222A" +"cupbrcap;","U+02A48" +"cupcap;","U+02A46" +"cupcup;","U+02A4A" +"cupdot;","U+0228D" +"cupor;","U+02A45" +"curarr;","U+021B7" +"curarrm;","U+0293C" +"curlyeqprec;","U+022DE" +"curlyeqsucc;","U+022DF" +"curlyvee;","U+022CE" +"curlywedge;","U+022CF" +"curren;","U+000A4" +"curren","U+000A4" +"curvearrowleft;","U+021B6" +"curvearrowright;","U+021B7" +"cuvee;","U+022CE" +"cuwed;","U+022CF" +"cwconint;","U+02232" +"cwint;","U+02231" +"cylcty;","U+0232D" +"dArr;","U+021D3" +"dHar;","U+02965" +"dagger;","U+02020" +"daleth;","U+02138" +"darr;","U+02193" +"dash;","U+02010" +"dashv;","U+022A3" +"dbkarow;","U+0290F" +"dblac;","U+002DD" +"dcaron;","U+0010F" +"dcy;","U+00434" +"dd;","U+02146" +"ddagger;","U+02021" +"ddarr;","U+021CA" +"ddotseq;","U+02A77" +"deg;","U+000B0" +"deg","U+000B0" +"delta;","U+003B4" +"demptyv;","U+029B1" +"dfisht;","U+0297F" +"dfr;","U+1D521" +"dharl;","U+021C3" +"dharr;","U+021C2" +"diam;","U+022C4" +"diamond;","U+022C4" +"diamondsuit;","U+02666" +"diams;","U+02666" +"die;","U+000A8" +"digamma;","U+003DD" +"disin;","U+022F2" +"div;","U+000F7" +"divide;","U+000F7" +"divide","U+000F7" +"divideontimes;","U+022C7" +"divonx;","U+022C7" +"djcy;","U+00452" +"dlcorn;","U+0231E" +"dlcrop;","U+0230D" +"dollar;","U+00024" +"dopf;","U+1D555" +"dot;","U+002D9" +"doteq;","U+02250" +"doteqdot;","U+02251" +"dotminus;","U+02238" +"dotplus;","U+02214" +"dotsquare;","U+022A1" +"doublebarwedge;","U+02306" +"downarrow;","U+02193" +"downdownarrows;","U+021CA" +"downharpoonleft;","U+021C3" +"downharpoonright;","U+021C2" +"drbkarow;","U+02910" +"drcorn;","U+0231F" +"drcrop;","U+0230C" +"dscr;","U+1D4B9" +"dscy;","U+00455" +"dsol;","U+029F6" +"dstrok;","U+00111" +"dtdot;","U+022F1" +"dtri;","U+025BF" +"dtrif;","U+025BE" +"duarr;","U+021F5" +"duhar;","U+0296F" +"dwangle;","U+029A6" +"dzcy;","U+0045F" +"dzigrarr;","U+027FF" +"eDDot;","U+02A77" +"eDot;","U+02251" +"eacute;","U+000E9" +"eacute","U+000E9" +"easter;","U+02A6E" +"ecaron;","U+0011B" +"ecir;","U+02256" +"ecirc;","U+000EA" +"ecirc","U+000EA" +"ecolon;","U+02255" +"ecy;","U+0044D" +"edot;","U+00117" +"ee;","U+02147" +"efDot;","U+02252" +"efr;","U+1D522" +"eg;","U+02A9A" +"egrave;","U+000E8" +"egrave","U+000E8" +"egs;","U+02A96" +"egsdot;","U+02A98" +"el;","U+02A99" +"elinters;","U+023E7" +"ell;","U+02113" +"els;","U+02A95" +"elsdot;","U+02A97" +"emacr;","U+00113" +"empty;","U+02205" +"emptyset;","U+02205" +"emptyv;","U+02205" +"emsp13;","U+02004" +"emsp14;","U+02005" +"emsp;","U+02003" +"eng;","U+0014B" +"ensp;","U+02002" +"eogon;","U+00119" +"eopf;","U+1D556" +"epar;","U+022D5" +"eparsl;","U+029E3" +"eplus;","U+02A71" +"epsi;","U+003B5" +"epsilon;","U+003B5" +"epsiv;","U+003F5" +"eqcirc;","U+02256" +"eqcolon;","U+02255" +"eqsim;","U+02242" +"eqslantgtr;","U+02A96" +"eqslantless;","U+02A95" +"equals;","U+0003D" +"equest;","U+0225F" +"equiv;","U+02261" +"equivDD;","U+02A78" +"eqvparsl;","U+029E5" +"erDot;","U+02253" +"erarr;","U+02971" +"escr;","U+0212F" +"esdot;","U+02250" +"esim;","U+02242" +"eta;","U+003B7" +"eth;","U+000F0" +"eth","U+000F0" +"euml;","U+000EB" +"euml","U+000EB" +"euro;","U+020AC" +"excl;","U+00021" +"exist;","U+02203" +"expectation;","U+02130" +"exponentiale;","U+02147" +"fallingdotseq;","U+02252" +"fcy;","U+00444" +"female;","U+02640" +"ffilig;","U+0FB03" +"fflig;","U+0FB00" +"ffllig;","U+0FB04" +"ffr;","U+1D523" +"filig;","U+0FB01" +"flat;","U+0266D" +"fllig;","U+0FB02" +"fltns;","U+025B1" +"fnof;","U+00192" +"fopf;","U+1D557" +"forall;","U+02200" +"fork;","U+022D4" +"forkv;","U+02AD9" +"fpartint;","U+02A0D" +"frac12;","U+000BD" +"frac12","U+000BD" +"frac13;","U+02153" +"frac14;","U+000BC" +"frac14","U+000BC" +"frac15;","U+02155" +"frac16;","U+02159" +"frac18;","U+0215B" +"frac23;","U+02154" +"frac25;","U+02156" +"frac34;","U+000BE" +"frac34","U+000BE" +"frac35;","U+02157" +"frac38;","U+0215C" +"frac45;","U+02158" +"frac56;","U+0215A" +"frac58;","U+0215D" +"frac78;","U+0215E" +"frasl;","U+02044" +"frown;","U+02322" +"fscr;","U+1D4BB" +"gE;","U+02267" +"gEl;","U+02A8C" +"gacute;","U+001F5" +"gamma;","U+003B3" +"gammad;","U+003DD" +"gap;","U+02A86" +"gbreve;","U+0011F" +"gcirc;","U+0011D" +"gcy;","U+00433" +"gdot;","U+00121" +"ge;","U+02265" +"gel;","U+022DB" +"geq;","U+02265" +"geqq;","U+02267" +"geqslant;","U+02A7E" +"ges;","U+02A7E" +"gescc;","U+02AA9" +"gesdot;","U+02A80" +"gesdoto;","U+02A82" +"gesdotol;","U+02A84" +"gesles;","U+02A94" +"gfr;","U+1D524" +"gg;","U+0226B" +"ggg;","U+022D9" +"gimel;","U+02137" +"gjcy;","U+00453" +"gl;","U+02277" +"glE;","U+02A92" +"gla;","U+02AA5" +"glj;","U+02AA4" +"gnE;","U+02269" +"gnap;","U+02A8A" +"gnapprox;","U+02A8A" +"gne;","U+02A88" +"gneq;","U+02A88" +"gneqq;","U+02269" +"gnsim;","U+022E7" +"gopf;","U+1D558" +"grave;","U+00060" +"gscr;","U+0210A" +"gsim;","U+02273" +"gsime;","U+02A8E" +"gsiml;","U+02A90" +"gt;","U+0003E" +"gt","U+0003E" +"gtcc;","U+02AA7" +"gtcir;","U+02A7A" +"gtdot;","U+022D7" +"gtlPar;","U+02995" +"gtquest;","U+02A7C" +"gtrapprox;","U+02A86" +"gtrarr;","U+02978" +"gtrdot;","U+022D7" +"gtreqless;","U+022DB" +"gtreqqless;","U+02A8C" +"gtrless;","U+02277" +"gtrsim;","U+02273" +"hArr;","U+021D4" +"hairsp;","U+0200A" +"half;","U+000BD" +"hamilt;","U+0210B" +"hardcy;","U+0044A" +"harr;","U+02194" +"harrcir;","U+02948" +"harrw;","U+021AD" +"hbar;","U+0210F" +"hcirc;","U+00125" +"hearts;","U+02665" +"heartsuit;","U+02665" +"hellip;","U+02026" +"hercon;","U+022B9" +"hfr;","U+1D525" +"hksearow;","U+02925" +"hkswarow;","U+02926" +"hoarr;","U+021FF" +"homtht;","U+0223B" +"hookleftarrow;","U+021A9" +"hookrightarrow;","U+021AA" +"hopf;","U+1D559" +"horbar;","U+02015" +"hscr;","U+1D4BD" +"hslash;","U+0210F" +"hstrok;","U+00127" +"hybull;","U+02043" +"hyphen;","U+02010" +"iacute;","U+000ED" +"iacute","U+000ED" +"ic;","U+02063" +"icirc;","U+000EE" +"icirc","U+000EE" +"icy;","U+00438" +"iecy;","U+00435" +"iexcl;","U+000A1" +"iexcl","U+000A1" +"iff;","U+021D4" +"ifr;","U+1D526" +"igrave;","U+000EC" +"igrave","U+000EC" +"ii;","U+02148" +"iiiint;","U+02A0C" +"iiint;","U+0222D" +"iinfin;","U+029DC" +"iiota;","U+02129" +"ijlig;","U+00133" +"imacr;","U+0012B" +"image;","U+02111" +"imagline;","U+02110" +"imagpart;","U+02111" +"imath;","U+00131" +"imof;","U+022B7" +"imped;","U+001B5" +"in;","U+02208" +"incare;","U+02105" +"infin;","U+0221E" +"infintie;","U+029DD" +"inodot;","U+00131" +"int;","U+0222B" +"intcal;","U+022BA" +"integers;","U+02124" +"intercal;","U+022BA" +"intlarhk;","U+02A17" +"intprod;","U+02A3C" +"iocy;","U+00451" +"iogon;","U+0012F" +"iopf;","U+1D55A" +"iota;","U+003B9" +"iprod;","U+02A3C" +"iquest;","U+000BF" +"iquest","U+000BF" +"iscr;","U+1D4BE" +"isin;","U+02208" +"isinE;","U+022F9" +"isindot;","U+022F5" +"isins;","U+022F4" +"isinsv;","U+022F3" +"isinv;","U+02208" +"it;","U+02062" +"itilde;","U+00129" +"iukcy;","U+00456" +"iuml;","U+000EF" +"iuml","U+000EF" +"jcirc;","U+00135" +"jcy;","U+00439" +"jfr;","U+1D527" +"jmath;","U+00237" +"jopf;","U+1D55B" +"jscr;","U+1D4BF" +"jsercy;","U+00458" +"jukcy;","U+00454" +"kappa;","U+003BA" +"kappav;","U+003F0" +"kcedil;","U+00137" +"kcy;","U+0043A" +"kfr;","U+1D528" +"kgreen;","U+00138" +"khcy;","U+00445" +"kjcy;","U+0045C" +"kopf;","U+1D55C" +"kscr;","U+1D4C0" +"lAarr;","U+021DA" +"lArr;","U+021D0" +"lAtail;","U+0291B" +"lBarr;","U+0290E" +"lE;","U+02266" +"lEg;","U+02A8B" +"lHar;","U+02962" +"lacute;","U+0013A" +"laemptyv;","U+029B4" +"lagran;","U+02112" +"lambda;","U+003BB" +"lang;","U+027E8" +"langd;","U+02991" +"langle;","U+027E8" +"lap;","U+02A85" +"laquo;","U+000AB" +"laquo","U+000AB" +"larr;","U+02190" +"larrb;","U+021E4" +"larrbfs;","U+0291F" +"larrfs;","U+0291D" +"larrhk;","U+021A9" +"larrlp;","U+021AB" +"larrpl;","U+02939" +"larrsim;","U+02973" +"larrtl;","U+021A2" +"lat;","U+02AAB" +"latail;","U+02919" +"late;","U+02AAD" +"lbarr;","U+0290C" +"lbbrk;","U+02772" +"lbrace;","U+0007B" +"lbrack;","U+0005B" +"lbrke;","U+0298B" +"lbrksld;","U+0298F" +"lbrkslu;","U+0298D" +"lcaron;","U+0013E" +"lcedil;","U+0013C" +"lceil;","U+02308" +"lcub;","U+0007B" +"lcy;","U+0043B" +"ldca;","U+02936" +"ldquo;","U+0201C" +"ldquor;","U+0201E" +"ldrdhar;","U+02967" +"ldrushar;","U+0294B" +"ldsh;","U+021B2" +"le;","U+02264" +"leftarrow;","U+02190" +"leftarrowtail;","U+021A2" +"leftharpoondown;","U+021BD" +"leftharpoonup;","U+021BC" +"leftleftarrows;","U+021C7" +"leftrightarrow;","U+02194" +"leftrightarrows;","U+021C6" +"leftrightharpoons;","U+021CB" +"leftrightsquigarrow;","U+021AD" +"leftthreetimes;","U+022CB" +"leg;","U+022DA" +"leq;","U+02264" +"leqq;","U+02266" +"leqslant;","U+02A7D" +"les;","U+02A7D" +"lescc;","U+02AA8" +"lesdot;","U+02A7F" +"lesdoto;","U+02A81" +"lesdotor;","U+02A83" +"lesges;","U+02A93" +"lessapprox;","U+02A85" +"lessdot;","U+022D6" +"lesseqgtr;","U+022DA" +"lesseqqgtr;","U+02A8B" +"lessgtr;","U+02276" +"lesssim;","U+02272" +"lfisht;","U+0297C" +"lfloor;","U+0230A" +"lfr;","U+1D529" +"lg;","U+02276" +"lgE;","U+02A91" +"lhard;","U+021BD" +"lharu;","U+021BC" +"lharul;","U+0296A" +"lhblk;","U+02584" +"ljcy;","U+00459" +"ll;","U+0226A" +"llarr;","U+021C7" +"llcorner;","U+0231E" +"llhard;","U+0296B" +"lltri;","U+025FA" +"lmidot;","U+00140" +"lmoust;","U+023B0" +"lmoustache;","U+023B0" +"lnE;","U+02268" +"lnap;","U+02A89" +"lnapprox;","U+02A89" +"lne;","U+02A87" +"lneq;","U+02A87" +"lneqq;","U+02268" +"lnsim;","U+022E6" +"loang;","U+027EC" +"loarr;","U+021FD" +"lobrk;","U+027E6" +"longleftarrow;","U+027F5" +"longleftrightarrow;","U+027F7" +"longmapsto;","U+027FC" +"longrightarrow;","U+027F6" +"looparrowleft;","U+021AB" +"looparrowright;","U+021AC" +"lopar;","U+02985" +"lopf;","U+1D55D" +"loplus;","U+02A2D" +"lotimes;","U+02A34" +"lowast;","U+02217" +"lowbar;","U+0005F" +"loz;","U+025CA" +"lozenge;","U+025CA" +"lozf;","U+029EB" +"lpar;","U+00028" +"lparlt;","U+02993" +"lrarr;","U+021C6" +"lrcorner;","U+0231F" +"lrhar;","U+021CB" +"lrhard;","U+0296D" +"lrm;","U+0200E" +"lrtri;","U+022BF" +"lsaquo;","U+02039" +"lscr;","U+1D4C1" +"lsh;","U+021B0" +"lsim;","U+02272" +"lsime;","U+02A8D" +"lsimg;","U+02A8F" +"lsqb;","U+0005B" +"lsquo;","U+02018" +"lsquor;","U+0201A" +"lstrok;","U+00142" +"lt;","U+0003C" +"lt","U+0003C" +"ltcc;","U+02AA6" +"ltcir;","U+02A79" +"ltdot;","U+022D6" +"lthree;","U+022CB" +"ltimes;","U+022C9" +"ltlarr;","U+02976" +"ltquest;","U+02A7B" +"ltrPar;","U+02996" +"ltri;","U+025C3" +"ltrie;","U+022B4" +"ltrif;","U+025C2" +"lurdshar;","U+0294A" +"luruhar;","U+02966" +"mDDot;","U+0223A" +"macr;","U+000AF" +"macr","U+000AF" +"male;","U+02642" +"malt;","U+02720" +"maltese;","U+02720" +"map;","U+021A6" +"mapsto;","U+021A6" +"mapstodown;","U+021A7" +"mapstoleft;","U+021A4" +"mapstoup;","U+021A5" +"marker;","U+025AE" +"mcomma;","U+02A29" +"mcy;","U+0043C" +"mdash;","U+02014" +"measuredangle;","U+02221" +"mfr;","U+1D52A" +"mho;","U+02127" +"micro;","U+000B5" +"micro","U+000B5" +"mid;","U+02223" +"midast;","U+0002A" +"midcir;","U+02AF0" +"middot;","U+000B7" +"middot","U+000B7" +"minus;","U+02212" +"minusb;","U+0229F" +"minusd;","U+02238" +"minusdu;","U+02A2A" +"mlcp;","U+02ADB" +"mldr;","U+02026" +"mnplus;","U+02213" +"models;","U+022A7" +"mopf;","U+1D55E" +"mp;","U+02213" +"mscr;","U+1D4C2" +"mstpos;","U+0223E" +"mu;","U+003BC" +"multimap;","U+022B8" +"mumap;","U+022B8" +"nLeftarrow;","U+021CD" +"nLeftrightarrow;","U+021CE" +"nRightarrow;","U+021CF" +"nVDash;","U+022AF" +"nVdash;","U+022AE" +"nabla;","U+02207" +"nacute;","U+00144" +"nap;","U+02249" +"napos;","U+00149" +"napprox;","U+02249" +"natur;","U+0266E" +"natural;","U+0266E" +"naturals;","U+02115" +"nbsp;","U+000A0" +"nbsp","U+000A0" +"ncap;","U+02A43" +"ncaron;","U+00148" +"ncedil;","U+00146" +"ncong;","U+02247" +"ncup;","U+02A42" +"ncy;","U+0043D" +"ndash;","U+02013" +"ne;","U+02260" +"neArr;","U+021D7" +"nearhk;","U+02924" +"nearr;","U+02197" +"nearrow;","U+02197" +"nequiv;","U+02262" +"nesear;","U+02928" +"nexist;","U+02204" +"nexists;","U+02204" +"nfr;","U+1D52B" +"nge;","U+02271" +"ngeq;","U+02271" +"ngsim;","U+02275" +"ngt;","U+0226F" +"ngtr;","U+0226F" +"nhArr;","U+021CE" +"nharr;","U+021AE" +"nhpar;","U+02AF2" +"ni;","U+0220B" +"nis;","U+022FC" +"nisd;","U+022FA" +"niv;","U+0220B" +"njcy;","U+0045A" +"nlArr;","U+021CD" +"nlarr;","U+0219A" +"nldr;","U+02025" +"nle;","U+02270" +"nleftarrow;","U+0219A" +"nleftrightarrow;","U+021AE" +"nleq;","U+02270" +"nless;","U+0226E" +"nlsim;","U+02274" +"nlt;","U+0226E" +"nltri;","U+022EA" +"nltrie;","U+022EC" +"nmid;","U+02224" +"nopf;","U+1D55F" +"not;","U+000AC" +"not","U+000AC" +"notin;","U+02209" +"notinva;","U+02209" +"notinvb;","U+022F7" +"notinvc;","U+022F6" +"notni;","U+0220C" +"notniva;","U+0220C" +"notnivb;","U+022FE" +"notnivc;","U+022FD" +"npar;","U+02226" +"nparallel;","U+02226" +"npolint;","U+02A14" +"npr;","U+02280" +"nprcue;","U+022E0" +"nprec;","U+02280" +"nrArr;","U+021CF" +"nrarr;","U+0219B" +"nrightarrow;","U+0219B" +"nrtri;","U+022EB" +"nrtrie;","U+022ED" +"nsc;","U+02281" +"nsccue;","U+022E1" +"nscr;","U+1D4C3" +"nshortmid;","U+02224" +"nshortparallel;","U+02226" +"nsim;","U+02241" +"nsime;","U+02244" +"nsimeq;","U+02244" +"nsmid;","U+02224" +"nspar;","U+02226" +"nsqsube;","U+022E2" +"nsqsupe;","U+022E3" +"nsub;","U+02284" +"nsube;","U+02288" +"nsubseteq;","U+02288" +"nsucc;","U+02281" +"nsup;","U+02285" +"nsupe;","U+02289" +"nsupseteq;","U+02289" +"ntgl;","U+02279" +"ntilde;","U+000F1" +"ntilde","U+000F1" +"ntlg;","U+02278" +"ntriangleleft;","U+022EA" +"ntrianglelefteq;","U+022EC" +"ntriangleright;","U+022EB" +"ntrianglerighteq;","U+022ED" +"nu;","U+003BD" +"num;","U+00023" +"numero;","U+02116" +"numsp;","U+02007" +"nvDash;","U+022AD" +"nvHarr;","U+02904" +"nvdash;","U+022AC" +"nvinfin;","U+029DE" +"nvlArr;","U+02902" +"nvrArr;","U+02903" +"nwArr;","U+021D6" +"nwarhk;","U+02923" +"nwarr;","U+02196" +"nwarrow;","U+02196" +"nwnear;","U+02927" +"oS;","U+024C8" +"oacute;","U+000F3" +"oacute","U+000F3" +"oast;","U+0229B" +"ocir;","U+0229A" +"ocirc;","U+000F4" +"ocirc","U+000F4" +"ocy;","U+0043E" +"odash;","U+0229D" +"odblac;","U+00151" +"odiv;","U+02A38" +"odot;","U+02299" +"odsold;","U+029BC" +"oelig;","U+00153" +"ofcir;","U+029BF" +"ofr;","U+1D52C" +"ogon;","U+002DB" +"ograve;","U+000F2" +"ograve","U+000F2" +"ogt;","U+029C1" +"ohbar;","U+029B5" +"ohm;","U+003A9" +"oint;","U+0222E" +"olarr;","U+021BA" +"olcir;","U+029BE" +"olcross;","U+029BB" +"oline;","U+0203E" +"olt;","U+029C0" +"omacr;","U+0014D" +"omega;","U+003C9" +"omicron;","U+003BF" +"omid;","U+029B6" +"ominus;","U+02296" +"oopf;","U+1D560" +"opar;","U+029B7" +"operp;","U+029B9" +"oplus;","U+02295" +"or;","U+02228" +"orarr;","U+021BB" +"ord;","U+02A5D" +"order;","U+02134" +"orderof;","U+02134" +"ordf;","U+000AA" +"ordf","U+000AA" +"ordm;","U+000BA" +"ordm","U+000BA" +"origof;","U+022B6" +"oror;","U+02A56" +"orslope;","U+02A57" +"orv;","U+02A5B" +"oscr;","U+02134" +"oslash;","U+000F8" +"oslash","U+000F8" +"osol;","U+02298" +"otilde;","U+000F5" +"otilde","U+000F5" +"otimes;","U+02297" +"otimesas;","U+02A36" +"ouml;","U+000F6" +"ouml","U+000F6" +"ovbar;","U+0233D" +"par;","U+02225" +"para;","U+000B6" +"para","U+000B6" +"parallel;","U+02225" +"parsim;","U+02AF3" +"parsl;","U+02AFD" +"part;","U+02202" +"pcy;","U+0043F" +"percnt;","U+00025" +"period;","U+0002E" +"permil;","U+02030" +"perp;","U+022A5" +"pertenk;","U+02031" +"pfr;","U+1D52D" +"phi;","U+003C6" +"phiv;","U+003D5" +"phmmat;","U+02133" +"phone;","U+0260E" +"pi;","U+003C0" +"pitchfork;","U+022D4" +"piv;","U+003D6" +"planck;","U+0210F" +"planckh;","U+0210E" +"plankv;","U+0210F" +"plus;","U+0002B" +"plusacir;","U+02A23" +"plusb;","U+0229E" +"pluscir;","U+02A22" +"plusdo;","U+02214" +"plusdu;","U+02A25" +"pluse;","U+02A72" +"plusmn;","U+000B1" +"plusmn","U+000B1" +"plussim;","U+02A26" +"plustwo;","U+02A27" +"pm;","U+000B1" +"pointint;","U+02A15" +"popf;","U+1D561" +"pound;","U+000A3" +"pound","U+000A3" +"pr;","U+0227A" +"prE;","U+02AB3" +"prap;","U+02AB7" +"prcue;","U+0227C" +"pre;","U+02AAF" +"prec;","U+0227A" +"precapprox;","U+02AB7" +"preccurlyeq;","U+0227C" +"preceq;","U+02AAF" +"precnapprox;","U+02AB9" +"precneqq;","U+02AB5" +"precnsim;","U+022E8" +"precsim;","U+0227E" +"prime;","U+02032" +"primes;","U+02119" +"prnE;","U+02AB5" +"prnap;","U+02AB9" +"prnsim;","U+022E8" +"prod;","U+0220F" +"profalar;","U+0232E" +"profline;","U+02312" +"profsurf;","U+02313" +"prop;","U+0221D" +"propto;","U+0221D" +"prsim;","U+0227E" +"prurel;","U+022B0" +"pscr;","U+1D4C5" +"psi;","U+003C8" +"puncsp;","U+02008" +"qfr;","U+1D52E" +"qint;","U+02A0C" +"qopf;","U+1D562" +"qprime;","U+02057" +"qscr;","U+1D4C6" +"quaternions;","U+0210D" +"quatint;","U+02A16" +"quest;","U+0003F" +"questeq;","U+0225F" +"quot;","U+00022" +"quot","U+00022" +"rAarr;","U+021DB" +"rArr;","U+021D2" +"rAtail;","U+0291C" +"rBarr;","U+0290F" +"rHar;","U+02964" +"racute;","U+00155" +"radic;","U+0221A" +"raemptyv;","U+029B3" +"rang;","U+027E9" +"rangd;","U+02992" +"range;","U+029A5" +"rangle;","U+027E9" +"raquo;","U+000BB" +"raquo","U+000BB" +"rarr;","U+02192" +"rarrap;","U+02975" +"rarrb;","U+021E5" +"rarrbfs;","U+02920" +"rarrc;","U+02933" +"rarrfs;","U+0291E" +"rarrhk;","U+021AA" +"rarrlp;","U+021AC" +"rarrpl;","U+02945" +"rarrsim;","U+02974" +"rarrtl;","U+021A3" +"rarrw;","U+0219D" +"ratail;","U+0291A" +"ratio;","U+02236" +"rationals;","U+0211A" +"rbarr;","U+0290D" +"rbbrk;","U+02773" +"rbrace;","U+0007D" +"rbrack;","U+0005D" +"rbrke;","U+0298C" +"rbrksld;","U+0298E" +"rbrkslu;","U+02990" +"rcaron;","U+00159" +"rcedil;","U+00157" +"rceil;","U+02309" +"rcub;","U+0007D" +"rcy;","U+00440" +"rdca;","U+02937" +"rdldhar;","U+02969" +"rdquo;","U+0201D" +"rdquor;","U+0201D" +"rdsh;","U+021B3" +"real;","U+0211C" +"realine;","U+0211B" +"realpart;","U+0211C" +"reals;","U+0211D" +"rect;","U+025AD" +"reg;","U+000AE" +"reg","U+000AE" +"rfisht;","U+0297D" +"rfloor;","U+0230B" +"rfr;","U+1D52F" +"rhard;","U+021C1" +"rharu;","U+021C0" +"rharul;","U+0296C" +"rho;","U+003C1" +"rhov;","U+003F1" +"rightarrow;","U+02192" +"rightarrowtail;","U+021A3" +"rightharpoondown;","U+021C1" +"rightharpoonup;","U+021C0" +"rightleftarrows;","U+021C4" +"rightleftharpoons;","U+021CC" +"rightrightarrows;","U+021C9" +"rightsquigarrow;","U+0219D" +"rightthreetimes;","U+022CC" +"ring;","U+002DA" +"risingdotseq;","U+02253" +"rlarr;","U+021C4" +"rlhar;","U+021CC" +"rlm;","U+0200F" +"rmoust;","U+023B1" +"rmoustache;","U+023B1" +"rnmid;","U+02AEE" +"roang;","U+027ED" +"roarr;","U+021FE" +"robrk;","U+027E7" +"ropar;","U+02986" +"ropf;","U+1D563" +"roplus;","U+02A2E" +"rotimes;","U+02A35" +"rpar;","U+00029" +"rpargt;","U+02994" +"rppolint;","U+02A12" +"rrarr;","U+021C9" +"rsaquo;","U+0203A" +"rscr;","U+1D4C7" +"rsh;","U+021B1" +"rsqb;","U+0005D" +"rsquo;","U+02019" +"rsquor;","U+02019" +"rthree;","U+022CC" +"rtimes;","U+022CA" +"rtri;","U+025B9" +"rtrie;","U+022B5" +"rtrif;","U+025B8" +"rtriltri;","U+029CE" +"ruluhar;","U+02968" +"rx;","U+0211E" +"sacute;","U+0015B" +"sbquo;","U+0201A" +"sc;","U+0227B" +"scE;","U+02AB4" +"scap;","U+02AB8" +"scaron;","U+00161" +"sccue;","U+0227D" +"sce;","U+02AB0" +"scedil;","U+0015F" +"scirc;","U+0015D" +"scnE;","U+02AB6" +"scnap;","U+02ABA" +"scnsim;","U+022E9" +"scpolint;","U+02A13" +"scsim;","U+0227F" +"scy;","U+00441" +"sdot;","U+022C5" +"sdotb;","U+022A1" +"sdote;","U+02A66" +"seArr;","U+021D8" +"searhk;","U+02925" +"searr;","U+02198" +"searrow;","U+02198" +"sect;","U+000A7" +"sect","U+000A7" +"semi;","U+0003B" +"seswar;","U+02929" +"setminus;","U+02216" +"setmn;","U+02216" +"sext;","U+02736" +"sfr;","U+1D530" +"sfrown;","U+02322" +"sharp;","U+0266F" +"shchcy;","U+00449" +"shcy;","U+00448" +"shortmid;","U+02223" +"shortparallel;","U+02225" +"shy;","U+000AD " +"shy","U+000AD " +"sigma;","U+003C3" +"sigmaf;","U+003C2" +"sigmav;","U+003C2" +"sim;","U+0223C" +"simdot;","U+02A6A" +"sime;","U+02243" +"simeq;","U+02243" +"simg;","U+02A9E" +"simgE;","U+02AA0" +"siml;","U+02A9D" +"simlE;","U+02A9F" +"simne;","U+02246" +"simplus;","U+02A24" +"simrarr;","U+02972" +"slarr;","U+02190" +"smallsetminus;","U+02216" +"smashp;","U+02A33" +"smeparsl;","U+029E4" +"smid;","U+02223" +"smile;","U+02323" +"smt;","U+02AAA" +"smte;","U+02AAC" +"softcy;","U+0044C" +"sol;","U+0002F" +"solb;","U+029C4" +"solbar;","U+0233F" +"sopf;","U+1D564" +"spades;","U+02660" +"spadesuit;","U+02660" +"spar;","U+02225" +"sqcap;","U+02293" +"sqcup;","U+02294" +"sqsub;","U+0228F" +"sqsube;","U+02291" +"sqsubset;","U+0228F" +"sqsubseteq;","U+02291" +"sqsup;","U+02290" +"sqsupe;","U+02292" +"sqsupset;","U+02290" +"sqsupseteq;","U+02292" +"squ;","U+025A1" +"square;","U+025A1" +"squarf;","U+025AA" +"squf;","U+025AA" +"srarr;","U+02192" +"sscr;","U+1D4C8" +"ssetmn;","U+02216" +"ssmile;","U+02323" +"sstarf;","U+022C6" +"star;","U+02606" +"starf;","U+02605" +"straightepsilon;","U+003F5" +"straightphi;","U+003D5" +"strns;","U+000AF" +"sub;","U+02282" +"subE;","U+02AC5" +"subdot;","U+02ABD" +"sube;","U+02286" +"subedot;","U+02AC3" +"submult;","U+02AC1" +"subnE;","U+02ACB" +"subne;","U+0228A" +"subplus;","U+02ABF" +"subrarr;","U+02979" +"subset;","U+02282" +"subseteq;","U+02286" +"subseteqq;","U+02AC5" +"subsetneq;","U+0228A" +"subsetneqq;","U+02ACB" +"subsim;","U+02AC7" +"subsub;","U+02AD5" +"subsup;","U+02AD3" +"succ;","U+0227B" +"succapprox;","U+02AB8" +"succcurlyeq;","U+0227D" +"succeq;","U+02AB0" +"succnapprox;","U+02ABA" +"succneqq;","U+02AB6" +"succnsim;","U+022E9" +"succsim;","U+0227F" +"sum;","U+02211" +"sung;","U+0266A" +"sup1;","U+000B9" +"sup1","U+000B9" +"sup2;","U+000B2" +"sup2","U+000B2" +"sup3;","U+000B3" +"sup3","U+000B3" +"sup;","U+02283" +"supE;","U+02AC6" +"supdot;","U+02ABE" +"supdsub;","U+02AD8" +"supe;","U+02287" +"supedot;","U+02AC4" +"suphsol;","U+027C9" +"suphsub;","U+02AD7" +"suplarr;","U+0297B" +"supmult;","U+02AC2" +"supnE;","U+02ACC" +"supne;","U+0228B" +"supplus;","U+02AC0" +"supset;","U+02283" +"supseteq;","U+02287" +"supseteqq;","U+02AC6" +"supsetneq;","U+0228B" +"supsetneqq;","U+02ACC" +"supsim;","U+02AC8" +"supsub;","U+02AD4" +"supsup;","U+02AD6" +"swArr;","U+021D9" +"swarhk;","U+02926" +"swarr;","U+02199" +"swarrow;","U+02199" +"swnwar;","U+0292A" +"szlig;","U+000DF" +"szlig","U+000DF" +"target;","U+02316" +"tau;","U+003C4" +"tbrk;","U+023B4" +"tcaron;","U+00165" +"tcedil;","U+00163" +"tcy;","U+00442" +"tdot;","U+020DB" +"telrec;","U+02315" +"tfr;","U+1D531" +"there4;","U+02234" +"therefore;","U+02234" +"theta;","U+003B8" +"thetasym;","U+003D1" +"thetav;","U+003D1" +"thickapprox;","U+02248" +"thicksim;","U+0223C" +"thinsp;","U+02009" +"thkap;","U+02248" +"thksim;","U+0223C" +"thorn;","U+000FE" +"thorn","U+000FE" +"tilde;","U+002DC" +"times;","U+000D7" +"times","U+000D7" +"timesb;","U+022A0" +"timesbar;","U+02A31" +"timesd;","U+02A30" +"tint;","U+0222D" +"toea;","U+02928" +"top;","U+022A4" +"topbot;","U+02336" +"topcir;","U+02AF1" +"topf;","U+1D565" +"topfork;","U+02ADA" +"tosa;","U+02929" +"tprime;","U+02034" +"trade;","U+02122" +"triangle;","U+025B5" +"triangledown;","U+025BF" +"triangleleft;","U+025C3" +"trianglelefteq;","U+022B4" +"triangleq;","U+0225C" +"triangleright;","U+025B9" +"trianglerighteq;","U+022B5" +"tridot;","U+025EC" +"trie;","U+0225C" +"triminus;","U+02A3A" +"triplus;","U+02A39" +"trisb;","U+029CD" +"tritime;","U+02A3B" +"trpezium;","U+023E2" +"tscr;","U+1D4C9" +"tscy;","U+00446" +"tshcy;","U+0045B" +"tstrok;","U+00167" +"twixt;","U+0226C" +"twoheadleftarrow;","U+0219E" +"twoheadrightarrow;","U+021A0" +"uArr;","U+021D1" +"uHar;","U+02963" +"uacute;","U+000FA" +"uacute","U+000FA" +"uarr;","U+02191" +"ubrcy;","U+0045E" +"ubreve;","U+0016D" +"ucirc;","U+000FB" +"ucirc","U+000FB" +"ucy;","U+00443" +"udarr;","U+021C5" +"udblac;","U+00171" +"udhar;","U+0296E" +"ufisht;","U+0297E" +"ufr;","U+1D532" +"ugrave;","U+000F9" +"ugrave","U+000F9" +"uharl;","U+021BF" +"uharr;","U+021BE" +"uhblk;","U+02580" +"ulcorn;","U+0231C" +"ulcorner;","U+0231C" +"ulcrop;","U+0230F" +"ultri;","U+025F8" +"umacr;","U+0016B" +"uml;","U+000A8" +"uml","U+000A8" +"uogon;","U+00173" +"uopf;","U+1D566" +"uparrow;","U+02191" +"updownarrow;","U+02195" +"upharpoonleft;","U+021BF" +"upharpoonright;","U+021BE" +"uplus;","U+0228E" +"upsi;","U+003C5" +"upsih;","U+003D2" +"upsilon;","U+003C5" +"upuparrows;","U+021C8" +"urcorn;","U+0231D" +"urcorner;","U+0231D" +"urcrop;","U+0230E" +"uring;","U+0016F" +"urtri;","U+025F9" +"uscr;","U+1D4CA" +"utdot;","U+022F0" +"utilde;","U+00169" +"utri;","U+025B5" +"utrif;","U+025B4" +"uuarr;","U+021C8" +"uuml;","U+000FC" +"uuml","U+000FC" +"uwangle;","U+029A7" +"vArr;","U+021D5" +"vBar;","U+02AE8" +"vBarv;","U+02AE9" +"vDash;","U+022A8" +"vangrt;","U+0299C" +"varepsilon;","U+003F5" +"varkappa;","U+003F0" +"varnothing;","U+02205" +"varphi;","U+003D5" +"varpi;","U+003D6" +"varpropto;","U+0221D" +"varr;","U+02195" +"varrho;","U+003F1" +"varsigma;","U+003C2" +"vartheta;","U+003D1" +"vartriangleleft;","U+022B2" +"vartriangleright;","U+022B3" +"vcy;","U+00432" +"vdash;","U+022A2" +"vee;","U+02228" +"veebar;","U+022BB" +"veeeq;","U+0225A" +"vellip;","U+022EE" +"verbar;","U+0007C" +"vert;","U+0007C" +"vfr;","U+1D533" +"vltri;","U+022B2" +"vopf;","U+1D567" +"vprop;","U+0221D" +"vrtri;","U+022B3" +"vscr;","U+1D4CB" +"vzigzag;","U+0299A" +"wcirc;","U+00175" +"wedbar;","U+02A5F" +"wedge;","U+02227" +"wedgeq;","U+02259" +"weierp;","U+02118" +"wfr;","U+1D534" +"wopf;","U+1D568" +"wp;","U+02118" +"wr;","U+02240" +"wreath;","U+02240" +"wscr;","U+1D4CC" +"xcap;","U+022C2" +"xcirc;","U+025EF" +"xcup;","U+022C3" +"xdtri;","U+025BD" +"xfr;","U+1D535" +"xhArr;","U+027FA" +"xharr;","U+027F7" +"xi;","U+003BE" +"xlArr;","U+027F8" +"xlarr;","U+027F5" +"xmap;","U+027FC" +"xnis;","U+022FB" +"xodot;","U+02A00" +"xopf;","U+1D569" +"xoplus;","U+02A01" +"xotime;","U+02A02" +"xrArr;","U+027F9" +"xrarr;","U+027F6" +"xscr;","U+1D4CD" +"xsqcup;","U+02A06" +"xuplus;","U+02A04" +"xutri;","U+025B3" +"xvee;","U+022C1" +"xwedge;","U+022C0" +"yacute;","U+000FD" +"yacute","U+000FD" +"yacy;","U+0044F" +"ycirc;","U+00177" +"ycy;","U+0044B" +"yen;","U+000A5" +"yen","U+000A5" +"yfr;","U+1D536" +"yicy;","U+00457" +"yopf;","U+1D56A" +"yscr;","U+1D4CE" +"yucy;","U+0044E" +"yuml;","U+000FF" +"yuml","U+000FF" +"zacute;","U+0017A" +"zcaron;","U+0017E" +"zcy;","U+00437" +"zdot;","U+0017C" +"zeetrf;","U+02128" +"zeta;","U+003B6" +"zfr;","U+1D537" +"zhcy;","U+00436" +"zigrarr;","U+021DD" +"zopf;","U+1D56B" +"zscr;","U+1D4CF" +"zwj;","U+0200D" +"zwnj;","U+0200C" diff --git a/WebCore/html/HTMLEntityParser.cpp b/WebCore/html/parser/HTMLEntityParser.cpp index f675844..6a422b8 100644 --- a/WebCore/html/HTMLEntityParser.cpp +++ b/WebCore/html/parser/HTMLEntityParser.cpp @@ -45,23 +45,36 @@ static const UChar windowsLatin1ExtensionArray[32] = { 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x009D, 0x017E, 0x0178, // 98-9F }; -inline UChar adjustEntity(unsigned value) +inline UChar adjustEntity(UChar32 value) { if ((value & ~0x1F) != 0x0080) return value; return windowsLatin1ExtensionArray[value - 0x80]; } -inline unsigned legalEntityFor(unsigned value) +inline UChar32 legalEntityFor(UChar32 value) { // FIXME: A number of specific entity values generate parse errors. if (value == 0 || value > 0x10FFFF || (value >= 0xD800 && value <= 0xDFFF)) return 0xFFFD; - if (value < 0xFFFF) + if (U_IS_BMP(value)) return adjustEntity(value); return value; } +inline bool convertToUTF16(UChar32 value, Vector<UChar, 16>& decodedEntity) +{ + if (U_IS_BMP(value)) { + UChar character = static_cast<UChar>(value); + ASSERT(character == value); + decodedEntity.append(character); + return true; + } + decodedEntity.append(U16_LEAD(value)); + decodedEntity.append(U16_TRAIL(value)); + return true; +} + inline bool isHexDigit(UChar cc) { return (cc >= '0' && cc <= '9') || (cc >= 'a' && cc <= 'f') || (cc >= 'A' && cc <= 'F'); @@ -85,14 +98,15 @@ void unconsumeCharacters(SegmentedString& source, const Vector<UChar, 10>& consu } -unsigned consumeHTMLEntity(SegmentedString& source, bool& notEnoughCharacters, UChar additionalAllowedCharacter) +bool consumeHTMLEntity(SegmentedString& source, Vector<UChar, 16>& decodedEntity, bool& notEnoughCharacters, UChar additionalAllowedCharacter) { ASSERT(!additionalAllowedCharacter || additionalAllowedCharacter == '"' || additionalAllowedCharacter == '\'' || additionalAllowedCharacter == '>'); ASSERT(!notEnoughCharacters); + ASSERT(decodedEntity.isEmpty()); enum EntityState { Initial, - NumberType, + Number, MaybeHexLowerCaseX, MaybeHexUpperCaseX, Hex, @@ -100,7 +114,7 @@ unsigned consumeHTMLEntity(SegmentedString& source, bool& notEnoughCharacters, U Named }; EntityState entityState = Initial; - unsigned result = 0; + UChar32 result = 0; Vector<UChar, 10> consumedCharacters; while (!source.isEmpty()) { @@ -108,20 +122,20 @@ unsigned consumeHTMLEntity(SegmentedString& source, bool& notEnoughCharacters, U switch (entityState) { case Initial: { if (cc == '\x09' || cc == '\x0A' || cc == '\x0C' || cc == ' ' || cc == '<' || cc == '&') - return 0; + return false; if (additionalAllowedCharacter && cc == additionalAllowedCharacter) - return 0; + return false; if (cc == '#') { - entityState = NumberType; + entityState = Number; break; } if ((cc >= 'a' && cc <= 'z') || (cc >= 'A' && cc <= 'Z')) { entityState = Named; continue; } - return 0; + return false; } - case NumberType: { + case Number: { if (cc == 'x') { entityState = MaybeHexLowerCaseX; break; @@ -135,7 +149,7 @@ unsigned consumeHTMLEntity(SegmentedString& source, bool& notEnoughCharacters, U continue; } source.push('#'); - return 0; + return false; } case MaybeHexLowerCaseX: { if (isHexDigit(cc)) { @@ -144,7 +158,7 @@ unsigned consumeHTMLEntity(SegmentedString& source, bool& notEnoughCharacters, U } source.push('#'); source.push('x'); - return 0; + return false; } case MaybeHexUpperCaseX: { if (isHexDigit(cc)) { @@ -153,7 +167,7 @@ unsigned consumeHTMLEntity(SegmentedString& source, bool& notEnoughCharacters, U } source.push('#'); source.push('X'); - return 0; + return false; } case Hex: { if (cc >= '0' && cc <= '9') @@ -162,21 +176,21 @@ unsigned consumeHTMLEntity(SegmentedString& source, bool& notEnoughCharacters, U result = result * 16 + 10 + cc - 'a'; else if (cc >= 'A' && cc <= 'F') result = result * 16 + 10 + cc - 'A'; - else if (cc == ';') { - source.advancePastNonNewline(); - return legalEntityFor(result); - } else - return legalEntityFor(result); + else { + if (cc == ';') + source.advanceAndASSERT(cc); + return convertToUTF16(legalEntityFor(result), decodedEntity); + } break; } case Decimal: { if (cc >= '0' && cc <= '9') result = result * 10 + cc - '0'; - else if (cc == ';') { - source.advancePastNonNewline(); - return legalEntityFor(result); - } else - return legalEntityFor(result); + else { + if (cc == ';') + source.advanceAndASSERT(cc); + return convertToUTF16(legalEntityFor(result), decodedEntity); + } break; } case Named: { @@ -194,12 +208,12 @@ unsigned consumeHTMLEntity(SegmentedString& source, bool& notEnoughCharacters, U // We can't an entity because there might be a longer entity // that we could match if we had more data. unconsumeCharacters(source, consumedCharacters); - return 0; + return false; } if (!entitySearch.mostRecentMatch()) { ASSERT(!entitySearch.currentValue()); unconsumeCharacters(source, consumedCharacters); - return 0; + return false; } if (entitySearch.mostRecentMatch()->length != entitySearch.currentLength()) { // We've consumed too many characters. We need to walk the @@ -218,12 +232,13 @@ unsigned consumeHTMLEntity(SegmentedString& source, bool& notEnoughCharacters, U } cc = *source; } - if (entitySearch.mostRecentMatch()->lastCharacter() == ';') - return entitySearch.mostRecentMatch()->value; - if (!additionalAllowedCharacter || !(isAlphaNumeric(cc) || cc == '=')) - return entitySearch.mostRecentMatch()->value; + if (entitySearch.mostRecentMatch()->lastCharacter() == ';' + || !additionalAllowedCharacter + || !(isAlphaNumeric(cc) || cc == '=')) { + return convertToUTF16(entitySearch.mostRecentMatch()->value, decodedEntity); + } unconsumeCharacters(source, consumedCharacters); - return 0; + return false; } } consumedCharacters.append(cc); @@ -232,7 +247,7 @@ unsigned consumeHTMLEntity(SegmentedString& source, bool& notEnoughCharacters, U ASSERT(source.isEmpty()); notEnoughCharacters = true; unconsumeCharacters(source, consumedCharacters); - return 0; + return false; } UChar decodeNamedEntity(const char* name) diff --git a/WebCore/html/HTMLEntityParser.h b/WebCore/html/parser/HTMLEntityParser.h index 1059b24..f02e849 100644 --- a/WebCore/html/HTMLEntityParser.h +++ b/WebCore/html/parser/HTMLEntityParser.h @@ -31,7 +31,7 @@ namespace WebCore { -unsigned consumeHTMLEntity(SegmentedString&, bool& notEnoughCharacters, UChar additionalAllowedCharacter = '\0'); +bool consumeHTMLEntity(SegmentedString&, Vector<UChar, 16>& decodedEntity, bool& notEnoughCharacters, UChar additionalAllowedCharacter = '\0'); // Used by the XML parser. Not suitable for use in HTML parsing. Use consumeHTMLEntity instead. UChar decodeNamedEntity(const char*); diff --git a/WebCore/html/HTMLEntitySearch.cpp b/WebCore/html/parser/HTMLEntitySearch.cpp index 580609e..580609e 100644 --- a/WebCore/html/HTMLEntitySearch.cpp +++ b/WebCore/html/parser/HTMLEntitySearch.cpp diff --git a/WebCore/html/HTMLEntitySearch.h b/WebCore/html/parser/HTMLEntitySearch.h index 11a23ae..0c66318 100644 --- a/WebCore/html/HTMLEntitySearch.h +++ b/WebCore/html/parser/HTMLEntitySearch.h @@ -39,7 +39,7 @@ public: void advance(UChar); bool isEntityPrefix() const { return !!m_first; } - int currentValue() const { return m_currentValue; } + UChar32 currentValue() const { return m_currentValue; } int currentLength() const { return m_currentLength; } const HTMLEntityTableEntry* mostRecentMatch() const { return m_mostRecentMatch; } @@ -63,7 +63,7 @@ private: } int m_currentLength; - int m_currentValue; + UChar32 m_currentValue; const HTMLEntityTableEntry* m_mostRecentMatch; const HTMLEntityTableEntry* m_first; diff --git a/WebCore/html/HTMLEntityTable.h b/WebCore/html/parser/HTMLEntityTable.h index 3734c34..3b9ab4e 100644 --- a/WebCore/html/HTMLEntityTable.h +++ b/WebCore/html/parser/HTMLEntityTable.h @@ -35,7 +35,7 @@ struct HTMLEntityTableEntry { const UChar* entity; int length; - int value; + UChar32 value; }; class HTMLEntityTable { diff --git a/WebCore/html/HTMLFormattingElementList.cpp b/WebCore/html/parser/HTMLFormattingElementList.cpp index 22bf03e..22bf03e 100644 --- a/WebCore/html/HTMLFormattingElementList.cpp +++ b/WebCore/html/parser/HTMLFormattingElementList.cpp diff --git a/WebCore/html/HTMLFormattingElementList.h b/WebCore/html/parser/HTMLFormattingElementList.h index aca05bb..aca05bb 100644 --- a/WebCore/html/HTMLFormattingElementList.h +++ b/WebCore/html/parser/HTMLFormattingElementList.h diff --git a/WebCore/html/HTMLParserScheduler.cpp b/WebCore/html/parser/HTMLParserScheduler.cpp index 6e67697..6e67697 100644 --- a/WebCore/html/HTMLParserScheduler.cpp +++ b/WebCore/html/parser/HTMLParserScheduler.cpp diff --git a/WebCore/html/HTMLParserScheduler.h b/WebCore/html/parser/HTMLParserScheduler.h index 5be33b0..5be33b0 100644 --- a/WebCore/html/HTMLParserScheduler.h +++ b/WebCore/html/parser/HTMLParserScheduler.h diff --git a/WebCore/html/HTMLPreloadScanner.cpp b/WebCore/html/parser/HTMLPreloadScanner.cpp index 7aafd90..7aafd90 100644 --- a/WebCore/html/HTMLPreloadScanner.cpp +++ b/WebCore/html/parser/HTMLPreloadScanner.cpp diff --git a/WebCore/html/HTMLPreloadScanner.h b/WebCore/html/parser/HTMLPreloadScanner.h index 94a90e6..94a90e6 100644 --- a/WebCore/html/HTMLPreloadScanner.h +++ b/WebCore/html/parser/HTMLPreloadScanner.h diff --git a/WebCore/html/HTMLScriptRunner.cpp b/WebCore/html/parser/HTMLScriptRunner.cpp index 6d470a0..6d470a0 100644 --- a/WebCore/html/HTMLScriptRunner.cpp +++ b/WebCore/html/parser/HTMLScriptRunner.cpp diff --git a/WebCore/html/HTMLScriptRunner.h b/WebCore/html/parser/HTMLScriptRunner.h index ead9289..ead9289 100644 --- a/WebCore/html/HTMLScriptRunner.h +++ b/WebCore/html/parser/HTMLScriptRunner.h diff --git a/WebCore/html/HTMLScriptRunnerHost.h b/WebCore/html/parser/HTMLScriptRunnerHost.h index 5b40a931..5b40a931 100644 --- a/WebCore/html/HTMLScriptRunnerHost.h +++ b/WebCore/html/parser/HTMLScriptRunnerHost.h diff --git a/WebCore/html/HTMLToken.h b/WebCore/html/parser/HTMLToken.h index 42cddb8..42cddb8 100644 --- a/WebCore/html/HTMLToken.h +++ b/WebCore/html/parser/HTMLToken.h diff --git a/WebCore/html/HTMLTokenizer.cpp b/WebCore/html/parser/HTMLTokenizer.cpp index a18701a..5791842 100644 --- a/WebCore/html/HTMLTokenizer.cpp +++ b/WebCore/html/parser/HTMLTokenizer.cpp @@ -67,6 +67,12 @@ inline void advanceStringAndASSERTIgnoringCase(SegmentedString& source, const ch source.advanceAndASSERTIgnoringCase(*expectedCharacters++); } +inline void advanceStringAndASSERT(SegmentedString& source, const char* expectedCharacters) +{ + while (*expectedCharacters) + source.advanceAndASSERT(*expectedCharacters++); +} + inline bool vectorEqualsString(const Vector<UChar, 32>& vector, const String& string) { if (vector.size() != string.length()) @@ -113,19 +119,25 @@ void HTMLTokenizer::reset() m_lineNumber = 0; m_skipLeadingNewLineForListing = false; m_forceNullCharacterReplacement = false; + m_shouldAllowCDATA = false; m_additionalAllowedCharacter = '\0'; } inline bool HTMLTokenizer::processEntity(SegmentedString& source) { bool notEnoughCharacters = false; - unsigned value = consumeHTMLEntity(source, notEnoughCharacters); + Vector<UChar, 16> decodedEntity; + bool success = consumeHTMLEntity(source, decodedEntity, notEnoughCharacters); if (notEnoughCharacters) return false; - if (!value) + if (!success) { + ASSERT(decodedEntity.isEmpty()); bufferCharacter('&'); - else - bufferCodePoint(value); + } else { + Vector<UChar>::const_iterator iter = decodedEntity.begin(); + for (; iter != decodedEntity.end(); ++iter) + bufferCharacter(*iter); + } return true; } @@ -1027,16 +1039,17 @@ bool HTMLTokenizer::nextToken(SegmentedString& source, HTMLToken& token) BEGIN_STATE(CharacterReferenceInAttributeValueState) { bool notEnoughCharacters = false; - unsigned value = consumeHTMLEntity(source, notEnoughCharacters, m_additionalAllowedCharacter); + Vector<UChar, 16> decodedEntity; + bool success = consumeHTMLEntity(source, decodedEntity, notEnoughCharacters, m_additionalAllowedCharacter); if (notEnoughCharacters) return haveBufferedCharacterToken(); - if (!value) + if (!success) { + ASSERT(decodedEntity.isEmpty()); m_token->appendToAttributeValue('&'); - else if (value < 0xFFFF) - m_token->appendToAttributeValue(value); - else { - m_token->appendToAttributeValue(U16_LEAD(value)); - m_token->appendToAttributeValue(U16_TRAIL(value)); + } else { + Vector<UChar>::const_iterator iter = decodedEntity.begin(); + for (; iter != decodedEntity.end(); ++iter) + 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 @@ -1105,6 +1118,7 @@ bool HTMLTokenizer::nextToken(SegmentedString& source, HTMLToken& token) BEGIN_STATE(MarkupDeclarationOpenState) { DEFINE_STATIC_LOCAL(String, dashDashString, ("--")); DEFINE_STATIC_LOCAL(String, doctypeString, ("doctype")); + DEFINE_STATIC_LOCAL(String, cdataString, ("[CDATA[")); if (cc == '-') { SegmentedString::LookAheadResult result = source.lookAhead(dashDashString); if (result == SegmentedString::DidMatch) { @@ -1121,10 +1135,14 @@ bool HTMLTokenizer::nextToken(SegmentedString& source, HTMLToken& token) SWITCH_TO(DOCTYPEState); } else if (result == SegmentedString::NotEnoughCharacters) return haveBufferedCharacterToken(); + } else if (cc == '[' && shouldAllowCDATA()) { + SegmentedString::LookAheadResult result = source.lookAhead(cdataString); + if (result == SegmentedString::DidMatch) { + advanceStringAndASSERT(source, "[CDATA["); + SWITCH_TO(CDATASectionState); + } else if (result == SegmentedString::NotEnoughCharacters) + return haveBufferedCharacterToken(); } - notImplemented(); - // FIXME: We're still missing the bits about the insertion mode being in foreign content: - // http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#markup-declaration-open-state parseError(); RECONSUME_IN(BogusCommentState); } @@ -1599,9 +1617,34 @@ bool HTMLTokenizer::nextToken(SegmentedString& source, HTMLToken& token) END_STATE() BEGIN_STATE(CDATASectionState) { - notImplemented(); - ADVANCE_TO(CDATASectionState); - // FIXME: Handle EOF properly. + if (cc == ']') + ADVANCE_TO(CDATASectionRightSquareBracketState); + else if (cc == InputStreamPreprocessor::endOfFileMarker) + RECONSUME_IN(DataState); + else { + bufferCharacter(cc); + ADVANCE_TO(CDATASectionState); + } + } + END_STATE() + + BEGIN_STATE(CDATASectionRightSquareBracketState) { + if (cc == ']') + ADVANCE_TO(CDATASectionDoubleRightSquareBracketState); + else { + bufferCharacter(']'); + RECONSUME_IN(CDATASectionState); + } + } + + BEGIN_STATE(CDATASectionDoubleRightSquareBracketState) { + if (cc == '>') + ADVANCE_TO(DataState); + else { + bufferCharacter(']'); + bufferCharacter(']'); + RECONSUME_IN(CDATASectionState); + } } END_STATE() @@ -1634,16 +1677,6 @@ inline void HTMLTokenizer::bufferCharacter(UChar character) m_token->appendToCharacter(character); } -inline void HTMLTokenizer::bufferCodePoint(unsigned value) -{ - if (value < 0xFFFF) { - bufferCharacter(value); - return; - } - bufferCharacter(U16_LEAD(value)); - bufferCharacter(U16_TRAIL(value)); -} - inline void HTMLTokenizer::parseError() { notImplemented(); diff --git a/WebCore/html/HTMLTokenizer.h b/WebCore/html/parser/HTMLTokenizer.h index 2b93e15..bab77f3 100644 --- a/WebCore/html/HTMLTokenizer.h +++ b/WebCore/html/parser/HTMLTokenizer.h @@ -114,6 +114,9 @@ public: AfterDOCTYPESystemIdentifierState, BogusDOCTYPEState, CDATASectionState, + // These CDATA states are not in the HTML5 spec, but we use them internally. + CDATASectionRightSquareBracketState, + CDATASectionDoubleRightSquareBracketState, }; static PassOwnPtr<HTMLTokenizer> create() { return adoptPtr(new HTMLTokenizer); } @@ -139,6 +142,9 @@ public: bool forceNullCharacterReplacement() const { return m_forceNullCharacterReplacement; } void setForceNullCharacterReplacement(bool value) { m_forceNullCharacterReplacement = value; } + bool shouldAllowCDATA() const { return m_shouldAllowCDATA; } + void setShouldAllowCDATA(bool value) { m_shouldAllowCDATA = value; } + bool shouldSkipNullCharacters() const { return !m_forceNullCharacterReplacement @@ -270,6 +276,7 @@ private: bool m_skipLeadingNewLineForListing; bool m_forceNullCharacterReplacement; + bool m_shouldAllowCDATA; // http://www.whatwg.org/specs/web-apps/current-work/#temporary-buffer Vector<UChar, 32> m_temporaryBuffer; diff --git a/WebCore/html/HTMLTreeBuilder.cpp b/WebCore/html/parser/HTMLTreeBuilder.cpp index 24eb62f..8c76fc0 100644 --- a/WebCore/html/HTMLTreeBuilder.cpp +++ b/WebCore/html/parser/HTMLTreeBuilder.cpp @@ -200,20 +200,6 @@ bool isSpecialNode(Node* node) || tagName == xmpTag; } -// http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#scoping -// and isScopeMarker in HTMLElementStack.cpp -bool isScopingTag(const AtomicString& tagName) -{ - return tagName == appletTag - || tagName == captionTag - || tagName == SVGNames::foreignObjectTag - || tagName == htmlTag - || tagName == marqueeTag - || tagName == objectTag - || tagName == tableTag - || isTableCellContextTag(tagName); -} - bool isNonAnchorNonNobrFormattingTag(const AtomicString& tagName) { return tagName == bTag @@ -255,16 +241,6 @@ HTMLFormElement* closestFormAncestor(Element* element) return 0; } -// FIXME: This belongs on ContainerNode, where it could avoid the double ref -// by directly releasing into the Vector. Such an implementation would need to -// be careful not to send mutation events. -void takeChildrenFromNode(ContainerNode* container, Vector<RefPtr<Node> >& children) -{ - for (Node* child = container->firstChild(); child; child = child->nextSibling()) - children.append(child); - container->removeAllChildren(); -} - } // namespace class HTMLTreeBuilder::ExternalCharacterTokenBuffer : public Noncopyable { @@ -397,7 +373,7 @@ HTMLTreeBuilder::HTMLTreeBuilder(HTMLTokenizer* tokenizer, DocumentFragment* fra if (contextElement) { // Steps 4.2-4.6 of the HTML5 Fragment Case parsing algorithm: // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html#fragment-case - m_document->setParseMode(contextElement->document()->parseMode()); + m_document->setCompatibilityMode(contextElement->document()->compatibilityMode()); processFakeStartTag(htmlTag); resetInsertionModeAppropriately(); m_tree.setForm(closestFormAncestor(contextElement)); @@ -431,6 +407,7 @@ HTMLTreeBuilder::FragmentParsingContext::FragmentParsingContext(DocumentFragment , m_contextElement(contextElement) , m_scriptingPermission(scriptingPermission) { + m_dummyDocumentForFragmentParsing->setCompatibilityMode(fragment->document()->compatibilityMode()); } Document* HTMLTreeBuilder::FragmentParsingContext::document() const @@ -445,15 +422,7 @@ void HTMLTreeBuilder::FragmentParsingContext::finished() ContainerNode* root = m_dummyDocumentForFragmentParsing.get(); if (m_contextElement) root = m_dummyDocumentForFragmentParsing->documentElement(); - Vector<RefPtr<Node> > children; - takeChildrenFromNode(root, children); - for (unsigned i = 0; i < children.size(); ++i) { - ExceptionCode ec = 0; - // FIXME: We need a parser-safe (no events) version of adoptNode. - RefPtr<Node> child = m_fragment->document()->adoptNode(children[i].release(), ec); - ASSERT(!ec); - m_fragment->parserAddChild(child.release()); - } + m_fragment->takeAllChildrenFrom(root); } HTMLTreeBuilder::FragmentParsingContext::~FragmentParsingContext() @@ -500,6 +469,7 @@ void HTMLTreeBuilder::constructTreeFromToken(HTMLToken& rawToken) // the U+0000 characters into replacement characters has compatibility // problems. m_tokenizer->setForceNullCharacterReplacement(m_insertionMode == TextMode || m_insertionMode == InForeignContentMode); + m_tokenizer->setShouldAllowCDATA(m_insertionMode == InForeignContentMode && m_tree.currentElement()->namespaceURI() != xhtmlNamespaceURI); } void HTMLTreeBuilder::processToken(AtomicHTMLToken& token) @@ -534,6 +504,7 @@ void HTMLTreeBuilder::processDoctypeToken(AtomicHTMLToken& token) ASSERT(token.type() == HTMLToken::DOCTYPE); if (m_insertionMode == InitialMode) { m_tree.insertDoctype(token); + setInsertionMode(BeforeHTMLMode); return; } if (m_insertionMode == InTableTextMode) { @@ -666,11 +637,6 @@ void mapLoweredLocalNameToName(PrefixedNameToQualifiedNameMap* map, QualifiedNam } } -void addName(PrefixedNameToQualifiedNameMap* map, const QualifiedName& name) -{ - map->add(name.localName().lower(), name); -} - void adjustSVGTagNameCase(AtomicHTMLToken& token) { static PrefixedNameToQualifiedNameMap* caseMap = 0; @@ -923,7 +889,7 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken& token) return; } if (token.name() == tableTag) { - if (m_document->parseMode() != Document::Compat && m_tree.openElements()->inButtonScope(pTag)) + if (!m_document->inQuirksMode() && m_tree.openElements()->inButtonScope(pTag)) processFakeEndTag(pTag); m_tree.insertHTMLElement(token); m_framesetOk = false; @@ -1152,7 +1118,7 @@ void HTMLTreeBuilder::processStartTagForInTable(AtomicHTMLToken& token) return; // FIXME: This deviates from the spec: // http://www.w3.org/Bugs/Public/show_bug.cgi?id=10216 - m_tree.insertHTMLFormElement(token); + m_tree.insertHTMLFormElement(token, true); m_tree.openElements()->pop(); return; } @@ -1486,7 +1452,10 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token) || token.name() == keygenTag || token.name() == textareaTag) { parseError(token); - notImplemented(); // fragment case + if (!m_tree.openElements()->inTableScope(selectTag)) { + ASSERT(isParsingFragment()); + return; + } AtomicHTMLToken endSelect(HTMLToken::EndTag, selectTag.localName()); processEndTag(endSelect); processStartTag(token); @@ -2356,7 +2325,11 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken& token) return; } if (token.name() == selectTag) { - notImplemented(); // fragment case + if (!m_tree.openElements()->inTableScope(token.name())) { + ASSERT(isParsingFragment()); + parseError(token); + return; + } m_tree.openElements()->popUntilPopped(selectTag.localName()); resetInsertionModeAppropriately(); return; @@ -2692,6 +2665,8 @@ void HTMLTreeBuilder::processEndOfFile(AtomicHTMLToken& token) void HTMLTreeBuilder::defaultForInitial() { notImplemented(); + if (!m_fragmentContext.fragment()) + m_document->setCompatibilityMode(Document::QuirksMode); // FIXME: parse error setInsertionMode(BeforeHTMLMode); } @@ -2851,8 +2826,9 @@ 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; - return String(buffer, numberToString(number, 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) diff --git a/WebCore/html/HTMLTreeBuilder.h b/WebCore/html/parser/HTMLTreeBuilder.h index c30e6b8..c30e6b8 100644 --- a/WebCore/html/HTMLTreeBuilder.h +++ b/WebCore/html/parser/HTMLTreeBuilder.h diff --git a/WebCore/html/HTMLViewSourceParser.cpp b/WebCore/html/parser/HTMLViewSourceParser.cpp index 8a7984d..8a7984d 100644 --- a/WebCore/html/HTMLViewSourceParser.cpp +++ b/WebCore/html/parser/HTMLViewSourceParser.cpp diff --git a/WebCore/html/HTMLViewSourceParser.h b/WebCore/html/parser/HTMLViewSourceParser.h index 34caf43..34caf43 100644 --- a/WebCore/html/HTMLViewSourceParser.h +++ b/WebCore/html/parser/HTMLViewSourceParser.h diff --git a/WebCore/html/parser/create-html-entity-table b/WebCore/html/parser/create-html-entity-table new file mode 100755 index 0000000..e6132bc --- /dev/null +++ b/WebCore/html/parser/create-html-entity-table @@ -0,0 +1,178 @@ +#!/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. + +import csv +import os.path +import string +import sys + +ENTITY = 0 +VALUE = 1 + +def convert_entity_to_cpp_name(entity): + postfix = "EntityName" + if entity[-1] == ";": + return "%sSemicolon%s" % (entity[:-1], postfix) + return "%s%s" % (entity, postfix) + + +def convert_entity_to_uchar_array(entity): + return "{'%s'}" % "', '".join(entity) + + +def convert_value_to_int(value): + assert(value[0] == "U") + assert(value[1] == "+") + return "0x" + value[2:] + + +def offset_table_entry(offset): + return " &staticEntityTable[%s]," % offset + + +program_name = os.path.basename(__file__) +if len(sys.argv) < 4 or sys.argv[1] != "-o": + print >> sys.stderr, "Usage: %s -o OUTPUT_FILE INPUT_FILE" % program_name + exit(1) + +output_path = sys.argv[2] +input_path = sys.argv[3] + +html_entity_names_file = open(input_path) +entries = list(csv.reader(html_entity_names_file)) +html_entity_names_file.close() + +entries.sort(lambda a, b: cmp(a[ENTITY], b[ENTITY])) +entity_count = len(entries) + +output_file = open(output_path, "w") + +print >> output_file, """/* + * 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. + */ + +// THIS FILE IS GENERATED BY WebCore/html/parser/create-html-entity-table +// DO NOT EDIT (unless you are a ninja)! + +#include "config.h" +#include "HTMLEntityTable.h" + +namespace WebCore { + +namespace { +""" + +for entry in entries: + print >> output_file, "const UChar %sEntityName[] = %s;" % ( + convert_entity_to_cpp_name(entry[ENTITY]), + convert_entity_to_uchar_array(entry[ENTITY])) + +print >> output_file, """ +HTMLEntityTableEntry staticEntityTable[%s] = {""" % entity_count + +index = {} +offset = 0 +for entry in entries: + letter = entry[ENTITY][0] + if not index.get(letter): + index[letter] = offset + print >> output_file, ' { %sEntityName, %s, %s },' % ( + convert_entity_to_cpp_name(entry[ENTITY]), + len(entry[ENTITY]), + convert_value_to_int(entry[VALUE])) + offset += 1 + +print >> output_file, """}; +""" + +print >> output_file, "const HTMLEntityTableEntry* uppercaseOffset[] = {" +for letter in string.uppercase: + print >> output_file, offset_table_entry(index[letter]) +print >> output_file, offset_table_entry(index['a']) +print >> output_file, """}; + +const HTMLEntityTableEntry* lowercaseOffset[] = {""" +for letter in string.lowercase: + print >> output_file, offset_table_entry(index[letter]) +print >> output_file, offset_table_entry(entity_count) +print >> output_file, """}; + +} + +const HTMLEntityTableEntry* HTMLEntityTable::firstEntryStartingWith(UChar c) +{ + if (c >= 'A' && c <= 'Z') + return uppercaseOffset[c - 'A']; + if (c >= 'a' && c <= 'z') + return lowercaseOffset[c - 'a']; + return 0; +} + +const HTMLEntityTableEntry* HTMLEntityTable::lastEntryStartingWith(UChar c) +{ + if (c >= 'A' && c <= 'Z') + return uppercaseOffset[c - 'A' + 1] - 1; + if (c >= 'a' && c <= 'z') + return lowercaseOffset[c - 'a' + 1] - 1; + return 0; +} + +const HTMLEntityTableEntry* HTMLEntityTable::firstEntry() +{ + return &staticEntityTable[0]; +} + +const HTMLEntityTableEntry* HTMLEntityTable::lastEntry() +{ + return &staticEntityTable[%s - 1]; +} + +} +""" % entity_count diff --git a/WebCore/inspector/CodeGeneratorInspector.pm b/WebCore/inspector/CodeGeneratorInspector.pm index be0948b..d76fbd3 100644 --- a/WebCore/inspector/CodeGeneratorInspector.pm +++ b/WebCore/inspector/CodeGeneratorInspector.pm @@ -120,7 +120,7 @@ $typeTransform{"boolean"} = { "defaultValue" => "false", "forward" => "", "header" => "", - "JSONType" => "Bool" + "JSONType" => "Boolean" }; $typeTransform{"void"} = { "forward" => "", @@ -211,7 +211,7 @@ sub GenerateInterface $backendJSStubName = $className . "BackendStub"; my @backendHead; push(@backendHead, " ${backendClassName}(InspectorController* inspectorController) : m_inspectorController(inspectorController) { }"); - push(@backendHead, " void reportProtocolError(const long callId, const String& method, const String& errorText) const;"); + push(@backendHead, " void reportProtocolError(const long callId, const String& errorText) const;"); push(@backendHead, " void dispatch(const String& message);"); push(@backendHead, " static bool getCommandName(const String& message, String* result);"); $backendConstructor = join("\n", @backendHead); @@ -306,7 +306,7 @@ sub generateBackendFunction my $domainAccessor = $typeTransform{$domain}->{"domainAccessor"}; $backendTypes{$domain} = 1; push(@function, " if (!$domainAccessor)"); - push(@function, " protocolErrors->pushString(String::format(\"Error: %s handler is not available.\", \"$domain\"));"); + push(@function, " protocolErrors->pushString(String::format(\"Protocol Error: %s handler is not available.\", \"$domain\"));"); push(@function, ""); if (scalar(@inArgs)) { @@ -316,8 +316,7 @@ sub generateBackendFunction push(@function, ""); push(@function, " RefPtr<InspectorObject> argumentsContainer;"); push(@function, " if (!(argumentsContainer = requestMessageObject->getObject(\"arguments\"))) {"); - push(@function, " ASSERT_NOT_REACHED();"); - push(@function, " protocolErrors->pushString(String::format(\"Error: arguments object was not found.\"));"); + push(@function, " protocolErrors->pushString(String::format(\"Protocol Error: 'arguments' property with type 'object' was not found.\"));"); push(@function, " } else {"); push(@function, " InspectorObject::const_iterator argumentsEndIterator = argumentsContainer->end();"); @@ -330,12 +329,10 @@ sub generateBackendFunction push(@function, ""); push(@function, " InspectorObject::const_iterator ${name}ValueIterator = argumentsContainer->find(\"$name\");"); push(@function, " if (${name}ValueIterator == argumentsEndIterator) {"); - push(@function, " ASSERT_NOT_REACHED();"); - push(@function, " protocolErrors->pushString(String::format(\"Error: Argument '%s' with type '%s' was not found.\", \"$name\", \"$JSONType\"));"); + push(@function, " protocolErrors->pushString(String::format(\"Protocol Error: Argument '%s' with type '%s' was not found.\", \"$name\", \"$JSONType\"));"); push(@function, " } else {"); push(@function, " if (!${name}ValueIterator->second->as$JSONType(&$name)) {"); - push(@function, " ASSERT_NOT_REACHED();"); - push(@function, " protocolErrors->pushString(String::format(\"Error: Argument '%s' has wrong type. It should be '%s'.\", \"$name\", \"$JSONType\"));"); + push(@function, " protocolErrors->pushString(String::format(\"Protocol Error: Argument '%s' has wrong type. It should be '%s'.\", \"$name\", \"$JSONType\"));"); push(@function, " }"); push(@function, " }"); } @@ -351,13 +348,10 @@ sub generateBackendFunction push(@function, ""); push(@function, " // use InspectorFrontend as a marker of WebInspector availability"); - push(@function, " if (callId && m_inspectorController->hasFrontend()) {"); + push(@function, " if ((callId || protocolErrors->length()) && m_inspectorController->hasFrontend()) {"); push(@function, " RefPtr<InspectorObject> responseMessage = InspectorObject::create();"); push(@function, " responseMessage->setNumber(\"seq\", callId);"); - push(@function, " responseMessage->setString(\"type\", \"response\");"); - push(@function, " responseMessage->setString(\"domain\", \"$domain\");"); - push(@function, " responseMessage->setString(\"command\", \"$functionName\");"); - push(@function, " responseMessage->setBool(\"success\", !protocolErrors->length());"); + push(@function, " responseMessage->setBoolean(\"success\", !protocolErrors->length());"); push(@function, ""); push(@function, " if (protocolErrors->length())"); push(@function, " responseMessage->setArray(\"errors\", protocolErrors);"); @@ -381,14 +375,11 @@ sub generateBackendReportProtocolError { my $reportProtocolError = << "EOF"; -void ${backendClassName}::reportProtocolError(const long callId, const String& method, const String& errorText) const +void ${backendClassName}::reportProtocolError(const long callId, const String& errorText) const { RefPtr<InspectorObject> message = InspectorObject::create(); message->setNumber("seq", callId); - message->setString("type", "error"); - message->setString("domain", "inspectorProtocol"); - message->setString("command", method); - message->setBool("success", false); + message->setBoolean("success", false); RefPtr<InspectorArray> errors = InspectorArray::create(); errors->pushString(errorText); message->setArray("errors", errors); @@ -420,49 +411,42 @@ $mapEntries RefPtr<InspectorValue> parsedMessage = InspectorValue::parseJSON(message); if (!parsedMessage) { - ASSERT_NOT_REACHED(); - reportProtocolError(callId, "dispatch", "Error: Invalid message format. Message should be in JSON format."); + reportProtocolError(callId, "Protocol Error: Invalid message format. Message should be in JSON format."); return; } RefPtr<InspectorObject> messageObject = parsedMessage->asObject(); if (!messageObject) { - ASSERT_NOT_REACHED(); - reportProtocolError(callId, "dispatch", "Error: Invalid message format. The message should be a JSONified object."); + reportProtocolError(callId, "Protocol Error: Invalid message format. The message should be a JSONified object."); return; } - RefPtr<InspectorValue> callIdValue = messageObject->get("seq"); - if (!callIdValue) { - ASSERT_NOT_REACHED(); - reportProtocolError(callId, "dispatch", "Error: Invalid message format. 'seq' property was not found in the request."); + RefPtr<InspectorValue> commandValue = messageObject->get("command"); + if (!commandValue) { + reportProtocolError(callId, "Protocol Error: Invalid message format. 'command' property wasn't found."); return; } - if (!callIdValue->asNumber(&callId)) { - ASSERT_NOT_REACHED(); - reportProtocolError(callId, "dispatch", "Error: Invalid message format. the type of 'seq' property should be number."); + String command; + if (!commandValue->asString(&command)) { + reportProtocolError(callId, "Protocol Error: Invalid message format. The type of 'command' property should be string."); return; } - RefPtr<InspectorValue> commandValue = messageObject->get("command"); - if (!commandValue) { - ASSERT_NOT_REACHED(); - reportProtocolError(callId, "dispatch", "Error: Invalid message format. 'command' property wasn't found."); + RefPtr<InspectorValue> callIdValue = messageObject->get("seq"); + if (!callIdValue) { + reportProtocolError(callId, "Protocol Error: Invalid message format. 'seq' property was not found in the request."); return; } - String command; - if (!commandValue->asString(&command)) { - ASSERT_NOT_REACHED(); - reportProtocolError(callId, "dispatch", "Error: Invalid message format. The type of 'command' property should be string."); + if (!callIdValue->asNumber(&callId)) { + reportProtocolError(callId, "Protocol Error: Invalid message format. The type of 'seq' property should be number."); return; } HashMap<String, CallHandler>::iterator it = dispatchMap.find(command); if (it == dispatchMap.end()) { - ASSERT_NOT_REACHED(); - reportProtocolError(callId, "dispatch", String::format("Error: Invalid command was received. '%s' wasn't found.", command.utf8().data())); + reportProtocolError(callId, String::format("Protocol Error: Invalid command was received. '%s' wasn't found.", command.utf8().data())); return; } @@ -505,10 +489,9 @@ sub generateBackendStubJS foreach my $function (@backendFunctions) { my $name = $function->signature->name; my $domain = $function->signature->extendedAttributes->{"handler"}; - my $argumentNames = join(",", map("\"" . $_->name . "\": null", grep($_->direction eq "in", @{$function->parameters}))); + my $argumentNames = join(",", map("\"" . $_->name . "\": \"" . lc($typeTransform{$_->type}->{"JSONType"}) . "\"", grep($_->direction eq "in", @{$function->parameters}))); push(@JSStubs, " this._registerDelegate('{" . "\"seq\": 0, " . - "\"type\": \"request\", " . "\"domain\": \"$domain\", " . "\"command\": \"$name\", " . "\"arguments\": {$argumentNames}" . @@ -535,14 +518,27 @@ WebInspector.InspectorBackendStub.prototype = { { var args = Array.prototype.slice.call(arguments); var request = JSON.parse(args.shift()); + for (var key in request.arguments) { - if (key === "callId") - request.seq = args.shift(); - else - request.arguments[key] = args.shift(); + if (args.length === 0) { + console.error("Protocol Error: Invalid number of arguments for 'InspectorBackend.%s' call. It should have the next arguments '%s'.", request.command, JSON.stringify(request.arguments)); + return; + } + var value = args.shift(); + if (typeof value !== request.arguments[key]) { + console.error("Protocol Error: Invalid type of argument '%s' for 'InspectorBackend.%s' call. It should be '%s' but it is '%s'.", key, request.command, request.arguments[key], typeof value); + return; + } + request.arguments[key] = value; } - if (args.length === 1 && typeof args[0] === "function") + + if (args.length === 1) { + if (typeof args[0] !== "function") { + console.error("Protocol Error: Optional callback argument for 'InspectorBackend.%s' call should be a function but its type is '%s'.", request.command, typeof args[0]); + return; + } request.seq = WebInspector.Callback.wrap(args[0]); + } var message = JSON.stringify(request); InspectorFrontendHost.sendMessageToBackend(message); diff --git a/WebCore/inspector/Inspector.idl b/WebCore/inspector/Inspector.idl index a56ef14..ff1c2af 100644 --- a/WebCore/inspector/Inspector.idl +++ b/WebCore/inspector/Inspector.idl @@ -102,7 +102,7 @@ module core { // This method is going to be broken down into smaller parts. [handler=Controller] void populateScriptObjects(); - [handler=Controller] void getSettings(in long callId, out Object settings); + [handler=Controller] void getSettings(out Object settings); [handler=Controller] void storeLastActivePanel(in String panelName); [handler=Controller] void saveApplicationSettings(in String settings); @@ -116,7 +116,7 @@ module core { [handler=Controller] void enableResourceTracking(in boolean always); [handler=Controller] void disableResourceTracking(in boolean always); - [handler=Controller] void getResourceContent(in long callId, in unsigned long identifier, out String content); + [handler=Controller] void getResourceContent(in unsigned long identifier, out String content); [handler=Controller] void reloadPage(); [handler=Controller] void startTimelineProfiler(); @@ -126,7 +126,7 @@ module core { [handler=Backend] void enableDebugger(in boolean always); [handler=Controller] void disableDebugger(in boolean always); - [handler=Debug] void setBreakpoint(in long callId, in String sourceID, in unsigned int lineNumber, in boolean enabled, in String condition, out boolean success, out unsigned int actualLineNumber); + [handler=Debug] void setBreakpoint(in String sourceID, in unsigned int lineNumber, in boolean enabled, in String condition, out boolean success, out unsigned int actualLineNumber); [handler=Debug] void removeBreakpoint(in String sourceID, in unsigned long lineNumber); [handler=Debug] void activateBreakpoints(); [handler=Debug] void deactivateBreakpoints(); @@ -140,8 +140,8 @@ module core { [handler=Debug] void setPauseOnExceptionsState(in long pauseOnExceptionsState); - [handler=Debug] void editScriptSource(in long callId, in String sourceID, in String newContent, out boolean success, out String result, out Value newCallFrames); - [handler=Debug] void getScriptSource(in long callId, in String sourceID, out String scriptSource); + [handler=Debug] void editScriptSource(in String sourceID, in String newContent, out boolean success, out String result, out Value newCallFrames); + [handler=Debug] void getScriptSource(in String sourceID, out String scriptSource); [handler=Controller] void enableProfiler(in boolean always); [handler=Controller] void disableProfiler(in boolean always); @@ -149,34 +149,33 @@ module core { [handler=Profiler] void startProfiling(); [handler=Profiler] void stopProfiling(); - [handler=Profiler] void getProfileHeaders(in long callId, out Array headers); - [handler=Profiler] void getProfile(in long callId, in unsigned long uid, out Object profile); + [handler=Profiler] void getProfileHeaders(out Array headers); + [handler=Profiler] void getProfile(in String type, in unsigned long uid, out Object profile); - [handler=Profiler] void removeProfile(in unsigned long uid); + [handler=Profiler] void removeProfile(in String type, in unsigned long uid); [handler=Profiler] void clearProfiles(); - [handler=Backend] void takeHeapSnapshot(); - [handler=Backend] void getProfilerLogLines(in long callId, in long inPosition, out long outPosition, out String log); + [handler=Profiler] void takeHeapSnapshot(); #endif [handler=Backend] void setInjectedScriptSource(in String scriptSource); - [handler=Backend] void dispatchOnInjectedScript(in long callId, in long injectedScriptId, in String methodName, in String arguments, out Value result, out boolean isException); + [handler=Backend] void dispatchOnInjectedScript(in long injectedScriptId, in String methodName, in String arguments, out Value result, out boolean isException); [handler=Controller] void addScriptToEvaluateOnLoad(in String scriptSource); [handler=Controller] void removeAllScriptsToEvaluateOnLoad(); - [handler=DOM] void getChildNodes(in long callId, in long nodeId); - [handler=DOM] void setAttribute(in long callId, in long elementId, in String name, in String value, out boolean success); - [handler=DOM] void removeAttribute(in long callId, in long elementId, in String name, out boolean success); - [handler=DOM] void setTextNodeValue(in long callId, in long nodeId, in String value, out boolean success); - [handler=DOM] void getEventListenersForNode(in long callId, in long nodeId, out long outNodeId, out Array listenersArray); + [handler=DOM] void getChildNodes(in long nodeId); + [handler=DOM] void setAttribute(in long elementId, in String name, in String value, out boolean success); + [handler=DOM] void removeAttribute(in long elementId, in String name, out boolean success); + [handler=DOM] void setTextNodeValue(in long nodeId, in String value, out boolean success); + [handler=DOM] void getEventListenersForNode(in long nodeId, out long outNodeId, out Array listenersArray); [handler=DOM] void copyNode(in long nodeId); - [handler=DOM] void removeNode(in long callId, in long nodeId, out long outNodeId); - [handler=DOM] void changeTagName(in long callId, in long nodeId, in String newTagName, out long outNodeId); - [handler=DOM] void getOuterHTML(in long callId, in long nodeId, out String outerHTML); - [handler=DOM] void setOuterHTML(in long callId, in long nodeId, in String outerHTML, out long outNodeId); + [handler=DOM] void removeNode(in long nodeId, out long outNodeId); + [handler=DOM] void changeTagName(in long nodeId, in String newTagName, out long outNodeId); + [handler=DOM] void getOuterHTML(in long nodeId, out String outerHTML); + [handler=DOM] void setOuterHTML(in long nodeId, in String outerHTML, out long outNodeId); [handler=DOM] void addInspectedNode(in long nodeId); [handler=DOM] void performSearch(in String query, in boolean runSynchronously); [handler=DOM] void searchCanceled(); - [handler=DOM] void pushNodeByPathToFrontend(in long callId, in String path, out long nodeId); + [handler=DOM] void pushNodeByPathToFrontend(in String path, out long nodeId); [handler=DOM] void setDOMBreakpoint(in long nodeId, in long type); [handler=DOM] void removeDOMBreakpoint(in long nodeId, in long type); @@ -185,41 +184,41 @@ module core { [handler=Controller] void hideDOMNodeHighlight(); [handler=Controller] void openInInspectedWindow(in String url); - [handler=DOM] void getStyles(in long callId, in long nodeId, in boolean authOnly, out Value styles); - [handler=DOM] void getAllStyles(in long callId, out Array styles); - [handler=DOM] void getInlineStyle(in long callId, in long nodeId, out Value style); - [handler=DOM] void getComputedStyle(in long callId, in long nodeId, out Value style); - [handler=DOM] void getStyleSheet(in long callId, in long styleSheetId, out Object styleSheet); - [handler=DOM] void getRuleRanges(in long callId, in long styleSheetId, out Value ranges); - [handler=DOM] void applyStyleText(in long callId, in long styleId, in String styleText, in String propertyName, out boolean success, out Value style, out Array changedProperties); - [handler=DOM] void setStyleText(in long callId, in long styleId, in String styleText, out boolean success); - [handler=DOM] void setStyleProperty(in long callId, in long styleId, in String name, in String value, out boolean success); - [handler=DOM] void toggleStyleEnabled(in long callId, in long styleId, in String propertyName, in boolean disabled, out Value style); - [handler=DOM] void setRuleSelector(in long callId, in long ruleId, in String selector, in long selectedNodeId, out Value rule, out boolean selectorAffectsNode); - [handler=DOM] void addRule(in long callId, in String selector, in long selectedNodeId, out Value rule, out boolean selectorAffectsNode); - [handler=DOM] void getSupportedCSSProperties(in long callId, out Array cssProperties); - - [handler=Controller] void getCookies(in long callId, out Array cookies, out String cookiesString); + [handler=DOM] void getStyles(in long nodeId, in boolean authOnly, out Value styles); + [handler=DOM] void getAllStyles(out Array styles); + [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 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); + [handler=DOM] void toggleStyleEnabled(in long styleId, in String propertyName, in boolean disabled, out Value style); + [handler=DOM] void setRuleSelector(in long ruleId, in String selector, in long selectedNodeId, out Value rule, out boolean selectorAffectsNode); + [handler=DOM] void addRule(in String selector, in long selectedNodeId, out Value rule, out boolean selectorAffectsNode); + [handler=DOM] void getSupportedCSSProperties(out Array cssProperties); + + [handler=Controller] void getCookies(out Array cookies, out String cookiesString); [handler=Controller] void deleteCookie(in String cookieName, in String domain); #if defined(ENABLE_OFFLINE_WEB_APPLICATIONS) && ENABLE_OFFLINE_WEB_APPLICATIONS - [handler=ApplicationCache] void getApplicationCaches(in long callId, out Value applicationCaches); + [handler=ApplicationCache] void getApplicationCaches(out Value applicationCaches); #endif [handler=Backend] void releaseWrapperObjectGroup(in long injectedScriptId, in String objectGroup); [handler=Controller] void didEvaluateForTestInFrontend(in long testCallId, in String jsonResult); #if defined(ENABLE_DATABASE) && ENABLE_DATABASE - [handler=Backend] void getDatabaseTableNames(in long callId, in long databaseId, out Array tableNames); - [handler=Backend] void executeSQL(in long callId, in long databaseId, in String query, out boolean success, out long transactionId); + [handler=Backend] void getDatabaseTableNames(in long databaseId, out Array tableNames); + [handler=Backend] void executeSQL(in long databaseId, in String query, out boolean success, out long transactionId); [notify] void sqlTransactionSucceeded(out long transactionId, out Value columnNames, out Value values); [notify] void sqlTransactionFailed(out long transactionId, out Value sqlError); #endif #if defined(ENABLE_DOM_STORAGE) && ENABLE_DOM_STORAGE - [handler=Controller] void getDOMStorageEntries(in long callId, in long storageId, out Array entries); - [handler=Controller] void setDOMStorageItem(in long callId, in long storageId, in String key, in String value, out boolean success); - [handler=Controller] void removeDOMStorageItem(in long callId, in long storageId, in String key, out boolean success); + [handler=Controller] void getDOMStorageEntries(in long storageId, out Array entries); + [handler=Controller] void setDOMStorageItem(in long storageId, in String key, in String value, out boolean success); + [handler=Controller] void removeDOMStorageItem(in long storageId, in String key, out boolean success); #endif }; } diff --git a/WebCore/inspector/InspectorBackend.cpp b/WebCore/inspector/InspectorBackend.cpp index 99f40a9..791e3a6 100644 --- a/WebCore/inspector/InspectorBackend.cpp +++ b/WebCore/inspector/InspectorBackend.cpp @@ -68,17 +68,6 @@ void InspectorBackend::enableDebugger(bool always) m_inspectorController->enableDebuggerFromFrontend(always); } -void InspectorBackend::takeHeapSnapshot() -{ - ScriptProfiler::takeHeapSnapshot(); -} - -void InspectorBackend::getProfilerLogLines(long position, long* outPosition, String* data) -{ - // FIXME: we should make inspector dispatcher pluggable, so that embedders could contribute APIs instead of polluting the core one - // https://bugs.webkit.org/show_bug.cgi?id=43357 - *outPosition = ScriptProfiler::getProfilerLogLines(position, data); -} #endif void InspectorBackend::setInjectedScriptSource(const String& source) diff --git a/WebCore/inspector/InspectorBackend.h b/WebCore/inspector/InspectorBackend.h index 23b31a3..1fcec96 100644 --- a/WebCore/inspector/InspectorBackend.h +++ b/WebCore/inspector/InspectorBackend.h @@ -60,8 +60,6 @@ public: #if ENABLE(JAVASCRIPT_DEBUGGER) void enableDebugger(bool always); - void takeHeapSnapshot(); - void getProfilerLogLines(long position, long* outPosition, String* data); #endif void setInjectedScriptSource(const String& source); diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp index f47b321..7fb052c 100644 --- a/WebCore/inspector/InspectorController.cpp +++ b/WebCore/inspector/InspectorController.cpp @@ -490,24 +490,6 @@ void InspectorController::connectFrontend() // Initialize Web Inspector title. m_frontend->inspectedURLChanged(m_inspectedPage->mainFrame()->loader()->url().string()); -#if ENABLE(JAVASCRIPT_DEBUGGER) - if (InspectorDebuggerAgent::isDebuggerAlwaysEnabled()) { - // FIXME (40364): This will force pushing script sources to frontend even if script - // panel is inactive. - enableDebuggerFromFrontend(false); - } else { - String debuggerEnabled = setting(debuggerEnabledSettingName); - if (debuggerEnabled == "true" || m_attachDebuggerWhenShown) - enableDebugger(); - } - m_profilerAgent->setFrontend(m_frontend.get()); - if (!ScriptProfiler::isProfilerAlwaysEnabled()) { - String profilerEnabledSetting = setting(profilerEnabledSettingName); - if (profilerEnabledSetting == "true") - enableProfiler(); - } -#endif - #if ENABLE(OFFLINE_WEB_APPLICATIONS) m_applicationCacheAgent = new InspectorApplicationCacheAgent(this, m_frontend.get()); #endif @@ -676,6 +658,22 @@ void InspectorController::populateScriptObjects() for (Vector<pair<long, String> >::iterator it = m_pendingEvaluateTestCommands.begin(); it != m_pendingEvaluateTestCommands.end(); ++it) m_frontend->evaluateForTestInFrontend((*it).first, (*it).second); m_pendingEvaluateTestCommands.clear(); + +#if ENABLE(JAVASCRIPT_DEBUGGER) + if (InspectorDebuggerAgent::isDebuggerAlwaysEnabled()) + enableDebuggerFromFrontend(false); + else { + String debuggerEnabled = setting(debuggerEnabledSettingName); + if (debuggerEnabled == "true" || m_attachDebuggerWhenShown) + enableDebugger(); + } + m_profilerAgent->setFrontend(m_frontend.get()); + if (!ScriptProfiler::isProfilerAlwaysEnabled()) { + String profilerEnabledSetting = setting(profilerEnabledSettingName); + if (profilerEnabledSetting == "true") + enableProfiler(); + } +#endif } void InspectorController::unbindAllResources() @@ -1339,9 +1337,9 @@ PassRefPtr<InspectorObject> InspectorController::buildObjectForCookie(const Cook value->setString("path", cookie.path); value->setNumber("expires", cookie.expires); value->setNumber("size", (cookie.name.length() + cookie.value.length())); - value->setBool("httpOnly", cookie.httpOnly); - value->setBool("secure", cookie.secure); - value->setBool("session", cookie.session); + value->setBoolean("httpOnly", cookie.httpOnly); + value->setBoolean("secure", cookie.secure); + value->setBoolean("session", cookie.session); return value; } diff --git a/WebCore/inspector/InspectorDOMAgent.cpp b/WebCore/inspector/InspectorDOMAgent.cpp index b8ae047..d2760e4 100644 --- a/WebCore/inspector/InspectorDOMAgent.cpp +++ b/WebCore/inspector/InspectorDOMAgent.cpp @@ -33,6 +33,7 @@ #if ENABLE(INSPECTOR) +#include "Attr.h" #include "CSSComputedStyleDeclaration.h" #include "CSSMutableStyleDeclaration.h" #include "CSSPropertyNames.h" @@ -538,6 +539,8 @@ void InspectorDOMAgent::setOuterHTML(long nodeId, const String& outerHTML, long* if (!node || !node->isHTMLElement()) return; + bool requiresTotalUpdate = node->nodeName() == "HTML" || node->nodeName() == "BODY" || node->nodeName() == "HEAD"; + bool childrenRequested = m_childrenRequested.contains(nodeId); Node* previousSibling = node->previousSibling(); Node* parentNode = node->parentNode(); @@ -548,8 +551,15 @@ void InspectorDOMAgent::setOuterHTML(long nodeId, const String& outerHTML, long* if (ec) return; - Node* newNode = previousSibling ? previousSibling->nextSibling() : parentNode->firstChild(); + if (requiresTotalUpdate) { + Document* document = mainFrameDocument(); + reset(); + setDocument(document); + *newId = 0; + return; + } + Node* newNode = previousSibling ? previousSibling->nextSibling() : parentNode->firstChild(); *newId = pushNodePathToFrontend(newNode); if (childrenRequested) pushChildNodesToFrontend(*newId); @@ -834,6 +844,10 @@ PassRefPtr<InspectorObject> InspectorDOMAgent::buildObjectForNode(Node* node, in value->setString("publicId", docType->publicId()); value->setString("systemId", docType->systemId()); value->setString("internalSubset", docType->internalSubset()); + } else if (node->nodeType() == Node::ATTRIBUTE_NODE) { + Attr* attribute = static_cast<Attr*>(node); + value->setString("name", attribute->name()); + value->setString("value", attribute->value()); } return value.release(); } @@ -880,8 +894,8 @@ PassRefPtr<InspectorObject> InspectorDOMAgent::buildObjectForEventListener(const RefPtr<EventListener> eventListener = registeredEventListener.listener; RefPtr<InspectorObject> value = InspectorObject::create(); value->setString("type", eventType); - value->setBool("useCapture", registeredEventListener.useCapture); - value->setBool("isAttribute", eventListener->isAttribute()); + value->setBoolean("useCapture", registeredEventListener.useCapture); + value->setBoolean("isAttribute", eventListener->isAttribute()); value->setNumber("nodeId", pushNodePathToFrontend(node)); value->setString("listenerBody", eventListenerHandlerBody(node->document(), eventListener.get())); String sourceName; @@ -1153,14 +1167,14 @@ void InspectorDOMAgent::getAllStyles(RefPtr<InspectorArray>* styles) void InspectorDOMAgent::getStyleSheet(long styleSheetId, RefPtr<InspectorObject>* styleSheetObject) { CSSStyleSheet* styleSheet = cssStore()->styleSheetForId(styleSheetId); - if (styleSheet && styleSheet->doc()) - *styleSheetObject = buildObjectForStyleSheet(styleSheet->doc(), styleSheet); + if (styleSheet && styleSheet->document()) + *styleSheetObject = buildObjectForStyleSheet(styleSheet->document(), styleSheet); } void InspectorDOMAgent::getRuleRanges(long styleSheetId, RefPtr<InspectorValue>* ruleRange) { CSSStyleSheet* styleSheet = cssStore()->styleSheetForId(styleSheetId); - if (styleSheet && styleSheet->doc()) { + if (styleSheet && styleSheet->document()) { HashMap<long, SourceRange> ruleRanges = cssStore()->getRuleRanges(styleSheet); if (!ruleRanges.size()) return; @@ -1460,7 +1474,7 @@ void InspectorDOMAgent::populateObjectWithStyleProperties(CSSStyleDeclaration* s String name = style->item(i); property->setString("name", name); property->setString("priority", style->getPropertyPriority(name)); - property->setBool("implicit", style->isPropertyImplicit(name)); + property->setBoolean("implicit", style->isPropertyImplicit(name)); String shorthand = style->getPropertyShorthand(name); property->setString("shorthand", shorthand); if (!shorthand.isEmpty() && !foundShorthands.contains(shorthand)) { @@ -1492,10 +1506,10 @@ PassRefPtr<InspectorObject> InspectorDOMAgent::buildObjectForStyleSheet(Document RefPtr<InspectorObject> result = InspectorObject::create(); long id = cssStore()->bindStyleSheet(styleSheet); result->setNumber("id", id); - result->setBool("disabled", styleSheet->disabled()); + result->setBoolean("disabled", styleSheet->disabled()); result->setString("href", styleSheet->href()); result->setString("title", styleSheet->title()); - result->setNumber("documentElementId", m_documentNodeToIdMap.get(styleSheet->doc())); + result->setNumber("documentElementId", m_documentNodeToIdMap.get(styleSheet->document())); RefPtr<InspectorArray> cssRules = InspectorArray::create(); PassRefPtr<CSSRuleList> cssRuleList = CSSRuleList::create(styleSheet, true); if (cssRuleList) { @@ -1526,9 +1540,9 @@ PassRefPtr<InspectorObject> InspectorDOMAgent::buildObjectForRule(Document* owne } bool isUserAgent = parentStyleSheet && !parentStyleSheet->ownerNode() && parentStyleSheet->href().isEmpty(); bool isUser = parentStyleSheet && parentStyleSheet->ownerNode() && parentStyleSheet->ownerNode()->nodeName() == "#document"; - result->setBool("isUserAgent", isUserAgent); - result->setBool("isUser", isUser); - result->setBool("isViaInspector", rule->parentStyleSheet() == cssStore()->inspectorStyleSheet(ownerDocument, false)); + result->setBoolean("isUserAgent", isUserAgent); + result->setBoolean("isUser", isUser); + result->setBoolean("isViaInspector", rule->parentStyleSheet() == cssStore()->inspectorStyleSheet(ownerDocument, false)); // Bind editable scripts only. bool bind = !isUserAgent && !isUser; diff --git a/WebCore/inspector/InspectorDOMStorageResource.cpp b/WebCore/inspector/InspectorDOMStorageResource.cpp index 72b4e10..c8d76ba 100644 --- a/WebCore/inspector/InspectorDOMStorageResource.cpp +++ b/WebCore/inspector/InspectorDOMStorageResource.cpp @@ -71,7 +71,7 @@ void InspectorDOMStorageResource::bind(InspectorFrontend* frontend) RefPtr<InspectorObject> jsonObject = InspectorObject::create(); jsonObject->setString("host", m_frame->document()->securityOrigin()->host()); - jsonObject->setBool("isLocalStorage", m_isLocalStorage); + jsonObject->setBoolean("isLocalStorage", m_isLocalStorage); jsonObject->setNumber("id", m_id); frontend->addDOMStorage(jsonObject); } diff --git a/WebCore/inspector/InspectorProfilerAgent.cpp b/WebCore/inspector/InspectorProfilerAgent.cpp index a73469a..9161c3b 100644 --- a/WebCore/inspector/InspectorProfilerAgent.cpp +++ b/WebCore/inspector/InspectorProfilerAgent.cpp @@ -39,6 +39,7 @@ #include "KURL.h" #include "Page.h" #include "ScriptDebugServer.h" +#include "ScriptHeapSnapshot.h" #include "ScriptProfile.h" #include "ScriptProfiler.h" #include <wtf/OwnPtr.h> @@ -51,6 +52,7 @@ namespace WebCore { static const char* const UserInitiatedProfileName = "org.webkit.profiles.user-initiated"; static const char* const CPUProfileType = "CPU"; +static const char* const HeapProfileType = "HEAP"; PassOwnPtr<InspectorProfilerAgent> InspectorProfilerAgent::create(InspectorController* inspectorController) { @@ -65,6 +67,7 @@ InspectorProfilerAgent::InspectorProfilerAgent(InspectorController* inspectorCon , m_recordingUserInitiatedProfile(false) , m_currentUserInitiatedProfileNumber(-1) , m_nextUserInitiatedProfileNumber(1) + , m_nextUserInitiatedHeapSnapshotNumber(1) { } @@ -104,6 +107,15 @@ PassRefPtr<InspectorObject> InspectorProfilerAgent::createProfileHeader(const Sc return header; } +PassRefPtr<InspectorObject> InspectorProfilerAgent::createSnapshotHeader(const ScriptHeapSnapshot& snapshot) +{ + RefPtr<InspectorObject> header = InspectorObject::create(); + header->setString("title", snapshot.title()); + header->setNumber("uid", snapshot.uid()); + header->setString("typeId", String(HeapProfileType)); + return header; +} + void InspectorProfilerAgent::disable() { if (!m_enabled) @@ -138,28 +150,46 @@ void InspectorProfilerAgent::getProfileHeaders(RefPtr<InspectorArray>* headers) ProfilesMap::iterator profilesEnd = m_profiles.end(); for (ProfilesMap::iterator it = m_profiles.begin(); it != profilesEnd; ++it) (*headers)->pushObject(createProfileHeader(*it->second)); -} - -void InspectorProfilerAgent::getProfile(unsigned uid, RefPtr<InspectorObject>* profileObject) -{ - ProfilesMap::iterator it = m_profiles.find(uid); - if (it != m_profiles.end()) { - *profileObject = createProfileHeader(*it->second); - (*profileObject)->setObject("head", it->second->buildInspectorObjectForHead()); + HeapSnapshotsMap::iterator snapshotsEnd = m_snapshots.end(); + for (HeapSnapshotsMap::iterator it = m_snapshots.begin(); it != snapshotsEnd; ++it) + (*headers)->pushObject(createSnapshotHeader(*it->second)); +} + +void InspectorProfilerAgent::getProfile(const String& type, unsigned uid, RefPtr<InspectorObject>* profileObject) +{ + if (type == CPUProfileType) { + ProfilesMap::iterator it = m_profiles.find(uid); + if (it != m_profiles.end()) { + *profileObject = createProfileHeader(*it->second); + (*profileObject)->setObject("head", it->second->buildInspectorObjectForHead()); + } + } else if (type == HeapProfileType) { + HeapSnapshotsMap::iterator it = m_snapshots.find(uid); + if (it != m_snapshots.end()) { + *profileObject = createSnapshotHeader(*it->second); + (*profileObject)->setObject("head", it->second->buildInspectorObjectForHead()); + } } } -void InspectorProfilerAgent::removeProfile(unsigned uid) +void InspectorProfilerAgent::removeProfile(const String& type, unsigned uid) { - if (m_profiles.contains(uid)) - m_profiles.remove(uid); + if (type == CPUProfileType) { + if (m_profiles.contains(uid)) + m_profiles.remove(uid); + } else if (type == HeapProfileType) { + if (m_snapshots.contains(uid)) + m_snapshots.remove(uid); + } } void InspectorProfilerAgent::resetState() { m_profiles.clear(); + m_snapshots.clear(); m_currentUserInitiatedProfileNumber = 1; m_nextUserInitiatedProfileNumber = 1; + m_nextUserInitiatedHeapSnapshotNumber = 1; if (m_frontend) m_frontend->resetProfilesPanel(); } @@ -199,6 +229,17 @@ void InspectorProfilerAgent::stopUserInitiatedProfiling() toggleRecordButton(false); } +void InspectorProfilerAgent::takeHeapSnapshot() +{ + String title = String::format("%s.%d", UserInitiatedProfileName, m_nextUserInitiatedHeapSnapshotNumber++); + RefPtr<ScriptHeapSnapshot> snapshot = ScriptProfiler::takeHeapSnapshot(title); + if (snapshot) { + m_snapshots.add(snapshot->uid(), snapshot); + if (m_frontend) + m_frontend->addProfileHeader(createSnapshotHeader(*snapshot)); + } +} + void InspectorProfilerAgent::toggleRecordButton(bool isProfiling) { if (m_frontend) diff --git a/WebCore/inspector/InspectorProfilerAgent.h b/WebCore/inspector/InspectorProfilerAgent.h index 9593eba..421efb0 100644 --- a/WebCore/inspector/InspectorProfilerAgent.h +++ b/WebCore/inspector/InspectorProfilerAgent.h @@ -44,6 +44,7 @@ class InspectorArray; class InspectorController; class InspectorFrontend; class InspectorObject; +class ScriptHeapSnapshot; class ScriptProfile; class InspectorProfilerAgent : public Noncopyable { @@ -60,22 +61,25 @@ public: bool enabled() { return m_enabled; } String getCurrentUserInitiatedProfileName(bool incrementProfileNumber = false); void getProfileHeaders(RefPtr<InspectorArray>* headers); - void getProfile(unsigned uid, RefPtr<InspectorObject>* profileObject); + void getProfile(const String& type, unsigned uid, RefPtr<InspectorObject>* profileObject); bool isRecordingUserInitiatedProfile() { return m_recordingUserInitiatedProfile; } - void removeProfile(unsigned uid); + void removeProfile(const String& type, unsigned uid); void resetState(); void setFrontend(InspectorFrontend* frontend) { m_frontend = frontend; } void startProfiling() { startUserInitiatedProfiling(); } void startUserInitiatedProfiling(); void stopProfiling() { stopUserInitiatedProfiling(); } void stopUserInitiatedProfiling(); + void takeHeapSnapshot(); void toggleRecordButton(bool isProfiling); private: typedef HashMap<unsigned int, RefPtr<ScriptProfile> > ProfilesMap; + typedef HashMap<unsigned int, RefPtr<ScriptHeapSnapshot> > HeapSnapshotsMap; InspectorProfilerAgent(InspectorController*); PassRefPtr<InspectorObject> createProfileHeader(const ScriptProfile& profile); + PassRefPtr<InspectorObject> createSnapshotHeader(const ScriptHeapSnapshot& snapshot); InspectorController* m_inspectorController; InspectorFrontend* m_frontend; @@ -83,7 +87,9 @@ private: bool m_recordingUserInitiatedProfile; int m_currentUserInitiatedProfileNumber; unsigned m_nextUserInitiatedProfileNumber; + unsigned m_nextUserInitiatedHeapSnapshotNumber; ProfilesMap m_profiles; + HeapSnapshotsMap m_snapshots; }; } // namespace WebCore diff --git a/WebCore/inspector/InspectorResource.cpp b/WebCore/inspector/InspectorResource.cpp index ed07339..131ce95 100644 --- a/WebCore/inspector/InspectorResource.cpp +++ b/WebCore/inspector/InspectorResource.cpp @@ -190,10 +190,10 @@ void InspectorResource::updateScriptObject(InspectorFrontend* frontend) jsonObject->setString("lastPathComponent", m_requestURL.lastPathComponent()); RefPtr<InspectorObject> requestHeaders = buildHeadersObject(m_requestHeaderFields); jsonObject->setObject("requestHeaders", requestHeaders); - jsonObject->setBool("mainResource", m_isMainResource); + jsonObject->setBoolean("mainResource", m_isMainResource); jsonObject->setString("requestMethod", m_requestMethod); jsonObject->setString("requestFormData", m_requestFormData); - jsonObject->setBool("didRequestChange", true); + jsonObject->setBoolean("didRequestChange", true); } if (m_changes.hasChange(ResponseChange)) { @@ -205,27 +205,27 @@ void InspectorResource::updateScriptObject(InspectorFrontend* frontend) RefPtr<InspectorObject> responseHeaders = buildHeadersObject(m_responseHeaderFields); jsonObject->setObject("responseHeaders", responseHeaders); jsonObject->setNumber("connectionID", m_connectionID); - jsonObject->setBool("connectionReused", m_connectionReused); - jsonObject->setBool("cached", m_cached); + jsonObject->setBoolean("connectionReused", m_connectionReused); + jsonObject->setBoolean("cached", m_cached); if (m_loadTiming && !m_cached) jsonObject->setObject("timing", buildObjectForTiming(m_loadTiming.get())); - jsonObject->setBool("didResponseChange", true); + jsonObject->setBoolean("didResponseChange", true); } if (m_changes.hasChange(TypeChange)) { jsonObject->setNumber("type", static_cast<int>(type())); - jsonObject->setBool("didTypeChange", true); + jsonObject->setBoolean("didTypeChange", true); } if (m_changes.hasChange(LengthChange)) { jsonObject->setNumber("resourceSize", m_length); - jsonObject->setBool("didLengthChange", true); + jsonObject->setBoolean("didLengthChange", true); } if (m_changes.hasChange(CompletionChange)) { - jsonObject->setBool("failed", m_failed); - jsonObject->setBool("finished", m_finished); - jsonObject->setBool("didCompletionChange", true); + jsonObject->setBoolean("failed", m_failed); + jsonObject->setBoolean("finished", m_finished); + jsonObject->setBoolean("didCompletionChange", true); } if (m_changes.hasChange(TimingChange)) { @@ -239,7 +239,7 @@ void InspectorResource::updateScriptObject(InspectorFrontend* frontend) jsonObject->setNumber("loadEventTime", m_loadEventTime); if (m_domContentEventTime > 0) jsonObject->setNumber("domContentEventTime", m_domContentEventTime); - jsonObject->setBool("didTimingChange", true); + jsonObject->setBoolean("didTimingChange", true); } if (m_changes.hasChange(RedirectsChange)) { diff --git a/WebCore/inspector/InspectorValues.cpp b/WebCore/inspector/InspectorValues.cpp index a7c43a5..c96e953 100644 --- a/WebCore/inspector/InspectorValues.cpp +++ b/WebCore/inspector/InspectorValues.cpp @@ -474,7 +474,7 @@ inline void doubleQuoteString(const String& str, Vector<UChar>* dst) } // anonymous namespace -bool InspectorValue::asBool(bool*) const +bool InspectorValue::asBoolean(bool*) const { return false; } @@ -555,7 +555,7 @@ void InspectorValue::writeJSON(Vector<UChar>* output) const output->append(nullString, 4); } -bool InspectorBasicValue::asBool(bool* output) const +bool InspectorBasicValue::asBoolean(bool* output) const { if (type() != TypeBoolean) return false; @@ -565,7 +565,7 @@ bool InspectorBasicValue::asBool(bool* output) const bool InspectorBasicValue::asNumber(double* output) const { - if (type() != TypeDouble) + if (type() != TypeNumber) return false; *output = m_doubleValue; return true; @@ -573,7 +573,7 @@ bool InspectorBasicValue::asNumber(double* output) const bool InspectorBasicValue::asNumber(long* output) const { - if (type() != TypeDouble) + if (type() != TypeNumber) return false; *output = static_cast<long>(m_doubleValue); return true; @@ -581,7 +581,7 @@ bool InspectorBasicValue::asNumber(long* output) const bool InspectorBasicValue::asNumber(unsigned long* output) const { - if (type() != TypeDouble) + if (type() != TypeNumber) return false; *output = static_cast<unsigned long>(m_doubleValue); return true; @@ -589,7 +589,7 @@ bool InspectorBasicValue::asNumber(unsigned long* output) const bool InspectorBasicValue::asNumber(unsigned int* output) const { - if (type() != TypeDouble) + if (type() != TypeNumber) return false; *output = static_cast<unsigned int>(m_doubleValue); return true; @@ -597,13 +597,13 @@ bool InspectorBasicValue::asNumber(unsigned int* output) const void InspectorBasicValue::writeJSON(Vector<UChar>* output) const { - ASSERT(type() == TypeBoolean || type() == TypeDouble); + ASSERT(type() == TypeBoolean || type() == TypeNumber); if (type() == TypeBoolean) { if (m_boolValue) output->append(trueString, 4); else output->append(falseString, 5); - } else if (type() == TypeDouble) { + } else if (type() == TypeNumber) { String value = String::format("%f", m_doubleValue); value.replace(',', '.'); output->append(value.characters(), value.length()); @@ -633,12 +633,12 @@ PassRefPtr<InspectorObject> InspectorObject::asObject() return this; } -bool InspectorObject::getBool(const String& name, bool* output) const +bool InspectorObject::getBoolean(const String& name, bool* output) const { RefPtr<InspectorValue> value = get(name); if (!value) return false; - return value->asBool(output); + return value->asBoolean(output); } bool InspectorObject::getNumber(const String& name, double* output) const diff --git a/WebCore/inspector/InspectorValues.h b/WebCore/inspector/InspectorValues.h index 473ad21..3dd9594 100644 --- a/WebCore/inspector/InspectorValues.h +++ b/WebCore/inspector/InspectorValues.h @@ -59,7 +59,7 @@ public: typedef enum { TypeNull = 0, TypeBoolean, - TypeDouble, + TypeNumber, TypeString, TypeObject, TypeArray @@ -67,7 +67,7 @@ public: Type type() const { return m_type; } - virtual bool asBool(bool* output) const; + virtual bool asBoolean(bool* output) const; virtual bool asNumber(double* output) const; virtual bool asNumber(long* output) const; virtual bool asNumber(unsigned long* output) const; @@ -109,7 +109,7 @@ public: return adoptRef(new InspectorBasicValue(value)); } - virtual bool asBool(bool* output) const; + virtual bool asBoolean(bool* output) const; virtual bool asNumber(double* output) const; virtual bool asNumber(long* output) const; virtual bool asNumber(unsigned long* output) const; @@ -119,8 +119,8 @@ public: private: explicit InspectorBasicValue(bool value) : InspectorValue(TypeBoolean), m_boolValue(value) { } - explicit InspectorBasicValue(int value) : InspectorValue(TypeDouble), m_doubleValue((double)value) { } - explicit InspectorBasicValue(double value) : InspectorValue(TypeDouble), m_doubleValue(value) { } + explicit InspectorBasicValue(int value) : InspectorValue(TypeNumber), m_doubleValue((double)value) { } + explicit InspectorBasicValue(double value) : InspectorValue(TypeNumber), m_doubleValue(value) { } union { bool m_boolValue; @@ -169,7 +169,7 @@ public: virtual bool asObject(RefPtr<InspectorObject>* output); virtual PassRefPtr<InspectorObject> asObject(); - void setBool(const String& name, bool); + void setBoolean(const String& name, bool); void setNumber(const String& name, double); void setString(const String& name, const String&); void setValue(const String& name, PassRefPtr<InspectorValue>); @@ -177,7 +177,7 @@ public: void setArray(const String& name, PassRefPtr<InspectorArray>); const_iterator find(const String& name) const; - bool getBool(const String& name, bool* output) const; + bool getBoolean(const String& name, bool* output) const; bool getNumber(const String& name, double* output) const; bool getString(const String& name, String* output) const; PassRefPtr<InspectorObject> getObject(const String& name) const; @@ -208,7 +208,7 @@ public: virtual bool asArray(RefPtr<InspectorArray>* output); virtual PassRefPtr<InspectorArray> asArray(); - void pushBool(bool); + void pushBoolean(bool); void pushNumber(double); void pushString(const String&); void pushValue(PassRefPtr<InspectorValue>); @@ -230,7 +230,7 @@ inline InspectorObject::const_iterator InspectorObject::find(const String& name) return m_data.find(name); } -inline void InspectorObject::setBool(const String& name, bool value) +inline void InspectorObject::setBoolean(const String& name, bool value) { setValue(name, InspectorBasicValue::create(value)); } @@ -263,7 +263,7 @@ inline void InspectorObject::setArray(const String& name, PassRefPtr<InspectorAr m_order.append(name); } -inline void InspectorArray::pushBool(bool value) +inline void InspectorArray::pushBoolean(bool value) { m_data.append(InspectorBasicValue::create(value)); } diff --git a/WebCore/inspector/ScriptBreakpoint.cpp b/WebCore/inspector/ScriptBreakpoint.cpp index 24401f1..b7205a7 100644 --- a/WebCore/inspector/ScriptBreakpoint.cpp +++ b/WebCore/inspector/ScriptBreakpoint.cpp @@ -47,7 +47,7 @@ void ScriptBreakpoint::sourceBreakpointsFromInspectorObject(PassRefPtr<Inspector continue; bool enabled; RefPtr<InspectorValue> enabledValue = breakpoint->get("enabled"); - if (!enabledValue || !enabledValue->asBool(&enabled)) + if (!enabledValue || !enabledValue->asBoolean(&enabled)) continue; String condition; RefPtr<InspectorValue> conditionValue = breakpoint->get("condition"); @@ -62,7 +62,7 @@ PassRefPtr<InspectorObject> ScriptBreakpoint::inspectorObjectFromSourceBreakpoin RefPtr<InspectorObject> breakpoints = InspectorObject::create(); for (SourceBreakpoints::const_iterator it = sourceBreakpoints.begin(); it != sourceBreakpoints.end(); ++it) { RefPtr<InspectorObject> breakpoint = InspectorObject::create(); - breakpoint->setBool("enabled", it->second.enabled); + breakpoint->setBoolean("enabled", it->second.enabled); breakpoint->setString("condition", it->second.condition); breakpoints->setObject(String::number(it->first), breakpoint); } diff --git a/WebCore/inspector/TimelineRecordFactory.cpp b/WebCore/inspector/TimelineRecordFactory.cpp index e1c2bbb..713d6bc 100644 --- a/WebCore/inspector/TimelineRecordFactory.cpp +++ b/WebCore/inspector/TimelineRecordFactory.cpp @@ -87,7 +87,7 @@ PassRefPtr<InspectorObject> TimelineRecordFactory::createTimerInstallData(int ti RefPtr<InspectorObject> data = InspectorObject::create(); data->setNumber("timerId", timerId); data->setNumber("timeout", timeout); - data->setBool("singleShot", singleShot); + data->setBoolean("singleShot", singleShot); return data.release(); } @@ -134,7 +134,7 @@ PassRefPtr<InspectorObject> TimelineRecordFactory::createResourceSendRequestData data->setNumber("identifier", identifier); data->setString("url", request.url().string()); data->setString("requestMethod", request.httpMethod()); - data->setBool("isMainResource", isMainResource); + data->setBoolean("isMainResource", isMainResource); return data.release(); } @@ -152,7 +152,7 @@ PassRefPtr<InspectorObject> TimelineRecordFactory::createResourceFinishData(unsi { RefPtr<InspectorObject> data = InspectorObject::create(); data->setNumber("identifier", identifier); - data->setBool("didFail", didFail); + data->setBoolean("didFail", didFail); return data.release(); } diff --git a/WebCore/inspector/front-end/AuditFormatters.js b/WebCore/inspector/front-end/AuditFormatters.js new file mode 100755 index 0000000..de277ad --- /dev/null +++ b/WebCore/inspector/front-end/AuditFormatters.js @@ -0,0 +1,86 @@ +/* + * 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. + */ + +WebInspector.applyFormatters = function(value) +{ + var formatter; + var type = typeof value; + var args; + + switch (type) { + case "string": + case "boolean": + case "number": + formatter = WebInspector.AuditFormatters.text; + args = [ value.toString() ]; + break; + + case "object": + if (value instanceof Array) { + formatter = WebInspector.AuditFormatters.concat; + args = value; + } else if (value.type && value.arguments) { + formatter = WebInspector.AuditFormatters[value.type]; + args = value.arguments; + } + } + if (!formatter) + throw "Invalid value or formatter: " + type + JSON.stringify(value); + + return formatter.apply(null, args); +} + +WebInspector.AuditFormatters = { + text: function(text) + { + return document.createTextNode(text); + }, + + snippet: function(snippetText) + { + var div = document.createElement("div"); + div.innerText = snippetText; + div.className = "source-code"; + return div; + }, + + concat: function() + { + var parent = document.createElement("span"); + for (var arg = 0; arg < arguments.length; ++arg) + parent.appendChild(WebInspector.applyFormatters(arguments[arg])); + return parent; + }, + + url: function(url, displayText) + { + return WebInspector.linkifyURLAsNode(url, displayText || url, null, (url in WebInspector.resourceURLMap)); + } +}; diff --git a/WebCore/inspector/front-end/AuditLauncherView.js b/WebCore/inspector/front-end/AuditLauncherView.js index 33d3872..18daee6 100644 --- a/WebCore/inspector/front-end/AuditLauncherView.js +++ b/WebCore/inspector/front-end/AuditLauncherView.js @@ -28,10 +28,9 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -WebInspector.AuditLauncherView = function(categoriesById, runnerCallback) +WebInspector.AuditLauncherView = function(runnerCallback) { WebInspector.View.call(this); - this._categoriesById = categoriesById; this._runnerCallback = runnerCallback; this._categoryIdPrefix = "audit-category-item-"; this._auditRunning = false; @@ -41,27 +40,16 @@ WebInspector.AuditLauncherView = function(categoriesById, runnerCallback) this._contentElement = document.createElement("div"); this._contentElement.className = "audit-launcher-view-content"; this.element.appendChild(this._contentElement); + this._boundCategoryClickListener = this._categoryClicked.bind(this); this._resetResourceCount(); - function categorySortFunction(a, b) - { - var aTitle = a.displayName || ""; - var bTitle = b.displayName || ""; - return aTitle.localeCompare(bTitle); - } - var sortedCategories = []; - for (var id in this._categoriesById) - sortedCategories.push(this._categoriesById[id]); - sortedCategories.sort(categorySortFunction); + this._sortedCategories = []; - if (!sortedCategories.length) { - this._headerElement = document.createElement("h1"); - this._headerElement.className = "no-audits"; - this._headerElement.textContent = WebInspector.UIString("No audits to run"); - this._contentElement.appendChild(this._headerElement); - } else - this._createLauncherUI(sortedCategories); + this._headerElement = document.createElement("h1"); + this._headerElement.className = "no-audits"; + this._headerElement.textContent = WebInspector.UIString("No audits to run"); + this._contentElement.appendChild(this._headerElement); } WebInspector.AuditLauncherView.prototype = { @@ -133,6 +121,30 @@ WebInspector.AuditLauncherView.prototype = { this._resetResourceCount(); }, + addCategory: function(category) + { + if (!this._sortedCategories.length) + this._createLauncherUI(); + + var categoryElement = this._createCategoryElement(category.displayName, category.id); + category._checkboxElement = categoryElement.firstChild; + if (this._selectAllCheckboxElement.checked) { + category._checkboxElement.checked = true; + ++this._currentCategoriesCount; + } + + function compareCategories(a, b) + { + var aTitle = a.displayName || ""; + var bTitle = b.displayName || ""; + return aTitle.localeCompare(bTitle); + } + var insertBefore = insertionIndexForObjectInListSortedByFunction(category, this._sortedCategories, compareCategories); + this._categoriesElement.insertBefore(categoryElement, this._categoriesElement.children[insertBefore]); + this._sortedCategories.splice(insertBefore, 0, category); + this._updateButton(); + }, + _setAuditRunning: function(auditRunning) { if (this._auditRunning === auditRunning) @@ -146,10 +158,11 @@ WebInspector.AuditLauncherView.prototype = { { var catIds = []; var childNodes = this._categoriesElement.childNodes; - for (var id in this._categoriesById) { - if (this._categoriesById[id]._checkboxElement.checked) - catIds.push(id); + for (var category = 0; category < this._sortedCategories.length; ++category) { + if (this._sortedCategories[category]._checkboxElement.checked) + catIds.push(this._sortedCategories[category].id); } + this._setAuditRunning(true); this._runnerCallback(catIds, this._auditPresentStateElement.checked, this._setAuditRunning.bind(this, false)); }, @@ -159,14 +172,14 @@ WebInspector.AuditLauncherView.prototype = { var childNodes = this._categoriesElement.childNodes; for (var i = 0, length = childNodes.length; i < length; ++i) childNodes[i].firstChild.checked = checkCategories; - this._currentCategoriesCount = checkCategories ? this._totalCategoriesCount : 0; + this._currentCategoriesCount = checkCategories ? this._sortedCategories.length : 0; this._updateButton(); }, _categoryClicked: function(event) { this._currentCategoriesCount += event.target.checked ? 1 : -1; - this._selectAllCheckboxElement.checked = this._currentCategoriesCount === this._totalCategoriesCount; + this._selectAllCheckboxElement.checked = this._currentCategoriesCount === this._sortedCategories.length; this._updateButton(); }, @@ -177,16 +190,21 @@ WebInspector.AuditLauncherView.prototype = { var element = document.createElement("input"); element.type = "checkbox"; + element.addEventListener("click", this._boundCategoryClickListener, false); labelElement.appendChild(element); labelElement.appendChild(document.createTextNode(title)); return labelElement; }, - _createLauncherUI: function(sortedCategories) + _createLauncherUI: function() { this._headerElement = document.createElement("h1"); this._headerElement.textContent = WebInspector.UIString("Select audits to run"); + + for (var child = 0; child < this._contentElement.children.length; ++child) + this._contentElement.removeChild(this._contentElement.children[child]); + this._contentElement.appendChild(this._headerElement); function handleSelectAllClick(event) @@ -204,16 +222,6 @@ WebInspector.AuditLauncherView.prototype = { this._categoriesElement.className = "audit-categories-container"; this._contentElement.appendChild(this._categoriesElement); - var boundCategoryClickListener = this._categoryClicked.bind(this); - - for (var i = 0; i < sortedCategories.length; ++i) { - categoryElement = this._createCategoryElement(sortedCategories[i].displayName, sortedCategories[i].id); - categoryElement.firstChild.addEventListener("click", boundCategoryClickListener, false); - sortedCategories[i]._checkboxElement = categoryElement.firstChild; - this._categoriesElement.appendChild(categoryElement); - } - - this._totalCategoriesCount = this._categoriesElement.childNodes.length; this._currentCategoriesCount = 0; var flexibleSpaceElement = document.createElement("div"); diff --git a/WebCore/inspector/front-end/AuditResultView.js b/WebCore/inspector/front-end/AuditResultView.js index 2f4afbd..2636463 100644 --- a/WebCore/inspector/front-end/AuditResultView.js +++ b/WebCore/inspector/front-end/AuditResultView.js @@ -81,15 +81,22 @@ WebInspector.AuditCategoryResultPane = function(categoryResult) WebInspector.AuditCategoryResultPane.prototype = { _appendResult: function(parentTreeElement, result) { - var title = result.value; - if (result.violationCount) - title = String.sprintf("%s (%d)", title, result.violationCount); + var title = ""; + + if (typeof result.value === "string") { + title = result.value; + if (result.violationCount) + title = String.sprintf("%s (%d)", title, result.violationCount); + } var treeElement = new TreeElement(title, null, !!result.children); parentTreeElement.appendChild(treeElement); if (result.className) treeElement.listItemElement.addStyleClass(result.className); + if (typeof result.value !== "string") + treeElement.listItemElement.appendChild(WebInspector.applyFormatters(result.value)); + if (result.children) { for (var i = 0; i < result.children.length; ++i) this._appendResult(treeElement, result.children[i]); diff --git a/WebCore/inspector/front-end/AuditRules.js b/WebCore/inspector/front-end/AuditRules.js index e28a364..a72de56 100644 --- a/WebCore/inspector/front-end/AuditRules.js +++ b/WebCore/inspector/front-end/AuditRules.js @@ -371,7 +371,7 @@ WebInspector.AuditRules.UnusedCssRule.prototype = { return routineResult; } - InspectorBackend.getAllStyles(WebInspector.Callback.wrap(evalCallback)); + InspectorBackend.getAllStyles(evalCallback); } } @@ -693,7 +693,7 @@ WebInspector.AuditRules.ImageDimensionsRule.prototype = { return callback(null); var context = {imagesLeft: imageIds.length, urlToNoDimensionCount: {}}; for (var i = imageIds.length - 1; i >= 0; --i) - InspectorBackend.getStyles(WebInspector.Callback.wrap(imageStylesReady.bind(this, imageIds[i], context)), imageIds[i], true); + InspectorBackend.getStyles(imageIds[i], true, imageStylesReady.bind(this, imageIds[i], context)); } function pushImageNodes() diff --git a/WebCore/inspector/front-end/AuditsPanel.js b/WebCore/inspector/front-end/AuditsPanel.js index bc7f3b3..f6cbed0 100644 --- a/WebCore/inspector/front-end/AuditsPanel.js +++ b/WebCore/inspector/front-end/AuditsPanel.js @@ -32,8 +32,6 @@ WebInspector.AuditsPanel = function() { WebInspector.Panel.call(this, "audits"); - this._constructCategories(); - this.createSidebar(); this.auditsTreeElement = new WebInspector.SidebarSectionTreeElement("", {}, true); this.sidebarTree.appendChild(this.auditsTreeElement); @@ -54,7 +52,11 @@ WebInspector.AuditsPanel = function() this.viewsContainerElement.id = "audit-views"; this.element.appendChild(this.viewsContainerElement); - this._launcherView = new WebInspector.AuditLauncherView(this.categoriesById, this.initiateAudit.bind(this)); + this._constructCategories(); + + this._launcherView = new WebInspector.AuditLauncherView(this.initiateAudit.bind(this)); + for (id in this.categoriesById) + this._launcherView.addCategory(this.categoriesById[id]); } WebInspector.AuditsPanel.prototype = { @@ -104,6 +106,17 @@ WebInspector.AuditsPanel.prototype = { this._launcherView.resourceFinished(resource); }, + addCategory: function(category) + { + this.categoriesById[category.id] = category; + this._launcherView.addCategory(category); + }, + + getCategory: function(id) + { + return this.categoriesById[id]; + }, + _constructCategories: function() { this._auditCategoriesById = {}; @@ -147,7 +160,7 @@ WebInspector.AuditsPanel.prototype = { var category = categories[i]; var result = new WebInspector.AuditCategoryResult(category); results.push(result); - category.runRules(resources, ruleResultReadyCallback.bind(null, result)); + category.run(resources, ruleResultReadyCallback.bind(null, result)); } }, @@ -220,7 +233,7 @@ WebInspector.AuditsPanel.prototype = { { this.visibleView = this._launcherView; }, - + get visibleView() { return this._visibleView; @@ -311,7 +324,7 @@ WebInspector.AuditCategory.prototype = { this._rules.push(rule); }, - runRules: function(resources, callback) + run: function(resources, callback) { this._ensureInitialized(); for (var i = 0; i < this._rules.length; ++i) diff --git a/WebCore/inspector/front-end/BreakpointManager.js b/WebCore/inspector/front-end/BreakpointManager.js index 824bc31..8518618 100644 --- a/WebCore/inspector/front-end/BreakpointManager.js +++ b/WebCore/inspector/front-end/BreakpointManager.js @@ -123,8 +123,7 @@ WebInspector.BreakpointManager.prototype = { this._setBreakpoint(breakpoint.sourceID, breakpoint.url, line, breakpoint.enabled, breakpoint.condition); } } - var callbackId = WebInspector.Callback.wrap(didSetBreakpoint.bind(this)); - InspectorBackend.setBreakpoint(callbackId, breakpoint.sourceID, breakpoint.line, breakpoint.enabled, breakpoint.condition); + InspectorBackend.setBreakpoint(breakpoint.sourceID, breakpoint.line, breakpoint.enabled, breakpoint.condition, didSetBreakpoint.bind(this)); } } diff --git a/WebCore/inspector/front-end/BreakpointsSidebarPane.js b/WebCore/inspector/front-end/BreakpointsSidebarPane.js index ccf45b6..3a0860f 100644 --- a/WebCore/inspector/front-end/BreakpointsSidebarPane.js +++ b/WebCore/inspector/front-end/BreakpointsSidebarPane.js @@ -191,7 +191,7 @@ WebInspector.DOMBreakpointItem = function(breakpoint) var link = WebInspector.panels.elements.linkifyNodeReference(this._breakpoint.node); this._element.appendChild(link); - var type = WebInspector.DOMBreakpoint.Labels[this._breakpoint.type]; + var type = WebInspector.DOMBreakpoint.labelForType(this._breakpoint.type); var typeElement = document.createTextNode(" - " + type); this._element.appendChild(typeElement); } diff --git a/WebCore/inspector/front-end/CSSStyleModel.js b/WebCore/inspector/front-end/CSSStyleModel.js index 66a20ce..bda4064 100644 --- a/WebCore/inspector/front-end/CSSStyleModel.js +++ b/WebCore/inspector/front-end/CSSStyleModel.js @@ -35,12 +35,12 @@ WebInspector.CSSStyleModel = function() WebInspector.CSSStyleModel.prototype = { getStylesAsync: function(nodeId, authOnly, userCallback) { - InspectorBackend.getStyles(WebInspector.Callback.wrap(userCallback), nodeId, authOnly); + InspectorBackend.getStyles(nodeId, authOnly, userCallback); }, getComputedStyleAsync: function(nodeId, userCallback) { - InspectorBackend.getComputedStyle(WebInspector.Callback.wrap(userCallback), nodeId); + InspectorBackend.getComputedStyle(nodeId, userCallback); }, setRuleSelector: function(ruleId, newContent, nodeId, successCallback, failureCallback) @@ -53,7 +53,7 @@ WebInspector.CSSStyleModel.prototype = { successCallback(WebInspector.CSSStyleDeclaration.parseRule(newRulePayload), doesAffectSelectedNode); } - InspectorBackend.setRuleSelector(WebInspector.Callback.wrap(callback), ruleId, newContent, nodeId); + InspectorBackend.setRuleSelector(ruleId, newContent, nodeId, callback); }, addRule: function(nodeId, newContent, successCallback, failureCallback) @@ -70,7 +70,7 @@ WebInspector.CSSStyleModel.prototype = { } } - InspectorBackend.addRule(WebInspector.Callback.wrap(callback), newContent, nodeId); + InspectorBackend.addRule(newContent, nodeId, callback); }, toggleStyleEnabled: function(styleId, propertyName, disabled, userCallback) @@ -86,12 +86,12 @@ WebInspector.CSSStyleModel.prototype = { userCallback(newStyle); } - InspectorBackend.toggleStyleEnabled(WebInspector.Callback.wrap(callback), styleId, propertyName, disabled); + InspectorBackend.toggleStyleEnabled(styleId, propertyName, disabled, callback); }, setCSSText: function(styleId, cssText) { - InspectorBackend.setStyleText(WebInspector.Callback.wrap(null), styleId, cssText); + InspectorBackend.setStyleText(styleId, cssText); }, applyStyleText: function(styleId, styleText, propertyName, successCallback, failureCallback) @@ -106,6 +106,6 @@ WebInspector.CSSStyleModel.prototype = { } } - InspectorBackend.applyStyleText(WebInspector.Callback.wrap(callback), styleId, styleText, propertyName); + InspectorBackend.applyStyleText(styleId, styleText, propertyName, callback); } } diff --git a/WebCore/inspector/front-end/DOMAgent.js b/WebCore/inspector/front-end/DOMAgent.js index 0d79d51..5aaa0d3 100644 --- a/WebCore/inspector/front-end/DOMAgent.js +++ b/WebCore/inspector/front-end/DOMAgent.js @@ -72,8 +72,12 @@ WebInspector.DOMNode = function(doc, payload) { this.publicId = payload.publicId; this.systemId = payload.systemId; this.internalSubset = payload.internalSubset; - } else if (this.nodeType === Node.DOCUMENT_NODE) + } else if (this.nodeType === Node.DOCUMENT_NODE) { this.documentURL = payload.documentURL; + } else if (this.nodeType === Node.ATTRIBUTE_NODE) { + this.name = payload.name; + this.value = payload.value; + } } WebInspector.DOMNode.prototype = { @@ -306,26 +310,25 @@ WebInspector.DOMAgent.prototype = { function mycallback() { callback(parent.children); } - var callId = WebInspector.Callback.wrap(mycallback); - InspectorBackend.getChildNodes(callId, parent.id); + InspectorBackend.getChildNodes(parent.id, mycallback); }, setAttributeAsync: function(node, name, value, callback) { var mycallback = this._didApplyDomChange.bind(this, node, callback); - InspectorBackend.setAttribute(WebInspector.Callback.wrap(mycallback), node.id, name, value); + InspectorBackend.setAttribute(node.id, name, value, mycallback); }, removeAttributeAsync: function(node, name, callback) { var mycallback = this._didApplyDomChange.bind(this, node, callback); - InspectorBackend.removeAttribute(WebInspector.Callback.wrap(mycallback), node.id, name); + InspectorBackend.removeAttribute(node.id, name, mycallback); }, setTextNodeValueAsync: function(node, text, callback) { var mycallback = this._didApplyDomChange.bind(this, node, callback); - InspectorBackend.setTextNodeValue(WebInspector.Callback.wrap(mycallback), node.id, text); + InspectorBackend.setTextNodeValue(node.id, text, mycallback); }, _didApplyDomChange: function(node, callback, success) @@ -429,8 +432,7 @@ WebInspector.ApplicationCache.getApplicationCachesAsync = function(callback) callback(applicationCaches); } - var callId = WebInspector.Callback.wrap(mycallback); - InspectorBackend.getApplicationCaches(callId); + InspectorBackend.getApplicationCaches(mycallback); } WebInspector.Cookies = {} @@ -445,8 +447,7 @@ WebInspector.Cookies.getCookiesAsync = function(callback) callback(cookies, true); } - var callId = WebInspector.Callback.wrap(mycallback); - InspectorBackend.getCookies(callId); + InspectorBackend.getCookies(mycallback); } WebInspector.Cookies.buildCookiesFromString = function(rawCookieString) @@ -496,9 +497,7 @@ WebInspector.EventListeners.getEventListenersForNodeAsync = function(node, callb { if (!node) return; - - var callId = WebInspector.Callback.wrap(callback); - InspectorBackend.getEventListenersForNode(callId, node.id); + InspectorBackend.getEventListenersForNode(node.id, callback); } WebInspector.CSSStyleDeclaration = function(payload) @@ -697,6 +696,13 @@ WebInspector.DOMBreakpointManager.prototype = { this.dispatchEventToListeners("dom-breakpoint-added", breakpoint); }, + findBreakpoint: function(nodeId, type) + { + var nodeBreakpoints = this._breakpoints[nodeId]; + if (nodeBreakpoints && type in nodeBreakpoints) + return nodeBreakpoints[type]; + }, + removeBreakpointsForNode: function(node) { var nodeBreakpoints = this._breakpoints[node.id]; @@ -733,10 +739,27 @@ WebInspector.DOMBreakpoint.Types = { NodeRemoved: 2 }; -WebInspector.DOMBreakpoint.Labels = {}; -WebInspector.DOMBreakpoint.Labels[WebInspector.DOMBreakpoint.Types.SubtreeModified] = WebInspector.UIString("Subtree Modified"); -WebInspector.DOMBreakpoint.Labels[WebInspector.DOMBreakpoint.Types.AttributeModified] = WebInspector.UIString("Attribute Modified"); -WebInspector.DOMBreakpoint.Labels[WebInspector.DOMBreakpoint.Types.NodeRemoved] = WebInspector.UIString("Node Removed"); +WebInspector.DOMBreakpoint.labelForType = function(type) +{ + if (!WebInspector.DOMBreakpoint._labels) { + WebInspector.DOMBreakpoint._labels = {}; + WebInspector.DOMBreakpoint._labels[WebInspector.DOMBreakpoint.Types.SubtreeModified] = WebInspector.UIString("Subtree Modified"); + WebInspector.DOMBreakpoint._labels[WebInspector.DOMBreakpoint.Types.AttributeModified] = WebInspector.UIString("Attribute Modified"); + WebInspector.DOMBreakpoint._labels[WebInspector.DOMBreakpoint.Types.NodeRemoved] = WebInspector.UIString("Node Removed"); + } + return WebInspector.DOMBreakpoint._labels[type]; +} + +WebInspector.DOMBreakpoint.contextMenuLabelForType = function(type) +{ + if (!WebInspector.DOMBreakpoint._contextMenuLabels) { + WebInspector.DOMBreakpoint._contextMenuLabels = {}; + WebInspector.DOMBreakpoint._contextMenuLabels[WebInspector.DOMBreakpoint.Types.SubtreeModified] = WebInspector.UIString("Break on Subtree Modifications"); + WebInspector.DOMBreakpoint._contextMenuLabels[WebInspector.DOMBreakpoint.Types.AttributeModified] = WebInspector.UIString("Break on Attributes Modifications"); + WebInspector.DOMBreakpoint._contextMenuLabels[WebInspector.DOMBreakpoint.Types.NodeRemoved] = WebInspector.UIString("Break on Node Removal"); + } + return WebInspector.DOMBreakpoint._contextMenuLabels[type]; +} WebInspector.DOMBreakpoint.prototype = { get enabled() diff --git a/WebCore/inspector/front-end/DOMStorage.js b/WebCore/inspector/front-end/DOMStorage.js index 5c28e29..37be8f6 100644 --- a/WebCore/inspector/front-end/DOMStorage.js +++ b/WebCore/inspector/front-end/DOMStorage.js @@ -56,20 +56,17 @@ WebInspector.DOMStorage.prototype = { getEntries: function(callback) { - var callId = WebInspector.Callback.wrap(callback); - InspectorBackend.getDOMStorageEntries(callId, this._id); + InspectorBackend.getDOMStorageEntries(this._id, callback); }, setItem: function(key, value, callback) { - var callId = WebInspector.Callback.wrap(callback); - InspectorBackend.setDOMStorageItem(callId, this._id, key, value); + InspectorBackend.setDOMStorageItem(this._id, key, value, callback); }, removeItem: function(key, callback) { - var callId = WebInspector.Callback.wrap(callback); - InspectorBackend.removeDOMStorageItem(callId, this._id, key); + InspectorBackend.removeDOMStorageItem(this._id, key, callback); } } diff --git a/WebCore/inspector/front-end/Database.js b/WebCore/inspector/front-end/Database.js index 45b7a0e..ca3e968 100644 --- a/WebCore/inspector/front-end/Database.js +++ b/WebCore/inspector/front-end/Database.js @@ -84,8 +84,7 @@ WebInspector.Database.prototype = { { callback(names.sort()); } - var callId = WebInspector.Callback.wrap(sortingCallback); - InspectorBackend.getDatabaseTableNames(callId, this._id); + InspectorBackend.getDatabaseTableNames(this._id, sortingCallback); }, executeSql: function(query, onSuccess, onError) @@ -99,7 +98,7 @@ WebInspector.Database.prototype = { WebInspector.Database.successCallbacks[transactionId] = onSuccess; WebInspector.Database.errorCallbacks[transactionId] = onError; } - InspectorBackend.executeSQL(WebInspector.Callback.wrap(callback), this._id, query); + InspectorBackend.executeSQL(this._id, query, callback); } } diff --git a/WebCore/inspector/front-end/ElementsPanel.js b/WebCore/inspector/front-end/ElementsPanel.js index f18299a..e1bc637 100644 --- a/WebCore/inspector/front-end/ElementsPanel.js +++ b/WebCore/inspector/front-end/ElementsPanel.js @@ -58,7 +58,7 @@ WebInspector.ElementsPanel = function() if (this._focusedDOMNode) { InspectorBackend.addInspectedNode(this._focusedDOMNode.id); - WebInspector.extensionServer.notifyObjectSelected(this.name, "DOMNode"); + WebInspector.extensionServer.notifyObjectSelected(this.panel.name, "DOMNode"); } }; @@ -224,10 +224,9 @@ WebInspector.ElementsPanel.prototype = { selectNode.call(this, node); } - if (this._selectedPathOnReset) { - var callId = WebInspector.Callback.wrap(selectLastSelectedNode.bind(this)); - InspectorBackend.pushNodeByPathToFrontend(callId, this._selectedPathOnReset.join(",")); - } else + if (this._selectedPathOnReset) + InspectorBackend.pushNodeByPathToFrontend(this._selectedPathOnReset.join(","), selectLastSelectedNode.bind(this)); + else selectNode.call(this); delete this._selectedPathOnReset; }, diff --git a/WebCore/inspector/front-end/ElementsTreeOutline.js b/WebCore/inspector/front-end/ElementsTreeOutline.js index 7f48161..ba3b320 100644 --- a/WebCore/inspector/front-end/ElementsTreeOutline.js +++ b/WebCore/inspector/front-end/ElementsTreeOutline.js @@ -765,16 +765,16 @@ WebInspector.ElementsTreeElement.prototype = { if (Preferences.domBreakpointsEnabled) { // Add debbuging-related actions contextMenu.appendSeparator(); - - contextMenu.appendItem(WebInspector.UIString("Stop on Subtree Modifications"), - WebInspector.domBreakpointManager.setBreakpoint.bind(WebInspector.domBreakpointManager, this.representedObject, WebInspector.DOMBreakpoint.Types.SubtreeModified)); - contextMenu.appendItem(WebInspector.UIString("Stop on Attributes Modifications"), - WebInspector.domBreakpointManager.setBreakpoint.bind(WebInspector.domBreakpointManager, this.representedObject, WebInspector.DOMBreakpoint.Types.AttributeModified)); - contextMenu.appendItem(WebInspector.UIString("Stop on Node Removal"), - WebInspector.domBreakpointManager.setBreakpoint.bind(WebInspector.domBreakpointManager, this.representedObject, WebInspector.DOMBreakpoint.Types.NodeRemoved)); - - contextMenu.appendItem(WebInspector.UIString("Remove Breakpoints"), - WebInspector.domBreakpointManager.removeBreakpointsForNode.bind(WebInspector.domBreakpointManager, this.representedObject)); + for (var type in WebInspector.DOMBreakpoint.Types) { + var typeId = WebInspector.DOMBreakpoint.Types[type]; + var label = WebInspector.DOMBreakpoint.contextMenuLabelForType(typeId); + var breakpoint = WebInspector.domBreakpointManager.findBreakpoint(this.representedObject.id, typeId); + if (!breakpoint) + var handler = WebInspector.domBreakpointManager.setBreakpoint.bind(WebInspector.domBreakpointManager, this.representedObject, typeId); + else + var handler = breakpoint.remove.bind(breakpoint); + contextMenu.appendCheckboxItem(label, handler, !!breakpoint); + } } }, @@ -1125,8 +1125,7 @@ WebInspector.ElementsTreeElement.prototype = { moveToNextAttributeIfNeeded.call(newTreeItem); } - var callId = WebInspector.Callback.wrap(changeTagNameCallback); - InspectorBackend.changeTagName(callId, this.representedObject.id, newText); + InspectorBackend.changeTagName(this.representedObject.id, newText, changeTagNameCallback); }, _textNodeEditingCommitted: function(element, newText) @@ -1265,6 +1264,11 @@ WebInspector.ElementsTreeElement.prototype = { info.title = "Document Fragment"; break; + case Node.ATTRIBUTE_NODE: + var value = node.value || "\u200B"; // Zero width space to force showing an empty value. + info.title = this._attributeHTML(node.name, value); + break; + case Node.ELEMENT_NODE: var tagName = this.treeOutline.nodeNameToCorrectCase(node.nodeName).escapeHTML(); if (this._elementCloseTag) { @@ -1374,8 +1378,7 @@ WebInspector.ElementsTreeElement.prototype = { parentElement.adjustCollapsedRange(true); } - var callId = WebInspector.Callback.wrap(removeNodeCallback); - InspectorBackend.removeNode(callId, this.representedObject.id); + InspectorBackend.removeNode(this.representedObject.id, removeNodeCallback); }, _editAsHTML: function() @@ -1402,12 +1405,10 @@ WebInspector.ElementsTreeElement.prototype = { function commitChange(value) { - var setCallId = WebInspector.Callback.wrap(selectNode); - InspectorBackend.setOuterHTML(setCallId, node.id, value); + InspectorBackend.setOuterHTML(node.id, value, selectNode); } - var getCallId = WebInspector.Callback.wrap(this._startEditingAsHTML.bind(this, commitChange)); - InspectorBackend.getOuterHTML(getCallId, node.id); + InspectorBackend.getOuterHTML(node.id, this._startEditingAsHTML.bind(this, commitChange)); }, _copyHTML: function() diff --git a/WebCore/inspector/front-end/EventListenersSidebarPane.js b/WebCore/inspector/front-end/EventListenersSidebarPane.js index 2800d6e..34dea00 100644 --- a/WebCore/inspector/front-end/EventListenersSidebarPane.js +++ b/WebCore/inspector/front-end/EventListenersSidebarPane.js @@ -183,7 +183,7 @@ WebInspector.EventListenerBar = function(eventListener, nodeId) this._setFunctionSubtitle(); this.editable = false; this.element.className = "event-bar"; /* Changed from "section" */ - this.propertiesElement.className = "event-properties"; /* Changed from "properties" */ + this.propertiesElement.className = "event-properties source-code"; /* Changed from "properties" */ } WebInspector.EventListenerBar.prototype = { @@ -196,7 +196,7 @@ WebInspector.EventListenerBar.prototype = { properties.push(new WebInspector.RemoteObjectProperty("node", nodeObject)); for (var propertyName in this.eventListener) { - var value = WebInspector.RemoteObject.fromPrimitiveValue(value); + var value = WebInspector.RemoteObject.fromPrimitiveValue(this.eventListener[propertyName]); properties.push(new WebInspector.RemoteObjectProperty(propertyName, value)); } this.updateProperties(properties); diff --git a/WebCore/inspector/front-end/ExtensionAPI.js b/WebCore/inspector/front-end/ExtensionAPI.js index a89dcf1..64f5482 100644 --- a/WebCore/inspector/front-end/ExtensionAPI.js +++ b/WebCore/inspector/front-end/ExtensionAPI.js @@ -28,7 +28,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -var injectedExtensionAPI = function(InjectedScriptHost, inspectedWindow, injectedScriptId) +WebInspector.injectedExtensionAPI = function(InjectedScriptHost, inspectedWindow, injectedScriptId) { // Here and below, all constructors are private to API implementation. @@ -37,19 +37,22 @@ var injectedExtensionAPI = function(InjectedScriptHost, inspectedWindow, injecte // by Foo consutrctor to re-bind publicly exported members to an instance // of Foo. -function EventSinkImpl(type) +function EventSinkImpl(type, customDispatch) { this._type = type; this._listeners = []; + this._customDispatch = customDispatch; } EventSinkImpl.prototype = { addListener: function(callback) { + if (typeof callback != "function") + throw new "addListener: callback is not a function"; if (this._listeners.length === 0) extensionServer.sendRequest({ command: "subscribe", type: this._type }); this._listeners.push(callback); - extensionServer.registerHandler("notify-" + this._type, bind(this._fire, this)); + extensionServer.registerHandler("notify-" + this._type, bind(this._dispatch, this)); }, removeListener: function(callback) @@ -66,26 +69,36 @@ EventSinkImpl.prototype = { extensionServer.sendRequest({ command: "unsubscribe", type: this._type }); }, - _fire: function(request) + _fire: function() { var listeners = this._listeners.slice(); for (var i = 0; i < listeners.length; ++i) - listeners[i].apply(null, request.arguments); + listeners[i].apply(null, arguments); + }, + + _dispatch: function(request) + { + if (this._customDispatch) + this._customDispatch.call(this, request); + else + this._fire.apply(this, request.arguments); } } -function EventSink(type) +function EventSink(type, customDispatch) { - var impl = new EventSinkImpl(type); + var impl = new EventSinkImpl(type, customDispatch); this.addListener = bind(impl.addListener, impl); this.removeListener = bind(impl.removeListener, impl); } function InspectorExtensionAPI() { + this.audits = new Audits(); this.inspectedWindow = new InspectedWindow(); this.panels = new Panels(); this.resources = new Resources(); + this.onReset = new EventSink("reset"); } @@ -125,7 +138,7 @@ function Panels() { return panels[name]; } - + for (var i = 0; i < wellKnownPanelNames.length; ++i) { var name = wellKnownPanelNames[i]; panels[name] = new Panel(name); @@ -151,7 +164,7 @@ Panels.prototype = { id: id, label: label, url: expandURL(pageURL), - icon: expandURL(iconURL) + icon: expandURL(iconURL) }; extensionServer.sendRequest(request, callback && bind(callbackWrapper, this)); } @@ -219,6 +232,124 @@ function ExtensionSidebarPane(id) this.setExpanded = bind(impl.setExpanded, impl); } +function Audits() +{ +} + +Audits.prototype = { + addCategory: function(displayName, ruleCount) + { + var id = "extension-audit-category-" + extensionServer.nextObjectId(); + extensionServer.sendRequest({ command: "addAuditCategory", id: id, displayName: displayName, ruleCount: ruleCount }); + return new AuditCategory(id); + } +} + +function AuditCategory(id) +{ + function customDispatch(request) + { + var auditResult = new AuditResult(request.arguments[0]); + try { + this._fire(auditResult); + } catch (e) { + console.error("Uncaught exception in extension audit event handler: " + e); + auditResult.done(); + } + } + var impl = new AuditCategoryImpl(id); + this.onAuditStarted = new EventSink("audit-started-" + id, customDispatch); +} + +function AuditCategoryImpl(id) +{ + this._id = id; +} + +function AuditResult(id) +{ + var impl = new AuditResultImpl(id); + + this.addResult = bind(impl.addResult, impl); + this.createResult = bind(impl.createResult, impl); + this.done = bind(impl.done, impl); + + var formatterTypes = [ + "url", + "snippet", + "text" + ]; + for (var i = 0; i < formatterTypes.length; ++i) + this[formatterTypes[i]] = bind(impl._nodeFactory, null, formatterTypes[i]); +} + +AuditResult.prototype = { + get Severity() + { + return private.audits.Severity; + } +} + +function AuditResultImpl(id) +{ + this._id = id; +} + +AuditResultImpl.prototype = { + addResult: function(displayName, description, severity, details) + { + // shorthand for specifying details directly in addResult(). + if (details && !(details instanceof AuditResultNode)) + details = details instanceof Array ? this.createNode.apply(this, details) : this.createNode(details); + + var request = { + command: "addAuditResult", + resultId: this._id, + displayName: displayName, + description: description, + severity: severity, + details: details + }; + extensionServer.sendRequest(request); + }, + + createResult: function() + { + var node = new AuditResultNode(); + node.contents = Array.prototype.slice.call(arguments); + return node; + }, + + done: function() + { + extensionServer.sendRequest({ command: "stopAuditCategoryRun", resultId: this._id }); + }, + + _nodeFactory: function(type) + { + return { + type: type, + arguments: Array.prototype.slice.call(arguments, 1) + }; + } +} + +function AuditResultNode(contents) +{ + this.contents = contents; + this.children = []; + this.expanded = false; +} + +AuditResultNode.prototype = { + addChild: function() + { + var node = AuditResultImpl.prototype.createResult.apply(null, arguments); + this.children.push(node); + return node; + } +}; + function InspectedWindow() { this.onLoaded = new EventSink("inspectedPageLoaded"); @@ -234,7 +365,13 @@ InspectedWindow.prototype = { evaluate: function(expression, callback) { - return extensionServer.sendRequest({ command: "evaluateOnInspectedPage", expression: expression }, callback); + function callbackWrapper(result) + { + if (result && !result.isException) + result.value = result.value === "undefined" ? undefined : JSON.parse(result.value); + callback(result); + } + return extensionServer.sendRequest({ command: "evaluateOnInspectedPage", expression: expression }, callback && callbackWrapper); } } diff --git a/WebCore/inspector/front-end/ExtensionAuditCategory.js b/WebCore/inspector/front-end/ExtensionAuditCategory.js new file mode 100644 index 0000000..5d155d7 --- /dev/null +++ b/WebCore/inspector/front-end/ExtensionAuditCategory.js @@ -0,0 +1,111 @@ +/* + * 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. + */ + +WebInspector.ExtensionAuditCategory = function(id, displayName, ruleCount) +{ + this._id = id; + this._displayName = displayName; + this._ruleCount = ruleCount; +} + +WebInspector.ExtensionAuditCategory.prototype = { + // AuditCategory interface + get id() + { + return this._id; + }, + + get displayName() + { + return this._displayName; + }, + + get ruleCount() + { + return this._ruleCount; + }, + + run: function(resources, callback) + { + new WebInspector.ExtensionAuditCategoryResults(this, callback); + } +} + +WebInspector.ExtensionAuditCategoryResults = function(category, callback) +{ + this._category = category; + this._pendingRules = category.ruleCount; + this._ruleCompletionCallback = callback; + + this.id = category.id + "-" + ++WebInspector.ExtensionAuditCategoryResults._lastId; + WebInspector.extensionServer.startAuditRun(category, this); +} + +WebInspector.ExtensionAuditCategoryResults.prototype = { + get complete() + { + return !this._pendingRules; + }, + + cancel: function() + { + while (!this.complete) + this._addResult(null); + }, + + addResult: function(displayName, description, severity, details) + { + var result = new WebInspector.AuditRuleResult(displayName); + result.addChild(description); + result.severity = severity; + if (details) + this._addNode(result, details); + this._addResult(result); + }, + + _addNode: function(parent, node) + { + var addedNode = parent.addChild(node.contents, node.expanded); + if (node.children) { + for (var i = 0; i < node.children.length; ++i) + this._addNode(addedNode, node.children[i]); + } + }, + + _addResult: function(result) + { + this._ruleCompletionCallback(result); + this._pendingRules--; + if (!this._pendingRules) + WebInspector.extensionServer.stopAuditRun(this); + } +} + +WebInspector.ExtensionAuditCategoryResults._lastId = 0; diff --git a/WebCore/inspector/front-end/ExtensionCommon.js b/WebCore/inspector/front-end/ExtensionCommon.js new file mode 100644 index 0000000..b04c18c --- /dev/null +++ b/WebCore/inspector/front-end/ExtensionCommon.js @@ -0,0 +1,46 @@ +/* + * 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. + */ + +WebInspector.commonExtensionSymbols = function(private) +{ + + if (!private.audits) + private.audits = {}; + + private.audits.Severity = { + Info: "info", + Warning: "warning", + Severe: "severe" + }; +} + +WebInspector.extensionAPI = {}; + +WebInspector.commonExtensionSymbols(WebInspector.extensionAPI); diff --git a/WebCore/inspector/front-end/ExtensionServer.js b/WebCore/inspector/front-end/ExtensionServer.js index 95f373f..f410d8c 100644 --- a/WebCore/inspector/front-end/ExtensionServer.js +++ b/WebCore/inspector/front-end/ExtensionServer.js @@ -40,11 +40,15 @@ WebInspector.ExtensionServer = function() this._registerHandler("getResources", this._onGetResources.bind(this)); this._registerHandler("createPanel", this._onCreatePanel.bind(this)); this._registerHandler("createSidebarPane", this._onCreateSidebar.bind(this)); - this._registerHandler("log", this._onLog.bind(this)); + this._registerHandler("log", this._onLog.bind(this)); this._registerHandler("evaluateOnInspectedPage", this._onEvaluateOnInspectedPage.bind(this)); this._registerHandler("setSidebarHeight", this._onSetSidebarHeight.bind(this)); this._registerHandler("setSidebarExpanded", this._onSetSidebarExpansion.bind(this)); + this._registerHandler("addAuditCategory", this._onAddAuditCategory.bind(this)); + this._registerHandler("addAuditResult", this._onAddAuditResult.bind(this)); + this._registerHandler("stopAuditCategoryRun", this._onStopAuditCategoryRun.bind(this)); + window.addEventListener("message", this._onWindowMessage.bind(this), false); } @@ -84,6 +88,17 @@ WebInspector.ExtensionServer.prototype = { this._postNotification("reset"); }, + startAuditRun: function(category, auditRun) + { + this._clientObjects[auditRun.id] = auditRun; + this._postNotification("audit-started-" + category.id, auditRun.id); + }, + + stopAuditRun: function(auditRun) + { + delete this._clientObjects[auditRun.id]; + }, + _convertResource: function(resource) { return { @@ -100,7 +115,7 @@ WebInspector.ExtensionServer.prototype = { return; var message = { command: "notify-" + type, - arguments: Array.prototype.slice.call(arguments, 1) + arguments: Array.prototype.slice.call(arguments, 1) }; for (var i = 0; i < subscribers.length; ++i) subscribers[i].postMessage(message); @@ -195,7 +210,6 @@ WebInspector.ExtensionServer.prototype = { _onEvaluateOnInspectedPage: function(message, port) { - var escapedMessage = escape(message.expression); function callback(resultPayload) { var resultObject = WebInspector.RemoteObject.fromPayload(resultPayload); @@ -205,7 +219,10 @@ WebInspector.ExtensionServer.prototype = { result.value = resultObject.description; this._dispatchCallback(message.requestId, port, result); } - InjectedScriptAccess.getDefault().evaluate("(function() { var a = window.eval(unescape(\"" + escapedMessage + "\")); return JSON.stringify(a); })();", "", callback.bind(this)); + var evalExpression = "JSON.stringify(eval('" + + "with (window.console._commandLineAPI) with (window) {' + unescape('" + escape(message.expression) + + "') + '}'));"; + InjectedScriptAccess.getDefault().evaluate(evalExpression, callback.bind(this)); }, _onRevealAndSelect: function(message) @@ -248,6 +265,36 @@ WebInspector.ExtensionServer.prototype = { return response; }, + _onAddAuditCategory: function(request) + { + var category = new WebInspector.ExtensionAuditCategory(request.id, request.displayName, request.ruleCount); + if (WebInspector.panels.audits.getCategory(category.id)) + return this._status.E_EXISTS(category.id); + this._clientObjects[request.id] = category; + WebInspector.panels.audits.addCategory(category); + }, + + _onAddAuditResult: function(request) + { + var auditResult = this._clientObjects[request.resultId]; + if (!auditResult) + return this._status.E_NOTFOUND(request.resultId); + try { + auditResult.addResult(request.displayName, request.description, request.severity, request.details); + } catch (e) { + return e; + } + return this._status.OK(); + }, + + _onStopAuditCategoryRun: function(request) + { + var auditRun = this._clientObjects[request.resultId]; + if (!auditRun) + return this._status.E_NOTFOUND(request.resultId); + auditRun.cancel(); + }, + initExtensions: function() { InspectorExtensionRegistry.getExtensionsAsync(); @@ -255,7 +302,8 @@ WebInspector.ExtensionServer.prototype = { _addExtensions: function(extensions) { - InspectorFrontendHost.setExtensionAPI("(" + injectedExtensionAPI.toString() + ")"); // See ExtensionAPI.js for details. + // See ExtensionAPI.js and ExtensionCommon.js for details. + InspectorFrontendHost.setExtensionAPI(this._buildExtensionAPIInjectedScript()); for (var i = 0; i < extensions.length; ++i) { var extension = extensions[i]; try { @@ -271,6 +319,15 @@ WebInspector.ExtensionServer.prototype = { } }, + _buildExtensionAPIInjectedScript: function() + { + return "(function(){ " + + "var private = {};" + + "(" + WebInspector.commonExtensionSymbols.toString() + ")(private);" + + "(" + WebInspector.injectedExtensionAPI.toString() + ").apply(this, arguments);" + + "})"; + }, + _onWindowMessage: function(event) { if (event.data !== "registerExtension") @@ -300,12 +357,14 @@ WebInspector.ExtensionServer.prototype = { } } -WebInspector.ExtensionServer._statuses = +WebInspector.ExtensionServer._statuses = { OK: "", - E_NOTFOUND: "Object not found (%s)", - E_NOTSUPPORTED: "Object does not support requested operation (%s)", - E_EXISTS: "Object already exists (%s)" + E_EXISTS: "Object already exists: %s", + E_BADARG: "Invalid argument %s: %s", + E_BADARGTYPE: "Invalid type for argument %s: got %s, expected %s", + E_NOTFOUND: "Object not found: %s", + E_NOTSUPPORTED: "Object does not support requested operation: %s", } WebInspector.ExtensionStatus = function() @@ -319,7 +378,7 @@ WebInspector.ExtensionStatus = function() status.isError = true; console.log("Extension server error: " + String.vsprintf(description, details)); } - return status; + return status; } for (status in WebInspector.ExtensionServer._statuses) this[status] = makeStatus.bind(null, status); diff --git a/WebCore/inspector/front-end/HeapSnapshotView.js b/WebCore/inspector/front-end/HeapSnapshotView.js new file mode 100644 index 0000000..6bcc0ff --- /dev/null +++ b/WebCore/inspector/front-end/HeapSnapshotView.js @@ -0,0 +1,1008 @@ +/* + * 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. + */ + +WebInspector.HeapSnapshotView = function(parent, profile) +{ + WebInspector.View.call(this); + + this.element.addStyleClass("heap-snapshot-view"); + + this.parent = parent; + this.parent.addEventListener("profile added", this._updateBaseOptions, this); + + this.showCountAsPercent = false; + this.showSizeAsPercent = false; + this.showCountDeltaAsPercent = false; + this.showSizeDeltaAsPercent = false; + + this.categories = { + code: new WebInspector.ResourceCategory("code", WebInspector.UIString("Code"), "rgb(255,121,0)"), + data: new WebInspector.ResourceCategory("data", WebInspector.UIString("Objects"), "rgb(47,102,236)") + }; + + var summaryContainer = document.createElement("div"); + summaryContainer.id = "heap-snapshot-summary-container"; + + this.countsSummaryBar = new WebInspector.SummaryBar(this.categories); + this.countsSummaryBar.element.className = "heap-snapshot-summary"; + this.countsSummaryBar.calculator = new WebInspector.HeapSummaryCountCalculator(); + var countsLabel = document.createElement("div"); + countsLabel.className = "heap-snapshot-summary-label"; + countsLabel.textContent = WebInspector.UIString("Count"); + this.countsSummaryBar.element.appendChild(countsLabel); + summaryContainer.appendChild(this.countsSummaryBar.element); + + this.sizesSummaryBar = new WebInspector.SummaryBar(this.categories); + this.sizesSummaryBar.element.className = "heap-snapshot-summary"; + this.sizesSummaryBar.calculator = new WebInspector.HeapSummarySizeCalculator(); + var sizesLabel = document.createElement("label"); + sizesLabel.className = "heap-snapshot-summary-label"; + sizesLabel.textContent = WebInspector.UIString("Size"); + this.sizesSummaryBar.element.appendChild(sizesLabel); + summaryContainer.appendChild(this.sizesSummaryBar.element); + + this.element.appendChild(summaryContainer); + + var columns = { + cons: { title: WebInspector.UIString("Constructor"), disclosure: true, sortable: true }, + count: { title: WebInspector.UIString("Count"), width: "54px", sortable: true }, + size: { title: WebInspector.UIString("Size"), width: "72px", sort: "descending", sortable: true }, + // \xb1 is a "plus-minus" sign. + countDelta: { title: WebInspector.UIString("\xb1 Count"), width: "72px", sortable: true }, + sizeDelta: { title: WebInspector.UIString("\xb1 Size"), width: "72px", sortable: true } + }; + + this.dataGrid = new WebInspector.DataGrid(columns); + this.dataGrid.addEventListener("sorting changed", this._sortData, this); + this.dataGrid.element.addEventListener("mousedown", this._mouseDownInDataGrid.bind(this), true); + this.element.appendChild(this.dataGrid.element); + + this.profile = profile; + + this.baseSelectElement = document.createElement("select"); + this.baseSelectElement.className = "status-bar-item"; + this.baseSelectElement.addEventListener("change", this._changeBase.bind(this), false); + this._updateBaseOptions(); + + this.percentButton = new WebInspector.StatusBarButton("", "percent-time-status-bar-item status-bar-item"); + this.percentButton.addEventListener("click", this._percentClicked.bind(this), false); + + this._loadProfile(this.profile, profileCallback.bind(this)); + + function profileCallback(profile) + { + var list = this._getProfiles(); + var profileIndex; + for (var i = 0; i < list.length; ++i) + if (list[i].uid === profile.uid) { + profileIndex = i; + break; + } + if (profileIndex > 0) + this.baseSelectElement.selectedIndex = profileIndex - 1; + else + this.baseSelectElement.selectedIndex = profileIndex; + this._resetDataGridList(resetCompleted.bind(this)); + } + + function resetCompleted() + { + this.refresh(); + this._updatePercentButton(); + } +} + +WebInspector.HeapSnapshotView.prototype = { + get statusBarItems() + { + return [this.baseSelectElement, this.percentButton.element]; + }, + + get profile() + { + return this._profile; + }, + + set profile(profile) + { + this._profile = profile; + }, + + show: function(parentElement) + { + WebInspector.View.prototype.show.call(this, parentElement); + this.dataGrid.updateWidths(); + }, + + hide: function() + { + WebInspector.View.prototype.hide.call(this); + this._currentSearchResultIndex = -1; + }, + + resize: function() + { + if (this.dataGrid) + this.dataGrid.updateWidths(); + }, + + refresh: function() + { + this.dataGrid.removeChildren(); + + var children = this.snapshotDataGridList.children; + var count = children.length; + for (var index = 0; index < count; ++index) + this.dataGrid.appendChild(children[index]); + + this._updateSummaryGraph(); + }, + + refreshShowAsPercents: function() + { + this._updatePercentButton(); + this.refreshVisibleData(); + }, + + _deleteSearchMatchedFlags: function(node) + { + delete node._searchMatchedConsColumn; + delete node._searchMatchedCountColumn; + delete node._searchMatchedSizeColumn; + delete node._searchMatchedCountDeltaColumn; + delete node._searchMatchedSizeDeltaColumn; + }, + + searchCanceled: function() + { + if (this._searchResults) { + for (var i = 0; i < this._searchResults.length; ++i) { + var profileNode = this._searchResults[i].profileNode; + this._deleteSearchMatchedFlags(profileNode); + profileNode.refresh(); + } + } + + delete this._searchFinishedCallback; + this._currentSearchResultIndex = -1; + this._searchResults = []; + }, + + performSearch: function(query, finishedCallback) + { + // Call searchCanceled since it will reset everything we need before doing a new search. + this.searchCanceled(); + + query = query.trim(); + + if (!query.length) + return; + + this._searchFinishedCallback = finishedCallback; + + var helper = WebInspector.HeapSnapshotView.SearchHelper; + + var operationAndNumber = helper.parseOperationAndNumber(query); + var operation = operationAndNumber[0]; + var queryNumber = operationAndNumber[1]; + + var percentUnits = helper.percents.test(query); + var megaBytesUnits = helper.megaBytes.test(query); + var kiloBytesUnits = helper.kiloBytes.test(query); + var bytesUnits = helper.bytes.test(query); + + var queryNumberBytes = (megaBytesUnits ? (queryNumber * 1024 * 1024) : (kiloBytesUnits ? (queryNumber * 1024) : queryNumber)); + + function matchesQuery(heapSnapshotDataGridNode) + { + WebInspector.HeapSnapshotView.prototype._deleteSearchMatchedFlags(heapSnapshotDataGridNode); + + if (percentUnits) { + heapSnapshotDataGridNode._searchMatchedCountColumn = operation(heapSnapshotDataGridNode.countPercent, queryNumber); + heapSnapshotDataGridNode._searchMatchedSizeColumn = operation(heapSnapshotDataGridNode.sizePercent, queryNumber); + heapSnapshotDataGridNode._searchMatchedCountDeltaColumn = operation(heapSnapshotDataGridNode.countDeltaPercent, queryNumber); + heapSnapshotDataGridNode._searchMatchedSizeDeltaColumn = operation(heapSnapshotDataGridNode.sizeDeltaPercent, queryNumber); + } else if (megaBytesUnits || kiloBytesUnits || bytesUnits) { + heapSnapshotDataGridNode._searchMatchedSizeColumn = operation(heapSnapshotDataGridNode.size, queryNumberBytes); + heapSnapshotDataGridNode._searchMatchedSizeDeltaColumn = operation(heapSnapshotDataGridNode.sizeDelta, queryNumberBytes); + } else { + heapSnapshotDataGridNode._searchMatchedCountColumn = operation(heapSnapshotDataGridNode.count, queryNumber); + heapSnapshotDataGridNode._searchMatchedCountDeltaColumn = operation(heapSnapshotDataGridNode.countDelta, queryNumber); + } + + if (heapSnapshotDataGridNode.constructorName.hasSubstring(query, true)) + heapSnapshotDataGridNode._searchMatchedConsColumn = true; + + if (heapSnapshotDataGridNode._searchMatchedConsColumn || + heapSnapshotDataGridNode._searchMatchedCountColumn || + heapSnapshotDataGridNode._searchMatchedSizeColumn || + heapSnapshotDataGridNode._searchMatchedCountDeltaColumn || + heapSnapshotDataGridNode._searchMatchedSizeDeltaColumn) { + heapSnapshotDataGridNode.refresh(); + return true; + } + + return false; + } + + var current = this.snapshotDataGridList.children[0]; + var depth = 0; + var info = {}; + + // The second and subsequent levels of heap snapshot nodes represent retainers, + // so recursive expansion will be infinite, since a graph is being traversed. + // So default to a recursion cap of 2 levels. + const maxDepth = 2; + + while (current) { + if (matchesQuery(current)) + this._searchResults.push({ profileNode: current }); + current = current.traverseNextNode(false, null, (depth >= maxDepth), info); + depth += info.depthChange; + } + + finishedCallback(this, this._searchResults.length); + }, + + // FIXME: move these methods to a superclass, inherit both views from it. + jumpToFirstSearchResult: WebInspector.CPUProfileView.prototype.jumpToFirstSearchResult, + jumpToLastSearchResult: WebInspector.CPUProfileView.prototype.jumpToLastSearchResult, + jumpToNextSearchResult: WebInspector.CPUProfileView.prototype.jumpToNextSearchResult, + jumpToPreviousSearchResult: WebInspector.CPUProfileView.prototype.jumpToPreviousSearchResult, + showingFirstSearchResult: WebInspector.CPUProfileView.prototype.showingFirstSearchResult, + showingLastSearchResult: WebInspector.CPUProfileView.prototype.showingLastSearchResult, + _jumpToSearchResult: WebInspector.CPUProfileView.prototype._jumpToSearchResult, + + refreshVisibleData: function() + { + var child = this.dataGrid.children[0]; + while (child) { + child.refresh(); + child = child.traverseNextNode(false, null, true); + } + this._updateSummaryGraph(); + }, + + _changeBase: function() + { + if (this.baseSnapshot.uid === this._getProfiles()[this.baseSelectElement.selectedIndex].uid) + return; + + this._resetDataGridList(resetCompleted.bind(this)); + + function resetCompleted() { + this.refresh(); + + if (!this.currentQuery || !this._searchFinishedCallback || !this._searchResults) + return; + + // The current search needs to be performed again. First negate out previous match + // count by calling the search finished callback with a negative number of matches. + // Then perform the search again with the same query and callback. + this._searchFinishedCallback(this, -this._searchResults.length); + this.performSearch(this.currentQuery, this._searchFinishedCallback); + } + }, + + _createSnapshotDataGridList: function() + { + if (this._snapshotDataGridList) + delete this._snapshotDataGridList; + + this._snapshotDataGridList = new WebInspector.HeapSnapshotDataGridList(this, this.baseSnapshot.entries, this.profile.entries); + return this._snapshotDataGridList; + }, + + _getProfiles: function() + { + return WebInspector.panels.profiles.getProfiles(WebInspector.HeapSnapshotProfileType.TypeId); + }, + + _loadProfile: function(profile, callback) + { + if (profile._loaded) { + callback(profile); + return; + } + + InspectorBackend.getProfile(profile.typeId, profile.uid, loadedCallback.bind(this)); + + function loadedCallback(loadedSnapshot) { + profile.children = loadedSnapshot.head.children; + profile.entries = loadedSnapshot.head.entries; + profile.lowlevels = loadedSnapshot.head.lowlevels; + this._prepareProfile(profile); + profile._loaded = true; + this.parent.updateProfile(profile); + callback(profile); + } + }, + + _mouseDownInDataGrid: function(event) + { + if (event.detail < 2) + return; + + var cell = event.target.enclosingNodeOrSelfWithNodeName("td"); + if (!cell || (!cell.hasStyleClass("count-column") && !cell.hasStyleClass("size-column") && !cell.hasStyleClass("countDelta-column") && !cell.hasStyleClass("sizeDelta-column"))) + return; + + if (cell.hasStyleClass("count-column")) + this.showCountAsPercent = !this.showCountAsPercent; + else if (cell.hasStyleClass("size-column")) + this.showSizeAsPercent = !this.showSizeAsPercent; + else if (cell.hasStyleClass("countDelta-column")) + this.showCountDeltaAsPercent = !this.showCountDeltaAsPercent; + else if (cell.hasStyleClass("sizeDelta-column")) + this.showSizeDeltaAsPercent = !this.showSizeDeltaAsPercent; + + this.refreshShowAsPercents(); + + event.preventDefault(); + event.stopPropagation(); + }, + + get _isShowingAsPercent() + { + return this.showCountAsPercent && this.showSizeAsPercent && this.showCountDeltaAsPercent && this.showSizeDeltaAsPercent; + }, + + _percentClicked: function(event) + { + var currentState = this._isShowingAsPercent; + this.showCountAsPercent = !currentState; + this.showSizeAsPercent = !currentState; + this.showCountDeltaAsPercent = !currentState; + this.showSizeDeltaAsPercent = !currentState; + this.refreshShowAsPercents(); + }, + + _prepareProfile: function(profile) + { + for (var profileEntry in profile.entries) + profile.entries[profileEntry].retainers = {}; + profile.clusters = {}; + + for (var addr in profile.children) { + var retainer = profile.children[addr]; + var retainerId = retainer.constructorName + ':' + addr; + for (var childAddr in retainer) { + if (childAddr === 'constructorName') continue; + var item = retainer[childAddr]; + var itemId = item.constructorName + ':' + childAddr; + if ((item.constructorName === 'Object' || item.constructorName === 'Array')) { + if (!(itemId in profile.clusters)) + profile.clusters[itemId] = { constructorName: itemId, retainers: {} }; + mergeRetainers(profile.clusters[itemId], item); + } + mergeRetainers(profile.entries[item.constructorName], item); + } + } + + function mergeRetainers(entry, item) + { + if (!(retainer.constructorName in entry.retainers)) + entry.retainers[retainer.constructorName] = { constructorName: retainer.constructorName, count: 0, clusters: {} }; + var retainerEntry = entry.retainers[retainer.constructorName]; + retainerEntry.count += item.count; + if (retainer.constructorName === 'Object' || retainer.constructorName === 'Array') + retainerEntry.clusters[retainerId] = true; + } + }, + + _resetDataGridList: function(callback) + { + this._loadProfile(this._getProfiles()[this.baseSelectElement.selectedIndex], profileLoaded.bind(this)); + + function profileLoaded(profile) + { + this.baseSnapshot = profile; + var lastComparator = WebInspector.HeapSnapshotDataGridList.propertyComparator("size", false); + if (this.snapshotDataGridList) + lastComparator = this.snapshotDataGridList.lastComparator; + this.snapshotDataGridList = this._createSnapshotDataGridList(); + this.snapshotDataGridList.sort(lastComparator, true); + callback(); + } + }, + + _sortData: function() + { + var sortAscending = this.dataGrid.sortOrder === "ascending"; + var sortColumnIdentifier = this.dataGrid.sortColumnIdentifier; + var sortProperty = { + cons: ["cons", null], + count: ["count", null], + size: ["size", "count"], + countDelta: this.showCountDeltaAsPercent ? ["countDeltaPercent", null] : ["countDelta", null], + sizeDelta: this.showSizeDeltaAsPercent ? ["sizeDeltaPercent", "countDeltaPercent"] : ["sizeDelta", "sizeDeltaPercent"] + }[sortColumnIdentifier]; + + this.snapshotDataGridList.sort(WebInspector.HeapSnapshotDataGridList.propertyComparator(sortProperty[0], sortProperty[1], sortAscending)); + + this.refresh(); + }, + + _updateBaseOptions: function() + { + var list = this._getProfiles(); + // We're assuming that snapshots can only be added. + if (this.baseSelectElement.length === list.length) + return; + + for (var i = this.baseSelectElement.length, n = list.length; i < n; ++i) { + var baseOption = document.createElement("option"); + var title = list[i].title; + if (!title.indexOf(UserInitiatedProfileName)) + title = WebInspector.UIString("Snapshot %d", title.substring(UserInitiatedProfileName.length + 1)); + baseOption.label = WebInspector.UIString("Compared to %s", title); + this.baseSelectElement.appendChild(baseOption); + } + }, + + _updatePercentButton: function() + { + if (this._isShowingAsPercent) { + this.percentButton.title = WebInspector.UIString("Show absolute counts and sizes."); + this.percentButton.toggled = true; + } else { + this.percentButton.title = WebInspector.UIString("Show counts and sizes as percentages."); + this.percentButton.toggled = false; + } + }, + + _updateSummaryGraph: function() + { + this.countsSummaryBar.calculator.showAsPercent = this._isShowingAsPercent; + this.countsSummaryBar.update(this.profile.lowlevels); + + this.sizesSummaryBar.calculator.showAsPercent = this._isShowingAsPercent; + this.sizesSummaryBar.update(this.profile.lowlevels); + } +}; + +WebInspector.HeapSnapshotView.prototype.__proto__ = WebInspector.View.prototype; + +WebInspector.HeapSnapshotView.SearchHelper = { + // In comparators, we assume that a value from a node is passed as the first parameter. + operations: { + LESS: function (a, b) { return a !== null && a < b; }, + LESS_OR_EQUAL: function (a, b) { return a !== null && a <= b; }, + EQUAL: function (a, b) { return a !== null && a === b; }, + GREATER_OR_EQUAL: function (a, b) { return a !== null && a >= b; }, + GREATER: function (a, b) { return a !== null && a > b; } + }, + + operationParsers: { + LESS: /^<(\d+)/, + LESS_OR_EQUAL: /^<=(\d+)/, + GREATER_OR_EQUAL: /^>=(\d+)/, + GREATER: /^>(\d+)/ + }, + + parseOperationAndNumber: function(query) + { + var operations = WebInspector.HeapSnapshotView.SearchHelper.operations; + var parsers = WebInspector.HeapSnapshotView.SearchHelper.operationParsers; + for (var operation in parsers) { + var match = query.match(parsers[operation]); + if (match !== null) + return [operations[operation], parseFloat(match[1])]; + } + return [operations.EQUAL, parseFloat(query)]; + }, + + percents: /%$/, + + megaBytes: /MB$/i, + + kiloBytes: /KB$/i, + + bytes: /B$/i +} + +WebInspector.HeapSummaryCalculator = function(lowLevelField) +{ + this.total = 1; + this.lowLevelField = lowLevelField; +} + +WebInspector.HeapSummaryCalculator.prototype = { + computeSummaryValues: function(lowLevels) + { + var highLevels = { data: 0, code: 0 }; + this.total = 0; + for (var item in lowLevels) { + var highItem = this._highFromLow(item); + if (highItem) { + var value = lowLevels[item][this.lowLevelField]; + highLevels[highItem] += value; + this.total += value; + } + } + var result = { categoryValues: highLevels }; + if (!this.showAsPercent) + result.total = this.total; + return result; + }, + + formatValue: function(value) + { + if (this.showAsPercent) + return WebInspector.UIString("%.2f%%", value / this.total * 100.0); + else + return this._valueToString(value); + }, + + get showAsPercent() + { + return this._showAsPercent; + }, + + set showAsPercent(x) + { + this._showAsPercent = x; + } +} + +WebInspector.HeapSummaryCountCalculator = function() +{ + WebInspector.HeapSummaryCalculator.call(this, "count"); +} + +WebInspector.HeapSummaryCountCalculator.prototype = { + _highFromLow: function(type) + { + if (type === "CODE_TYPE" || type === "SHARED_FUNCTION_INFO_TYPE" || type === "SCRIPT_TYPE") return "code"; + if (type === "STRING_TYPE" || type === "HEAP_NUMBER_TYPE" || type.match(/^JS_/)) return "data"; + return null; + }, + + _valueToString: function(value) + { + return value.toString(); + } +} + +WebInspector.HeapSummaryCountCalculator.prototype.__proto__ = WebInspector.HeapSummaryCalculator.prototype; + +WebInspector.HeapSummarySizeCalculator = function() +{ + WebInspector.HeapSummaryCalculator.call(this, "size"); +} + +WebInspector.HeapSummarySizeCalculator.prototype = { + _highFromLow: function(type) + { + if (type === "CODE_TYPE" || type === "SHARED_FUNCTION_INFO_TYPE" || type === "SCRIPT_TYPE") + return "code"; + if (type === "STRING_TYPE" || type === "HEAP_NUMBER_TYPE" || type.match(/^JS_/) || type.match(/_ARRAY_TYPE$/)) + return "data"; + return null; + }, + + _valueToString: Number.bytesToString +} + +WebInspector.HeapSummarySizeCalculator.prototype.__proto__ = WebInspector.HeapSummaryCalculator.prototype; + +WebInspector.HeapSnapshotDataGridNodeWithRetainers = function(owningTree) +{ + this.tree = owningTree; + + WebInspector.DataGridNode.call(this, null, this._hasRetainers); + + this.addEventListener("populate", this._populate, this); +}; + +WebInspector.HeapSnapshotDataGridNodeWithRetainers.prototype = { + isEmptySet: function(set) + { + for (var x in set) + return false; + return true; + }, + + get _hasRetainers() + { + return !this.isEmptySet(this.retainers); + }, + + get _parent() + { + // For top-level nodes, return owning tree as a parent, not data grid. + return this.parent !== this.dataGrid ? this.parent : this.tree; + }, + + _populate: function(event) + { + function appendDiffEntry(baseItem, snapshotItem) + { + this.appendChild(new WebInspector.HeapSnapshotDataGridRetainerNode(this.snapshotView, baseItem, snapshotItem, this.tree)); + } + + this.produceDiff(this.baseRetainers, this.retainers, appendDiffEntry.bind(this)); + + if (this._parent) { + var currentComparator = this._parent.lastComparator; + if (currentComparator) + this.sort(currentComparator, true); + } + + this.removeEventListener("populate", this._populate, this); + }, + + produceDiff: function(baseEntries, currentEntries, callback) + { + for (var item in currentEntries) + callback(baseEntries[item], currentEntries[item]); + + for (item in baseEntries) { + if (!(item in currentEntries)) + callback(baseEntries[item], null); + } + }, + + sort: function(comparator, force) { + if (!force && this.lastComparator === comparator) + return; + + this.children.sort(comparator); + var childCount = this.children.length; + for (var childIndex = 0; childIndex < childCount; ++childIndex) + this.children[childIndex]._recalculateSiblings(childIndex); + for (var i = 0; i < this.children.length; ++i) { + var child = this.children[i]; + if (!force && (!child.expanded || child.lastComparator === comparator)) + continue; + child.sort(comparator, force); + } + this.lastComparator = comparator; + }, + + signForDelta: function(delta) { + if (delta === 0) + return ""; + if (delta > 0) + return "+"; + else + return "\u2212"; // Math minus sign, same width as plus. + }, + + showDeltaAsPercent: function(value) + { + if (value === Number.POSITIVE_INFINITY) + return WebInspector.UIString("new"); + else if (value === Number.NEGATIVE_INFINITY) + return WebInspector.UIString("deleted"); + if (value > 1000.0) + return WebInspector.UIString("%s >1000%%", this.signForDelta(value)); + return WebInspector.UIString("%s%.2f%%", this.signForDelta(value), Math.abs(value)); + }, + + getTotalCount: function() + { + if (!this._count) { + this._count = 0; + for (var i = 0, n = this.children.length; i < n; ++i) + this._count += this.children[i].count; + } + return this._count; + }, + + getTotalSize: function() + { + if (!this._size) { + this._size = 0; + for (var i = 0, n = this.children.length; i < n; ++i) + this._size += this.children[i].size; + } + return this._size; + }, + + get countPercent() + { + return this.count / this._parent.getTotalCount() * 100.0; + }, + + get sizePercent() + { + return this.size / this._parent.getTotalSize() * 100.0; + }, + + get countDeltaPercent() + { + if (this.baseCount > 0) { + if (this.count > 0) + return this.countDelta / this.baseCount * 100.0; + else + return Number.NEGATIVE_INFINITY; + } else + return Number.POSITIVE_INFINITY; + }, + + get sizeDeltaPercent() + { + if (this.baseSize > 0) { + if (this.size > 0) + return this.sizeDelta / this.baseSize * 100.0; + else + return Number.NEGATIVE_INFINITY; + } else + return Number.POSITIVE_INFINITY; + }, + + get data() + { + var data = {}; + + data["cons"] = this.constructorName; + + if (this.snapshotView.showCountAsPercent) + data["count"] = WebInspector.UIString("%.2f%%", this.countPercent); + else + data["count"] = this.count; + + if (this.size !== null) { + if (this.snapshotView.showSizeAsPercent) + data["size"] = WebInspector.UIString("%.2f%%", this.sizePercent); + else + data["size"] = Number.bytesToString(this.size); + } else + data["size"] = ""; + + if (this.snapshotView.showCountDeltaAsPercent) + data["countDelta"] = this.showDeltaAsPercent(this.countDeltaPercent); + else + data["countDelta"] = WebInspector.UIString("%s%d", this.signForDelta(this.countDelta), Math.abs(this.countDelta)); + + if (this.sizeDelta !== null) { + if (this.snapshotView.showSizeDeltaAsPercent) + data["sizeDelta"] = this.showDeltaAsPercent(this.sizeDeltaPercent); + else + data["sizeDelta"] = WebInspector.UIString("%s%s", this.signForDelta(this.sizeDelta), Number.bytesToString(Math.abs(this.sizeDelta))); + } else + data["sizeDelta"] = ""; + + return data; + }, + + createCell: function(columnIdentifier) + { + var cell = WebInspector.DataGridNode.prototype.createCell.call(this, columnIdentifier); + + if ((columnIdentifier === "cons" && this._searchMatchedConsColumn) || + (columnIdentifier === "count" && this._searchMatchedCountColumn) || + (columnIdentifier === "size" && this._searchMatchedSizeColumn) || + (columnIdentifier === "countDelta" && this._searchMatchedCountDeltaColumn) || + (columnIdentifier === "sizeDelta" && this._searchMatchedSizeDeltaColumn)) + cell.addStyleClass("highlight"); + + return cell; + } +}; + +WebInspector.HeapSnapshotDataGridNodeWithRetainers.prototype.__proto__ = WebInspector.DataGridNode.prototype; + +WebInspector.HeapSnapshotDataGridNode = function(snapshotView, baseEntry, snapshotEntry, owningTree) +{ + this.snapshotView = snapshotView; + + if (!snapshotEntry) + snapshotEntry = { constructorName: baseEntry.constructorName, count: 0, size: 0, retainers: {} }; + this.constructorName = snapshotEntry.constructorName; + this.count = snapshotEntry.count; + this.size = snapshotEntry.size; + this.retainers = snapshotEntry.retainers; + + if (!baseEntry) + baseEntry = { count: 0, size: 0, retainers: {} }; + this.baseCount = baseEntry.count; + this.countDelta = this.count - this.baseCount; + this.baseSize = baseEntry.size; + this.sizeDelta = this.size - this.baseSize; + this.baseRetainers = baseEntry.retainers; + + WebInspector.HeapSnapshotDataGridNodeWithRetainers.call(this, owningTree); +}; + +WebInspector.HeapSnapshotDataGridNode.prototype.__proto__ = WebInspector.HeapSnapshotDataGridNodeWithRetainers.prototype; + +WebInspector.HeapSnapshotDataGridList = function(snapshotView, baseEntries, snapshotEntries) +{ + this.tree = this; + this.snapshotView = snapshotView; + this.children = []; + this.lastComparator = null; + this.populateChildren(baseEntries, snapshotEntries); +}; + +WebInspector.HeapSnapshotDataGridList.prototype = { + appendChild: function(child) + { + this.insertChild(child, this.children.length); + }, + + insertChild: function(child, index) + { + this.children.splice(index, 0, child); + }, + + removeChildren: function() + { + this.children = []; + }, + + populateChildren: function(baseEntries, snapshotEntries) + { + function appendListEntry(baseItem, snapshotItem) + { + this.appendChild(new WebInspector.HeapSnapshotDataGridNode(this.snapshotView, baseItem, snapshotItem, this)); + } + this.produceDiff(baseEntries, snapshotEntries, appendListEntry.bind(this)); + }, + + produceDiff: WebInspector.HeapSnapshotDataGridNodeWithRetainers.prototype.produceDiff, + sort: WebInspector.HeapSnapshotDataGridNodeWithRetainers.prototype.sort, + getTotalCount: WebInspector.HeapSnapshotDataGridNodeWithRetainers.prototype.getTotalCount, + getTotalSize: WebInspector.HeapSnapshotDataGridNodeWithRetainers.prototype.getTotalSize +}; + +WebInspector.HeapSnapshotDataGridList.propertyComparators = [{}, {}]; + +WebInspector.HeapSnapshotDataGridList.propertyComparator = function(property, property2, isAscending) +{ + var propertyHash = property + "#" + property2; + var comparator = this.propertyComparators[(isAscending ? 1 : 0)][propertyHash]; + if (!comparator) { + comparator = function(lhs, rhs) { + var l = lhs[property], r = rhs[property]; + if ((l === null || r === null) && property2 !== null) + l = lhs[property2], r = rhs[property2]; + var result = l < r ? -1 : (l > r ? 1 : 0); + return isAscending ? result : -result; + }; + this.propertyComparators[(isAscending ? 1 : 0)][propertyHash] = comparator; + } + return comparator; +}; + +WebInspector.HeapSnapshotDataGridRetainerNode = function(snapshotView, baseEntry, snapshotEntry, owningTree) +{ + this.snapshotView = snapshotView; + + if (!snapshotEntry) + snapshotEntry = { constructorName: baseEntry.constructorName, count: 0, clusters: {} }; + this.constructorName = snapshotEntry.constructorName; + this.count = snapshotEntry.count; + this.retainers = this._calculateRetainers(this.snapshotView.profile, snapshotEntry.clusters); + + if (!baseEntry) + baseEntry = { count: 0, clusters: {} }; + this.baseCount = baseEntry.count; + this.countDelta = this.count - this.baseCount; + this.baseRetainers = this._calculateRetainers(this.snapshotView.baseSnapshot, baseEntry.clusters); + + this.size = null; + this.sizeDelta = null; + + WebInspector.HeapSnapshotDataGridNodeWithRetainers.call(this, owningTree); +} + +WebInspector.HeapSnapshotDataGridRetainerNode.prototype = { + get sizePercent() + { + return null; + }, + + get sizeDeltaPercent() + { + return null; + }, + + _calculateRetainers: function(snapshot, clusters) + { + var retainers = {}; + if (this.isEmptySet(clusters)) { + if (this.constructorName in snapshot.entries) + return snapshot.entries[this.constructorName].retainers; + } else { + // In case when an entry is retained by clusters, we need to gather up the list + // of retainers by merging retainers of every cluster. + // E.g. having such a tree: + // A + // Object:1 10 + // X 3 + // Y 4 + // Object:2 5 + // X 6 + // + // will result in a following retainers list: X 9, Y 4. + for (var clusterName in clusters) { + if (clusterName in snapshot.clusters) { + var clusterRetainers = snapshot.clusters[clusterName].retainers; + for (var clusterRetainer in clusterRetainers) { + var clusterRetainerEntry = clusterRetainers[clusterRetainer]; + if (!(clusterRetainer in retainers)) + retainers[clusterRetainer] = { constructorName: clusterRetainerEntry.constructorName, count: 0, clusters: {} }; + retainers[clusterRetainer].count += clusterRetainerEntry.count; + for (var clusterRetainerCluster in clusterRetainerEntry.clusters) + retainers[clusterRetainer].clusters[clusterRetainerCluster] = true; + } + } + } + } + return retainers; + } +}; + +WebInspector.HeapSnapshotDataGridRetainerNode.prototype.__proto__ = WebInspector.HeapSnapshotDataGridNodeWithRetainers.prototype; + + +WebInspector.HeapSnapshotProfileType = function() +{ + WebInspector.ProfileType.call(this, WebInspector.HeapSnapshotProfileType.TypeId, WebInspector.UIString("HEAP SNAPSHOTS")); +} + +WebInspector.HeapSnapshotProfileType.TypeId = "HEAP"; + +WebInspector.HeapSnapshotProfileType.prototype = { + get buttonTooltip() + { + return WebInspector.UIString("Take heap snapshot."); + }, + + get buttonStyle() + { + return "heap-snapshot-status-bar-item status-bar-item"; + }, + + buttonClicked: function() + { + InspectorBackend.takeHeapSnapshot(); + }, + + get welcomeMessage() + { + return WebInspector.UIString("Get a heap snapshot by pressing the %s button on the status bar."); + }, + + createSidebarTreeElementForProfile: function(profile) + { + return new WebInspector.ProfileSidebarTreeElement(profile, WebInspector.UIString("Snapshot %d"), "heap-snapshot-sidebar-tree-item"); + }, + + createView: function(profile) + { + return new WebInspector.HeapSnapshotView(WebInspector.panels.profiles, profile); + } +} + +WebInspector.HeapSnapshotProfileType.prototype.__proto__ = WebInspector.ProfileType.prototype; diff --git a/WebCore/inspector/front-end/InjectedScriptAccess.js b/WebCore/inspector/front-end/InjectedScriptAccess.js index ce264dd..cb3c2b8 100644 --- a/WebCore/inspector/front-end/InjectedScriptAccess.js +++ b/WebCore/inspector/front-end/InjectedScriptAccess.js @@ -76,9 +76,7 @@ InjectedScriptAccess._installHandler = function(methodName, async) else WebInspector.console.addMessage(WebInspector.ConsoleMessage.createTextMessage("Error dispatching: " + methodName)); } - var callId = WebInspector.Callback.wrap(myCallback); - - InspectorBackend.dispatchOnInjectedScript(callId, this._worldId, methodName, argsString); + InspectorBackend.dispatchOnInjectedScript(this._worldId, methodName, argsString, myCallback); }; } diff --git a/WebCore/inspector/front-end/MetricsSidebarPane.js b/WebCore/inspector/front-end/MetricsSidebarPane.js index ed5a7ec..18bc240 100644 --- a/WebCore/inspector/front-end/MetricsSidebarPane.js +++ b/WebCore/inspector/front-end/MetricsSidebarPane.js @@ -52,14 +52,14 @@ WebInspector.MetricsSidebarPane.prototype = { var style = WebInspector.CSSStyleDeclaration.parseStyle(stylePayload); self._update(style); }; - InspectorBackend.getComputedStyle(WebInspector.Callback.wrap(callback), node.id); + InspectorBackend.getComputedStyle(node.id, callback); var inlineStyleCallback = function(stylePayload) { if (!stylePayload) return; self._inlineStyleId = stylePayload.id; }; - InspectorBackend.getInlineStyle(WebInspector.Callback.wrap(inlineStyleCallback), node.id); + InspectorBackend.getInlineStyle(node.id, inlineStyleCallback); }, _update: function(style) @@ -210,7 +210,7 @@ WebInspector.MetricsSidebarPane.prototype = { self.update(); }; - InspectorBackend.setStyleProperty(WebInspector.Callback.wrap(callback), this._inlineStyleId, context.styleProperty, userInput); + InspectorBackend.setStyleProperty(this._inlineStyleId, context.styleProperty, userInput, callback); } } diff --git a/WebCore/inspector/front-end/ObjectPropertiesSection.js b/WebCore/inspector/front-end/ObjectPropertiesSection.js index aab9546..015039c 100644 --- a/WebCore/inspector/front-end/ObjectPropertiesSection.js +++ b/WebCore/inspector/front-end/ObjectPropertiesSection.js @@ -184,6 +184,8 @@ WebInspector.ObjectPropertyTreeElement.prototype = { this.valueElement.addStyleClass("dimmed"); if (this.property.value.isError()) this.valueElement.addStyleClass("error"); + if (this.property.value.type) + this.valueElement.addStyleClass("console-formatted-" + this.property.value.type); this.listItemElement.removeChildren(); diff --git a/WebCore/inspector/front-end/Panel.js b/WebCore/inspector/front-end/Panel.js index 8cbdebb..2a4104f 100644 --- a/WebCore/inspector/front-end/Panel.js +++ b/WebCore/inspector/front-end/Panel.js @@ -72,6 +72,11 @@ WebInspector.Panel.prototype = { return this._toolbarItem; }, + get name() + { + return this._panelName; + }, + show: function() { WebInspector.View.prototype.show.call(this); diff --git a/WebCore/inspector/front-end/ProfileView.js b/WebCore/inspector/front-end/ProfileView.js index 817f1f5..c325bf7 100644 --- a/WebCore/inspector/front-end/ProfileView.js +++ b/WebCore/inspector/front-end/ProfileView.js @@ -94,8 +94,7 @@ WebInspector.CPUProfileView = function(profile) self._updatePercentButton(); } - var callId = WebInspector.Callback.wrap(profileCallback); - InspectorBackend.getProfile(callId, this.profile.uid); + InspectorBackend.getProfile(this.profile.typeId, this.profile.uid, profileCallback); } WebInspector.CPUProfileView.prototype = { @@ -611,7 +610,7 @@ WebInspector.CPUProfileType.prototype = { createSidebarTreeElementForProfile: function(profile) { - return new WebInspector.ProfileSidebarTreeElement(profile); + return new WebInspector.ProfileSidebarTreeElement(profile, WebInspector.UIString("Profile %d"), "profile-sidebar-tree-item"); }, createView: function(profile) diff --git a/WebCore/inspector/front-end/ProfilesPanel.js b/WebCore/inspector/front-end/ProfilesPanel.js index e18274c..2bd76f9 100644 --- a/WebCore/inspector/front-end/ProfilesPanel.js +++ b/WebCore/inspector/front-end/ProfilesPanel.js @@ -158,8 +158,7 @@ WebInspector.ProfilesPanel.prototype = { show: function() { WebInspector.Panel.prototype.show.call(this); - if (!this._profilesWereRequested) - this._populateProfiles(); + this._populateProfiles(); }, profilerWasEnabled: function() @@ -321,6 +320,7 @@ WebInspector.ProfilesPanel.prototype = { this.welcomeView.hide(); if (!this.visibleView) this.showProfile(profile); + this.dispatchEventToListeners("profile added"); } }, @@ -345,7 +345,7 @@ WebInspector.ProfilesPanel.prototype = { sidebarParent.removeChild(profile._profilesTreeElement); if (!profile.isTemporary) - InspectorBackend.removeProfile(profile.uid); + InspectorBackend.removeProfile(profile.typeId, profile.uid); // No other item will be selected if there aren't any other profiles, so // make sure that view gets cleared when the last profile is removed. @@ -376,6 +376,27 @@ WebInspector.ProfilesPanel.prototype = { this.profileViewStatusBarItemsContainer.appendChild(statusBarItems[i]); }, + getProfiles: function(typeId) + { + var result = []; + var profilesCount = this._profiles.length; + for (var i = 0; i < profilesCount; ++i) + if (this._profiles[i].typeId === typeId) + result.push(this._profiles[i]); + return result; + }, + + updateProfile: function(profile) + { + var profilesCount = this._profiles.length; + for (var i = 0; i < profilesCount; ++i) + if (this._profiles[i].typeId === profile.typeId + && this._profiles[i].uid === profile.uid) { + this._profiles[i] = profile; + break; + } + }, + showView: function(view) { this.showProfile(view.profile); @@ -510,12 +531,8 @@ WebInspector.ProfilesPanel.prototype = { _populateProfiles: function() { - var sidebarTreeChildrenCount = this.sidebarTree.children.length; - for (var i = 0; i < sidebarTreeChildrenCount; ++i) { - var treeElement = this.sidebarTree.children[i]; - if (treeElement.children.length) - return; - } + if (!this._profilerEnabled || this._profilesWereRequested) + return; function populateCallback(profileHeaders) { profileHeaders.sort(function(a, b) { return a.uid - b.uid; }); @@ -524,8 +541,7 @@ WebInspector.ProfilesPanel.prototype = { WebInspector.addProfileHeader(profileHeaders[i]); } - var callId = WebInspector.Callback.wrap(populateCallback); - InspectorBackend.getProfileHeaders(callId); + InspectorBackend.getProfileHeaders(populateCallback); this._profilesWereRequested = true; }, @@ -541,14 +557,15 @@ WebInspector.ProfilesPanel.prototype = { WebInspector.ProfilesPanel.prototype.__proto__ = WebInspector.Panel.prototype; -WebInspector.ProfileSidebarTreeElement = function(profile) +WebInspector.ProfileSidebarTreeElement = function(profile, titleFormat, className) { this.profile = profile; + this._titleFormat = titleFormat; if (this.profile.title.indexOf(UserInitiatedProfileName) === 0) this._profileNumber = this.profile.title.substring(UserInitiatedProfileName.length + 1); - WebInspector.SidebarTreeElement.call(this, "profile-sidebar-tree-item", "", "", profile, false); + WebInspector.SidebarTreeElement.call(this, className, "", "", profile, false); this.refreshTitles(); } @@ -570,7 +587,7 @@ WebInspector.ProfileSidebarTreeElement.prototype = { if (this._mainTitle) return this._mainTitle; if (this.profile.title.indexOf(UserInitiatedProfileName) === 0) - return WebInspector.UIString("Profile %d", this._profileNumber); + return WebInspector.UIString(this._titleFormat, this._profileNumber); return this.profile.title; }, diff --git a/WebCore/inspector/front-end/ResourcesPanel.js b/WebCore/inspector/front-end/ResourcesPanel.js index ff0d1ab..27df5cf 100644 --- a/WebCore/inspector/front-end/ResourcesPanel.js +++ b/WebCore/inspector/front-end/ResourcesPanel.js @@ -883,7 +883,7 @@ WebInspector.ResourcesPanel.prototype.__proto__ = WebInspector.AbstractTimelineP WebInspector.getResourceContent = function(identifier, callback) { - InspectorBackend.getResourceContent(WebInspector.Callback.wrap(callback), identifier); + InspectorBackend.getResourceContent(identifier, callback); } WebInspector.ResourceTimeCalculator = function(startAtZero) diff --git a/WebCore/inspector/front-end/ScriptView.js b/WebCore/inspector/front-end/ScriptView.js index 74dc30a..d878e9b 100644 --- a/WebCore/inspector/front-end/ScriptView.js +++ b/WebCore/inspector/front-end/ScriptView.js @@ -56,10 +56,8 @@ WebInspector.ScriptView.prototype = { if (this.script.source) this._sourceFrameSetupFinished(); - else { - var callbackId = WebInspector.Callback.wrap(this._didGetScriptSource.bind(this)) - InspectorBackend.getScriptSource(callbackId, this.script.sourceID); - } + else + InspectorBackend.getScriptSource(this.script.sourceID, this._didGetScriptSource.bind(this)); }, _didGetScriptSource: function(source) diff --git a/WebCore/inspector/front-end/ScriptsPanel.js b/WebCore/inspector/front-end/ScriptsPanel.js index 7521ea9..75fd6f7 100644 --- a/WebCore/inspector/front-end/ScriptsPanel.js +++ b/WebCore/inspector/front-end/ScriptsPanel.js @@ -343,8 +343,7 @@ WebInspector.ScriptsPanel.prototype = { WebInspector.breakpointManager.setBreakpoint(sourceID, breakpoint.url, newLine, breakpoint.enabled, breakpoint.condition); } }; - var callbackId = WebInspector.Callback.wrap(mycallback.bind(this)) - InspectorBackend.editScriptSource(callbackId, sourceID, newContent); + InspectorBackend.editScriptSource(sourceID, newContent, mycallback.bind(this)); }, selectedCallFrameId: function() diff --git a/WebCore/inspector/front-end/Settings.js b/WebCore/inspector/front-end/Settings.js index 33a1b91..41d82f9 100644 --- a/WebCore/inspector/front-end/Settings.js +++ b/WebCore/inspector/front-end/Settings.js @@ -81,10 +81,10 @@ WebInspector.Settings.initialize = function() WebInspector.sessionSettings.dispatchEventToListeners("loaded"); } - InspectorBackend.getSettings(WebInspector.Callback.wrap(function(settings) { + InspectorBackend.getSettings(function(settings) { populateApplicationSettings(settings.application); populateSessionSettings(settings.session); - })); + }); } WebInspector.Settings.prototype = { diff --git a/WebCore/inspector/front-end/SourceCSSTokenizer.re2js b/WebCore/inspector/front-end/SourceCSSTokenizer.re2js index b4d3eef..f4628d2 100644 --- a/WebCore/inspector/front-end/SourceCSSTokenizer.re2js +++ b/WebCore/inspector/front-end/SourceCSSTokenizer.re2js @@ -48,7 +48,7 @@ WebInspector.SourceCSSTokenizer = function() this._valueKeywords = [ "above", "absolute", "activeborder", "activecaption", "afar", "after-white-space", "ahead", "alias", "all", "all-scroll", - "alternate", "always","amharic", "amharic-abegede", "antialiased", "appworkspace", "aqua", "arabic-indic", "armenian", + "alternate", "always","amharic", "amharic-abegede", "antialiased", "appworkspace", "aqua", "arabic-indic", "armenian", "asterisks", "auto", "avoid", "background", "backwards", "baseline", "below", "bidi-override", "binary", "bengali", "black", "blink", "block", "block-axis", "blue", "bold", "bolder", "border", "border-box", "both", "bottom", "break-all", "break-word", "button", "button-bevel", "buttonface", "buttonhighlight", "buttonshadow", "buttontext", "cambodian", "capitalize", "caps-lock-indicator", @@ -61,7 +61,7 @@ WebInspector.SourceCSSTokenizer = function() "ethiopic-abegede-ti-er", "ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er", "ethiopic-halehame-aa-et", "ethiopic-halehame-am-et", "ethiopic-halehame-gez", "ethiopic-halehame-om-et", "ethiopic-halehame-sid-et", "ethiopic-halehame-so-et", "ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", "ethiopic-halehame-tig", "ew-resize", "expanded", - "extra-condensed", "extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "forwards", "from", "fuchsia", "geometricPrecision", + "extra-condensed", "extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "footnotes", "forwards", "from", "fuchsia", "geometricPrecision", "georgian", "gray", "graytext", "green", "grey", "groove", "gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hebrew", "help", "hidden", "hide", "higher", "highlight", "highlighttext", "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "icon", "ignore", "inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite", "infobackground", "infotext", "inherit", "initial", "inline", diff --git a/WebCore/inspector/front-end/WebKit.qrc b/WebCore/inspector/front-end/WebKit.qrc index 4901857..b640936 100644 --- a/WebCore/inspector/front-end/WebKit.qrc +++ b/WebCore/inspector/front-end/WebKit.qrc @@ -4,6 +4,7 @@ <file>AbstractTimelinePanel.js</file> <file>ApplicationCacheItemsView.js</file> <file>AuditCategories.js</file> + <file>AuditFormatters.js</file> <file>AuditLauncherView.js</file> <file>AuditResultView.js</file> <file>AuditRules.js</file> @@ -35,11 +36,14 @@ <file>ElementsTreeOutline.js</file> <file>EventListenersSidebarPane.js</file> <file>ExtensionAPI.js</file> + <file>ExtensionAuditCategory.js</file> + <file>ExtensionCommon.js</file> <file>ExtensionPanel.js</file> <file>ExtensionRegistryStub.js</file> <file>ExtensionServer.js</file> <file>FontView.js</file> <file>HAREntry.js</file> + <file>HeapSnapshotView.js</file> <file>HelpScreen.js</file> <file>ImageView.js</file> <file>InjectedFakeWorker.js</file> diff --git a/WebCore/inspector/front-end/inspector.css b/WebCore/inspector/front-end/inspector.css index 4319816..a3ffa44 100644 --- a/WebCore/inspector/front-end/inspector.css +++ b/WebCore/inspector/front-end/inspector.css @@ -3910,6 +3910,115 @@ button.enable-toggle-status-bar-item .glyph { -webkit-mask-image: url(Images/reloadButtonGlyph.png); } +/* Heap Snapshot View Styles */ + +/* FIXME: move to a separate css file */ +.heap-snapshot-sidebar-tree-item .icon { + content: url(Images/profileIcon.png); +} + +.heap-snapshot-sidebar-tree-item.small .icon { + content: url(Images/profileSmallIcon.png); +} + +.heap-snapshot-view { + display: none; + overflow: hidden; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; +} + +.heap-snapshot-view.visible { + display: block; +} + +.heap-snapshot-view .data-grid { + border: none; + max-height: 100%; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 93px; +} + +.heap-snapshot-view .data-grid th.count-column { + text-align: center; +} + +.heap-snapshot-view .data-grid td.count-column { + text-align: right; +} + +.heap-snapshot-view .data-grid th.size-column { + text-align: center; +} + +.heap-snapshot-view .data-grid td.size-column { + text-align: right; +} + +.heap-snapshot-view .data-grid th.countDelta-column { + text-align: center; +} + +.heap-snapshot-view .data-grid td.countDelta-column { + text-align: right; +} + +.heap-snapshot-view .data-grid th.sizeDelta-column { + text-align: center; +} + +.heap-snapshot-view .data-grid td.sizeDelta-column { + text-align: right; +} + +#heap-snapshot-summary-container { + position: absolute; + padding-top: 20px; + bottom: 0; + left: 0; + right: 0; + height: 93px; + margin-left: -1px; + border-left: 1px solid rgb(102, 102, 102); + background-color: rgb(101, 111, 130); + background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0))); + background-repeat: repeat-x; + background-position: top; + text-align: center; + text-shadow: black 0 1px 1px; + white-space: nowrap; + color: white; + -webkit-background-size: 1px 6px; + -webkit-background-origin: padding; + -webkit-background-clip: padding; +} + +.heap-snapshot-summary { + display: inline-block; + width: 50%; + min-width: 300px; + position: relative; +} + +.heap-snapshot-summary canvas.summary-graph { + width: 225px; +} + +.heap-snapshot-summary-label { + font-size: 12px; + font-weight: bold; + position: absolute; + top: 1px; + width: 50%; + left: 25%; +} + .delete-storage-status-bar-item .glyph { -webkit-mask-image: url(Images/excludeButtonGlyph.png); } diff --git a/WebCore/inspector/front-end/inspector.html b/WebCore/inspector/front-end/inspector.html index 14e2cdc..3e4b6c1 100644 --- a/WebCore/inspector/front-end/inspector.html +++ b/WebCore/inspector/front-end/inspector.html @@ -98,6 +98,8 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. <script type="text/javascript" src="ProfilesPanel.js"></script> <script type="text/javascript" src="ConsolePanel.js"></script> <script type="text/javascript" src="ExtensionAPI.js"></script> + <script type="text/javascript" src="ExtensionAuditCategory.js"></script> + <script type="text/javascript" src="ExtensionCommon.js"></script> <script type="text/javascript" src="ExtensionServer.js"></script> <script type="text/javascript" src="ExtensionPanel.js"></script> <script type="text/javascript" src="AuditsPanel.js"></script> @@ -105,6 +107,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. <script type="text/javascript" src="AuditLauncherView.js"></script> <script type="text/javascript" src="AuditRules.js"></script> <script type="text/javascript" src="AuditCategories.js"></script> + <script type="text/javascript" src="AuditFormatters.js"></script> <script type="text/javascript" src="ResourceView.js"></script> <script type="text/javascript" src="SourceFrame.js"></script> <script type="text/javascript" src="DOMSyntaxHighlighter.js"></script> @@ -125,6 +128,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. <script type="text/javascript" src="BottomUpProfileDataGridTree.js"></script> <script type="text/javascript" src="TopDownProfileDataGridTree.js"></script> <script type="text/javascript" src="ProfileView.js"></script> + <script type="text/javascript" src="HeapSnapshotView.js"></script> <script type="text/javascript" src="DOMAgent.js"></script> <script type="text/javascript" src="InjectedScript.js"></script> <script type="text/javascript" src="InjectedScriptAccess.js"></script> diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js index db89e20..0bff335 100644 --- a/WebCore/inspector/front-end/inspector.js +++ b/WebCore/inspector/front-end/inspector.js @@ -233,6 +233,8 @@ var WebInspector = { if (hiddenPanels.indexOf("profiles") === -1) { this.panels.profiles = new WebInspector.ProfilesPanel(); this.panels.profiles.registerProfileType(new WebInspector.CPUProfileType()); + if (Preferences.heapProfilerPresent) + this.panels.profiles.registerProfileType(new WebInspector.HeapSnapshotProfileType()); } if (hiddenPanels.indexOf("storage") === -1 && hiddenPanels.indexOf("databases") === -1) this.panels.storage = new WebInspector.StoragePanel(); @@ -583,7 +585,7 @@ WebInspector.doLoadedDone = function() InspectorBackend.populateScriptObjects(); // As a DOMAgent method, this needs to happen after the frontend has loaded and the agent is available. - InspectorBackend.getSupportedCSSProperties(WebInspector.Callback.wrap(WebInspector.CSSCompletions._load)); + InspectorBackend.getSupportedCSSProperties(WebInspector.CSSCompletions._load); } WebInspector.addPanelToolbarIcon = function(toolbarElement, panel, previousToolbarItem) @@ -632,27 +634,29 @@ WebInspector.dispatch = function(message) { WebInspector_syncDispatch = function(message) { var messageObject = (typeof message === "string") ? JSON.parse(message) : message; - if (messageObject.type === "response" && !messageObject.success) { - WebInspector.removeResponseCallbackEntry(messageObject.seq) - WebInspector.reportProtocolError(messageObject); - return; - } var arguments = []; if (messageObject.data) for (var key in messageObject.data) arguments.push(messageObject.data[key]); + if ("seq" in messageObject) { // just a response for some request + if (messageObject.success) + WebInspector.processResponse(messageObject.seq, arguments); + else { + WebInspector.removeResponseCallbackEntry(messageObject.seq) + WebInspector.reportProtocolError(messageObject); + } + return; + } + if (messageObject.type === "event") { - if (!messageObject.event in WebInspector) { - console.error("Attempted to dispatch unimplemented WebInspector method: %s", messageObject.event); + if (!(messageObject.event in WebInspector)) { + console.error("Protocol Error: Attempted to dispatch an unimplemented WebInspector method '%s'", messageObject.event); return; } WebInspector[messageObject.event].apply(WebInspector, arguments); } - - if (messageObject.type === "response") - WebInspector.processResponse(messageObject.seq, arguments); } WebInspector.dispatchMessageFromBackend = function(messageObject) @@ -662,7 +666,7 @@ WebInspector.dispatchMessageFromBackend = function(messageObject) WebInspector.reportProtocolError = function(messageObject) { - console.error("Error: InspectorBackend." + messageObject.command + " failed."); + console.error("Protocol Error: InspectorBackend request with seq = %d failed.", messageObject.seq); for (var error in messageObject.errors) console.error(" " + error); WebInspector.removeResponseCallbackEntry(messageObject.seq); @@ -1444,6 +1448,7 @@ WebInspector.failedToParseScriptSource = function(sourceURL, source, startingLin WebInspector.pausedScript = function(callFrames) { this.panels.scripts.debuggerPaused(callFrames); + InspectorFrontendHost.bringToFront(); } WebInspector.resumedScript = function() diff --git a/WebCore/inspector/front-end/utilities.js b/WebCore/inspector/front-end/utilities.js index 66cf284..e8adff6 100644 --- a/WebCore/inspector/front-end/utilities.js +++ b/WebCore/inspector/front-end/utilities.js @@ -732,12 +732,6 @@ Array.convert = function(list) function insertionIndexForObjectInListSortedByFunction(anObject, aList, aFunction) { - // indexOf returns (-lowerBound - 1). Taking (-result - 1) works out to lowerBound. - return (-indexOfObjectInListSortedByFunction(anObject, aList, aFunction) - 1); -} - -function indexOfObjectInListSortedByFunction(anObject, aList, aFunction) -{ var first = 0; var last = aList.length - 1; var floor = Math.floor; @@ -760,9 +754,7 @@ function indexOfObjectInListSortedByFunction(anObject, aList, aFunction) } } - // By returning 1 less than the negative lower search bound, we can reuse this function - // for both indexOf and insertionIndexFor, with some simple arithmetic. - return (-first - 1); + return first; } String.sprintf = function(format) diff --git a/WebCore/loader/CrossOriginAccessControl.cpp b/WebCore/loader/CrossOriginAccessControl.cpp index 630f2b7..f510704 100644 --- a/WebCore/loader/CrossOriginAccessControl.cpp +++ b/WebCore/loader/CrossOriginAccessControl.cpp @@ -71,9 +71,9 @@ bool isSimpleCrossOriginAccessRequest(const String& method, const HTTPHeaderMap& } typedef HashSet<String, CaseFoldingHash> HTTPHeaderSet; -static HTTPHeaderSet* createAllowedCrossOriginResponseHeadersSet() +static PassOwnPtr<HTTPHeaderSet> createAllowedCrossOriginResponseHeadersSet() { - HTTPHeaderSet* headerSet = new HashSet<String, CaseFoldingHash>; + OwnPtr<HTTPHeaderSet> headerSet = adoptPtr(new HashSet<String, CaseFoldingHash>); headerSet->add("cache-control"); headerSet->add("content-language"); @@ -82,12 +82,12 @@ static HTTPHeaderSet* createAllowedCrossOriginResponseHeadersSet() headerSet->add("last-modified"); headerSet->add("pragma"); - return headerSet; + return headerSet.release(); } bool isOnAccessControlResponseHeaderWhitelist(const String& name) { - AtomicallyInitializedStatic(HTTPHeaderSet*, allowedCrossOriginResponseHeaders = createAllowedCrossOriginResponseHeadersSet()); + AtomicallyInitializedStatic(HTTPHeaderSet*, allowedCrossOriginResponseHeaders = createAllowedCrossOriginResponseHeadersSet().leakPtr()); return allowedCrossOriginResponseHeaders->contains(name); } diff --git a/WebCore/loader/DocLoader.cpp b/WebCore/loader/DocLoader.cpp index d63123e..d04e148 100644 --- a/WebCore/loader/DocLoader.cpp +++ b/WebCore/loader/DocLoader.cpp @@ -180,6 +180,7 @@ CachedXSLStyleSheet* DocLoader::requestXSLStyleSheet(const String& url) #if ENABLE(LINK_PREFETCH) CachedResource* DocLoader::requestLinkPrefetch(const String& url) { + ASSERT(frame()); return requestResource(CachedResource::LinkPrefetch, url, String()); } #endif @@ -473,7 +474,7 @@ void DocLoader::requestPreload(CachedResource::Type type, const String& url, con resource->increasePreloadCount(); if (!m_preloads) - m_preloads.set(new ListHashSet<CachedResource*>); + m_preloads = adoptPtr(new ListHashSet<CachedResource*>); m_preloads->add(resource); #if PRELOAD_DEBUG diff --git a/WebCore/loader/DocumentLoader.cpp b/WebCore/loader/DocumentLoader.cpp index 26d66e8..1e18077 100644 --- a/WebCore/loader/DocumentLoader.cpp +++ b/WebCore/loader/DocumentLoader.cpp @@ -91,7 +91,7 @@ DocumentLoader::DocumentLoader(const ResourceRequest& req, const SubstituteData& , m_substituteResourceDeliveryTimer(this, &DocumentLoader::substituteResourceDeliveryTimerFired) , m_didCreateGlobalHistoryEntry(false) #if ENABLE(OFFLINE_WEB_APPLICATIONS) - , m_applicationCacheHost(new ApplicationCacheHost(this)) + , m_applicationCacheHost(adoptPtr(new ApplicationCacheHost(this))) #endif { } @@ -411,7 +411,7 @@ bool DocumentLoader::isLoadingInAPISense() const void DocumentLoader::addAllArchiveResources(Archive* archive) { if (!m_archiveResourceCollection) - m_archiveResourceCollection.set(new ArchiveResourceCollection); + m_archiveResourceCollection = adoptPtr(new ArchiveResourceCollection); ASSERT(archive); if (!archive) @@ -425,7 +425,7 @@ void DocumentLoader::addAllArchiveResources(Archive* archive) void DocumentLoader::addArchiveResource(PassRefPtr<ArchiveResource> resource) { if (!m_archiveResourceCollection) - m_archiveResourceCollection.set(new ArchiveResourceCollection); + m_archiveResourceCollection = adoptPtr(new ArchiveResourceCollection); ASSERT(resource); if (!resource) diff --git a/WebCore/loader/DocumentThreadableLoader.cpp b/WebCore/loader/DocumentThreadableLoader.cpp index 16f114d..a792144 100644 --- a/WebCore/loader/DocumentThreadableLoader.cpp +++ b/WebCore/loader/DocumentThreadableLoader.cpp @@ -83,7 +83,7 @@ DocumentThreadableLoader::DocumentThreadableLoader(Document* document, Threadabl ASSERT(m_options.crossOriginRequestPolicy == UseAccessControl); - OwnPtr<ResourceRequest> crossOriginRequest(new ResourceRequest(request)); + OwnPtr<ResourceRequest> crossOriginRequest = adoptPtr(new ResourceRequest(request)); crossOriginRequest->removeCredentials(); crossOriginRequest->setAllowCookies(m_options.allowCredentials); @@ -195,7 +195,7 @@ void DocumentThreadableLoader::didReceiveResponse(SubresourceLoader* loader, con return; } - OwnPtr<CrossOriginPreflightResultCacheItem> preflightResult(new CrossOriginPreflightResultCacheItem(m_options.allowCredentials)); + OwnPtr<CrossOriginPreflightResultCacheItem> preflightResult = adoptPtr(new CrossOriginPreflightResultCacheItem(m_options.allowCredentials)); if (!preflightResult->parse(response, accessControlErrorDescription) || !preflightResult->allowsCrossOriginMethod(m_actualRequest->httpMethod(), accessControlErrorDescription) || !preflightResult->allowsCrossOriginHeaders(m_actualRequest->httpHeaderFields(), accessControlErrorDescription)) { diff --git a/WebCore/loader/DocumentWriter.cpp b/WebCore/loader/DocumentWriter.cpp index d99f340..cd82d6e 100644 --- a/WebCore/loader/DocumentWriter.cpp +++ b/WebCore/loader/DocumentWriter.cpp @@ -72,7 +72,7 @@ void DocumentWriter::replaceDocument(const String& source) if (!source.isNull()) { if (!m_receivedData) { m_receivedData = true; - m_frame->document()->setParseMode(Document::Strict); + m_frame->document()->setCompatibilityMode(Document::NoQuirksMode); } // FIXME: This should call DocumentParser::appendBytes instead of append @@ -179,7 +179,7 @@ TextResourceDecoder* DocumentWriter::createDecoderIfNeeded() return m_decoder.get(); } -void DocumentWriter::reportDataRecieved() +void DocumentWriter::reportDataReceived() { ASSERT(m_decoder); if (!m_receivedData) { diff --git a/WebCore/loader/DocumentWriter.h b/WebCore/loader/DocumentWriter.h index b1007ef..531a632 100644 --- a/WebCore/loader/DocumentWriter.h +++ b/WebCore/loader/DocumentWriter.h @@ -69,7 +69,7 @@ public: // Exposed for DoucmentParser::appendBytes TextResourceDecoder* createDecoderIfNeeded(); - void reportDataRecieved(); + void reportDataReceived(); private: PassRefPtr<Document> createDocument(const KURL&); diff --git a/WebCore/loader/EmptyClients.h b/WebCore/loader/EmptyClients.h index 0d30713..32722d6 100644 --- a/WebCore/loader/EmptyClients.h +++ b/WebCore/loader/EmptyClients.h @@ -46,10 +46,6 @@ #include "ResourceError.h" #include "SearchPopupMenu.h" -#if USE(GLES2_RENDERING) -#include "GLES2Context.h" -#endif - /* This file holds empty Client stubs for use by WebCore. Viewless element needs to create a dummy Page->Frame->FrameView tree for use in parsing or executing JavaScript. @@ -203,11 +199,6 @@ public: virtual void scheduleCompositingLayerSync() {}; #endif -#if USE(GLES2_RENDERING) - virtual PassOwnPtr<GLES2Context> getOnscreenGLES2Context() { return 0; } - virtual PassOwnPtr<GLES2Context> getOffscreenGLES2Context() { return 0; } -#endif - #if PLATFORM(WIN) virtual void setLastSetCursorToCurrentCursor() { } #endif @@ -477,6 +468,10 @@ public: #if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) virtual void checkTextOfParagraph(const UChar*, int, uint64_t, Vector<TextCheckingResult>&) { }; #endif +#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) { } +#endif virtual void updateSpellingUIWithGrammarString(const String&, const GrammarDetail&) { } virtual void updateSpellingUIWithMisspelledWord(const String&) { } virtual void showSpellingUI(bool) { } diff --git a/WebCore/loader/FormSubmission.cpp b/WebCore/loader/FormSubmission.cpp index 22e89d7..98a545e 100644 --- a/WebCore/loader/FormSubmission.cpp +++ b/WebCore/loader/FormSubmission.cpp @@ -162,10 +162,10 @@ PassRefPtr<FormSubmission> FormSubmission::create(HTMLFormElement* form, const A String boundary; if (isMultiPartForm) { - formData = FormData::createMultiPart(domFormData->items(), domFormData->encoding(), document); + formData = FormData::createMultiPart(*(static_cast<FormDataList*>(domFormData.get())), domFormData->encoding(), document); boundary = formData->boundary().data(); } else { - formData = FormData::create(domFormData->items(), domFormData->encoding()); + formData = FormData::create(*(static_cast<FormDataList*>(domFormData.get())), domFormData->encoding()); if (attributes.method() == PostMethod && isMailtoForm) { // Convert the form data into a string that we put into the URL. appendMailtoPostFormDataToURL(actionURL, *formData, encodingType); diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp index dc2c68c..496cac9 100644 --- a/WebCore/loader/FrameLoader.cpp +++ b/WebCore/loader/FrameLoader.cpp @@ -166,11 +166,6 @@ static int numRequests(Document* document) return document->docLoader()->requestCount(); } -static inline bool canReferToParentFrameEncoding(const Frame* frame, const Frame* parentFrame) -{ - return parentFrame && parentFrame->document()->securityOrigin()->canAccess(frame->document()->securityOrigin()); -} - // This is not in the FrameLoader class to emphasize that it does not depend on // private FrameLoader data, and to avoid increasing the number of public functions // with access to private data. Since only this .cpp file needs it, making it @@ -841,6 +836,10 @@ void FrameLoader::checkCompleted() if (numRequests(m_frame->document())) return; + // Still waiting for elements that don't go through a FrameLoader? + if (m_frame->document()->isDelayingLoadEvent()) + return; + // OK, completed. m_isComplete = true; @@ -889,7 +888,7 @@ void FrameLoader::scheduleCheckLoadComplete() void FrameLoader::checkCallImplicitClose() { - if (m_didCallImplicitClose || m_frame->document()->parsing()) + if (m_didCallImplicitClose || m_frame->document()->parsing() || m_frame->document()->isDelayingLoadEvent()) return; if (!allChildrenAreComplete()) @@ -1187,10 +1186,8 @@ void FrameLoader::loadInSameDocument(const KURL& url, SerializedScriptValue* sta m_client->dispatchDidNavigateWithinPage(); - if (stateObject) { - m_frame->document()->statePopped(stateObject); - m_client->dispatchDidPopStateWithinPage(); - } + m_frame->document()->statePopped(stateObject ? stateObject : SerializedScriptValue::nullValue()); + m_client->dispatchDidPopStateWithinPage(); if (hashChange) { m_frame->document()->enqueueHashchangeEvent(oldURL, url); @@ -1968,7 +1965,8 @@ void FrameLoader::transitionToCommitted(PassRefPtr<CachedPage> cachedPage) history()->updateForBackForwardNavigation(); - if (history()->currentItem()) + // For cached pages, CachedFrame::restore will take care of firing the popstate event with the history item's state object + if (history()->currentItem() && !cachedPage) m_pendingStateObject = history()->currentItem()->stateObject(); // Create a document view for this document, or used the cached view. @@ -2182,6 +2180,10 @@ void FrameLoader::finishedLoading() dl->setPrimaryLoadComplete(true); m_client->dispatchDidLoadMainResource(dl.get()); checkLoadComplete(); + + DOMWindow* window = m_frame->existingDOMWindow(); + if (window && window->printDeferred()) + window->print(); } bool FrameLoader::isHostedByObjectElement() const @@ -2530,6 +2532,7 @@ void FrameLoader::closeAndRemoveChild(Frame* child) child->setView(0); if (child->ownerElement() && child->page()) child->page()->decrementFrameCount(); + // FIXME: The page isn't being destroyed, so it's not right to call a function named pageDestroyed(). child->pageDestroyed(); m_frame->tree()->removeChild(child); @@ -2618,6 +2621,7 @@ void FrameLoader::detachFromParent() parent->loader()->scheduleCheckCompleted(); } else { m_frame->setView(0); + // FIXME: The page isn't being destroyed, so it's not right to call a function named pageDestroyed(). m_frame->pageDestroyed(); } } @@ -2670,17 +2674,19 @@ void FrameLoader::addExtraFieldsToRequest(ResourceRequest& request, FrameLoadTyp request.setCachePolicy(documentLoader()->originalRequest().cachePolicy()); else request.setCachePolicy(UseProtocolCachePolicy); - } else if (loadType == FrameLoadTypeReload) { - request.setCachePolicy(ReloadIgnoringCacheData); - request.setHTTPHeaderField("Cache-Control", "max-age=0"); - } else if (loadType == FrameLoadTypeReloadFromOrigin) { - request.setCachePolicy(ReloadIgnoringCacheData); - request.setHTTPHeaderField("Cache-Control", "no-cache"); - request.setHTTPHeaderField("Pragma", "no-cache"); - } else if (request.isConditional()) + } else if (loadType == FrameLoadTypeReload || loadType == FrameLoadTypeReloadFromOrigin || request.isConditional()) request.setCachePolicy(ReloadIgnoringCacheData); else if (isBackForwardLoadType(loadType) && m_stateMachine.committedFirstRealDocumentLoad() && !request.url().protocolIs("https")) request.setCachePolicy(ReturnCacheDataElseLoad); + + if (request.cachePolicy() == ReloadIgnoringCacheData) { + if (loadType == FrameLoadTypeReload) + request.setHTTPHeaderField("Cache-Control", "max-age=0"); + else if (loadType == FrameLoadTypeReloadFromOrigin) { + request.setHTTPHeaderField("Cache-Control", "no-cache"); + request.setHTTPHeaderField("Pragma", "no-cache"); + } + } if (mainResource) request.setHTTPAccept(defaultAcceptHeader); @@ -3260,11 +3266,11 @@ void FrameLoader::navigateToDifferentDocument(HistoryItem* item, FrameLoadType l void FrameLoader::loadItem(HistoryItem* item, FrameLoadType loadType) { // We do same-document navigation in the following cases: - // - The HistoryItem corresponds to the same document. + // - The HistoryItem corresponds to the same document (or documents in the case of frames). // - The HistoryItem is not the same as the current item. HistoryItem* currentItem = history()->currentItem(); bool sameDocumentNavigation = currentItem && item != currentItem - && item->documentSequenceNumber() == currentItem->documentSequenceNumber(); + && item->hasSameDocuments(currentItem); #if ENABLE(WML) // All WML decks should go through the real load mechanism, not the scroll-to-anchor code diff --git a/WebCore/loader/HistoryController.cpp b/WebCore/loader/HistoryController.cpp index 144faa5..32a6a91 100644 --- a/WebCore/loader/HistoryController.cpp +++ b/WebCore/loader/HistoryController.cpp @@ -558,9 +558,10 @@ void HistoryController::recursiveGoToItem(HistoryItem* item, HistoryItem* fromIt // to match. // Note: If item and fromItem are the same, then we need to create a new // document. - if (item != fromItem && item->itemSequenceNumber() == fromItem->itemSequenceNumber() - && ((m_frame->tree()->name().isEmpty() && item->target().isEmpty()) || m_frame->tree()->name() == item->target()) - && childFramesMatchItem(item)) + if (item != fromItem + && item->itemSequenceNumber() == fromItem->itemSequenceNumber() + && currentFramesMatchItem(item) + && fromItem->hasSameFrames(item)) { // This content is good, so leave it alone and look for children that need reloading // Save form state (works from currentItem, since prevItem is nil) @@ -585,7 +586,7 @@ void HistoryController::recursiveGoToItem(HistoryItem* item, HistoryItem* fromIt for (int i = 0; i < size; ++i) { String childFrameName = childItems[i]->target(); HistoryItem* fromChildItem = fromItem->childItemWithTarget(childFrameName); - ASSERT(fromChildItem || fromItem->isTargetItem()); + ASSERT(fromChildItem); Frame* childFrame = m_frame->tree()->child(childFrameName); ASSERT(childFrame); childFrame->loader()->history()->recursiveGoToItem(childItems[i].get(), fromChildItem, type); @@ -595,10 +596,12 @@ void HistoryController::recursiveGoToItem(HistoryItem* item, HistoryItem* fromIt } } -// helper method that determines whether the subframes described by the item's subitems -// match our own current frameset -bool HistoryController::childFramesMatchItem(HistoryItem* item) const +// Helper method that determines whether the current frame tree matches given history item's. +bool HistoryController::currentFramesMatchItem(HistoryItem* item) const { + if ((!m_frame->tree()->name().isEmpty() || !item->target().isEmpty()) && m_frame->tree()->name() != item->target()) + return false; + const HistoryItemVector& childItems = item->children(); if (childItems.size() != m_frame->tree()->childCount()) return false; @@ -609,7 +612,6 @@ bool HistoryController::childFramesMatchItem(HistoryItem* item) const return false; } - // Found matches for all item targets return true; } @@ -655,12 +657,6 @@ void HistoryController::pushState(PassRefPtr<SerializedScriptValue> stateObject, m_currentItem->setStateObject(stateObject); m_currentItem->setURLString(urlString); - // Create a null state object for the previous HistoryItem so that we will - // generate a popstate event when navigating back to it. - // FIXME: http://webkit.org/b/41372 implies that we shouldn't need this. - if (!m_previousItem->stateObject()) - m_previousItem->setStateObject(SerializedScriptValue::create()); - page->backForwardList()->addItem(topItem.release()); } diff --git a/WebCore/loader/HistoryController.h b/WebCore/loader/HistoryController.h index 19902f8..487fdc9 100644 --- a/WebCore/loader/HistoryController.h +++ b/WebCore/loader/HistoryController.h @@ -86,7 +86,7 @@ private: PassRefPtr<HistoryItem> createItemTree(Frame* targetFrame, bool clipAtTarget); void recursiveGoToItem(HistoryItem*, HistoryItem*, FrameLoadType); - bool childFramesMatchItem(HistoryItem*) const; + bool currentFramesMatchItem(HistoryItem*) const; void updateBackForwardListClippedAtTarget(bool doClip); Frame* m_frame; diff --git a/WebCore/loader/ImageDocument.cpp b/WebCore/loader/ImageDocument.cpp index a1a9f80..702ed9d 100644 --- a/WebCore/loader/ImageDocument.cpp +++ b/WebCore/loader/ImageDocument.cpp @@ -177,7 +177,8 @@ ImageDocument::ImageDocument(Frame* frame, const KURL& url) , m_didShrinkImage(false) , m_shouldShrinkImage(shouldShrinkToFit()) { - setParseMode(Compat); + setCompatibilityMode(QuirksMode); + lockCompatibilityMode(); } PassRefPtr<DocumentParser> ImageDocument::createParser() diff --git a/WebCore/loader/ImageLoader.cpp b/WebCore/loader/ImageLoader.cpp index d169d3e..242bf94 100644 --- a/WebCore/loader/ImageLoader.cpp +++ b/WebCore/loader/ImageLoader.cpp @@ -31,6 +31,13 @@ #include "HTMLObjectElement.h" #include "RenderImage.h" +#if ENABLE(SVG) +#include "RenderSVGImage.h" +#endif +#if ENABLE(VIDEO) +#include "RenderVideo.h" +#endif + #if !ASSERT_DISABLED // ImageLoader objects are allocated as members of other objects, so generic pointer check would always fail. namespace WTF { @@ -130,11 +137,8 @@ void ImageLoader::setImage(CachedImage* newImage) oldImage->removeClient(this); } - if (RenderObject* renderer = m_element->renderer()) { - if (!renderer->isImage()) - return; - toRenderImage(renderer)->resetAnimation(); - } + if (RenderImageResource* imageResource = renderImageResource()) + imageResource->resetAnimation(); } void ImageLoader::updateFromElement() @@ -195,11 +199,8 @@ void ImageLoader::updateFromElement() oldImage->removeClient(this); } - if (RenderObject* renderer = m_element->renderer()) { - if (!renderer->isImage()) - return; - toRenderImage(renderer)->resetAnimation(); - } + if (RenderImageResource* imageResource = renderImageResource()) + imageResource->resetAnimation(); } void ImageLoader::updateFromElementIgnoringPreviousError() @@ -223,20 +224,42 @@ void ImageLoader::notifyFinished(CachedResource*) loadEventSender().dispatchEventSoon(this); } +RenderImageResource* ImageLoader::renderImageResource() +{ + RenderObject* renderer = m_element->renderer(); + + if (!renderer) + return 0; + + if (renderer->isImage()) + return toRenderImage(renderer)->imageResource(); + +#if ENABLE(SVG) + if (renderer->isSVGImage()) + return toRenderSVGImage(renderer)->imageResource(); +#endif + +#if ENABLE(VIDEO) + if (renderer->isVideo()) + return toRenderVideo(renderer)->imageResource(); +#endif + + return 0; +} + void ImageLoader::updateRenderer() { - if (RenderObject* renderer = m_element->renderer()) { - if (!renderer->isImage() && !renderer->isVideo()) - return; - RenderImage* imageRenderer = toRenderImage(renderer); - - // Only update the renderer if it doesn't have an image or if what we have - // is a complete image. This prevents flickering in the case where a dynamic - // change is happening between two images. - CachedImage* cachedImage = imageRenderer->cachedImage(); - if (m_image != cachedImage && (m_imageComplete || !cachedImage)) - imageRenderer->setCachedImage(m_image.get()); - } + RenderImageResource* imageResource = renderImageResource(); + + if (!imageResource) + return; + + // Only update the renderer if it doesn't have an image or if what we have + // is a complete image. This prevents flickering in the case where a dynamic + // change is happening between two images. + CachedImage* cachedImage = imageResource->cachedImage(); + if (m_image != cachedImage && (m_imageComplete || !cachedImage)) + imageResource->setCachedImage(m_image.get()); } void ImageLoader::dispatchPendingBeforeLoadEvent() diff --git a/WebCore/loader/ImageLoader.h b/WebCore/loader/ImageLoader.h index 02ddce8..9bf7624 100644 --- a/WebCore/loader/ImageLoader.h +++ b/WebCore/loader/ImageLoader.h @@ -31,6 +31,7 @@ namespace WebCore { class Element; class ImageLoadEventSender; +class RenderImageResource; class ImageLoader : public CachedResourceClient { public: @@ -72,6 +73,7 @@ private: void dispatchPendingBeforeLoadEvent(); void dispatchPendingLoadEvent(); + RenderImageResource* renderImageResource(); void updateRenderer(); Element* m_element; diff --git a/WebCore/loader/MediaDocument.cpp b/WebCore/loader/MediaDocument.cpp index 7e28d02..77c3d1f 100644 --- a/WebCore/loader/MediaDocument.cpp +++ b/WebCore/loader/MediaDocument.cpp @@ -71,6 +71,9 @@ void MediaDocumentParser::createDocumentStructure() ExceptionCode ec; RefPtr<Element> rootElement = document()->createElement(htmlTag, false); document()->appendChild(rootElement, ec); + + if (document()->frame() && document()->frame()->loader()) + document()->frame()->loader()->dispatchDocumentElementAvailable(); RefPtr<Element> body = document()->createElement(bodyTag, false); body->setAttribute(styleAttr, "background-color: rgb(38,38,38);"); @@ -110,7 +113,8 @@ MediaDocument::MediaDocument(Frame* frame, const KURL& url) : HTMLDocument(frame, url) , m_replaceMediaElementTimer(this, &MediaDocument::replaceMediaElementTimerFired) { - setParseMode(Compat); + setCompatibilityMode(QuirksMode); + lockCompatibilityMode(); } MediaDocument::~MediaDocument() diff --git a/WebCore/loader/PingLoader.cpp b/WebCore/loader/PingLoader.cpp index d2c6410..60c6f30 100644 --- a/WebCore/loader/PingLoader.cpp +++ b/WebCore/loader/PingLoader.cpp @@ -53,7 +53,7 @@ void PingLoader::loadImage(Frame* frame, const KURL& url) if (!SecurityOrigin::shouldHideReferrer(request.url(), frame->loader()->outgoingReferrer())) request.setHTTPReferrer(frame->loader()->outgoingReferrer()); frame->loader()->addExtraFieldsToSubresourceRequest(request); - OwnPtr<PingLoader> pingLoader(new PingLoader(frame, request)); + OwnPtr<PingLoader> pingLoader = adoptPtr(new PingLoader(frame, request)); // Leak the ping loader, since it will kill itself as soon as it receives a response. PingLoader* leakedPingLoader = pingLoader.leakPtr(); diff --git a/WebCore/loader/PluginDocument.cpp b/WebCore/loader/PluginDocument.cpp index 54e686c..ad11dfb 100644 --- a/WebCore/loader/PluginDocument.cpp +++ b/WebCore/loader/PluginDocument.cpp @@ -84,6 +84,9 @@ void PluginDocumentParser::createDocumentStructure() RefPtr<Element> rootElement = document()->createElement(htmlTag, false); document()->appendChild(rootElement, ec); + if (document()->frame() && document()->frame()->loader()) + document()->frame()->loader()->dispatchDocumentElementAvailable(); + RefPtr<Element> body = document()->createElement(bodyTag, false); body->setAttribute(marginwidthAttr, "0"); body->setAttribute(marginheightAttr, "0"); @@ -121,7 +124,7 @@ void PluginDocumentParser::appendBytes(DocumentWriter*, const char*, int, bool) document()->updateLayout(); - if (RenderWidget* renderer = toRenderWidget(m_embedElement->renderer())) { + if (RenderPart* renderer = m_embedElement->renderPart()) { frame->loader()->client()->redirectDataToPlugin(renderer->widget()); frame->loader()->activeDocumentLoader()->mainResourceLoader()->setShouldBufferData(false); } @@ -132,7 +135,8 @@ void PluginDocumentParser::appendBytes(DocumentWriter*, const char*, int, bool) PluginDocument::PluginDocument(Frame* frame, const KURL& url) : HTMLDocument(frame, url) { - setParseMode(Compat); + setCompatibilityMode(QuirksMode); + lockCompatibilityMode(); } PassRefPtr<DocumentParser> PluginDocument::createParser() diff --git a/WebCore/loader/ProgressTracker.cpp b/WebCore/loader/ProgressTracker.cpp index 88231c8..7f61cd1 100644 --- a/WebCore/loader/ProgressTracker.cpp +++ b/WebCore/loader/ProgressTracker.cpp @@ -169,7 +169,7 @@ void ProgressTracker::incrementProgress(unsigned long identifier, const Resource item->bytesReceived = 0; item->estimatedLength = estimatedLength; } else - m_progressItems.set(identifier, new ProgressItem(estimatedLength)); + m_progressItems.set(identifier, adoptPtr(new ProgressItem(estimatedLength)).leakPtr()); } void ProgressTracker::incrementProgress(unsigned long identifier, const char*, int length) diff --git a/WebCore/loader/RedirectScheduler.cpp b/WebCore/loader/RedirectScheduler.cpp index 26d7787..461baf7 100644 --- a/WebCore/loader/RedirectScheduler.cpp +++ b/WebCore/loader/RedirectScheduler.cpp @@ -250,7 +250,7 @@ void RedirectScheduler::scheduleRedirect(double delay, const String& url) // We want a new back/forward list item if the refresh timeout is > 1 second. if (!m_redirect || delay <= m_redirect->delay()) - schedule(new ScheduledRedirect(delay, url, true, delay <= 1, false)); + schedule(adoptPtr(new ScheduledRedirect(delay, url, true, delay <= 1, false))); } bool RedirectScheduler::mustLockBackForwardList(Frame* targetFrame, bool wasUserGesture) @@ -294,7 +294,7 @@ void RedirectScheduler::scheduleLocationChange(const String& url, const String& // This may happen when a frame changes the location of another frame. bool duringLoad = !loader->stateMachine()->committedFirstRealDocumentLoad(); - schedule(new ScheduledLocationChange(url, referrer, lockHistory, lockBackForwardList, wasUserGesture, duringLoad)); + schedule(adoptPtr(new ScheduledLocationChange(url, referrer, lockHistory, lockBackForwardList, wasUserGesture, duringLoad))); } void RedirectScheduler::scheduleFormSubmission(PassRefPtr<FormSubmission> submission) @@ -314,7 +314,7 @@ void RedirectScheduler::scheduleFormSubmission(PassRefPtr<FormSubmission> submis bool lockBackForwardList = mustLockBackForwardList(m_frame, UserGestureIndicator::processingUserGesture()) || (submission->state()->formSubmissionTrigger() == SubmittedByJavaScript && m_frame->tree()->parent()); - schedule(new ScheduledFormSubmission(submission, lockBackForwardList, duringLoad)); + schedule(adoptPtr(new ScheduledFormSubmission(submission, lockBackForwardList, duringLoad))); } void RedirectScheduler::scheduleRefresh(bool wasUserGesture) @@ -325,7 +325,7 @@ void RedirectScheduler::scheduleRefresh(bool wasUserGesture) if (url.isEmpty()) return; - schedule(new ScheduledRefresh(url.string(), m_frame->loader()->outgoingReferrer(), wasUserGesture)); + schedule(adoptPtr(new ScheduledRefresh(url.string(), m_frame->loader()->outgoingReferrer(), wasUserGesture))); } void RedirectScheduler::scheduleHistoryNavigation(int steps) @@ -341,18 +341,8 @@ void RedirectScheduler::scheduleHistoryNavigation(int steps) return; } -#if !ENABLE(HISTORY_ALWAYS_ASYNC) - // If the specified entry and the current entry have the same document (or documents, in there are frames), this is either a - // state object traversal or a fragment traversal (or both) and should be performed synchronously. - HistoryItem* currentEntry = m_frame->loader()->history()->currentItem(); - if (currentEntry != specifiedEntry && currentEntry->hasSameDocuments(specifiedEntry)) { - m_frame->loader()->history()->goToItem(specifiedEntry, FrameLoadTypeIndexedBackForward); - return; - } -#endif - // In all other cases, schedule the history traversal to occur asynchronously. - schedule(new ScheduledHistoryNavigation(steps)); + schedule(adoptPtr(new ScheduledHistoryNavigation(steps))); } void RedirectScheduler::timerFired(Timer<RedirectScheduler>*) diff --git a/WebCore/loader/SinkDocument.cpp b/WebCore/loader/SinkDocument.cpp index 262d318..47535dc 100644 --- a/WebCore/loader/SinkDocument.cpp +++ b/WebCore/loader/SinkDocument.cpp @@ -50,7 +50,8 @@ private: SinkDocument::SinkDocument(Frame* frame, const KURL& url) : HTMLDocument(frame, url) { - setParseMode(Compat); + setCompatibilityMode(QuirksMode); + lockCompatibilityMode(); } PassRefPtr<DocumentParser> SinkDocument::createParser() diff --git a/WebCore/loader/SubframeLoader.cpp b/WebCore/loader/SubframeLoader.cpp index f56ebf1..ceafb88 100644 --- a/WebCore/loader/SubframeLoader.cpp +++ b/WebCore/loader/SubframeLoader.cpp @@ -38,9 +38,8 @@ #include "HTMLAppletElement.h" #include "HTMLFrameElementBase.h" #include "HTMLNames.h" -#include "HTMLPlugInElement.h" +#include "HTMLPlugInImageElement.h" #include "MIMETypeRegistry.h" -#include "Node.h" #include "Page.h" #include "PluginData.h" #include "RenderEmbeddedObject.h" @@ -63,16 +62,6 @@ SubframeLoader::SubframeLoader(Frame* frame) { } -static HTMLPlugInElement* toPlugInElement(Node* node) -{ - if (!node) - return 0; - - ASSERT(node->hasTagName(objectTag) || node->hasTagName(embedTag) || node->hasTagName(appletTag)); - - return static_cast<HTMLPlugInElement*>(node); -} - void SubframeLoader::clear() { m_containsPlugins = false; @@ -99,7 +88,7 @@ bool SubframeLoader::requestFrame(HTMLFrameOwnerElement* ownerElement, const Str return true; } -bool SubframeLoader::requestObject(RenderEmbeddedObject* renderer, const String& url, const AtomicString& frameName, +bool SubframeLoader::requestObject(HTMLPlugInImageElement* ownerElement, const String& url, const AtomicString& frameName, const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues) { if (url.isEmpty() && mimeType.isEmpty()) @@ -110,6 +99,12 @@ bool SubframeLoader::requestObject(RenderEmbeddedObject* renderer, const String& return false; } + // FIXME: None of this code should use renderers! + RenderEmbeddedObject* renderer = ownerElement->renderEmbeddedObject(); + ASSERT(renderer); + if (!renderer) + return false; + KURL completedURL; if (!url.isEmpty()) completedURL = completeURL(url); @@ -126,19 +121,19 @@ bool SubframeLoader::requestObject(RenderEmbeddedObject* renderer, const String& return false; if (m_frame->document() && m_frame->document()->securityOrigin()->isSandboxed(SandboxPlugins)) return false; - return loadPlugin(renderer, completedURL, mimeType, paramNames, paramValues, useFallback); - } - ASSERT(renderer->node()->hasTagName(objectTag) || renderer->node()->hasTagName(embedTag)); - HTMLPlugInElement* element = static_cast<HTMLPlugInElement*>(renderer->node()); + ASSERT(ownerElement->hasTagName(objectTag) || ownerElement->hasTagName(embedTag)); + HTMLPlugInImageElement* pluginElement = static_cast<HTMLPlugInImageElement*>(ownerElement); + + return loadPlugin(pluginElement, completedURL, mimeType, paramNames, paramValues, useFallback); + } // If the plug-in element already contains a subframe, loadOrRedirectSubframe will re-use it. Otherwise, // it will create a new frame and set it as the RenderPart's widget, causing what was previously // in the widget to be torn down. - return loadOrRedirectSubframe(element, completedURL, frameName, true, true); + return loadOrRedirectSubframe(ownerElement, completedURL, frameName, true, true); } - #if ENABLE(PLUGIN_PROXY_FOR_VIDEO) PassRefPtr<Widget> SubframeLoader::loadMediaPlayerProxyPlugin(Node* node, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues) @@ -252,7 +247,7 @@ Frame* SubframeLoader::loadSubframe(HTMLFrameOwnerElement* ownerElement, const K marginHeight = o->getMarginHeight(); } - if (!SecurityOrigin::canLoad(url, referrer, 0)) { + if (!SecurityOrigin::canLoad(url, String(), ownerElement->document())) { FrameLoader::reportLocalLoadFailed(m_frame, url.string()); return 0; } @@ -304,7 +299,6 @@ bool SubframeLoader::allowPlugins(ReasonForCallingAllowPlugins reason) return allowed; } - bool SubframeLoader::shouldUsePlugin(const KURL& url, const String& mimeType, bool hasFallback, bool& useFallback) { if (m_frame->loader()->client()->shouldUsePluginDocument(mimeType)) { @@ -327,37 +321,46 @@ bool SubframeLoader::shouldUsePlugin(const KURL& url, const String& mimeType, bo useFallback = objectType == ObjectContentNone && hasFallback; return objectType == ObjectContentNone || objectType == ObjectContentNetscapePlugin || objectType == ObjectContentOtherPlugin; } - -bool SubframeLoader::loadPlugin(RenderEmbeddedObject* renderer, const KURL& url, const String& mimeType, + +Document* SubframeLoader::document() const +{ + return m_frame->document(); +} + +bool SubframeLoader::loadPlugin(HTMLPlugInImageElement* pluginElement, const KURL& url, const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues, bool useFallback) { - RefPtr<Widget> widget; + RenderEmbeddedObject* renderer = pluginElement->renderEmbeddedObject(); - if (renderer && !useFallback) { - HTMLPlugInElement* element = toPlugInElement(renderer->node()); + // FIXME: This code should not depend on renderer! + if (!renderer || useFallback) + return false; - if (!SecurityOrigin::canLoad(url, String(), m_frame->document())) { - FrameLoader::reportLocalLoadFailed(m_frame, url.string()); - return false; - } + if (!SecurityOrigin::canLoad(url, String(), document())) { + FrameLoader::reportLocalLoadFailed(m_frame, url.string()); + return false; + } - m_frame->loader()->checkIfRunInsecureContent(m_frame->document()->securityOrigin(), url); + FrameLoader* frameLoader = m_frame->loader(); + frameLoader->checkIfRunInsecureContent(document()->securityOrigin(), url); - widget = m_frame->loader()->client()->createPlugin(IntSize(renderer->contentWidth(), renderer->contentHeight()), - element, url, paramNames, paramValues, mimeType, - m_frame->document()->isPluginDocument() && !m_containsPlugins); - if (widget) { - renderer->setWidget(widget); - m_containsPlugins = true; + IntSize contentSize(renderer->contentWidth(), renderer->contentHeight()); + bool loadManually = document()->isPluginDocument() && !m_containsPlugins; + RefPtr<Widget> widget = frameLoader->client()->createPlugin(contentSize, + pluginElement, url, paramNames, paramValues, mimeType, loadManually); -#if ENABLE(PLUGIN_PROXY_FOR_VIDEO) - renderer->node()->setNeedsStyleRecalc(SyntheticStyleChange); -#endif - } else - renderer->setShowsMissingPluginIndicator(); + if (!widget) { + renderer->setShowsMissingPluginIndicator(); + return false; } - return widget; + renderer->setWidget(widget); + m_containsPlugins = true; + +#if ENABLE(PLUGIN_PROXY_FOR_VIDEO) + pluginElement->setNeedsStyleRecalc(SyntheticStyleChange); +#endif + return true; } KURL SubframeLoader::completeURL(const String& url) const diff --git a/WebCore/loader/SubframeLoader.h b/WebCore/loader/SubframeLoader.h index d42ef2c..6c3baf8 100644 --- a/WebCore/loader/SubframeLoader.h +++ b/WebCore/loader/SubframeLoader.h @@ -40,16 +40,17 @@ namespace WebCore { +class Document; class Frame; class FrameLoaderClient; class HTMLAppletElement; class HTMLFrameOwnerElement; +class HTMLPlugInImageElement; class IntSize; class KURL; #if ENABLE(PLUGIN_PROXY_FOR_VIDEO) class Node; #endif -class RenderEmbeddedObject; class Widget; // This is a slight misnomer. It handles the higher level logic of loading both subframes and plugins. @@ -60,10 +61,12 @@ public: void clear(); bool requestFrame(HTMLFrameOwnerElement*, const String& url, const AtomicString& frameName, bool lockHistory = true, bool lockBackForwardList = true); - bool requestObject(RenderEmbeddedObject*, const String& url, const AtomicString& frameName, + bool requestObject(HTMLPlugInImageElement*, const String& url, const AtomicString& frameName, const String& serviceType, const Vector<String>& paramNames, const Vector<String>& paramValues); #if ENABLE(PLUGIN_PROXY_FOR_VIDEO) + // FIXME: This should take Element* instead of Node*, or better yet the + // specific type of Element which this code depends on. PassRefPtr<Widget> loadMediaPlayerProxyPlugin(Node*, const KURL&, const Vector<String>& paramNames, const Vector<String>& paramValues); #endif @@ -76,11 +79,13 @@ public: private: Frame* loadOrRedirectSubframe(HTMLFrameOwnerElement*, const KURL&, const AtomicString& frameName, bool lockHistory, bool lockBackForwardList); Frame* loadSubframe(HTMLFrameOwnerElement*, const KURL&, const String& name, const String& referrer); - bool loadPlugin(RenderEmbeddedObject*, const KURL&, const String& mimeType, + bool loadPlugin(HTMLPlugInImageElement*, const KURL&, const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues, bool useFallback); bool shouldUsePlugin(const KURL&, const String& mimeType, bool hasFallback, bool& useFallback); + Document* document() const; + bool m_containsPlugins; Frame* m_frame; diff --git a/WebCore/loader/TextDocument.cpp b/WebCore/loader/TextDocument.cpp index 5e2b774..4b09a9e 100644 --- a/WebCore/loader/TextDocument.cpp +++ b/WebCore/loader/TextDocument.cpp @@ -202,6 +202,8 @@ bool TextDocumentParser::finishWasCalled() TextDocument::TextDocument(Frame* frame, const KURL& url) : HTMLDocument(frame, url) { + setCompatibilityMode(QuirksMode); + lockCompatibilityMode(); } PassRefPtr<DocumentParser> TextDocument::createParser() diff --git a/WebCore/loader/WorkerThreadableLoader.cpp b/WebCore/loader/WorkerThreadableLoader.cpp index 4789a05..4d18c28 100644 --- a/WebCore/loader/WorkerThreadableLoader.cpp +++ b/WebCore/loader/WorkerThreadableLoader.cpp @@ -193,7 +193,7 @@ static void workerContextDidReceiveData(ScriptExecutionContext* context, RefPtr< void WorkerThreadableLoader::MainThreadBridge::didReceiveData(const char* data, int lengthReceived) { - OwnPtr<Vector<char> > vector(new Vector<char>(lengthReceived)); // needs to be an OwnPtr for usage with createCallbackTask. + OwnPtr<Vector<char> > vector = adoptPtr(new Vector<char>(lengthReceived)); // needs to be an OwnPtr for usage with createCallbackTask. memcpy(vector->data(), data, lengthReceived); m_loaderProxy.postTaskForModeToWorkerContext(createCallbackTask(&workerContextDidReceiveData, m_workerClientWrapper, vector.release()), m_taskMode); } diff --git a/WebCore/loader/archive/ArchiveResource.cpp b/WebCore/loader/archive/ArchiveResource.cpp index 691f66a..7dedc93 100644 --- a/WebCore/loader/archive/ArchiveResource.cpp +++ b/WebCore/loader/archive/ArchiveResource.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008 Apple Inc. All rights reserved. + * Copyright (C) 2008, 2010 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -33,31 +33,8 @@ namespace WebCore { -PassRefPtr<ArchiveResource> ArchiveResource::create(PassRefPtr<SharedBuffer> data, const KURL& url, const ResourceResponse& response) -{ - return data ? adoptRef(new ArchiveResource(data, url, response)) : 0; -} - -PassRefPtr<ArchiveResource> ArchiveResource::create(PassRefPtr<SharedBuffer> data, const KURL& url, const String& mimeType, const String& textEncoding, const String& frameName) -{ - return data ? adoptRef(new ArchiveResource(data, url, mimeType, textEncoding, frameName)) : 0; -} - -PassRefPtr<ArchiveResource> ArchiveResource::create(PassRefPtr<SharedBuffer> data, const KURL& url, const String& mimeType, const String& textEncoding, const String& frameName, const ResourceResponse& resourceResponse) -{ - return data ? adoptRef(new ArchiveResource(data, url, mimeType, textEncoding, frameName, resourceResponse)) : 0; -} - -ArchiveResource::ArchiveResource(PassRefPtr<SharedBuffer> data, const KURL& url, const ResourceResponse& response) +inline ArchiveResource::ArchiveResource(PassRefPtr<SharedBuffer> data, const KURL& url, const String& mimeType, const String& textEncoding, const String& frameName, const ResourceResponse& response) : SubstituteResource(url, response, data) - , m_mimeType(response.mimeType()) - , m_textEncoding(response.textEncodingName()) - , m_shouldIgnoreWhenUnarchiving(false) -{ -} - -ArchiveResource::ArchiveResource(PassRefPtr<SharedBuffer> data, const KURL& url, const String& mimeType, const String& textEncoding, const String& frameName) - : SubstituteResource(url, ResourceResponse(url, mimeType, data ? data->size() : 0, textEncoding, String()), data) , m_mimeType(mimeType) , m_textEncoding(textEncoding) , m_frameName(frameName) @@ -65,13 +42,21 @@ ArchiveResource::ArchiveResource(PassRefPtr<SharedBuffer> data, const KURL& url, { } -ArchiveResource::ArchiveResource(PassRefPtr<SharedBuffer> data, const KURL& url, const String& mimeType, const String& textEncoding, const String& frameName, const ResourceResponse& response) - : SubstituteResource(url, response.isNull() ? ResourceResponse(url, mimeType, data ? data->size() : 0, textEncoding, String()) : response, data) - , m_mimeType(mimeType) - , m_textEncoding(textEncoding) - , m_frameName(frameName) - , m_shouldIgnoreWhenUnarchiving(false) +PassRefPtr<ArchiveResource> ArchiveResource::create(PassRefPtr<SharedBuffer> data, const KURL& url, const String& mimeType, const String& textEncoding, const String& frameName, const ResourceResponse& response) +{ + if (!data) + return 0; + if (response.isNull()) { + unsigned dataSize = data->size(); + return adoptRef(new ArchiveResource(data, url, mimeType, textEncoding, frameName, + ResourceResponse(url, mimeType, dataSize, textEncoding, String()))); + } + return adoptRef(new ArchiveResource(data, url, mimeType, textEncoding, frameName, response)); +} + +PassRefPtr<ArchiveResource> ArchiveResource::create(PassRefPtr<SharedBuffer> data, const KURL& url, const ResourceResponse& response) { + return create(data, url, response.mimeType(), response.textEncodingName(), String(), response); } } diff --git a/WebCore/loader/archive/ArchiveResource.h b/WebCore/loader/archive/ArchiveResource.h index d975e04..97d6e32 100644 --- a/WebCore/loader/archive/ArchiveResource.h +++ b/WebCore/loader/archive/ArchiveResource.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008 Apple Inc. All rights reserved. + * Copyright (C) 2008, 2010 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -31,32 +31,29 @@ #include "SubstituteResource.h" -#include "PlatformString.h" - namespace WebCore { class ArchiveResource : public SubstituteResource { public: static PassRefPtr<ArchiveResource> create(PassRefPtr<SharedBuffer>, const KURL&, const ResourceResponse&); - static PassRefPtr<ArchiveResource> create(PassRefPtr<SharedBuffer>, const KURL&, const String& mimeType, const String& textEncoding, const String& frameName); - static PassRefPtr<ArchiveResource> create(PassRefPtr<SharedBuffer>, const KURL&, const String& mimeType, const String& textEncoding, const String& frameName, const ResourceResponse&); - + static PassRefPtr<ArchiveResource> create(PassRefPtr<SharedBuffer>, const KURL&, + const String& mimeType, const String& textEncoding, const String& frameName, + const ResourceResponse& = ResourceResponse()); + const String& mimeType() const { return m_mimeType; } const String& textEncoding() const { return m_textEncoding; } const String& frameName() const { return m_frameName; } - + void ignoreWhenUnarchiving() { m_shouldIgnoreWhenUnarchiving = true; } bool shouldIgnoreWhenUnarchiving() const { return m_shouldIgnoreWhenUnarchiving; } private: - ArchiveResource(PassRefPtr<SharedBuffer>, const KURL&, const ResourceResponse&); - ArchiveResource(PassRefPtr<SharedBuffer>, const KURL&, const String& mimeType, const String& textEncoding, const String& frameName); ArchiveResource(PassRefPtr<SharedBuffer>, const KURL&, const String& mimeType, const String& textEncoding, const String& frameName, const ResourceResponse&); - + String m_mimeType; String m_textEncoding; String m_frameName; - + bool m_shouldIgnoreWhenUnarchiving; }; diff --git a/WebCore/loader/archive/cf/LegacyWebArchive.cpp b/WebCore/loader/archive/cf/LegacyWebArchive.cpp index 3a144c2..ea0ce74 100644 --- a/WebCore/loader/archive/cf/LegacyWebArchive.cpp +++ b/WebCore/loader/archive/cf/LegacyWebArchive.cpp @@ -233,7 +233,7 @@ PassRefPtr<ArchiveResource> LegacyWebArchive::createResource(CFDictionaryRef dic response = createResourceResponseFromPropertyListData(resourceResponseData, resourceResponseVersion); } - return ArchiveResource::create(SharedBuffer::create(CFDataGetBytePtr(resourceData), CFDataGetLength(resourceData)), KURL(ParsedURLString, url), mimeType, textEncoding, frameName, response); + return ArchiveResource::create(SharedBuffer::wrapCFData(resourceData), KURL(KURL(), url), mimeType, textEncoding, frameName, response); } PassRefPtr<LegacyWebArchive> LegacyWebArchive::create() diff --git a/WebCore/loader/icon/IconDatabase.cpp b/WebCore/loader/icon/IconDatabase.cpp index f708622..130b442 100644 --- a/WebCore/loader/icon/IconDatabase.cpp +++ b/WebCore/loader/icon/IconDatabase.cpp @@ -1846,7 +1846,7 @@ inline void readySQLiteStatement(OwnPtr<SQLiteStatement>& statement, SQLiteDatab statement.set(0); } if (!statement) { - statement.set(new SQLiteStatement(db, str)); + statement = adoptPtr(new SQLiteStatement(db, str)); if (statement->prepare() != SQLResultOk) LOG_ERROR("Preparing statement %s failed", str.ascii().data()); } diff --git a/WebCore/loader/icon/IconLoader.cpp b/WebCore/loader/icon/IconLoader.cpp index 6e2762f..877c80e 100644 --- a/WebCore/loader/icon/IconLoader.cpp +++ b/WebCore/loader/icon/IconLoader.cpp @@ -51,7 +51,7 @@ IconLoader::IconLoader(Frame* frame) PassOwnPtr<IconLoader> IconLoader::create(Frame* frame) { - return new IconLoader(frame); + return adoptPtr(new IconLoader(frame)); } IconLoader::~IconLoader() diff --git a/WebCore/manual-tests/print-before-load.html b/WebCore/manual-tests/print-before-load.html new file mode 100644 index 0000000..edec30b --- /dev/null +++ b/WebCore/manual-tests/print-before-load.html @@ -0,0 +1,16 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html> +<head> +<title>Print Test Page</title> +<body> + +<script language="JavaScript" type="text/javascript"> +window.print(); +</script> + +This webpage should pop up a print dialog. If you print from that dialog, you +should see this output on paper. + +</body> +</html> + diff --git a/WebCore/mathml/RenderMathMLRoot.cpp b/WebCore/mathml/RenderMathMLRoot.cpp index 4ed8c19..da303c9 100644 --- a/WebCore/mathml/RenderMathMLRoot.cpp +++ b/WebCore/mathml/RenderMathMLRoot.cpp @@ -99,7 +99,10 @@ void RenderMathMLRoot::paint(PaintInfo& info, int tx, int ty) if (info.context->paintingDisabled()) return; - + + if (!firstChild() || !lastChild()) + return; + tx += x(); ty += y(); @@ -203,11 +206,15 @@ void RenderMathMLRoot::paint(PaintInfo& info, int tx, int ty) void RenderMathMLRoot::layout() { RenderBlock::layout(); - + + if (!firstChild() || !lastChild()) + return; + int maxHeight = toRenderBoxModelObject(lastChild())->offsetHeight(); RenderObject* current = lastChild()->firstChild(); - current->style()->setVerticalAlign(BASELINE); + if (current) + current->style()->setVerticalAlign(BASELINE); if (!maxHeight) maxHeight = style()->fontSize(); @@ -228,6 +235,8 @@ void RenderMathMLRoot::layout() // Positioning of the index RenderBoxModelObject* indexBox = toRenderBoxModelObject(firstChild()->firstChild()); + if (!indexBox) + return; int indexShift = indexBox->offsetWidth() + topStartShift; int radicalHeight = static_cast<int>((1 - gRadicalTopLeftPointYPos) * maxHeight); diff --git a/WebCore/mathml/RenderMathMLSubSup.cpp b/WebCore/mathml/RenderMathMLSubSup.cpp index 52ac0e3..4cda36f 100644 --- a/WebCore/mathml/RenderMathMLSubSup.cpp +++ b/WebCore/mathml/RenderMathMLSubSup.cpp @@ -162,7 +162,7 @@ void RenderMathMLSubSup::layout() maxHeight = height; current = current->nextSibling(); } - int heightDiff = (m_scripts->offsetHeight() - maxHeight) / 2; + int heightDiff = m_scripts ? (m_scripts->offsetHeight() - maxHeight) / 2 : 0; if (heightDiff < 0) heightDiff = 0; base->style()->setMarginTop(Length(heightDiff, Fixed)); diff --git a/WebCore/notifications/Notification.h b/WebCore/notifications/Notification.h index 35f9cb8..f14a302 100644 --- a/WebCore/notifications/Notification.h +++ b/WebCore/notifications/Notification.h @@ -83,6 +83,7 @@ namespace WebCore { DEFINE_ATTRIBUTE_EVENT_LISTENER(display); DEFINE_ATTRIBUTE_EVENT_LISTENER(error); DEFINE_ATTRIBUTE_EVENT_LISTENER(close); + DEFINE_ATTRIBUTE_EVENT_LISTENER(click); using RefCounted<Notification>::ref; using RefCounted<Notification>::deref; diff --git a/WebCore/notifications/Notification.idl b/WebCore/notifications/Notification.idl index 5ca84a5..66a1229 100644 --- a/WebCore/notifications/Notification.idl +++ b/WebCore/notifications/Notification.idl @@ -41,6 +41,7 @@ module threads { attribute EventListener ondisplay; attribute EventListener onerror; attribute EventListener onclose; + attribute EventListener onclick; attribute DOMString dir; attribute DOMString replaceId; diff --git a/WebCore/page/ChromeClient.h b/WebCore/page/ChromeClient.h index eb2372d..224c8dc 100644 --- a/WebCore/page/ChromeClient.h +++ b/WebCore/page/ChromeClient.h @@ -68,10 +68,6 @@ namespace WebCore { class GraphicsLayer; #endif -#if USE(GLES2_RENDERING) - class GLES2Context; -#endif - #if ENABLE(NOTIFICATIONS) class NotificationPresenter; #endif @@ -234,16 +230,16 @@ namespace WebCore { virtual bool allowsAcceleratedCompositing() const { return true; } #endif -#if USE(GLES2_RENDERING) - // Request a GL ES 2 context to use for compositing this page's content. - virtual PassOwnPtr<GLES2Context> getOnscreenGLES2Context() = 0; - virtual PassOwnPtr<GLES2Context> getOffscreenGLES2Context() = 0; -#endif - virtual bool supportsFullscreenForNode(const Node*) { return false; } virtual void enterFullscreenForNode(Node*) { } virtual void exitFullscreenForNode(Node*) { } +#if ENABLE(FULLSCREEN_API) + virtual bool supportsFullScreenForElement(const Element*) { return false; } + virtual void enterFullScreenForElement(Element*) { } + virtual void exitFullScreenForElement(Element*) { } +#endif + #if ENABLE(TILED_BACKING_STORE) virtual IntRect visibleRectForTiledBackingStore() const { return IntRect(); } #endif diff --git a/WebCore/page/DOMSelection.cpp b/WebCore/page/DOMSelection.cpp index 106dd13..6c25103 100644 --- a/WebCore/page/DOMSelection.cpp +++ b/WebCore/page/DOMSelection.cpp @@ -214,21 +214,33 @@ void DOMSelection::collapse(Node* node, int offset, ExceptionCode& ec) m_frame->selection()->moveTo(VisiblePosition(node, offset, DOWNSTREAM)); } -void DOMSelection::collapseToEnd() +void DOMSelection::collapseToEnd(ExceptionCode& ec) { if (!m_frame) return; const VisibleSelection& selection = m_frame->selection()->selection(); + + if (selection.isNone()) { + ec = INVALID_STATE_ERR; + return; + } + m_frame->selection()->moveTo(VisiblePosition(selection.end(), DOWNSTREAM)); } -void DOMSelection::collapseToStart() +void DOMSelection::collapseToStart(ExceptionCode& ec) { if (!m_frame) return; const VisibleSelection& selection = m_frame->selection()->selection(); + + if (selection.isNone()) { + ec = INVALID_STATE_ERR; + return; + } + m_frame->selection()->moveTo(VisiblePosition(selection.start(), DOWNSTREAM)); } diff --git a/WebCore/page/DOMSelection.h b/WebCore/page/DOMSelection.h index b0421c7..b5fd197 100644 --- a/WebCore/page/DOMSelection.h +++ b/WebCore/page/DOMSelection.h @@ -74,8 +74,8 @@ namespace WebCore { bool isCollapsed() const; int rangeCount() const; void collapse(Node*, int offset, ExceptionCode&); - void collapseToEnd(); - void collapseToStart(); + void collapseToEnd(ExceptionCode&); + void collapseToStart(ExceptionCode&); void extend(Node*, int offset, ExceptionCode&); PassRefPtr<Range> getRangeAt(int, ExceptionCode&); void removeAllRanges(); diff --git a/WebCore/page/DOMSelection.idl b/WebCore/page/DOMSelection.idl index 4d0c942..ee82823 100644 --- a/WebCore/page/DOMSelection.idl +++ b/WebCore/page/DOMSelection.idl @@ -42,8 +42,10 @@ module window { void collapse(in Node node, in long index) raises(DOMException); - void collapseToEnd(); - void collapseToStart(); + void collapseToEnd() + raises(DOMException); + void collapseToStart() + raises(DOMException); void deleteFromDocument(); boolean containsNode(in Node node, in boolean allowPartial); diff --git a/WebCore/page/DOMWindow.cpp b/WebCore/page/DOMWindow.cpp index 86708de..a3d8090 100644 --- a/WebCore/page/DOMWindow.cpp +++ b/WebCore/page/DOMWindow.cpp @@ -63,6 +63,7 @@ #include "IDBKeyRange.h" #include "InspectorController.h" #include "InspectorTimelineAgent.h" +#include "KURL.h" #include "Location.h" #include "StyleMedia.h" #include "MessageEvent.h" @@ -87,6 +88,15 @@ #include <wtf/MathExtras.h> #include <wtf/text/CString.h> +#if ENABLE(FILE_SYSTEM) +#include "AsyncFileSystem.h" +#include "DOMFileSystem.h" +#include "ErrorCallback.h" +#include "FileError.h" +#include "FileSystemCallback.h" +#include "LocalFileSystem.h" +#endif + using std::min; using std::max; @@ -379,7 +389,8 @@ bool DOMWindow::canShowModalDialogNow(const Frame* frame) } DOMWindow::DOMWindow(Frame* frame) - : m_frame(frame) + : m_printDeferred(false), + m_frame(frame) { } @@ -719,6 +730,35 @@ IDBKeyRange* DOMWindow::iDBKeyRange() const } #endif +#if ENABLE(FILE_SYSTEM) +void DOMWindow::requestFileSystem(int type, long long size, PassRefPtr<FileSystemCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback) +{ + Document* document = this->document(); + if (!document) + return; + + if (!m_localFileSystem) { + // FIXME: See if access is allowed. + + Page* page = document->page(); + if (!page) { + DOMFileSystem::scheduleCallback(document, errorCallback, FileError::create(INVALID_STATE_ERR)); + return; + } + + // FIXME: Get the quota settings as well. + String path = page->settings()->fileSystemRootPath(); + m_localFileSystem = LocalFileSystem::create(path); + } + + m_localFileSystem->requestFileSystem(document, static_cast<AsyncFileSystem::Type>(type), size, successCallback, errorCallback); +} + +COMPILE_ASSERT(int(DOMWindow::TEMPORARY) == int(AsyncFileSystem::Temporary), enum_mismatch); +COMPILE_ASSERT(int(DOMWindow::PERSISTENT) == int(AsyncFileSystem::Persistent), enum_mismatch); + +#endif + void DOMWindow::postMessage(PassRefPtr<SerializedScriptValue> message, MessagePort* port, const String& targetOrigin, DOMWindow* source, ExceptionCode& ec) { MessagePortArray ports; @@ -861,6 +901,11 @@ void DOMWindow::print() if (!page) return; + if (m_frame->loader()->isLoading()) { + m_printDeferred = true; + return; + } + m_printDeferred = false; page->chrome()->print(m_frame); } @@ -1581,4 +1626,16 @@ EventTargetData* DOMWindow::ensureEventTargetData() return &m_eventTargetData; } +#if ENABLE(BLOB) +String DOMWindow::createBlobURL(Blob* blob) +{ + return scriptExecutionContext()->createPublicBlobURL(blob).string(); +} + +void DOMWindow::revokeBlobURL(const String& blobURLString) +{ + scriptExecutionContext()->revokePublicBlobURL(KURL(ParsedURLString, blobURLString)); +} +#endif + } // namespace WebCore diff --git a/WebCore/page/DOMWindow.h b/WebCore/page/DOMWindow.h index 8d57dcc..894aa08 100644 --- a/WebCore/page/DOMWindow.h +++ b/WebCore/page/DOMWindow.h @@ -40,6 +40,7 @@ namespace WebCore { class BarInfo; class BeforeUnloadEvent; + class Blob; class CSSRuleList; class CSSStyleDeclaration; class Console; @@ -48,14 +49,17 @@ namespace WebCore { class DatabaseCallback; class Document; class Element; + class ErrorCallback; class Event; class EventListener; + class FileSystemCallback; class FloatRect; class Frame; class History; class IDBFactory; class IDBKeyRange; class InspectorTimelineAgent; + class LocalFileSystem; class Location; class StyleMedia; class Navigator; @@ -90,6 +94,7 @@ namespace WebCore { virtual DOMWindow* toDOMWindow() { return this; } virtual ScriptExecutionContext* scriptExecutionContext() const; + bool printDeferred() const { return m_printDeferred; } Frame* frame() const { return m_frame; } void disconnectFrame(); @@ -236,6 +241,15 @@ namespace WebCore { IDBKeyRange* iDBKeyRange() const; #endif +#if ENABLE(FILE_SYSTEM) + // They are placed here and in all capital letters to enforce compile-time enum checking. + enum FileSystemType { + TEMPORARY, + PERSISTENT, + }; + void requestFileSystem(int type, long long size, PassRefPtr<FileSystemCallback>, PassRefPtr<ErrorCallback>); +#endif + void postMessage(PassRefPtr<SerializedScriptValue> message, const MessagePortArray*, const String& targetOrigin, DOMWindow* source, ExceptionCode&); // FIXME: remove this when we update the ObjC bindings (bug #28774). void postMessage(PassRefPtr<SerializedScriptValue> message, MessagePort*, const String& targetOrigin, DOMWindow* source, ExceptionCode&); @@ -381,6 +395,10 @@ namespace WebCore { #if ENABLE(OFFLINE_WEB_APPLICATIONS) DOMApplicationCache* optionalApplicationCache() const { return m_applicationCache.get(); } #endif +#if ENABLE(BLOB) + String createBlobURL(Blob*); + void revokeBlobURL(const String&); +#endif using RefCounted<DOMWindow>::ref; using RefCounted<DOMWindow>::deref; @@ -397,6 +415,7 @@ namespace WebCore { RefPtr<SecurityOrigin> m_securityOrigin; KURL m_url; + bool m_printDeferred; Frame* m_frame; mutable RefPtr<Screen> m_screen; mutable RefPtr<DOMSelection> m_selection; @@ -428,6 +447,9 @@ namespace WebCore { mutable RefPtr<IDBFactory> m_idbFactory; mutable RefPtr<IDBKeyRange> m_idbKeyRange; #endif +#if ENABLE(FILE_SYSTEM) + RefPtr<LocalFileSystem> m_localFileSystem; +#endif EventTargetData m_eventTargetData; diff --git a/WebCore/page/DOMWindow.idl b/WebCore/page/DOMWindow.idl index cabe68a..35b847c 100644 --- a/WebCore/page/DOMWindow.idl +++ b/WebCore/page/DOMWindow.idl @@ -176,6 +176,11 @@ module window { readonly attribute [EnabledAtRuntime] IDBFactory indexedDB; readonly attribute [EnabledAtRuntime] IDBKeyRange IDBKeyRange; #endif +#if defined(ENABLE_FILE_SYSTEM) && ENABLE_FILE_SYSTEM + 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); +#endif #if defined(ENABLE_ORIENTATION_EVENTS) && ENABLE_ORIENTATION_EVENTS // This is the interface orientation in degrees. Some examples are: @@ -465,9 +470,7 @@ module window { attribute [Conditional=3D_CANVAS,EnabledAtRuntime] WebGLRenderingContextConstructor WebGLRenderingContext; attribute TextMetricsConstructor TextMetrics; -#if !defined(V8_BINDING) || !V8_BINDING attribute DOMStringMapConstructor DOMStringMap; -#endif attribute [JSCCustomGetter,Conditional=3D_CANVAS,EnabledAtRuntime] ArrayBufferConstructor ArrayBuffer; // Usable with new operator attribute [JSCCustomGetter,Conditional=3D_CANVAS,EnabledAtRuntime] Int8ArrayConstructor Int8Array; // Usable with new operator @@ -744,6 +747,11 @@ module window { attribute [Conditional=BLOB] BlobBuilderConstructor BlobBuilder; +#if defined(ENABLE_BLOB) && ENABLE_BLOB + DOMString createBlobURL(in Blob blob); + void revokeBlobURL(in DOMString blobURL); +#endif + #endif // defined(LANGUAGE_JAVASCRIPT) #if defined(V8_BINDING) && V8_BINDING diff --git a/WebCore/page/EditorClient.h b/WebCore/page/EditorClient.h index 93e27ff..4a192d7 100644 --- a/WebCore/page/EditorClient.h +++ b/WebCore/page/EditorClient.h @@ -28,6 +28,7 @@ #define EditorClient_h #include "EditorInsertAction.h" +#include "FloatRect.h" #include "PlatformString.h" #include "TextAffinity.h" #include <wtf/Forward.h> @@ -51,6 +52,7 @@ namespace WebCore { class CSSStyleDeclaration; class EditCommand; +class Editor; class Element; class Frame; class HTMLElement; @@ -177,6 +179,12 @@ public: #if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) virtual void checkTextOfParagraph(const UChar* text, int length, uint64_t checkingTypes, Vector<TextCheckingResult>& results) = 0; #endif + +#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; +#endif + virtual void updateSpellingUIWithGrammarString(const String&, const GrammarDetail& detail) = 0; virtual void updateSpellingUIWithMisspelledWord(const String&) = 0; virtual void showSpellingUI(bool show) = 0; diff --git a/WebCore/page/EventHandler.cpp b/WebCore/page/EventHandler.cpp index 6263a4b..72cbe23 100644 --- a/WebCore/page/EventHandler.cpp +++ b/WebCore/page/EventHandler.cpp @@ -69,6 +69,7 @@ #include "Scrollbar.h" #include "SelectionController.h" #include "Settings.h" +#include "StyleCachedImage.h" #include "TextEvent.h" #include "TextIterator.h" #include "UserGestureIndicator.h" @@ -1083,10 +1084,13 @@ Cursor EventHandler::selectCursor(const MouseEventWithHitTestResults& event, Scr if (style && style->cursors()) { const CursorList* cursors = style->cursors(); for (unsigned i = 0; i < cursors->size(); ++i) { - const CachedImage* cimage = (*cursors)[i].image(); - IntPoint hotSpot = (*cursors)[i].hotSpot(); + const CachedImage* cimage = 0; + StyleImage* image = (*cursors)[i].image(); + if (image->isCachedImage()) + cimage = static_cast<StyleCachedImage*>(image)->cachedImage(); if (!cimage) continue; + IntPoint hotSpot = (*cursors)[i].hotSpot(); // Limit the size of cursors so that they cannot be used to cover UI elements in chrome. IntSize size = cimage->image()->size(); if (size.width() > 128 || size.height() > 128) diff --git a/WebCore/page/FocusController.cpp b/WebCore/page/FocusController.cpp index 2c2c447..a87d6a6 100644 --- a/WebCore/page/FocusController.cpp +++ b/WebCore/page/FocusController.cpp @@ -623,8 +623,11 @@ bool FocusController::setFocusedNode(Node* node, PassRefPtr<Frame> newFocusedFra // Setting the focused node can result in losing our last reft to node when JS event handlers fire. RefPtr<Node> protect = node; - if (newDocument) - newDocument->setFocusedNode(node); + if (newDocument) { + bool successfullyFocused = newDocument->setFocusedNode(node); + if (!successfullyFocused) + return false; + } if (newDocument->focusedNode() == node) m_page->editorClient()->setInputMethodState(node->shouldUseInputMethod()); @@ -641,7 +644,7 @@ void FocusController::setActive(bool active) if (FrameView* view = m_page->mainFrame()->view()) { if (!view->platformWidget()) { - view->layoutIfNeededRecursive(); + view->updateLayoutAndStyleIfNeededRecursive(); view->updateControlTints(); } } diff --git a/WebCore/page/Frame.cpp b/WebCore/page/Frame.cpp index c23368a..09cb8c3 100644 --- a/WebCore/page/Frame.cpp +++ b/WebCore/page/Frame.cpp @@ -150,7 +150,6 @@ inline Frame::Frame(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoader #endif , m_highlightTextMatches(false) , m_inViewSourceMode(false) - , m_needsReapplyStyles(false) , m_isDisconnected(false) , m_excludeFromTextSearch(false) { @@ -627,47 +626,13 @@ void Frame::setPrinting(bool printing, const FloatSize& pageSize, float maximumS m_doc->setPrinting(printing); view()->adjustMediaTypeForPrinting(printing); - m_doc->updateStyleSelector(); + m_doc->styleSelectorChanged(RecalcStyleImmediately); view()->forceLayoutForPagination(pageSize, maximumShrinkRatio, shouldAdjustViewSize); for (Frame* child = tree()->firstChild(); child; child = child->tree()->nextSibling()) child->setPrinting(printing, pageSize, maximumShrinkRatio, shouldAdjustViewSize); } -void Frame::setNeedsReapplyStyles() -{ - // When the frame is not showing web content, it doesn't make sense to apply styles. - // If we tried, we'd end up doing things with the document, but the document, if one - // exists, is not currently shown and should be in the page cache. - if (!m_loader.client()->hasHTMLView()) - return; - - if (m_needsReapplyStyles) - return; - - m_needsReapplyStyles = true; - - // FrameView's "layout" timer includes reapplyStyles, so despite its - // name, it's what we want to call here. - if (view()) - view()->scheduleRelayout(); -} - -void Frame::reapplyStyles() -{ - m_needsReapplyStyles = false; - - // FIXME: This call doesn't really make sense in a function called reapplyStyles. - // We should probably eventually move it into its own function. - m_doc->docLoader()->setAutoLoadImages(m_page && m_page->settings()->loadsImagesAutomatically()); - - // FIXME: It's not entirely clear why the following is needed. - // The document automatically does this as required when you set the style sheet. - // But we had problems when this code was removed. Details are in - // <http://bugs.webkit.org/show_bug.cgi?id=8079>. - m_doc->updateStyleSelector(); -} - void Frame::injectUserScripts(UserScriptInjectionTime injectionTime) { if (!m_page) @@ -774,24 +739,6 @@ void Frame::computeAndSetTypingStyle(CSSStyleDeclaration *style, EditAction edit m_typingStyle = mutableStyle.release(); } -String Frame::selectionStartStylePropertyValue(int stylePropertyID) const -{ - Node *nodeToRemove; - RefPtr<CSSStyleDeclaration> selectionStyle = selectionComputedStyle(nodeToRemove); - if (!selectionStyle) - return String(); - - String value = selectionStyle->getPropertyValue(stylePropertyID); - - if (nodeToRemove) { - ExceptionCode ec = 0; - nodeToRemove->remove(ec); - ASSERT(!ec); - } - - return value; -} - PassRefPtr<CSSComputedStyleDeclaration> Frame::selectionComputedStyle(Node*& nodeToRemove) const { nodeToRemove = 0; @@ -1262,7 +1209,7 @@ bool Frame::findString(const String& target, bool forward, bool caseFlag, bool w return true; } -unsigned Frame::markAllMatchesForText(const String& target, bool caseFlag, unsigned limit) +unsigned Frame::countMatchesForText(const String& target, bool caseFlag, unsigned limit, bool markMatches) { if (target.isEmpty()) return 0; @@ -1285,7 +1232,8 @@ unsigned Frame::markAllMatchesForText(const String& target, bool caseFlag, unsig // Only treat the result as a match if it is visible if (editor()->insideVisibleArea(resultRange.get())) { ++matchCount; - document()->markers()->addMarker(resultRange.get(), DocumentMarker::TextMatch); + if (markMatches) + document()->markers()->addMarker(resultRange.get(), DocumentMarker::TextMatch); } // Stop looking if we hit the specified limit. A limit of 0 means no limit. @@ -1303,16 +1251,16 @@ unsigned Frame::markAllMatchesForText(const String& target, bool caseFlag, unsig searchRange->setEnd(shadowTreeRoot, shadowTreeRoot->childNodeCount(), exception); } while (true); - // Do a "fake" paint in order to execute the code that computes the rendered rect for - // each text match. - Document* doc = document(); - if (m_view && contentRenderer()) { - doc->updateLayout(); // Ensure layout is up to date. - IntRect visibleRect = m_view->visibleContentRect(); - if (!visibleRect.isEmpty()) { - GraphicsContext context((PlatformGraphicsContext*)0); - context.setPaintingDisabled(true); - m_view->paintContents(&context, visibleRect); + if (markMatches) { + // Do a "fake" paint in order to execute the code that computes the rendered rect for each text match. + if (m_view && contentRenderer()) { + document()->updateLayout(); // Ensure layout is up to date. + IntRect visibleRect = m_view->visibleContentRect(); + if (!visibleRect.isEmpty()) { + GraphicsContext context((PlatformGraphicsContext*)0); + context.setPaintingDisabled(true); + m_view->paintContents(&context, visibleRect); + } } } @@ -1470,8 +1418,10 @@ void Frame::respondToChangedSelection(const VisibleSelection& oldSelection, bool // This only erases markers that are in the first unit (word or sentence) of the selection. // Perhaps peculiar, but it matches AppKit. - if (RefPtr<Range> wordRange = newAdjacentWords.toNormalizedRange()) + if (RefPtr<Range> wordRange = newAdjacentWords.toNormalizedRange()) { document()->markers()->removeMarkers(wordRange.get(), DocumentMarker::Spelling); + document()->markers()->removeMarkers(wordRange.get(), DocumentMarker::Replacement); + } if (RefPtr<Range> sentenceRange = newSelectedSentence.toNormalizedRange()) document()->markers()->removeMarkers(sentenceRange.get(), DocumentMarker::Grammar); } @@ -1572,7 +1522,7 @@ void Frame::tiledBackingStorePaintBegin() { if (!m_view) return; - m_view->layoutIfNeededRecursive(); + m_view->updateLayoutAndStyleIfNeededRecursive(); m_view->flushDeferredRepaints(); } diff --git a/WebCore/page/Frame.h b/WebCore/page/Frame.h index 36803f8..eb3cdba 100644 --- a/WebCore/page/Frame.h +++ b/WebCore/page/Frame.h @@ -164,10 +164,6 @@ namespace WebCore { void clearTimers(); static void clearTimers(FrameView*, Document*); - void setNeedsReapplyStyles(); - bool needsReapplyStyles() const; - void reapplyStyles(); - String documentTypeString() const; // This method -- and the corresponding list of former DOM windows -- @@ -197,7 +193,6 @@ namespace WebCore { void setMark(const VisibleSelection&); void computeAndSetTypingStyle(CSSStyleDeclaration* , EditAction = EditActionUnspecified); - String selectionStartStylePropertyValue(int stylePropertyID) const; void applyEditingStyleToBodyElement() const; void applyEditingStyleToElement(Element*) const; @@ -208,7 +203,7 @@ namespace WebCore { RenderStyle* styleForSelectionStart(Node*& nodeToRemove) const; - unsigned markAllMatchesForText(const String&, bool caseFlag, unsigned limit); + unsigned countMatchesForText(const String&, bool caseFlag, unsigned limit, bool markMatches); bool markedTextMatchesAreHighlighted() const; void setMarkedTextMatchesAreHighlighted(bool flag); @@ -329,7 +324,6 @@ namespace WebCore { bool m_highlightTextMatches; bool m_inViewSourceMode; - bool m_needsReapplyStyles; bool m_isDisconnected; bool m_excludeFromTextSearch; @@ -398,11 +392,6 @@ namespace WebCore { m_mark = s; } - inline bool Frame::needsReapplyStyles() const - { - return m_needsReapplyStyles; - } - inline CSSMutableStyleDeclaration* Frame::typingStyle() const { return m_typingStyle.get(); diff --git a/WebCore/page/FrameView.cpp b/WebCore/page/FrameView.cpp index f8a9418..ac9341f 100644 --- a/WebCore/page/FrameView.cpp +++ b/WebCore/page/FrameView.cpp @@ -137,6 +137,8 @@ FrameView::FrameView(Frame* frame) , m_fixedObjectCount(0) , m_layoutTimer(this, &FrameView::layoutTimerFired) , m_layoutRoot(0) + , m_hasPendingPostLayoutTasks(false) + , m_inSynchronousPostLayout(false) , m_postLayoutTasksTimer(this, &FrameView::postLayoutTimerFired) , m_isTransparent(false) , m_baseBackgroundColor(Color::white) @@ -173,7 +175,7 @@ PassRefPtr<FrameView> FrameView::create(Frame* frame, const IntSize& initialSize FrameView::~FrameView() { - if (m_postLayoutTasksTimer.isActive()) { + if (m_hasPendingPostLayoutTasks) { m_postLayoutTasksTimer.stop(); m_scheduledEvents.clear(); m_enqueueEvents = 0; @@ -213,6 +215,8 @@ void FrameView::reset() m_doFullRepaint = true; m_layoutSchedulingEnabled = true; m_inLayout = false; + m_inSynchronousPostLayout = false; + m_hasPendingPostLayoutTasks = false; m_layoutCount = 0; m_nestedLayoutCount = 0; m_postLayoutTasksTimer.stop(); @@ -528,8 +532,11 @@ bool FrameView::hasCompositedContent() const void FrameView::enterCompositingMode() { #if USE(ACCELERATED_COMPOSITING) - if (RenderView* view = m_frame->contentRenderer()) + if (RenderView* view = m_frame->contentRenderer()) { view->compositor()->enableCompositingMode(); + if (!needsLayout()) + view->compositor()->scheduleCompositingLayerUpdate(); + } #endif } @@ -647,24 +654,23 @@ void FrameView::layout(bool allowSubtree) m_layoutSchedulingEnabled = false; - if (!m_nestedLayoutCount && m_postLayoutTasksTimer.isActive()) { + if (!m_nestedLayoutCount && !m_inSynchronousPostLayout && m_hasPendingPostLayoutTasks) { // This is a new top-level layout. If there are any remaining tasks from the previous // layout, finish them now. + m_inSynchronousPostLayout = true; m_postLayoutTasksTimer.stop(); performPostLayoutTasks(); + m_inSynchronousPostLayout = false; } // Viewport-dependent media queries may cause us to need completely different style information. // Check that here. if (document->styleSelector()->affectedByViewportChange()) - document->updateStyleSelector(); + document->styleSelectorChanged(RecalcStyleImmediately); // Always ensure our style info is up-to-date. This can happen in situations where // the layout beats any sort of style recalc update that needs to occur. - if (m_frame->needsReapplyStyles()) - m_frame->reapplyStyles(); - else if (document->childNeedsStyleRecalc()) - document->recalcStyle(); + document->updateStyleIfNeeded(); bool subtree = m_layoutRoot; @@ -841,17 +847,25 @@ void FrameView::layout(bool allowSubtree) updateOverflowStatus(layoutWidth() < contentsWidth(), layoutHeight() < contentsHeight()); - if (!m_postLayoutTasksTimer.isActive()) { - // Calls resumeScheduledEvents() - performPostLayoutTasks(); + if (!m_hasPendingPostLayoutTasks) { + if (!m_inSynchronousPostLayout) { + m_inSynchronousPostLayout = true; + // Calls resumeScheduledEvents() + performPostLayoutTasks(); + m_inSynchronousPostLayout = false; + } - if (!m_postLayoutTasksTimer.isActive() && needsLayout()) { - // Post-layout widget updates or an event handler made us need layout again. - // Lay out again, but this time defer widget updates and event dispatch until after - // we return. + if (!m_hasPendingPostLayoutTasks && (needsLayout() || m_inSynchronousPostLayout)) { + // If we need layout or are already in a synchronous call to postLayoutTasks(), + // defer widget updates and event dispatch until after we return. postLayoutTasks() + // can make us need to update again, and we can get stuck in a nasty cycle unless + // we call it through the timer here. + m_hasPendingPostLayoutTasks = true; m_postLayoutTasksTimer.startOneShot(0); - pauseScheduledEvents(); - layout(); + if (needsLayout()) { + pauseScheduledEvents(); + layout(); + } } } else { resumeScheduledEvents(); @@ -1468,12 +1482,9 @@ bool FrameView::needsLayout() const if (!m_frame) return false; RenderView* root = m_frame->contentRenderer(); - Document* document = m_frame->document(); return layoutPending() || (root && root->needsLayout()) || m_layoutRoot - || (document && document->childNeedsStyleRecalc()) // can occur when using WebKit ObjC interface - || m_frame->needsReapplyStyles() || (m_deferSetNeedsLayouts && m_setNeedsLayoutWasDeferred); } @@ -1490,6 +1501,8 @@ void FrameView::setNeedsLayout() void FrameView::unscheduleRelayout() { + m_postLayoutTasksTimer.stop(); + if (!m_layoutTimer.isActive()) return; @@ -1633,6 +1646,8 @@ bool FrameView::updateWidgets() void FrameView::performPostLayoutTasks() { + m_hasPendingPostLayoutTasks = false; + if (m_firstLayoutCallbackPending) { m_firstLayoutCallbackPending = false; m_frame->loader()->didFirstLayout(); @@ -1965,7 +1980,7 @@ void FrameView::paintContents(GraphicsContext* p, const IntRect& rect) RenderView* contentRenderer = frame()->contentRenderer(); if (!contentRenderer) { - LOG_ERROR("called Frame::paint with nil renderer"); + LOG_ERROR("called FrameView::paint with nil renderer"); return; } @@ -2036,7 +2051,7 @@ void FrameView::setNodeToDraw(Node* node) m_nodeToDraw = node; } -void FrameView::layoutIfNeededRecursive() +void FrameView::updateLayoutAndStyleIfNeededRecursive() { // We have to crawl our entire tree looking for any FrameViews that need // layout and make sure they are up to date. @@ -2047,6 +2062,8 @@ void FrameView::layoutIfNeededRecursive() // region but then become included later by the second frame adding rects to the dirty region // when it lays out. + m_frame->document()->updateStyleIfNeeded(); + if (needsLayout()) layout(); @@ -2055,10 +2072,10 @@ void FrameView::layoutIfNeededRecursive() for (HashSet<RefPtr<Widget> >::const_iterator current = viewChildren->begin(); current != end; ++current) { Widget* widget = (*current).get(); if (widget->isFrameView()) - static_cast<FrameView*>(widget)->layoutIfNeededRecursive(); + static_cast<FrameView*>(widget)->updateLayoutAndStyleIfNeededRecursive(); } - // layoutIfNeededRecursive is called when we need to make sure layout is up-to-date before + // updateLayoutAndStyleIfNeededRecursive is called when we need to make sure style and layout are up-to-date before // painting, so we need to flush out any deferred repaints too. flushDeferredRepaints(); } diff --git a/WebCore/page/FrameView.h b/WebCore/page/FrameView.h index 47dff43..463020a 100644 --- a/WebCore/page/FrameView.h +++ b/WebCore/page/FrameView.h @@ -193,7 +193,7 @@ public: static double currentPaintTimeStamp() { return sCurrentPaintTimeStamp; } // returns 0 if not painting - void layoutIfNeededRecursive(); + void updateLayoutAndStyleIfNeededRecursive(); void flushDeferredRepaints(); void setIsVisuallyNonEmpty() { m_isVisuallyNonEmpty = true; } @@ -319,6 +319,8 @@ private: bool m_layoutSchedulingEnabled; bool m_inLayout; + bool m_hasPendingPostLayoutTasks; + bool m_inSynchronousPostLayout; int m_layoutCount; unsigned m_nestedLayoutCount; Timer<FrameView> m_postLayoutTasksTimer; diff --git a/WebCore/page/Page.cpp b/WebCore/page/Page.cpp index b8abb54..b9eea6a 100644 --- a/WebCore/page/Page.cpp +++ b/WebCore/page/Page.cpp @@ -277,7 +277,7 @@ void Page::setViewMode(ViewMode viewMode) m_mainFrame->view()->forceLayout(); if (m_mainFrame->document()) - m_mainFrame->document()->updateStyleSelector(); + m_mainFrame->document()->styleSelectorChanged(RecalcStyleImmediately); } void Page::setMainFrame(PassRefPtr<Frame> mainFrame) @@ -424,14 +424,14 @@ void Page::initGroup() m_group = m_singlePageGroup.get(); } -void Page::setNeedsReapplyStyles() +void Page::scheduleForcedStyleRecalcForAllPages() { if (!allPages) return; HashSet<Page*>::iterator end = allPages->end(); for (HashSet<Page*>::iterator it = allPages->begin(); it != end; ++it) for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree()->traverseNext()) - frame->setNeedsReapplyStyles(); + frame->document()->scheduleForcedStyleRecalc(); } void Page::refreshPlugins(bool reload) @@ -544,7 +544,7 @@ unsigned int Page::markAllMatchesForText(const String& target, TextCaseSensitivi Frame* frame = mainFrame(); do { frame->setMarkedTextMatchesAreHighlighted(shouldHighlight); - matches += frame->markAllMatchesForText(target, caseSensitivity == TextCaseSensitive, (limit == 0) ? 0 : (limit - matches)); + matches += frame->countMatchesForText(target, caseSensitivity == TextCaseSensitive, (limit == 0) ? 0 : (limit - matches), true); frame = incrementFrame(frame, true, false); } while (frame); @@ -657,7 +657,7 @@ void Page::userStyleSheetLocationChanged() for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext()) { if (frame->document()) - frame->document()->clearPageUserSheet(); + frame->document()->updatePageUserSheet(); } } diff --git a/WebCore/page/Page.h b/WebCore/page/Page.h index d9e9255..8f01faa 100644 --- a/WebCore/page/Page.h +++ b/WebCore/page/Page.h @@ -91,7 +91,7 @@ namespace WebCore { class Page : public Noncopyable { public: - static void setNeedsReapplyStyles(); + static void scheduleForcedStyleRecalcForAllPages(); // It is up to the platform to ensure that non-null clients are provided where required. struct PageClients { diff --git a/WebCore/page/PageGroup.cpp b/WebCore/page/PageGroup.cpp index aecd550..4c9403b 100644 --- a/WebCore/page/PageGroup.cpp +++ b/WebCore/page/PageGroup.cpp @@ -363,7 +363,7 @@ void PageGroup::resetUserStyleCacheInAllFrames() HashSet<Page*>::const_iterator end = m_pages.end(); for (HashSet<Page*>::const_iterator it = m_pages.begin(); it != end; ++it) { for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree()->traverseNext()) - frame->document()->clearPageGroupUserSheets(); + frame->document()->updatePageGroupUserSheets(); } #endif } diff --git a/WebCore/page/SecurityOrigin.cpp b/WebCore/page/SecurityOrigin.cpp index 5b51501..6edf32a 100644 --- a/WebCore/page/SecurityOrigin.cpp +++ b/WebCore/page/SecurityOrigin.cpp @@ -236,7 +236,13 @@ bool SecurityOrigin::canRequest(const KURL& url) const return false; RefPtr<SecurityOrigin> targetOrigin = SecurityOrigin::create(url); - if (targetOrigin->isUnique()) + + bool doUniqueOriginCheck = true; +#if ENABLE(BLOB) + // For blob scheme, we want to ignore this check. + doUniqueOriginCheck = !url.protocolIs("blob"); +#endif + if (doUniqueOriginCheck && targetOrigin->isUnique()) return false; // We call isSameSchemeHostPort here instead of canAccess because we want diff --git a/WebCore/page/Settings.cpp b/WebCore/page/Settings.cpp index a7ca533..47e764c 100644 --- a/WebCore/page/Settings.cpp +++ b/WebCore/page/Settings.cpp @@ -28,6 +28,7 @@ #include "BackForwardList.h" #include "Database.h" +#include "DocLoader.h" #include "Frame.h" #include "FrameTree.h" #include "FrameView.h" @@ -41,10 +42,16 @@ using namespace std; namespace WebCore { -static void setNeedsReapplyStylesInAllFrames(Page* page) +static void setNeedsRecalcStyleInAllFrames(Page* page) { for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext()) - frame->setNeedsReapplyStyles(); + frame->document()->styleSelectorChanged(DeferRecalcStyle); +} + +static void setLoadsImagesAutomaticallyInAllFrames(Page* page) +{ + for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext()) + frame->document()->docLoader()->setAutoLoadImages(page->settings()->loadsImagesAutomatically()); } #if USE(SAFARI_THEME) @@ -121,7 +128,7 @@ Settings::Settings(Page* page) , m_inApplicationChromeMode(false) , m_offlineWebApplicationCacheEnabled(false) , m_shouldPaintCustomScrollbars(false) - , m_enforceCSSMIMETypeInStrictMode(true) + , m_enforceCSSMIMETypeInNoQuirksMode(true) , m_usesEncodingDetector(false) , m_allowScriptsToCloseWindows(false) , m_editingBehaviorType( @@ -146,6 +153,9 @@ Settings::Settings(Page* page) , m_tiledBackingStoreEnabled(false) , m_paginateDuringLayoutEnabled(false) , m_dnsPrefetchingEnabled(true) +#if ENABLE(FULLSCREEN_API) + , m_fullScreenAPIEnabled(false) +#endif , m_memoryInfoEnabled(false) , m_interactiveFormValidation(false) #ifdef ANDROID_PLUGINS @@ -167,7 +177,7 @@ void Settings::setStandardFontFamily(const AtomicString& standardFontFamily) return; m_standardFontFamily = standardFontFamily; - setNeedsReapplyStylesInAllFrames(m_page); + setNeedsRecalcStyleInAllFrames(m_page); } void Settings::setFixedFontFamily(const AtomicString& fixedFontFamily) @@ -176,7 +186,7 @@ void Settings::setFixedFontFamily(const AtomicString& fixedFontFamily) return; m_fixedFontFamily = fixedFontFamily; - setNeedsReapplyStylesInAllFrames(m_page); + setNeedsRecalcStyleInAllFrames(m_page); } void Settings::setSerifFontFamily(const AtomicString& serifFontFamily) @@ -185,7 +195,7 @@ void Settings::setSerifFontFamily(const AtomicString& serifFontFamily) return; m_serifFontFamily = serifFontFamily; - setNeedsReapplyStylesInAllFrames(m_page); + setNeedsRecalcStyleInAllFrames(m_page); } void Settings::setSansSerifFontFamily(const AtomicString& sansSerifFontFamily) @@ -194,7 +204,7 @@ void Settings::setSansSerifFontFamily(const AtomicString& sansSerifFontFamily) return; m_sansSerifFontFamily = sansSerifFontFamily; - setNeedsReapplyStylesInAllFrames(m_page); + setNeedsRecalcStyleInAllFrames(m_page); } void Settings::setCursiveFontFamily(const AtomicString& cursiveFontFamily) @@ -203,7 +213,7 @@ void Settings::setCursiveFontFamily(const AtomicString& cursiveFontFamily) return; m_cursiveFontFamily = cursiveFontFamily; - setNeedsReapplyStylesInAllFrames(m_page); + setNeedsRecalcStyleInAllFrames(m_page); } void Settings::setFantasyFontFamily(const AtomicString& fantasyFontFamily) @@ -212,7 +222,7 @@ void Settings::setFantasyFontFamily(const AtomicString& fantasyFontFamily) return; m_fantasyFontFamily = fantasyFontFamily; - setNeedsReapplyStylesInAllFrames(m_page); + setNeedsRecalcStyleInAllFrames(m_page); } void Settings::setMinimumFontSize(int minimumFontSize) @@ -221,7 +231,7 @@ void Settings::setMinimumFontSize(int minimumFontSize) return; m_minimumFontSize = minimumFontSize; - setNeedsReapplyStylesInAllFrames(m_page); + setNeedsRecalcStyleInAllFrames(m_page); } void Settings::setMinimumLogicalFontSize(int minimumLogicalFontSize) @@ -230,7 +240,7 @@ void Settings::setMinimumLogicalFontSize(int minimumLogicalFontSize) return; m_minimumLogicalFontSize = minimumLogicalFontSize; - setNeedsReapplyStylesInAllFrames(m_page); + setNeedsRecalcStyleInAllFrames(m_page); } void Settings::setDefaultFontSize(int defaultFontSize) @@ -239,7 +249,7 @@ void Settings::setDefaultFontSize(int defaultFontSize) return; m_defaultFontSize = defaultFontSize; - setNeedsReapplyStylesInAllFrames(m_page); + setNeedsRecalcStyleInAllFrames(m_page); } void Settings::setDefaultFixedFontSize(int defaultFontSize) @@ -248,7 +258,7 @@ void Settings::setDefaultFixedFontSize(int defaultFontSize) return; m_defaultFixedFontSize = defaultFontSize; - setNeedsReapplyStylesInAllFrames(m_page); + setNeedsRecalcStyleInAllFrames(m_page); } #ifdef ANDROID_BLOCK_NETWORK_IMAGE @@ -261,6 +271,7 @@ void Settings::setBlockNetworkImage(bool blockNetworkImage) void Settings::setLoadsImagesAutomatically(bool loadsImagesAutomatically) { m_loadsImagesAutomatically = loadsImagesAutomatically; + setLoadsImagesAutomaticallyInAllFrames(m_page); } void Settings::setJavaScriptEnabled(bool isJavaScriptEnabled) @@ -365,7 +376,7 @@ void Settings::setTextAreasAreResizable(bool textAreasAreResizable) return; m_textAreasAreResizable = textAreasAreResizable; - setNeedsReapplyStylesInAllFrames(m_page); + setNeedsRecalcStyleInAllFrames(m_page); } void Settings::setEditableLinkBehavior(EditableLinkBehavior editableLinkBehavior) @@ -638,7 +649,7 @@ void Settings::setAuthorAndUserStylesEnabled(bool authorAndUserStylesEnabled) return; m_authorAndUserStylesEnabled = authorAndUserStylesEnabled; - setNeedsReapplyStylesInAllFrames(m_page); + setNeedsRecalcStyleInAllFrames(m_page); } void Settings::setFontRenderingMode(FontRenderingMode mode) @@ -646,7 +657,7 @@ void Settings::setFontRenderingMode(FontRenderingMode mode) if (fontRenderingMode() == mode) return; m_fontRenderingMode = mode; - setNeedsReapplyStylesInAllFrames(m_page); + setNeedsRecalcStyleInAllFrames(m_page); } FontRenderingMode Settings::fontRenderingMode() const @@ -679,6 +690,11 @@ void Settings::setLocalStorageDatabasePath(const String& path) m_localStorageDatabasePath = path; } +void Settings::setFileSystemRootPath(const String& path) +{ + m_fileSystemRootPath = path; +} + void Settings::setApplicationChromeMode(bool mode) { m_inApplicationChromeMode = mode; @@ -700,12 +716,12 @@ void Settings::setZoomMode(ZoomMode mode) return; m_zoomMode = mode; - setNeedsReapplyStylesInAllFrames(m_page); + setNeedsRecalcStyleInAllFrames(m_page); } -void Settings::setEnforceCSSMIMETypeInStrictMode(bool enforceCSSMIMETypeInStrictMode) +void Settings::setEnforceCSSMIMETypeInNoQuirksMode(bool enforceCSSMIMETypeInNoQuirksMode) { - m_enforceCSSMIMETypeInStrictMode = enforceCSSMIMETypeInStrictMode; + m_enforceCSSMIMETypeInNoQuirksMode = enforceCSSMIMETypeInNoQuirksMode; } #if USE(SAFARI_THEME) @@ -751,7 +767,7 @@ void Settings::setAcceleratedCompositingEnabled(bool enabled) return; m_acceleratedCompositingEnabled = enabled; - setNeedsReapplyStylesInAllFrames(m_page); + setNeedsRecalcStyleInAllFrames(m_page); } void Settings::setShowDebugBorders(bool enabled) @@ -760,7 +776,7 @@ void Settings::setShowDebugBorders(bool enabled) return; m_showDebugBorders = enabled; - setNeedsReapplyStylesInAllFrames(m_page); + setNeedsRecalcStyleInAllFrames(m_page); } void Settings::setShowRepaintCounter(bool enabled) @@ -769,7 +785,7 @@ void Settings::setShowRepaintCounter(bool enabled) return; m_showRepaintCounter = enabled; - setNeedsReapplyStylesInAllFrames(m_page); + setNeedsRecalcStyleInAllFrames(m_page); } void Settings::setExperimentalNotificationsEnabled(bool enabled) diff --git a/WebCore/page/Settings.h b/WebCore/page/Settings.h index 0048598..b95c62d 100644 --- a/WebCore/page/Settings.h +++ b/WebCore/page/Settings.h @@ -307,7 +307,10 @@ namespace WebCore { void setLocalStorageDatabasePath(const String&); const String& localStorageDatabasePath() const { return m_localStorageDatabasePath; } - + + void setFileSystemRootPath(const String&); + const String& fileSystemRootPath() const { return m_fileSystemRootPath; } + void setApplicationChromeMode(bool); bool inApplicationChromeMode() const { return m_inApplicationChromeMode; } @@ -320,8 +323,8 @@ namespace WebCore { void setZoomMode(ZoomMode); ZoomMode zoomMode() const { return m_zoomMode; } - void setEnforceCSSMIMETypeInStrictMode(bool); - bool enforceCSSMIMETypeInStrictMode() { return m_enforceCSSMIMETypeInStrictMode; } + void setEnforceCSSMIMETypeInNoQuirksMode(bool); + bool enforceCSSMIMETypeInNoQuirksMode() { return m_enforceCSSMIMETypeInNoQuirksMode; } void setMaximumDecodedImageSize(size_t size) { m_maximumDecodedImageSize = size; } size_t maximumDecodedImageSize() const { return m_maximumDecodedImageSize; } @@ -379,6 +382,11 @@ namespace WebCore { void setPaginateDuringLayoutEnabled(bool flag) { m_paginateDuringLayoutEnabled = flag; } bool paginateDuringLayoutEnabled() const { return m_paginateDuringLayoutEnabled; } +#if ENABLE(FULLSCREEN_API) + void setFullScreenEnabled(bool flag) { m_fullScreenAPIEnabled = flag; } + bool fullScreenEnabled() const { return m_fullScreenAPIEnabled; } +#endif + void setMemoryInfoEnabled(bool flag) { m_memoryInfoEnabled = flag; } bool memoryInfoEnabled() const { return m_memoryInfoEnabled; } @@ -391,10 +399,11 @@ namespace WebCore { private: Page* m_page; - + String m_defaultTextEncodingName; String m_ftpDirectoryTemplatePath; String m_localStorageDatabasePath; + String m_fileSystemRootPath; KURL m_userStyleSheetLocation; AtomicString m_standardFontFamily; AtomicString m_fixedFontFamily; @@ -492,7 +501,7 @@ namespace WebCore { bool m_inApplicationChromeMode : 1; bool m_offlineWebApplicationCacheEnabled : 1; bool m_shouldPaintCustomScrollbars : 1; - bool m_enforceCSSMIMETypeInStrictMode : 1; + bool m_enforceCSSMIMETypeInNoQuirksMode : 1; bool m_usesEncodingDetector : 1; bool m_allowScriptsToCloseWindows : 1; unsigned m_editingBehaviorType : 1; @@ -508,12 +517,19 @@ namespace WebCore { bool m_tiledBackingStoreEnabled : 1; bool m_paginateDuringLayoutEnabled : 1; bool m_dnsPrefetchingEnabled : 1; +#if ENABLE(FULLSCREEN_API) + bool m_fullScreenAPIEnabled : 1; +#endif bool m_memoryInfoEnabled: 1; bool m_interactiveFormValidation: 1; +<<<<<<< HEAD #ifdef ANDROID_PLUGINS bool m_pluginsOnDemand : 1; #endif +======= + +>>>>>>> webkit.org at r66666 #if USE(SAFARI_THEME) static bool gShouldPaintNativeControls; #endif diff --git a/WebCore/page/XSSAuditor.cpp b/WebCore/page/XSSAuditor.cpp index fb0e1c0..0e6cc65 100644 --- a/WebCore/page/XSSAuditor.cpp +++ b/WebCore/page/XSSAuditor.cpp @@ -277,19 +277,18 @@ String XSSAuditor::decodeHTMLEntities(const String& string, bool leaveUndecodabl if (leaveUndecodableEntitiesUntouched) sourceShadow = source; bool notEnoughCharacters = false; - unsigned entity = consumeHTMLEntity(source, notEnoughCharacters); + Vector<UChar, 16> decodedEntity; + bool success = consumeHTMLEntity(source, decodedEntity, notEnoughCharacters); // We ignore notEnoughCharacters because we might as well use this loop // to copy the remaining characters into |result|. - - if (entity > 0xFFFF) { - result.append(U16_LEAD(entity)); - result.append(U16_TRAIL(entity)); - } else if (entity && (!leaveUndecodableEntitiesUntouched || entity != 0xFFFD)){ - result.append(entity); - } else { + if (!success || (!leaveUndecodableEntitiesUntouched && decodedEntity.size() == 1 && decodedEntity[0] == 0xFFFD)) { result.append('&'); if (leaveUndecodableEntitiesUntouched) source = sourceShadow; + } else { + Vector<UChar>::const_iterator iter = decodedEntity.begin(); + for (; iter != decodedEntity.end(); ++iter) + result.append(*iter); } } diff --git a/WebCore/page/animation/AnimationBase.cpp b/WebCore/page/animation/AnimationBase.cpp index 4f304e2..d4926ea 100644 --- a/WebCore/page/animation/AnimationBase.cpp +++ b/WebCore/page/animation/AnimationBase.cpp @@ -644,10 +644,10 @@ void AnimationBase::ensurePropertyMap() gPropertyWrappers->append(new PropertyWrapper<Length>(CSSPropertyWebkitTransformOriginX, &RenderStyle::transformOriginX, &RenderStyle::setTransformOriginX)); gPropertyWrappers->append(new PropertyWrapper<Length>(CSSPropertyWebkitTransformOriginY, &RenderStyle::transformOriginY, &RenderStyle::setTransformOriginY)); gPropertyWrappers->append(new PropertyWrapper<float>(CSSPropertyWebkitTransformOriginZ, &RenderStyle::transformOriginZ, &RenderStyle::setTransformOriginZ)); - gPropertyWrappers->append(new PropertyWrapper<const IntSize&>(CSSPropertyBorderTopLeftRadius, &RenderStyle::borderTopLeftRadius, &RenderStyle::setBorderTopLeftRadius)); - gPropertyWrappers->append(new PropertyWrapper<const IntSize&>(CSSPropertyBorderTopRightRadius, &RenderStyle::borderTopRightRadius, &RenderStyle::setBorderTopRightRadius)); - gPropertyWrappers->append(new PropertyWrapper<const IntSize&>(CSSPropertyBorderBottomLeftRadius, &RenderStyle::borderBottomLeftRadius, &RenderStyle::setBorderBottomLeftRadius)); - gPropertyWrappers->append(new PropertyWrapper<const IntSize&>(CSSPropertyBorderBottomRightRadius, &RenderStyle::borderBottomRightRadius, &RenderStyle::setBorderBottomRightRadius)); + gPropertyWrappers->append(new PropertyWrapper<const LengthSize&>(CSSPropertyBorderTopLeftRadius, &RenderStyle::borderTopLeftRadius, &RenderStyle::setBorderTopLeftRadius)); + gPropertyWrappers->append(new PropertyWrapper<const LengthSize&>(CSSPropertyBorderTopRightRadius, &RenderStyle::borderTopRightRadius, &RenderStyle::setBorderTopRightRadius)); + gPropertyWrappers->append(new PropertyWrapper<const LengthSize&>(CSSPropertyBorderBottomLeftRadius, &RenderStyle::borderBottomLeftRadius, &RenderStyle::setBorderBottomLeftRadius)); + gPropertyWrappers->append(new PropertyWrapper<const LengthSize&>(CSSPropertyBorderBottomRightRadius, &RenderStyle::borderBottomRightRadius, &RenderStyle::setBorderBottomRightRadius)); gPropertyWrappers->append(new PropertyWrapper<EVisibility>(CSSPropertyVisibility, &RenderStyle::visibility, &RenderStyle::setVisibility)); gPropertyWrappers->append(new PropertyWrapper<float>(CSSPropertyZoom, &RenderStyle::zoom, &RenderStyle::setZoom)); @@ -1114,7 +1114,7 @@ void AnimationBase::updateStateMachine(AnimStateInput input, double param) } else { bool started = startAnimation(beginAnimationUpdateTime() - m_startTime); m_compAnim->animationController()->addToStartTimeResponseWaitList(this, started); - m_isAccelerated = !started; + m_isAccelerated = started; } } break; @@ -1242,7 +1242,7 @@ double AnimationBase::progress(double scale, double offset, const TimingFunction int integralTime = static_cast<int>(fractionalTime); fractionalTime -= integralTime; - if (m_animation->direction() && (integralTime & 1)) + if ((m_animation->direction() == Animation::AnimationDirectionAlternate) && (integralTime & 1)) fractionalTime = 1 - fractionalTime; if (scale != 1 || offset) diff --git a/WebCore/page/animation/KeyframeAnimation.cpp b/WebCore/page/animation/KeyframeAnimation.cpp index 2f2cfc0..01ec2f1 100644 --- a/WebCore/page/animation/KeyframeAnimation.cpp +++ b/WebCore/page/animation/KeyframeAnimation.cpp @@ -62,41 +62,67 @@ KeyframeAnimation::~KeyframeAnimation() endAnimation(); } -void KeyframeAnimation::getKeyframeAnimationInterval(const RenderStyle*& fromStyle, const RenderStyle*& toStyle, double& prog) const +void KeyframeAnimation::fetchIntervalEndpointsForProperty(int property, const RenderStyle*& fromStyle, const RenderStyle*& toStyle, double& prog) const { // Find the first key double elapsedTime = getElapsedTime(); - double t = m_animation->duration() ? (elapsedTime / m_animation->duration()) : 1; + double fractionalTime = m_animation->duration() ? (elapsedTime / m_animation->duration()) : 1; - ASSERT(t >= 0); - if (t < 0) - t = 0; + ASSERT(fractionalTime >= 0); + if (fractionalTime < 0) + fractionalTime = 0; - int i = static_cast<int>(t); - t -= i; - if (m_animation->direction() && (i & 1)) - t = 1 - t; + // FIXME: share this code with AnimationBase::progress(). + int iteration = static_cast<int>(fractionalTime); + fractionalTime -= iteration; + + bool reversing = (m_animation->direction() == Animation::AnimationDirectionAlternate) && (iteration & 1); + if (reversing) + fractionalTime = 1 - fractionalTime; - double scale = 1; - double offset = 0; - Vector<KeyframeValue>::const_iterator endKeyframes = m_keyframes.endKeyframes(); - for (Vector<KeyframeValue>::const_iterator it = m_keyframes.beginKeyframes(); it != endKeyframes; ++it) { - if (t < it->key()) { - // The first key should always be 0, so we should never succeed on the first key - if (!fromStyle) - break; - scale = 1.0 / (it->key() - offset); - toStyle = it->style(); + size_t numKeyframes = m_keyframes.size(); + if (!numKeyframes) + return; + + ASSERT(!m_keyframes[0].key()); + ASSERT(m_keyframes[m_keyframes.size() - 1].key() == 1); + + int prevIndex = -1; + int nextIndex = -1; + + // FIXME: with a lot of keys, this linear search will be slow. We could binary search. + for (size_t i = 0; i < numKeyframes; ++i) { + const KeyframeValue& currKeyFrame = m_keyframes[i]; + + if (!currKeyFrame.containsProperty(property)) + continue; + + if (fractionalTime < currKeyFrame.key()) { + nextIndex = i; break; } - - offset = it->key(); - fromStyle = it->style(); + + prevIndex = i; } - if (!fromStyle || !toStyle) - return; + double scale = 1; + double offset = 0; + + if (prevIndex == -1) + prevIndex = 0; + + if (nextIndex == -1) + nextIndex = m_keyframes.size() - 1; + + const KeyframeValue& prevKeyframe = m_keyframes[prevIndex]; + const KeyframeValue& nextKeyframe = m_keyframes[nextIndex]; + + fromStyle = prevKeyframe.style(); + toStyle = nextKeyframe.style(); + + offset = prevKeyframe.key(); + scale = 1.0 / (nextKeyframe.key() - prevKeyframe.key()); const TimingFunction* timingFunction = 0; if (fromStyle->animations() && fromStyle->animations()->size() > 0) { @@ -131,18 +157,9 @@ void KeyframeAnimation::animate(CompositeAnimation*, RenderObject*, const Render // through to the style blend so that we get the fromStyle. if (waitingToStart() && m_animation->delay() > 0 && !m_animation->fillsBackwards()) return; - - // FIXME: we need to be more efficient about determining which keyframes we are animating between. - // We should cache the last pair or something. - // Get the from/to styles and progress between - const RenderStyle* fromStyle = 0; - const RenderStyle* toStyle = 0; - double progress; - getKeyframeAnimationInterval(fromStyle, toStyle, progress); - - // If either style is 0 we have an invalid case, just stop the animation. - if (!fromStyle || !toStyle) { + // If we have no keyframes, don't animate. + if (!m_keyframes.size()) { updateStateMachine(AnimationStateInputEndAnimation, -1); return; } @@ -152,9 +169,19 @@ void KeyframeAnimation::animate(CompositeAnimation*, RenderObject*, const Render if (!animatedStyle) animatedStyle = RenderStyle::clone(targetStyle); + // FIXME: we need to be more efficient about determining which keyframes we are animating between. + // We should cache the last pair or something. HashSet<int>::const_iterator endProperties = m_keyframes.endProperties(); for (HashSet<int>::const_iterator it = m_keyframes.beginProperties(); it != endProperties; ++it) { - bool needsAnim = blendProperties(this, *it, animatedStyle.get(), fromStyle, toStyle, progress); + int property = *it; + + // Get the from/to styles and progress between + const RenderStyle* fromStyle = 0; + const RenderStyle* toStyle = 0; + double progress; + fetchIntervalEndpointsForProperty(property, fromStyle, toStyle, progress); + + bool needsAnim = blendProperties(this, property, animatedStyle.get(), fromStyle, toStyle, progress); if (needsAnim) setAnimating(); else { @@ -175,26 +202,29 @@ void KeyframeAnimation::getAnimatedStyle(RefPtr<RenderStyle>& animatedStyle) if (waitingToStart() && m_animation->delay() > 0 && !m_animation->fillsBackwards()) return; - // Get the from/to styles and progress between - const RenderStyle* fromStyle = 0; - const RenderStyle* toStyle = 0; - double progress; - getKeyframeAnimationInterval(fromStyle, toStyle, progress); - - // If either style is 0 we have an invalid case - if (!fromStyle || !toStyle) + if (!m_keyframes.size()) return; if (!animatedStyle) animatedStyle = RenderStyle::clone(m_object->style()); HashSet<int>::const_iterator endProperties = m_keyframes.endProperties(); - for (HashSet<int>::const_iterator it = m_keyframes.beginProperties(); it != endProperties; ++it) - blendProperties(this, *it, animatedStyle.get(), fromStyle, toStyle, progress); + for (HashSet<int>::const_iterator it = m_keyframes.beginProperties(); it != endProperties; ++it) { + int property = *it; + + // Get the from/to styles and progress between + const RenderStyle* fromStyle = 0; + const RenderStyle* toStyle = 0; + double progress; + fetchIntervalEndpointsForProperty(property, fromStyle, toStyle, progress); + + blendProperties(this, property, animatedStyle.get(), fromStyle, toStyle, progress); + } } bool KeyframeAnimation::hasAnimationForProperty(int property) const { + // FIXME: why not just m_keyframes.containsProperty()? HashSet<int>::const_iterator end = m_keyframes.endProperties(); for (HashSet<int>::const_iterator it = m_keyframes.beginProperties(); it != end; ++it) { if (*it == property) @@ -346,27 +376,27 @@ void KeyframeAnimation::validateTransformFunctionList() if (m_keyframes.size() < 2 || !m_keyframes.containsProperty(CSSPropertyWebkitTransform)) return; - Vector<KeyframeValue>::const_iterator end = m_keyframes.endKeyframes(); - // Empty transforms match anything, so find the first non-empty entry as the reference - size_t firstIndex = 0; - Vector<KeyframeValue>::const_iterator firstIt = end; - - for (Vector<KeyframeValue>::const_iterator it = m_keyframes.beginKeyframes(); it != end; ++it, ++firstIndex) { - if (it->style()->transform().operations().size() > 0) { - firstIt = it; + size_t numKeyframes = m_keyframes.size(); + size_t firstNonEmptyTransformKeyframeIndex = numKeyframes; + + for (size_t i = 0; i < numKeyframes; ++i) { + const KeyframeValue& currentKeyframe = m_keyframes[i]; + if (currentKeyframe.style()->transform().operations().size()) { + firstNonEmptyTransformKeyframeIndex = i; break; } } - if (firstIt == end) + if (firstNonEmptyTransformKeyframeIndex == numKeyframes) return; - const TransformOperations* firstVal = &firstIt->style()->transform(); + const TransformOperations* firstVal = &m_keyframes[firstNonEmptyTransformKeyframeIndex].style()->transform(); // See if the keyframes are valid - for (Vector<KeyframeValue>::const_iterator it = firstIt+1; it != end; ++it) { - const TransformOperations* val = &it->style()->transform(); + for (size_t i = firstNonEmptyTransformKeyframeIndex + 1; i < numKeyframes; ++i) { + const KeyframeValue& currentKeyframe = m_keyframes[i]; + const TransformOperations* val = ¤tKeyframe.style()->transform(); // A null transform matches anything if (val->operations().isEmpty()) diff --git a/WebCore/page/animation/KeyframeAnimation.h b/WebCore/page/animation/KeyframeAnimation.h index fab0ae8..a187f35 100644 --- a/WebCore/page/animation/KeyframeAnimation.h +++ b/WebCore/page/animation/KeyframeAnimation.h @@ -82,8 +82,8 @@ private: KeyframeAnimation(const Animation* animation, RenderObject*, int index, CompositeAnimation*, RenderStyle* unanimatedStyle); virtual ~KeyframeAnimation(); - // Get the styles surrounding the current animation time and the progress between them - void getKeyframeAnimationInterval(const RenderStyle*& fromStyle, const RenderStyle*& toStyle, double& progress) const; + // Get the styles for the given property surrounding the current animation time and the progress between them. + void fetchIntervalEndpointsForProperty(int property, const RenderStyle*& fromStyle, const RenderStyle*& toStyle, double& progress) const; // The keyframes that we are blending. KeyframeList m_keyframes; diff --git a/WebCore/page/chromium/ChromeClientChromium.h b/WebCore/page/chromium/ChromeClientChromium.h index e897c15..7765472 100644 --- a/WebCore/page/chromium/ChromeClientChromium.h +++ b/WebCore/page/chromium/ChromeClientChromium.h @@ -55,6 +55,9 @@ public: // Notifies embedder that the state of an accessibility object has changed. virtual void didChangeAccessibilityObjectState(AccessibilityObject*) = 0; + + // Notified embedder that the children of an accessibility object has changed. + virtual void didChangeAccessibilityObjectChildren(AccessibilityObject*) = 0; }; } // namespace WebCore diff --git a/WebCore/page/efl/EventHandlerEfl.cpp b/WebCore/page/efl/EventHandlerEfl.cpp index df5c276..acf4343 100644 --- a/WebCore/page/efl/EventHandlerEfl.cpp +++ b/WebCore/page/efl/EventHandlerEfl.cpp @@ -110,7 +110,7 @@ bool EventHandler::passWheelEventToWidget(PlatformWheelEvent& event, Widget* wid PassRefPtr<Clipboard> EventHandler::createDraggingClipboard() const { - return new ClipboardEfl(ClipboardWritable, true); + return ClipboardEfl::create(ClipboardWritable, true); } bool EventHandler::passMousePressEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe) diff --git a/WebCore/storage/DOMFileSystem.cpp b/WebCore/platform/AsyncFileSystem.cpp index c3dbd34..b4fcd0d 100644 --- a/WebCore/storage/DOMFileSystem.cpp +++ b/WebCore/platform/AsyncFileSystem.cpp @@ -29,23 +29,46 @@ */ #include "config.h" -#include "DOMFileSystem.h" +#include "AsyncFileSystem.h" #if ENABLE(FILE_SYSTEM) -#include "DirectoryEntry.h" +#include "AsyncFileSystemCallbacks.h" +#include "FileSystem.h" namespace WebCore { -DOMFileSystem::DOMFileSystem(const String& name, const String& rootPath) - : m_rootPath(rootPath) - , m_name(name) +PassOwnPtr<AsyncFileSystem> AsyncFileSystem::create(const String&) { + // FIXME: return default AsyncFileSystem implementation. + return 0; } -PassRefPtr<DirectoryEntry> DOMFileSystem::root() +// Default implementation. +void AsyncFileSystem::openFileSystem(const String& basePath, const String& storageIdentifier, Type type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) { - return DirectoryEntry::create(this, "/"); + String typeString = (type == Persistent) ? "Persistent" : "Temporary"; + + String name = storageIdentifier; + name += ":"; + name += typeString; + + String rootPath = basePath; + rootPath.append(PlatformFilePathSeparator); + rootPath += storageIdentifier; + rootPath.append(PlatformFilePathSeparator); + rootPath += typeString; + rootPath.append(PlatformFilePathSeparator); + + callbacks->didOpenFileSystem(name, AsyncFileSystem::create(rootPath)); +} + +// Default implementation. +String AsyncFileSystem::virtualToPlatformPath(const String& path) const +{ + ASSERT(!m_platformRootPath.isEmpty()); + String virtualPath = path; + return m_platformRootPath + virtualPath.replace('/', PlatformFilePathSeparator); } } // namespace diff --git a/WebCore/platform/AsyncFileSystem.h b/WebCore/platform/AsyncFileSystem.h new file mode 100644 index 0000000..601f0ea --- /dev/null +++ b/WebCore/platform/AsyncFileSystem.h @@ -0,0 +1,126 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef AsyncFileSystem_h +#define AsyncFileSystem_h + +#if ENABLE(FILE_SYSTEM) + +#include "PlatformString.h" +#include "Timer.h" +#include <wtf/PassOwnPtr.h> + +namespace WebCore { + +class AsyncFileSystem; +class AsyncFileSystemCallbacks; + +// This class provides async interface for platform-specific file system implementation. Note that all the methods take platform paths. +class AsyncFileSystem : public Noncopyable { +public: + virtual ~AsyncFileSystem() { } + + // FileSystem type + enum Type { + Temporary, + Persistent, + }; + + virtual void stop() { } + virtual bool hasPendingActivity() { return false; } + + // Creates and returns a new platform-specific AsyncFileSystem instance if the platform has its own implementation. + static PassOwnPtr<AsyncFileSystem> create(const String& rootPath); + + // Opens a new file system. + static void openFileSystem(const String& basePath, const String& storageIdentifier, Type, PassOwnPtr<AsyncFileSystemCallbacks>); + + // Moves a file or directory from srcPath to destPath. + // AsyncFileSystemCallbacks::didSucceed() is called when the operation is completed successfully. + // AsyncFileSystemCallbacks::didFail() is called otherwise. + virtual void move(const String& srcPath, const String& destPath, PassOwnPtr<AsyncFileSystemCallbacks>) = 0; + + // Copies a file or directory from srcPath to destPath. + // AsyncFileSystemCallbacks::didSucceed() is called when the operation is completed successfully. + // AsyncFileSystemCallbacks::didFail() is called otherwise. + virtual void copy(const String& srcPath, const String& destPath, PassOwnPtr<AsyncFileSystemCallbacks>) = 0; + + // Deletes a file or directory at a given path. + // AsyncFileSystemCallbacks::didSucceed() is called when the operation is completed successfully. + // AsyncFileSystemCallbacks::didFail() is called otherwise. + virtual void remove(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>) = 0; + + // Retrieves the metadata information of the file or directory at a given path. + // AsyncFileSystemCallbacks::didReadMetadata() is called when the operation is completed successfully. + // AsyncFileSystemCallbacks::didFail() is called otherwise. + virtual void readMetadata(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>) = 0; + + // Creates a file at a given path. If exclusive flag is true, it fails if the path already exists. + // AsyncFileSystemCallbacks::didSucceed() is called when the operation is completed successfully. + // AsyncFileSystemCallbacks::didFail() is called otherwise. + virtual void createFile(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks>) = 0; + + // Creates a directory at a given path. If exclusive flag is true, it fails if the path already exists. + // AsyncFileSystemCallbacks::didSucceed() is called when the operation is completed successfully. + // AsyncFileSystemCallbacks::didFail() is called otherwise. + virtual void createDirectory(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks>) = 0; + + // Checks if a file exists at a given path. + // AsyncFileSystemCallbacks::didSucceed() is called if the file exists. + // AsyncFileSystemCallbacks::didFail() is called otherwise. + virtual void fileExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>) = 0; + + // Checks if a directory exists at a given path. + // AsyncFileSystemCallbacks::didSucceed() is called if the directory exists. + // AsyncFileSystemCallbacks::didFail() is called otherwise. + virtual void directoryExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>) = 0; + + // Reads directory entries of a given directory at path. + // AsyncFileSystemCallbacks::didReadDirectoryEntry() is called when each directory entry is called. AsyncFileSystemCallbacks::didReadDirectoryEntries() is called after a chunk of directory entries have been read. + // AsyncFileSystemCallbacks::didFail() is when there is an error. + virtual void readDirectory(const String& path, PassOwnPtr<AsyncFileSystemCallbacks>) = 0; + + // Converts a given absolute virtual path to a platform path that starts with the platform root path of this file system. + virtual String virtualToPlatformPath(const String& path) const; + +protected: + AsyncFileSystem(const String& platformRootPath) + : m_platformRootPath(platformRootPath) + { + } + + String m_platformRootPath; +}; + +} // namespace WebCore + +#endif // ENABLE(FILE_SYSTEM) + +#endif // AsyncFileSystem_h diff --git a/WebCore/platform/AsyncFileSystemCallbacks.h b/WebCore/platform/AsyncFileSystemCallbacks.h new file mode 100644 index 0000000..0547fad --- /dev/null +++ b/WebCore/platform/AsyncFileSystemCallbacks.h @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef AsyncFileSystemCallbacks_h +#define AsyncFileSystemCallbacks_h + +#if ENABLE(FILE_SYSTEM) + +#include "PlatformString.h" + +namespace WebCore { + +class AsyncFileSystem; + +class AsyncFileSystemCallbacks : public Noncopyable { +public: + // Called when a requested operation is completed successfully. + virtual void didSucceed() = 0; + + // Called when a requested file system is opened. + virtual void didOpenFileSystem(const String& name, PassOwnPtr<AsyncFileSystem>) = 0; + + // Called when a file metadata is read successfully. + virtual void didReadMetadata(double modificationTime) = 0; + + // Called when a directory entry is read. + virtual void didReadDirectoryEntry(const String& name, bool isDirectory) = 0; + + // Called after a chunk of directory entries have been read (i.e. indicates it's good time to call back to the application). If hasMore is true there can be more chunks. + virtual void didReadDirectoryEntries(bool hasMore) = 0; + + // Called when there was an error. + virtual void didFail(int code) = 0; + + virtual ~AsyncFileSystemCallbacks() { } +}; + +} // namespace + +#endif // ENABLE(FILE_SYSTEM) + +#endif // AsyncFileSystemCallbacks_h diff --git a/WebCore/platform/BlobItem.cpp b/WebCore/platform/BlobItem.cpp deleted file mode 100644 index 591516d..0000000 --- a/WebCore/platform/BlobItem.cpp +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Copyright (C) 2010 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * 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 "BlobItem.h" - -#include "FileSystem.h" -#include "UUID.h" -#include <wtf/Assertions.h> - -namespace WebCore { - -#if ENABLE(BLOB) -static const double invalidModificationTime = 0; - -static double getFileSnapshotModificationTime(const String& path) -{ - // FIXME: synchronized file call - time_t modificationTime; - if (getFileModificationTime(path, modificationTime)) - return static_cast<double>(modificationTime); - return invalidModificationTime; -} -#endif // ENABLE(BLOB) - -// DataBlobItem ---------------------------------------------------------------- - -#if ENABLE(BLOB) -PassRefPtr<BlobItem> DataBlobItem::slice(long long start, long long length) -{ - ASSERT(start >= 0 && length >= 0); - ASSERT(static_cast<unsigned long long>(start) < size()); - if (!start && size() <= static_cast<unsigned long long>(length)) - return this; - if (static_cast<unsigned long long>(start + length) > size()) - length = size() - start; - return DataRangeBlobItem::create(this, start, length); -} -#endif - -// FileBlobItem ---------------------------------------------------------------- - -PassRefPtr<BlobItem> FileBlobItem::create(const String& path) -{ - return adoptRef(static_cast<BlobItem*>(new FileBlobItem(path))); -} - -FileBlobItem::FileBlobItem(const String& path) - : m_path(path) - , m_fileName(pathGetFileName(m_path)) -{ -} - -#if ENABLE(DIRECTORY_UPLOAD) -PassRefPtr<BlobItem> FileBlobItem::create(const String& path, const String& relativePath) -{ - return adoptRef(static_cast<BlobItem*>(new FileBlobItem(path, relativePath))); -} - -FileBlobItem::FileBlobItem(const String& path, const String& relativePath) - : m_path(path) - , m_fileName(pathGetFileName(m_path)) - , m_relativePath(relativePath) -{ -} -#endif - -unsigned long long FileBlobItem::size() const -{ - // FIXME: synchronized file call - long long size; - if (!getFileSize(m_path, size)) - return 0; - return static_cast<unsigned long long>(size); -} - -#if ENABLE(BLOB) -PassRefPtr<BlobItem> FileBlobItem::slice(long long start, long long length) -{ - ASSERT(start >= 0 && length >= 0); - long long fileSize = size(); - ASSERT(start < fileSize); - if (!start && fileSize <= length) - return this; - if (start + length > fileSize) - length = fileSize - start; - const FileRangeBlobItem* fileRangeItem = toFileRangeBlobItem(); - double modificationTime = fileRangeItem ? fileRangeItem->snapshotModificationTime() : getFileSnapshotModificationTime(path()); - return FileRangeBlobItem::create(path(), start, length, modificationTime); -} -#endif // ENABLE(BLOB) - -// StringBlobItem -------------------------------------------------------------- - -PassRefPtr<BlobItem> StringBlobItem::create(const CString& text) -{ - return adoptRef(static_cast<BlobItem*>(new StringBlobItem(text))); -} - -StringBlobItem::StringBlobItem(const CString& text) - : m_data(text) -{ -} - -// ByteArrayBlobItem ---------------------------------------------------------- - -PassRefPtr<BlobItem> ByteArrayBlobItem::create(const char* data, size_t size) -{ - return adoptRef(static_cast<BlobItem*>(new ByteArrayBlobItem(data, size))); -} - -ByteArrayBlobItem::ByteArrayBlobItem(const char* data, size_t size) -{ - m_bytesArray.append(data, size); -} - -#if ENABLE(BLOB) - -// DataRangeBlobItem ----------------------------------------------------------- - -PassRefPtr<BlobItem> DataRangeBlobItem::create(PassRefPtr<DataBlobItem> item, long long start, long long length) -{ - return adoptRef(static_cast<BlobItem*>(new DataRangeBlobItem(item, start, length))); -} - -DataRangeBlobItem::DataRangeBlobItem(PassRefPtr<DataBlobItem> item, long long start, long long length) - : m_length(length) -{ - const DataRangeBlobItem* rangeItem = item->toDataRangeBlobItem(); - if (rangeItem) { - m_item = rangeItem->m_item; - m_start = start + rangeItem->m_start; - ASSERT(!m_item->toDataRangeBlobItem()); - ASSERT(static_cast<unsigned long long>(m_start + m_length) <= m_item->size()); - } else { - m_item = item; - m_start = start; - } -} - -const char* DataRangeBlobItem::data() const -{ - return m_item->data() + m_start; -} - -// FileRangeBlobItem ----------------------------------------------------------- - -PassRefPtr<BlobItem> FileRangeBlobItem::create(const String& path, long long start, long long length, double snapshotModificationTime) -{ - return adoptRef(static_cast<BlobItem*>(new FileRangeBlobItem(path, start, length, snapshotModificationTime))); -} - -FileRangeBlobItem::FileRangeBlobItem(const String& path, long long start, long long length, double modificationTime) - : FileBlobItem(path) - , m_start(start) - , m_length(length) - , m_snapshotModificationTime(modificationTime) -{ - m_uniqueName = "Blob" + createCanonicalUUIDString(); - m_uniqueName.replace("-", ""); // For safty, remove '-' from the filename snce some servers may not like it. -} - -#endif // ENABLE(BLOB) - -} // namespace WebCore diff --git a/WebCore/platform/BlobItem.h b/WebCore/platform/BlobItem.h deleted file mode 100644 index 42ece92..0000000 --- a/WebCore/platform/BlobItem.h +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Copyright (C) 2010 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * 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 BlobItem_h -#define BlobItem_h - -#include "PlatformString.h" -#include <wtf/OwnPtr.h> -#include <wtf/PassRefPtr.h> -#include <wtf/RefCounted.h> -#include <wtf/Vector.h> -#include <wtf/text/CString.h> - -namespace WebCore { - -class ByteArrayBlobItem; -class DataBlobItem; -class DataRangeBlobItem; -class FileBlobItem; -class FileRangeBlobItem; -class StringBlobItem; - -// A base interface for all arbitrary-data-object component items. -// The BlobItem and its subclasses are structured like the following: -// BlobItem -// | -// +-------> DataBlobItem -// | | -// | +---------> StringBlobItem -// | +---------> ByteArrayBlobItem -// | +---------> DataRangeBlobItem -// | -// +-------> FileBlobItem -// | -// +---------> FileRangeBlobItem -// -class BlobItem : public RefCounted<BlobItem> { -public: - virtual ~BlobItem() { } - virtual unsigned long long size() const = 0; - - virtual const DataBlobItem* toDataBlobItem() const { return 0; } - virtual const StringBlobItem* toStringBlobItem() const { return 0; } - virtual const ByteArrayBlobItem* toByteArrayBlobItem() const { return 0; } - virtual const FileBlobItem* toFileBlobItem() const { return 0; } -#if ENABLE(BLOB) - virtual const DataRangeBlobItem* toDataRangeBlobItem() const { return 0; } - virtual const FileRangeBlobItem* toFileRangeBlobItem() const { return 0; } - - // Note: no external methods except for Blob::slice should call this. - virtual PassRefPtr<BlobItem> slice(long long start, long long length) = 0; -#endif // ENABLE(BLOB) - -protected: - BlobItem() { } -}; - -typedef Vector<RefPtr<BlobItem> > BlobItemList; - -class DataBlobItem : public BlobItem { -public: - virtual const char* data() const = 0; - - // BlobItem methods. - virtual const DataBlobItem* toDataBlobItem() const { return this; } -#if ENABLE(BLOB) - virtual PassRefPtr<BlobItem> slice(long long start, long long length); -#endif // ENABLE(BLOB) -}; - -class FileBlobItem : public BlobItem { -public: - static PassRefPtr<BlobItem> create(const String& path); -#if ENABLE(DIRECTORY_UPLOAD) - static PassRefPtr<BlobItem> create(const String& path, const String& relativePath); -#endif - virtual const String& name() const { return m_fileName; } - virtual const String& path() const { return m_path; } -#if ENABLE(DIRECTORY_UPLOAD) - const String& relativePath() const { return m_relativePath; } -#endif - - // BlobItem methods. - virtual unsigned long long size() const; - virtual const FileBlobItem* toFileBlobItem() const { return this; } -#if ENABLE(BLOB) - virtual PassRefPtr<BlobItem> slice(long long start, long long length); -#endif // ENABLE(BLOB) - -protected: - FileBlobItem(const String& path); -#if ENABLE(DIRECTORY_UPLOAD) - FileBlobItem(const String& path, const String& relativePath); -#endif - String m_path; - String m_fileName; -#if ENABLE(DIRECTORY_UPLOAD) - String m_relativePath; -#endif -}; - -class StringBlobItem : public DataBlobItem { -public: - static PassRefPtr<BlobItem> create(const CString&); - const CString& cstr() const { return m_data; } - - // BlobItem methods. - virtual unsigned long long size() const { return m_data.length(); } - virtual const StringBlobItem* toStringBlobItem() const { return this; } - - // DataBlobItem methods. - virtual const char* data() const { return m_data.data(); } - -private: - StringBlobItem(const CString&); - CString m_data; -}; - -class ByteArrayBlobItem : public DataBlobItem { -public: - static PassRefPtr<BlobItem> create(const char* data, size_t size); - - // BlobItem methods. - virtual unsigned long long size() const { return m_bytesArray.size(); } - virtual const ByteArrayBlobItem* toByteArrayBlobItem() const { return this; } - - // DataBlobItem methods. - virtual const char* data() const { return m_bytesArray.data(); } - -private: - ByteArrayBlobItem(const char* data, size_t size); - Vector<char> m_bytesArray; -}; - -#if ENABLE(BLOB) - -// BlobItem class for sliced data (string or bytes-array). -class DataRangeBlobItem : public DataBlobItem { -public: - static PassRefPtr<BlobItem> create(PassRefPtr<DataBlobItem>, long long start, long long length); - - // BlobItem methods. - virtual unsigned long long size() const { return m_length; } - virtual const DataRangeBlobItem* toDataRangeBlobItem() const { return this; } - - // DataBlobItem methods. - virtual const char* data() const; - -private: - DataRangeBlobItem(PassRefPtr<DataBlobItem>, long long start, long long length); - RefPtr<DataBlobItem> m_item; - long long m_start; - long long m_length; -}; - -class FileRangeBlobItem : public FileBlobItem { -public: - static PassRefPtr<BlobItem> create(const String& path, long long start, long long length, double snapshotModificationTime); - long long start() const { return m_start; } - double snapshotModificationTime() const { return m_snapshotModificationTime; } - - // BlobItem methods. - virtual unsigned long long size() const { return m_length; } - virtual const FileRangeBlobItem* toFileRangeBlobItem() const { return this; } - - // FileBlobItem methods. - virtual const String& name() const { return m_uniqueName; } - -private: - FileRangeBlobItem(const String& path, long long start, long long length, double snapshotModificationTime); - long long m_start; - long long m_length; - String m_uniqueName; - - double m_snapshotModificationTime; -}; - -#endif // ENABLE(BLOB) - -} // namespace WebCore - -#endif // BlobItem_h diff --git a/WebCore/platform/FileSystem.h b/WebCore/platform/FileSystem.h index ec75a21..e3916cf 100644 --- a/WebCore/platform/FileSystem.h +++ b/WebCore/platform/FileSystem.h @@ -138,6 +138,12 @@ enum FileSeekOrigin { SeekFromEnd }; +#if OS(WINDOWS) +static const char PlatformFilePathSeparator = '\\'; +#else +static const char PlatformFilePathSeparator = '/'; +#endif + bool fileExists(const String&); bool deleteFile(const String&); bool deleteEmptyDirectory(const String&); diff --git a/WebCore/platform/Length.h b/WebCore/platform/Length.h index a3b1eda..7dd875e 100644 --- a/WebCore/platform/Length.h +++ b/WebCore/platform/Length.h @@ -30,6 +30,8 @@ namespace WebCore { const int undefinedLength = -1; const int percentScaleFactor = 128; +const int intMaxForLength = 0x7ffffff; // max value for a 28-bit int +const int intMinForLength = (-0x7ffffff - 1); // min value for a 28-bit int enum LengthType { Auto, Relative, Percent, Fixed, Static, Intrinsic, MinIntrinsic }; diff --git a/WebCore/platform/MIMETypeRegistry.cpp b/WebCore/platform/MIMETypeRegistry.cpp index b489d3b..5c20e08 100644 --- a/WebCore/platform/MIMETypeRegistry.cpp +++ b/WebCore/platform/MIMETypeRegistry.cpp @@ -279,6 +279,10 @@ static MediaMIMETypeMap& mediaMIMETypeMap() { "video/annodex", "axv" }, { "audio/speex", "spx" }, + // WebM + { "video/webm", "webm" }, + { "audio/webm", "webm" }, + // MPEG { "audio/mpeg", "m1a" }, { "audio/mpeg", "m2a" }, diff --git a/WebCore/platform/PurgeableBuffer.h b/WebCore/platform/PurgeableBuffer.h index 3caf482..32341c2 100644 --- a/WebCore/platform/PurgeableBuffer.h +++ b/WebCore/platform/PurgeableBuffer.h @@ -63,7 +63,7 @@ namespace WebCore { mutable State m_state; }; -#if !OS(DARWIN) || defined(BUILDING_ON_TIGER) || PLATFORM(QT) || PLATFORM(GTK) +#if !ENABLE(PURGEABLE_MEMORY) inline PassOwnPtr<PurgeableBuffer> PurgeableBuffer::create(const char*, size_t) { return PassOwnPtr<PurgeableBuffer>(); } inline PurgeableBuffer::~PurgeableBuffer() { } inline const char* PurgeableBuffer::data() const { return 0; } diff --git a/WebCore/platform/ScrollView.cpp b/WebCore/platform/ScrollView.cpp index 927a9fc..854fef5 100644 --- a/WebCore/platform/ScrollView.cpp +++ b/WebCore/platform/ScrollView.cpp @@ -699,7 +699,7 @@ void ScrollView::wheelEvent(PlatformWheelEvent& e) if (e.granularity() == ScrollByPageWheelEvent) { ASSERT(deltaX == 0); bool negative = deltaY < 0; - deltaY = max(max<int>(visibleHeight() * Scrollbar::minFractionToStepWhenPaging(), visibleHeight() - Scrollbar::maxOverlapBetweenPages()), 1); + deltaY = max(max(static_cast<float>(visibleHeight()) * Scrollbar::minFractionToStepWhenPaging(), static_cast<float>(visibleHeight() - Scrollbar::maxOverlapBetweenPages())), 1.0f); if (negative) deltaY = -deltaY; } diff --git a/WebCore/platform/ScrollView.h b/WebCore/platform/ScrollView.h index 6853969..5624d70 100644 --- a/WebCore/platform/ScrollView.h +++ b/WebCore/platform/ScrollView.h @@ -57,7 +57,7 @@ class ScrollView : public Widget, public ScrollbarClient { public: ~ScrollView(); - // ScrollbarClient function. FrameView overrides the other two. + // ScrollbarClient function. FrameView overrides the others. virtual void valueChanged(Scrollbar*); // The window thats hosts the ScrollView. The ScrollView will communicate scrolls and repaints to the diff --git a/WebCore/platform/Scrollbar.cpp b/WebCore/platform/Scrollbar.cpp index 119a9dc..ff8f66f 100644 --- a/WebCore/platform/Scrollbar.cpp +++ b/WebCore/platform/Scrollbar.cpp @@ -142,24 +142,20 @@ bool Scrollbar::scroll(ScrollDirection direction, ScrollGranularity granularity, } #endif + // Ignore perpendicular scrolls. + if ((m_orientation == HorizontalScrollbar) ? (direction == ScrollUp || direction == ScrollDown) : (direction == ScrollLeft || direction == ScrollRight)) + return false; float step = 0; - if ((direction == ScrollUp && m_orientation == VerticalScrollbar) || (direction == ScrollLeft && m_orientation == HorizontalScrollbar)) - step = -1; - else if ((direction == ScrollDown && m_orientation == VerticalScrollbar) || (direction == ScrollRight && m_orientation == HorizontalScrollbar)) - step = 1; - - if (granularity == ScrollByLine) - step *= m_lineStep; - else if (granularity == ScrollByPage) - step *= m_pageStep; - else if (granularity == ScrollByDocument) - step *= m_totalSize; - else if (granularity == ScrollByPixel) - step *= m_pixelStep; - - float newPos = m_currentPos + step * multiplier; - float maxPos = m_totalSize - m_visibleSize; - return setCurrentPos(max(min(newPos, maxPos), 0.0f)); + switch (granularity) { + case ScrollByLine: step = m_lineStep; break; + case ScrollByPage: step = m_pageStep; break; + case ScrollByDocument: step = m_totalSize; break; + case ScrollByPixel: step = m_pixelStep; break; + } + if (direction == ScrollUp || direction == ScrollLeft) + multiplier = -multiplier; + + return setCurrentPos(max(min(m_currentPos + (step * multiplier), static_cast<float>(m_totalSize - m_visibleSize)), 0.0f)); } void Scrollbar::updateThumb() diff --git a/WebCore/platform/Scrollbar.h b/WebCore/platform/Scrollbar.h index 6b3cd0d..f8ef96d 100644 --- a/WebCore/platform/Scrollbar.h +++ b/WebCore/platform/Scrollbar.h @@ -79,7 +79,7 @@ public: void setProportion(int visibleSize, int totalSize); void setPressedPos(int p) { m_pressedPos = p; } - bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1.0f); + bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1); virtual void paint(GraphicsContext*, const IntRect& damageRect); @@ -124,9 +124,6 @@ public: virtual IntPoint convertToContainingView(const IntPoint&) const; virtual IntPoint convertFromContainingView(const IntPoint&) const; -private: - virtual bool isScrollbar() const { return true; } - protected: Scrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize, ScrollbarTheme* = 0); @@ -142,7 +139,6 @@ protected: ScrollGranularity pressedPartScrollGranularity(); void moveThumb(int pos); - bool setCurrentPos(float pos); ScrollbarClient* m_client; ScrollbarOrientation m_orientation; @@ -167,6 +163,11 @@ protected: bool m_overlapsResizer; bool m_suppressInvalidation; + +private: + virtual bool isScrollbar() const { return true; } + + bool setCurrentPos(float pos); }; } diff --git a/WebCore/platform/ScrollbarClient.h b/WebCore/platform/ScrollbarClient.h index 6efe72e..fa94ecc 100644 --- a/WebCore/platform/ScrollbarClient.h +++ b/WebCore/platform/ScrollbarClient.h @@ -34,7 +34,7 @@ namespace WebCore { class ScrollbarClient { public: - virtual ~ScrollbarClient() {} + virtual ~ScrollbarClient() { } virtual void valueChanged(Scrollbar*) = 0; virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&) = 0; diff --git a/WebCore/platform/ThemeTypes.h b/WebCore/platform/ThemeTypes.h index d82aa73..3567004 100644 --- a/WebCore/platform/ThemeTypes.h +++ b/WebCore/platform/ThemeTypes.h @@ -51,7 +51,7 @@ enum ControlPart { MediaFullscreenButtonPart, MediaMuteButtonPart, MediaPlayButtonPart, MediaSeekBackButtonPart, MediaSeekForwardButtonPart, MediaRewindButtonPart, MediaReturnToRealtimeButtonPart, MediaToggleClosedCaptionsButtonPart, MediaSliderPart, MediaSliderThumbPart, MediaVolumeSliderContainerPart, MediaVolumeSliderPart, MediaVolumeSliderThumbPart, - MediaVolumeSliderMuteButtonPart, MediaControlsBackgroundPart, MediaCurrentTimePart, MediaTimeRemainingPart, + MediaVolumeSliderMuteButtonPart, MediaControlsBackgroundPart, MediaControlsFullscreenBackgroundPart, MediaCurrentTimePart, MediaTimeRemainingPart, MenulistPart, MenulistButtonPart, MenulistTextPart, MenulistTextFieldPart, MeterPart, OuterSpinButtonPart, ProgressBarPart, ProgressBarValuePart, SliderHorizontalPart, SliderVerticalPart, SliderThumbHorizontalPart, SliderThumbVerticalPart, CaretPart, SearchFieldPart, SearchFieldDecorationPart, diff --git a/WebCore/platform/TreeShared.h b/WebCore/platform/TreeShared.h index 6e60656..9d9ac1f 100644 --- a/WebCore/platform/TreeShared.h +++ b/WebCore/platform/TreeShared.h @@ -34,11 +34,11 @@ template<typename T> void adopted(TreeShared<T>*); template<typename T> class TreeShared : public Noncopyable { public: - TreeShared(int initialRefCount = 1) - : m_refCount(initialRefCount) + TreeShared() + : m_refCount(1) , m_parent(0) #ifndef NDEBUG - , m_adoptionIsRequired(initialRefCount == 1) + , m_adoptionIsRequired(true) #endif { ASSERT(isMainThread()); diff --git a/WebCore/platform/audio/Cone.cpp b/WebCore/platform/audio/Cone.cpp new file mode 100644 index 0000000..91813ab --- /dev/null +++ b/WebCore/platform/audio/Cone.cpp @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 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 "Cone.h" + +namespace WebCore { + +ConeEffect::ConeEffect() + : m_innerAngle(360.0) + , m_outerAngle(360.0) + , m_outerGain(0.0) +{ +} + +double ConeEffect::gain(Vector3 sourcePosition, Vector3 sourceOrientation, Vector3 listenerPosition) +{ + if (sourceOrientation.isZero() || ((m_innerAngle == 360.0) && (m_outerAngle == 360.0))) + return 1.0; // no cone specified - unity gain + + // Normalized source-listener vector + Vector3 sourceToListener = listenerPosition - sourcePosition; + sourceToListener.normalize(); + + Vector3 normalizedSourceOrientation = sourceOrientation; + normalizedSourceOrientation.normalize(); + + // Angle between the source orientation vector and the source-listener vector + double dotProduct = dot(sourceToListener, normalizedSourceOrientation); + double angle = 180.0 * acos(dotProduct) / M_PI; + double absAngle = fabs(angle); + + // Divide by 2.0 here since API is entire angle (not half-angle) + double absInnerAngle = fabs(m_innerAngle) / 2.0; + double absOuterAngle = fabs(m_outerAngle) / 2.0; + double gain = 1.0; + + if (absAngle <= absInnerAngle) + // No attenuation + gain = 1.0; + else if (absAngle >= absOuterAngle) + // Max attenuation + gain = m_outerGain; + else { + // Between inner and outer cones + // inner -> outer, x goes from 0 -> 1 + double x = (absAngle - absInnerAngle) / (absOuterAngle - absInnerAngle); + gain = (1.0 - x) + m_outerGain * x; + } + + return gain; +} + +} // namespace WebCore + +#endif // ENABLE(WEB_AUDIO) diff --git a/WebCore/platform/audio/Cone.h b/WebCore/platform/audio/Cone.h new file mode 100644 index 0000000..9936f28 --- /dev/null +++ b/WebCore/platform/audio/Cone.h @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 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 Cone_h +#define Cone_h + +#include <wtf/Vector3.h> + +namespace WebCore { + +// Cone gain is defined according to the OpenAL specification + +class ConeEffect { +public: + ConeEffect(); + + // Returns scalar gain for the given source/listener positions/orientations + double gain(Vector3 sourcePosition, Vector3 sourceOrientation, Vector3 listenerPosition); + + // Angles in degrees + void setInnerAngle(double innerAngle) { m_innerAngle = innerAngle; } + double innerAngle() const { return m_innerAngle; } + + void setOuterAngle(double outerAngle) { m_outerAngle = outerAngle; } + double outerAngle() const { return m_outerAngle; } + + void setOuterGain(double outerGain) { m_outerGain = outerGain; } + double outerGain() const { return m_outerGain; } + +protected: + double m_innerAngle; + double m_outerAngle; + double m_outerGain; +}; + +} // namespace WebCore + +#endif // Cone_h diff --git a/WebCore/platform/audio/FFTConvolver.cpp b/WebCore/platform/audio/FFTConvolver.cpp new file mode 100644 index 0000000..b0211fd --- /dev/null +++ b/WebCore/platform/audio/FFTConvolver.cpp @@ -0,0 +1,108 @@ +/* + * 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 "FFTConvolver.h" + +#include "Accelerate.h" + +namespace WebCore { + +FFTConvolver::FFTConvolver(size_t fftSize) + : m_frame(fftSize) + , m_readWriteIndex(0) + , m_inputBuffer(fftSize) // 2nd half of buffer is always zeroed + , m_outputBuffer(fftSize) + , m_lastOverlapBuffer(fftSize / 2) +{ +} + +void FFTConvolver::process(FFTFrame* fftKernel, float* sourceP, float* destP, size_t framesToProcess) +{ + // FIXME: make so framesToProcess is not required to fit evenly into fftSize/2 + + // Copy samples to input buffer (note contraint above!) + float* inputP = m_inputBuffer.data(); + + // Sanity check + bool isCopyGood1 = sourceP && inputP && m_readWriteIndex + framesToProcess <= m_inputBuffer.size(); + ASSERT(isCopyGood1); + if (!isCopyGood1) + return; + + memcpy(inputP + m_readWriteIndex, sourceP, sizeof(float) * framesToProcess); + + // Copy samples from output buffer + float* outputP = m_outputBuffer.data(); + + // Sanity check + bool isCopyGood2 = destP && outputP && m_readWriteIndex + framesToProcess <= m_outputBuffer.size(); + ASSERT(isCopyGood2); + if (!isCopyGood2) + return; + + memcpy(destP, outputP + m_readWriteIndex, sizeof(float) * framesToProcess); + m_readWriteIndex += framesToProcess; + + + // Check if it's time to perform the next FFT + size_t halfSize = fftSize() / 2; + if (m_readWriteIndex == halfSize) { + // The input buffer is now filled (get frequency-domain version) + m_frame.doFFT(m_inputBuffer.data()); + m_frame.multiply(*fftKernel); + m_frame.doInverseFFT(m_outputBuffer.data()); + + // Overlap-add 1st half from previous time + vadd(m_outputBuffer.data(), 1, m_lastOverlapBuffer.data(), 1, m_outputBuffer.data(), 1, halfSize); + + // Finally, save 2nd half of result + bool isCopyGood3 = m_outputBuffer.size() == 2 * halfSize && m_lastOverlapBuffer.size() == halfSize; + ASSERT(isCopyGood3); + if (!isCopyGood3) + return; + + memcpy(m_lastOverlapBuffer.data(), m_outputBuffer.data() + halfSize, sizeof(float) * halfSize); + + // Reset index back to start for next time + m_readWriteIndex = 0; + } +} + +void FFTConvolver::reset() +{ + m_lastOverlapBuffer.zero(); + m_readWriteIndex = 0; +} + +} // namespace WebCore + +#endif // ENABLE(WEB_AUDIO) diff --git a/WebCore/platform/audio/FFTConvolver.h b/WebCore/platform/audio/FFTConvolver.h new file mode 100644 index 0000000..0eec7c1 --- /dev/null +++ b/WebCore/platform/audio/FFTConvolver.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 FFTConvolver_h +#define FFTConvolver_h + +#include "AudioFloatArray.h" +#include "FFTFrame.h" + +namespace WebCore { + +class FFTConvolver { +public: + // fftSize must be a power of two + FFTConvolver(size_t fftSize); + + // For now, with multiple calls to Process(), framesToProcess MUST add up EXACTLY to fftSize / 2 + // + // FIXME: Later, we can do more sophisticated buffering to relax this requirement... + // + // The input to output latency is equal to fftSize / 2 + // + // Processing in-place is allowed... + void process(FFTFrame* fftKernel, float* sourceP, float* destP, size_t framesToProcess); + + void reset(); + + size_t fftSize() const { return m_frame.fftSize(); } + +private: + FFTFrame m_frame; + + // Buffer input until we get fftSize / 2 samples then do an FFT + size_t m_readWriteIndex; + AudioFloatArray m_inputBuffer; + + // Stores output which we read a little at a time + AudioFloatArray m_outputBuffer; + + // Saves the 2nd half of the FFT buffer, so we can do an overlap-add with the 1st half of the next one + AudioFloatArray m_lastOverlapBuffer; +}; + +} // namespace WebCore + +#endif // FFTConvolver_h diff --git a/WebCore/platform/audio/Reverb.cpp b/WebCore/platform/audio/Reverb.cpp new file mode 100644 index 0000000..886a553 --- /dev/null +++ b/WebCore/platform/audio/Reverb.cpp @@ -0,0 +1,227 @@ +/* + * 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 "Reverb.h" + +#include "AudioBus.h" +#include "AudioFileReader.h" +#include "ReverbConvolver.h" +#include <math.h> +#include <wtf/MathExtras.h> +#include <wtf/OwnPtr.h> +#include <wtf/PassOwnPtr.h> + +#if OS(DARWIN) +using namespace std; +#endif + +namespace WebCore { + +// Empirical gain calibration tested across many impulse responses to ensure perceived volume is same as dry (unprocessed) signal +const double GainCalibration = -58.0; + +// A minimum power value to when normalizing a silent (or very quiet) impulse response +const double MinPower = 0.000125; + +static double calculateNormalizationScale(AudioBus* response) +{ + // Normalize by RMS power + size_t numberOfChannels = response->numberOfChannels(); + size_t frameSize = response->frameSize(); + + double power = 0.0; + + for (size_t i = 0; i < numberOfChannels; ++i) { + int n = frameSize; + float* p = response->channel(i)->data(); + + while (n--) { + float sample = *p++; + power += sample * sample; + } + } + + power = sqrt(power / (numberOfChannels * frameSize)); + + // Protect against accidental overload + if (isinf(power) || isnan(power) || power < MinPower) + power = MinPower; + + double scale = 1.0 / power; + + scale *= pow(10.0, GainCalibration * 0.05); // calibrate to make perceived volume same as unprocessed + + // True-stereo compensation + if (response->numberOfChannels() == 4) + scale *= 0.5; + + return scale; +} + +Reverb::Reverb(AudioBus* impulseResponse, size_t renderSliceSize, size_t maxFFTSize, size_t numberOfChannels, bool useBackgroundThreads) +{ + double scale = calculateNormalizationScale(impulseResponse); + if (scale) + impulseResponse->scale(scale); + + initialize(impulseResponse, renderSliceSize, maxFFTSize, numberOfChannels, useBackgroundThreads); + + // Undo scaling since this shouldn't be a destructive operation on impulseResponse + if (scale) + impulseResponse->scale(1.0 / scale); +} + +void Reverb::initialize(AudioBus* impulseResponseBuffer, size_t renderSliceSize, size_t maxFFTSize, size_t numberOfChannels, bool useBackgroundThreads) +{ + m_impulseResponseLength = impulseResponseBuffer->frameSize(); + + // The reverb can handle a mono impulse response and still do stereo processing + size_t numResponseChannels = impulseResponseBuffer->numberOfChannels(); + m_convolvers.reserveCapacity(numberOfChannels); + + int convolverRenderPhase = 0; + for (size_t i = 0; i < numResponseChannels; ++i) { + AudioChannel* channel = impulseResponseBuffer->channel(i); + + ReverbConvolver* convolver = new ReverbConvolver(channel, renderSliceSize, maxFFTSize, convolverRenderPhase, useBackgroundThreads); + m_convolvers.append(convolver); + + convolverRenderPhase += renderSliceSize; + } + + // For "True" stereo processing we allocate a temporary buffer to avoid repeatedly allocating it in the process() method. + // It can be bad to allocate memory in a real-time thread. + if (numResponseChannels == 4) + m_tempBuffer = new AudioBus(2, MaxFrameSize); +} + +void Reverb::process(AudioBus* sourceBus, AudioBus* destinationBus, size_t framesToProcess) +{ + // Do a fairly comprehensive sanity check. + // If these conditions are satisfied, all of the source and destination pointers will be valid for the various matrixing cases. + bool isSafeToProcess = sourceBus && destinationBus && sourceBus->numberOfChannels() > 0 && destinationBus->numberOfChannels() > 0 + && framesToProcess <= MaxFrameSize && framesToProcess <= sourceBus->frameSize() && framesToProcess <= destinationBus->frameSize(); + + ASSERT(isSafeToProcess); + if (!isSafeToProcess) + return; + + // For now only handle mono or stereo output + if (destinationBus->numberOfChannels() > 2) { + destinationBus->zero(); + return; + } + + AudioChannel* destinationChannelL = destinationBus->channel(0); + AudioChannel* sourceChannelL = sourceBus->channel(0); + + // Handle input -> output matrixing... + size_t numInputChannels = sourceBus->numberOfChannels(); + size_t numOutputChannels = destinationBus->numberOfChannels(); + size_t numReverbChannels = m_convolvers.size(); + + if (numInputChannels == 2 && numReverbChannels == 2 && numOutputChannels == 2) { + // 2 -> 2 -> 2 + AudioChannel* sourceChannelR = sourceBus->channel(1); + AudioChannel* destinationChannelR = destinationBus->channel(1); + m_convolvers[0]->process(sourceChannelL, destinationChannelL, framesToProcess); + m_convolvers[1]->process(sourceChannelR, destinationChannelR, framesToProcess); + } else if (numInputChannels == 1 && numOutputChannels == 2 && numReverbChannels == 2) { + // 1 -> 2 -> 2 + for (int i = 0; i < 2; ++i) { + AudioChannel* destinationChannel = destinationBus->channel(i); + m_convolvers[i]->process(sourceChannelL, destinationChannel, framesToProcess); + } + } else if (numInputChannels == 1 && numReverbChannels == 1 && numOutputChannels == 2) { + // 1 -> 1 -> 2 + m_convolvers[0]->process(sourceChannelL, destinationChannelL, framesToProcess); + + // simply copy L -> R + AudioChannel* destinationChannelR = destinationBus->channel(1); + bool isCopySafe = destinationChannelL->data() && destinationChannelR->data() && destinationChannelL->frameSize() >= framesToProcess && destinationChannelR->frameSize() >= framesToProcess; + ASSERT(isCopySafe); + if (!isCopySafe) + return; + memcpy(destinationChannelR->data(), destinationChannelL->data(), sizeof(float) * framesToProcess); + } else if (numInputChannels == 1 && numReverbChannels == 1 && numOutputChannels == 1) { + // 1 -> 1 -> 1 + m_convolvers[0]->process(sourceChannelL, destinationChannelL, framesToProcess); + } else if (numInputChannels == 2 && numReverbChannels == 4 && numOutputChannels == 2) { + // 2 -> 4 -> 2 ("True" stereo) + AudioChannel* sourceChannelR = sourceBus->channel(1); + AudioChannel* destinationChannelR = destinationBus->channel(1); + + AudioChannel* tempChannelL = m_tempBuffer->channel(0); + AudioChannel* tempChannelR = m_tempBuffer->channel(1); + + // Process left virtual source + m_convolvers[0]->process(sourceChannelL, destinationChannelL, framesToProcess); + m_convolvers[1]->process(sourceChannelL, destinationChannelR, framesToProcess); + + // Process right virtual source + m_convolvers[2]->process(sourceChannelR, tempChannelL, framesToProcess); + m_convolvers[3]->process(sourceChannelR, tempChannelR, framesToProcess); + + destinationBus->sumFrom(*m_tempBuffer); + } else if (numInputChannels == 1 && numReverbChannels == 4 && numOutputChannels == 2) { + // 1 -> 4 -> 2 (Processing mono with "True" stereo impulse response) + // This is an inefficient use of a four-channel impulse response, but we should handle the case. + AudioChannel* destinationChannelR = destinationBus->channel(1); + + AudioChannel* tempChannelL = m_tempBuffer->channel(0); + AudioChannel* tempChannelR = m_tempBuffer->channel(1); + + // Process left virtual source + m_convolvers[0]->process(sourceChannelL, destinationChannelL, framesToProcess); + m_convolvers[1]->process(sourceChannelL, destinationChannelR, framesToProcess); + + // Process right virtual source + m_convolvers[2]->process(sourceChannelL, tempChannelL, framesToProcess); + m_convolvers[3]->process(sourceChannelL, tempChannelR, framesToProcess); + + destinationBus->sumFrom(*m_tempBuffer); + } else { + // Handle gracefully any unexpected / unsupported matrixing + // FIXME: add code for 5.1 support... + destinationBus->zero(); + } +} + +void Reverb::reset() +{ + for (size_t i = 0; i < m_convolvers.size(); ++i) + m_convolvers[i]->reset(); +} + +} // namespace WebCore + +#endif // ENABLE(WEB_AUDIO) diff --git a/WebCore/platform/audio/Reverb.h b/WebCore/platform/audio/Reverb.h new file mode 100644 index 0000000..26f5f8e --- /dev/null +++ b/WebCore/platform/audio/Reverb.h @@ -0,0 +1,66 @@ +/* + * 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 Reverb_h +#define Reverb_h + +#include "ReverbConvolver.h" +#include <wtf/Vector.h> + +namespace WebCore { + +class AudioBus; + +// Multi-channel convolution reverb with channel matrixing - one or more ReverbConvolver objects are used internally. + +class Reverb { +public: + enum { MaxFrameSize = 256 }; + + // renderSliceSize is a rendering hint, so the FFTs can be optimized to not all occur at the same time (very bad when rendering on a real-time thread). + Reverb(AudioBus* impulseResponseBuffer, size_t renderSliceSize, size_t maxFFTSize, size_t numberOfChannels, bool useBackgroundThreads); + + void process(AudioBus* sourceBus, AudioBus* destinationBus, size_t framesToProcess); + void reset(); + + unsigned impulseResponseLength() const { return m_impulseResponseLength; } + +private: + void initialize(AudioBus* impulseResponseBuffer, size_t renderSliceSize, size_t maxFFTSize, size_t numberOfChannels, bool useBackgroundThreads); + + size_t m_impulseResponseLength; + + Vector<OwnPtr<ReverbConvolver> > m_convolvers; + + // For "True" stereo processing + OwnPtr<AudioBus> m_tempBuffer; +}; + +} // namespace WebCore + +#endif // Reverb_h diff --git a/WebCore/platform/audio/ReverbAccumulationBuffer.cpp b/WebCore/platform/audio/ReverbAccumulationBuffer.cpp new file mode 100644 index 0000000..7b1c63b --- /dev/null +++ b/WebCore/platform/audio/ReverbAccumulationBuffer.cpp @@ -0,0 +1,117 @@ +/* + * 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 "ReverbAccumulationBuffer.h" + +#include "Accelerate.h" + +namespace WebCore { + +ReverbAccumulationBuffer::ReverbAccumulationBuffer(size_t length) + : m_buffer(length) + , m_readIndex(0) + , m_readTimeFrame(0) +{ +} + +void ReverbAccumulationBuffer::readAndClear(float* destination, size_t numberOfFrames) +{ + size_t bufferLength = m_buffer.size(); + bool isCopySafe = m_readIndex <= bufferLength && numberOfFrames <= bufferLength; + + ASSERT(isCopySafe); + if (!isCopySafe) + return; + + size_t framesAvailable = bufferLength - m_readIndex; + size_t numberOfFrames1 = std::min(numberOfFrames, framesAvailable); + size_t numberOfFrames2 = numberOfFrames - numberOfFrames1; + + float* source = m_buffer.data(); + memcpy(destination, source + m_readIndex, sizeof(float) * numberOfFrames1); + memset(source + m_readIndex, 0, sizeof(float) * numberOfFrames1); + + // Handle wrap-around if necessary + if (numberOfFrames2 > 0) { + memcpy(destination + numberOfFrames1, source, sizeof(float) * numberOfFrames2); + memset(source, 0, sizeof(float) * numberOfFrames2); + } + + m_readIndex = (m_readIndex + numberOfFrames) % bufferLength; + m_readTimeFrame += numberOfFrames; +} + +void ReverbAccumulationBuffer::updateReadIndex(int* readIndex, size_t numberOfFrames) const +{ + // Update caller's readIndex + *readIndex = (*readIndex + numberOfFrames) % m_buffer.size(); +} + +int ReverbAccumulationBuffer::accumulate(float* source, size_t numberOfFrames, int* readIndex, size_t delayFrames) +{ + size_t bufferLength = m_buffer.size(); + + size_t writeIndex = (*readIndex + delayFrames) % bufferLength; + + // Update caller's readIndex + *readIndex = (*readIndex + numberOfFrames) % bufferLength; + + size_t framesAvailable = bufferLength - writeIndex; + size_t numberOfFrames1 = std::min(numberOfFrames, framesAvailable); + size_t numberOfFrames2 = numberOfFrames - numberOfFrames1; + + float* destination = m_buffer.data(); + + bool isSafe = writeIndex <= bufferLength && numberOfFrames1 + writeIndex <= bufferLength && numberOfFrames2 <= bufferLength; + ASSERT(isSafe); + if (!isSafe) + return 0; + + vadd(source, 1, destination + writeIndex, 1, destination + writeIndex, 1, numberOfFrames1); + + // Handle wrap-around if necessary + if (numberOfFrames2 > 0) + vadd(source + numberOfFrames1, 1, destination, 1, destination, 1, numberOfFrames2); + + return writeIndex; +} + +void ReverbAccumulationBuffer::reset() +{ + m_buffer.zero(); + m_readIndex = 0; + m_readTimeFrame = 0; +} + +} // namespace WebCore + +#endif // ENABLE(WEB_AUDIO) diff --git a/WebCore/platform/audio/ReverbAccumulationBuffer.h b/WebCore/platform/audio/ReverbAccumulationBuffer.h new file mode 100644 index 0000000..44a0773 --- /dev/null +++ b/WebCore/platform/audio/ReverbAccumulationBuffer.h @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of 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 ReverbAccumulationBuffer_h +#define ReverbAccumulationBuffer_h + +#include "AudioFloatArray.h" + +namespace WebCore { + +// ReverbAccumulationBuffer is a circular delay buffer with one client reading from it and multiple clients +// writing/accumulating to it at different delay offsets from the read position. The read operation will zero the memory +// just read from the buffer, so it will be ready for accumulation the next time around. +class ReverbAccumulationBuffer { +public: + ReverbAccumulationBuffer(size_t length); + + // This will read from, then clear-out numberOfFrames + void readAndClear(float* destination, size_t numberOfFrames); + + // Each ReverbConvolverStage will accumulate its output at the appropriate delay from the read position. + // We need to pass in and update readIndex here, since each ReverbConvolverStage may be running in + // a different thread than the realtime thread calling ReadAndClear() and maintaining m_readIndex + // Returns the writeIndex where the accumulation took place + int accumulate(float* source, size_t numberOfFrames, int* readIndex, size_t delayFrames); + + size_t readIndex() const { return m_readIndex; } + void updateReadIndex(int* readIndex, size_t numberOfFrames) const; + + size_t readTimeFrame() const { return m_readTimeFrame; } + + void reset(); + +private: + AudioFloatArray m_buffer; + size_t m_readIndex; + size_t m_readTimeFrame; // for debugging (frame on continuous timeline) +}; + +} // namespace WebCore + +#endif // ReverbAccumulationBuffer_h diff --git a/WebCore/platform/audio/ReverbConvolver.cpp b/WebCore/platform/audio/ReverbConvolver.cpp new file mode 100644 index 0000000..719e586 --- /dev/null +++ b/WebCore/platform/audio/ReverbConvolver.cpp @@ -0,0 +1,228 @@ +/* + * 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 "ReverbConvolver.h" + +#include "Accelerate.h" +#include "AudioBus.h" + +namespace WebCore { + +const int InputBufferSize = 8 * 16384; + +// We only process the leading portion of the impulse response in the real-time thread. We don't exceed this length. +// It turns out then, that the background thread has about 278msec of scheduling slop. +// Empirically, this has been found to be a good compromise between giving enough time for scheduling slop, +// while still minimizing the amount of processing done in the primary (high-priority) thread. +// This was found to be a good value on Mac OS X, and may work well on other platforms as well, assuming +// the very rough scheduling latencies are similar on these time-scales. Of course, this code may need to be +// tuned for individual platforms if this assumption is found to be incorrect. +const size_t RealtimeFrameLimit = 8192 + 4096; // ~278msec @ 44.1KHz + +const size_t MinFFTSize = 256; +const size_t MaxRealtimeFFTSize = 2048; + +static void* backgroundThreadEntry(void* threadData) +{ + ReverbConvolver* reverbConvolver = static_cast<ReverbConvolver*>(threadData); + reverbConvolver->backgroundThreadEntry(); + return 0; +} + +ReverbConvolver::ReverbConvolver(AudioChannel* impulseResponse, size_t renderSliceSize, size_t maxFFTSize, size_t convolverRenderPhase, bool useBackgroundThreads) + : m_impulseResponseLength(impulseResponse->frameSize()) + , m_accumulationBuffer(impulseResponse->frameSize() + renderSliceSize) + , m_inputBuffer(InputBufferSize) + , m_renderSliceSize(renderSliceSize) + , m_minFFTSize(MinFFTSize) // First stage will have this size - successive stages will double in size each time + , m_maxFFTSize(maxFFTSize) // until we hit m_maxFFTSize + , m_useBackgroundThreads(useBackgroundThreads) + , m_backgroundThread(0) + , m_wantsToExit(false) + , m_moreInputBuffered(false) +{ + // If we are using background threads then don't exceed this FFT size for the + // stages which run in the real-time thread. This avoids having only one or two + // large stages (size 16384 or so) at the end which take a lot of time every several + // processing slices. This way we amortize the cost over more processing slices. + m_maxRealtimeFFTSize = MaxRealtimeFFTSize; + + // For the moment, a good way to know if we have real-time constraint is to check if we're using background threads. + // Otherwise, assume we're being run from a command-line tool. + bool hasRealtimeConstraint = useBackgroundThreads; + + float* response = impulseResponse->data(); + size_t totalResponseLength = impulseResponse->frameSize(); + + // Because we're not using direct-convolution in the leading portion, the reverb has an overall latency of half the first-stage FFT size + size_t reverbTotalLatency = m_minFFTSize / 2; + + size_t stageOffset = 0; + int i = 0; + size_t fftSize = m_minFFTSize; + while (stageOffset < totalResponseLength) { + size_t stageSize = fftSize / 2; + + // For the last stage, it's possible that stageOffset is such that we're straddling the end + // of the impulse response buffer (if we use stageSize), so reduce the last stage's length... + if (stageSize + stageOffset > totalResponseLength) + stageSize = totalResponseLength - stageOffset; + + // This "staggers" the time when each FFT happens so they don't all happen at the same time + int renderPhase = convolverRenderPhase + i * renderSliceSize; + + OwnPtr<ReverbConvolverStage> stage(new ReverbConvolverStage(response, totalResponseLength, reverbTotalLatency, stageOffset, stageSize, fftSize, renderPhase, renderSliceSize, &m_accumulationBuffer)); + + bool isBackgroundStage = false; + + if (this->useBackgroundThreads() && stageOffset > RealtimeFrameLimit) { + m_backgroundStages.append(stage.release()); + isBackgroundStage = true; + } else + m_stages.append(stage.release()); + + stageOffset += stageSize; + ++i; + + // Figure out next FFT size + fftSize *= 2; + if (hasRealtimeConstraint && !isBackgroundStage && fftSize > m_maxRealtimeFFTSize) + fftSize = m_maxRealtimeFFTSize; + if (fftSize > m_maxFFTSize) + fftSize = m_maxFFTSize; + } + + // Start up background thread + // FIXME: would be better to up the thread priority here. It doesn't need to be real-time, but higher than the default... + if (this->useBackgroundThreads() && m_backgroundStages.size() > 0) + m_backgroundThread = createThread(WebCore::backgroundThreadEntry, this, "convolution background thread"); +} + +ReverbConvolver::~ReverbConvolver() +{ + // Wait for background thread to stop + if (useBackgroundThreads() && m_backgroundThread) { + m_wantsToExit = true; + + // Wake up thread so it can return + { + MutexLocker locker(m_backgroundThreadLock); + m_moreInputBuffered = true; + m_backgroundThreadCondition.signal(); + } + + waitForThreadCompletion(m_backgroundThread, 0); + } +} + +void ReverbConvolver::backgroundThreadEntry() +{ + while (!m_wantsToExit) { + // Wait for realtime thread to give us more input + m_moreInputBuffered = false; + { + MutexLocker locker(m_backgroundThreadLock); + while (!m_moreInputBuffered && !m_wantsToExit) + m_backgroundThreadCondition.wait(m_backgroundThreadLock); + } + + // Process all of the stages until their read indices reach the input buffer's write index + int writeIndex = m_inputBuffer.writeIndex(); + + // Even though it doesn't seem like every stage needs to maintain its own version of readIndex + // we do this in case we want to run in more than one background thread. + int readIndex; + + while ((readIndex = m_backgroundStages[0]->inputReadIndex()) != writeIndex) { // FIXME: do better to detect buffer overrun... + // The ReverbConvolverStages need to process in amounts which evenly divide half the FFT size + const int SliceSize = MinFFTSize / 2; + + // Accumulate contributions from each stage + for (size_t i = 0; i < m_backgroundStages.size(); ++i) + m_backgroundStages[i]->processInBackground(this, SliceSize); + } + } +} + +void ReverbConvolver::process(AudioChannel* sourceChannel, AudioChannel* destinationChannel, size_t framesToProcess) +{ + bool isSafe = sourceChannel && destinationChannel && sourceChannel->frameSize() >= framesToProcess && destinationChannel->frameSize() >= framesToProcess; + ASSERT(isSafe); + if (!isSafe) + return; + + float* source = sourceChannel->data(); + float* destination = destinationChannel->data(); + bool isDataSafe = source && destination; + ASSERT(isDataSafe); + if (!isDataSafe) + return; + + // Feed input buffer (read by all threads) + m_inputBuffer.write(source, framesToProcess); + + // Accumulate contributions from each stage + for (size_t i = 0; i < m_stages.size(); ++i) + m_stages[i]->process(source, framesToProcess); + + // Finally read from accumulation buffer + m_accumulationBuffer.readAndClear(destination, framesToProcess); + + // Now that we've buffered more input, wake up our background thread. + + // Not using a MutexLocker looks strange, but we use a tryLock() instead because this is run on the real-time + // thread where it is a disaster for the lock to be contended (causes audio glitching). It's OK if we fail to + // signal from time to time, since we'll get to it the next time we're called. We're called repeatedly + // and frequently (around every 3ms). The background thread is processing well into the future and has a considerable amount of + // leeway here... + if (m_backgroundThreadLock.tryLock()) { + m_moreInputBuffered = true; + m_backgroundThreadCondition.signal(); + m_backgroundThreadLock.unlock(); + } +} + +void ReverbConvolver::reset() +{ + for (size_t i = 0; i < m_stages.size(); ++i) + m_stages[i]->reset(); + + for (size_t i = 0; i < m_backgroundStages.size(); ++i) + m_backgroundStages[i]->reset(); + + m_accumulationBuffer.reset(); + m_inputBuffer.reset(); +} + +} // namespace WebCore + +#endif // ENABLE(WEB_AUDIO) diff --git a/WebCore/platform/audio/ReverbConvolver.h b/WebCore/platform/audio/ReverbConvolver.h new file mode 100644 index 0000000..34f77d3 --- /dev/null +++ b/WebCore/platform/audio/ReverbConvolver.h @@ -0,0 +1,97 @@ +/* + * 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 ReverbConvolver_h +#define ReverbConvolver_h + +#include "AudioFloatArray.h" +#include "FFTConvolver.h" +#include "ReverbAccumulationBuffer.h" +#include "ReverbConvolverStage.h" +#include "ReverbInputBuffer.h" +#include <wtf/OwnPtr.h> +#include <wtf/RefCounted.h> +#include <wtf/Threading.h> +#include <wtf/Vector.h> + +namespace WebCore { + +class AudioChannel; + +class ReverbConvolver { +public: + // maxFFTSize can be adjusted (from say 2048 to 32768) depending on how much precision is necessary. + // For certain tweaky de-convolving applications the phase errors add up quickly and lead to non-sensical results with + // larger FFT sizes and single-precision floats. In these cases 2048 is a good size. + // If not doing multi-threaded convolution, then should not go > 8192. + ReverbConvolver(AudioChannel* impulseResponse, size_t renderSliceSize, size_t maxFFTSize, size_t convolverRenderPhase, bool useBackgroundThreads); + ~ReverbConvolver(); + + void process(AudioChannel* sourceChannel, AudioChannel* destinationChannel, size_t framesToProcess); + void reset(); + + size_t impulseResponseLength() const { return m_impulseResponseLength; } + + ReverbInputBuffer* inputBuffer() { return &m_inputBuffer; } + + bool useBackgroundThreads() const { return m_useBackgroundThreads; } + void backgroundThreadEntry(); + +private: + Vector<OwnPtr<ReverbConvolverStage> > m_stages; + Vector<OwnPtr<ReverbConvolverStage> > m_backgroundStages; + size_t m_impulseResponseLength; + + ReverbAccumulationBuffer m_accumulationBuffer; + + // One or more background threads read from this input buffer which is fed from the realtime thread. + ReverbInputBuffer m_inputBuffer; + + // We're given a rendering hint, so the FFTs can be optimized to not all occur at the same time + // (very bad when rendering on a real-time thread). + size_t m_renderSliceSize; + + // First stage will be of size m_minFFTSize. Each next stage will be twice as big until we hit m_maxFFTSize. + size_t m_minFFTSize; + size_t m_maxFFTSize; + + // But don't exceed this size in the real-time thread (if we're doing background processing). + size_t m_maxRealtimeFFTSize; + + // Background thread and synchronization + bool m_useBackgroundThreads; + ThreadIdentifier m_backgroundThread; + bool m_wantsToExit; + bool m_moreInputBuffered; + mutable Mutex m_backgroundThreadLock; + mutable ThreadCondition m_backgroundThreadCondition; +}; + +} // namespace WebCore + +#endif // ReverbConvolver_h diff --git a/WebCore/platform/audio/ReverbConvolverStage.cpp b/WebCore/platform/audio/ReverbConvolverStage.cpp new file mode 100644 index 0000000..8606502 --- /dev/null +++ b/WebCore/platform/audio/ReverbConvolverStage.cpp @@ -0,0 +1,163 @@ +/* + * 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 "ReverbConvolverStage.h" + +#include "Accelerate.h" +#include "ReverbAccumulationBuffer.h" +#include "ReverbConvolver.h" +#include "ReverbInputBuffer.h" +#include <wtf/OwnPtr.h> +#include <wtf/PassOwnPtr.h> + +namespace WebCore { + +ReverbConvolverStage::ReverbConvolverStage(float* impulseResponse, size_t responseLength, size_t reverbTotalLatency, size_t stageOffset, size_t stageLength, + size_t fftSize, size_t renderPhase, size_t renderSliceSize, ReverbAccumulationBuffer* accumulationBuffer) + : m_fftKernel(fftSize) + , m_accumulationBuffer(accumulationBuffer) + , m_accumulationReadIndex(0) + , m_inputReadIndex(0) + , m_impulseResponseLength(responseLength) +{ + ASSERT(impulseResponse); + ASSERT(accumulationBuffer); + + m_fftKernel.doPaddedFFT(impulseResponse + stageOffset, stageLength); + m_convolver = new FFTConvolver(fftSize); + m_temporaryBuffer.allocate(renderSliceSize); + + // The convolution stage at offset stageOffset needs to have a corresponding delay to cancel out the offset. + size_t totalDelay = stageOffset + reverbTotalLatency; + + // But, the FFT convolution itself incurs fftSize / 2 latency, so subtract this out... + size_t halfSize = fftSize / 2; + ASSERT(totalDelay >= halfSize); + if (totalDelay >= halfSize) + totalDelay -= halfSize; + + // We divide up the total delay, into pre and post delay sections so that we can schedule at exactly the moment when the FFT will happen. + // This is coordinated with the other stages, so they don't all do their FFTs at the same time... + int maxPreDelayLength = std::min(halfSize, totalDelay); + m_preDelayLength = totalDelay > 0 ? renderPhase % maxPreDelayLength : 0; + if (m_preDelayLength > totalDelay) + m_preDelayLength = 0; + + m_postDelayLength = totalDelay - m_preDelayLength; + m_preReadWriteIndex = 0; + m_framesProcessed = 0; // total frames processed so far + + m_preDelayBuffer.allocate(m_preDelayLength < fftSize ? fftSize : m_preDelayLength); +} + +void ReverbConvolverStage::processInBackground(ReverbConvolver* convolver, size_t framesToProcess) +{ + ReverbInputBuffer* inputBuffer = convolver->inputBuffer(); + float* source = inputBuffer->directReadFrom(&m_inputReadIndex, framesToProcess); + process(source, framesToProcess); +} + +void ReverbConvolverStage::process(float* source, size_t framesToProcess) +{ + ASSERT(source); + if (!source) + return; + + // Deal with pre-delay stream : note special handling of zero delay. + + float* preDelayedSource; + float* temporaryBuffer; + bool isTemporaryBufferSafe = false; + if (m_preDelayLength > 0) { + // Handles both the read case (call to process() ) and the write case (memcpy() ) + bool isPreDelaySafe = m_preReadWriteIndex + framesToProcess <= m_preDelayBuffer.size(); + ASSERT(isPreDelaySafe); + if (!isPreDelaySafe) + return; + + isTemporaryBufferSafe = framesToProcess <= m_temporaryBuffer.size(); + + preDelayedSource = m_preDelayBuffer.data() + m_preReadWriteIndex; + temporaryBuffer = m_temporaryBuffer.data(); + } else { + // Zero delay + preDelayedSource = source; + temporaryBuffer = m_preDelayBuffer.data(); + + isTemporaryBufferSafe = framesToProcess <= m_preDelayBuffer.size(); + } + + ASSERT(isTemporaryBufferSafe); + if (!isTemporaryBufferSafe) + return; + + int writeIndex = 0; + + if (m_framesProcessed < m_preDelayLength) { + // For the first m_preDelayLength frames don't process the convolver, instead simply buffer in the pre-delay. + // But while buffering the pre-delay, we still need to update our index. + m_accumulationBuffer->updateReadIndex(&m_accumulationReadIndex, framesToProcess); + } else { + // Now, run the convolution (into the delay buffer). + // An expensive FFT will happen every fftSize / 2 frames. + // We process in-place here... + m_convolver->process(&m_fftKernel, preDelayedSource, temporaryBuffer, framesToProcess); + + // Now accumulate into reverb's accumulation buffer. + writeIndex = m_accumulationBuffer->accumulate(temporaryBuffer, framesToProcess, &m_accumulationReadIndex, m_postDelayLength); + } + + // Finally copy input to pre-delay. + if (m_preDelayLength > 0) { + memcpy(preDelayedSource, source, sizeof(float) * framesToProcess); + m_preReadWriteIndex += framesToProcess; + + ASSERT(m_preReadWriteIndex <= m_preDelayLength); + if (m_preReadWriteIndex >= m_preDelayLength) + m_preReadWriteIndex = 0; + } + + m_framesProcessed += framesToProcess; +} + +void ReverbConvolverStage::reset() +{ + m_convolver->reset(); + m_preDelayBuffer.zero(); + m_accumulationReadIndex = 0; + m_inputReadIndex = 0; + m_framesProcessed = 0; +} + +} // namespace WebCore + +#endif // ENABLE(WEB_AUDIO) diff --git a/WebCore/platform/audio/ReverbConvolverStage.h b/WebCore/platform/audio/ReverbConvolverStage.h new file mode 100644 index 0000000..88351af --- /dev/null +++ b/WebCore/platform/audio/ReverbConvolverStage.h @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 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 ReverbConvolverStage_h +#define ReverbConvolverStage_h + +#include "AudioFloatArray.h" +#include "FFTFrame.h" +#include <wtf/OwnPtr.h> + +namespace WebCore { + +class ReverbAccumulationBuffer; +class ReverbConvolver; +class FFTConvolver; + +// A ReverbConvolverStage represents the convolution associated with a sub-section of a large impulse response. +// It incorporates a delay line to account for the offset of the sub-section within the larger impulse response. +class ReverbConvolverStage { +public: + // renderPhase is useful to know so that we can manipulate the pre versus post delay so that stages will perform + // their heavy work (FFT processing) on different slices to balance the load in a real-time thread. + ReverbConvolverStage(float* impulseResponse, size_t responseLength, size_t reverbTotalLatency, size_t stageOffset, size_t stageLength, + size_t fftSize, size_t renderPhase, size_t renderSliceSize, ReverbAccumulationBuffer* accumulationBuffer); + + // WARNING: framesToProcess must be such that it evenly divides the delay buffer size (stage_offset). + void process(float* source, size_t framesToProcess); + + void processInBackground(ReverbConvolver* convolver, size_t framesToProcess); + + void reset(); + + // Useful for background processing + int inputReadIndex() const { return m_inputReadIndex; } + +private: + FFTFrame m_fftKernel; + OwnPtr<FFTConvolver> m_convolver; + + AudioFloatArray m_preDelayBuffer; + + ReverbAccumulationBuffer* m_accumulationBuffer; + int m_accumulationReadIndex; + int m_inputReadIndex; + + size_t m_preDelayLength; + size_t m_postDelayLength; + size_t m_preReadWriteIndex; + size_t m_framesProcessed; + + AudioFloatArray m_temporaryBuffer; + + size_t m_impulseResponseLength; +}; + +} // namespace WebCore + +#endif // ReverbConvolverStage_h diff --git a/WebCore/platform/audio/ReverbInputBuffer.cpp b/WebCore/platform/audio/ReverbInputBuffer.cpp new file mode 100644 index 0000000..f270f6f --- /dev/null +++ b/WebCore/platform/audio/ReverbInputBuffer.cpp @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 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 "ReverbInputBuffer.h" + +namespace WebCore { + +ReverbInputBuffer::ReverbInputBuffer(size_t length) + : m_buffer(length) + , m_writeIndex(0) +{ +} + +void ReverbInputBuffer::write(float* sourceP, size_t numberOfFrames) +{ + size_t bufferLength = m_buffer.size(); + bool isCopySafe = m_writeIndex + numberOfFrames <= bufferLength; + ASSERT(isCopySafe); + if (!isCopySafe) + return; + + memcpy(m_buffer.data() + m_writeIndex, sourceP, sizeof(float) * numberOfFrames); + + m_writeIndex += numberOfFrames; + ASSERT(m_writeIndex <= bufferLength); + + if (m_writeIndex >= bufferLength) + m_writeIndex = 0; +} + +float* ReverbInputBuffer::directReadFrom(int* readIndex, size_t numberOfFrames) +{ + size_t bufferLength = m_buffer.size(); + bool isPointerGood = readIndex && *readIndex >= 0 && *readIndex + numberOfFrames <= bufferLength; + ASSERT(isPointerGood); + if (!isPointerGood) { + // Should never happen in practice but return pointer to start of buffer (avoid crash) + if (readIndex) + *readIndex = 0; + return m_buffer.data(); + } + + float* sourceP = m_buffer.data(); + float* p = sourceP + *readIndex; + + // Update readIndex + *readIndex = (*readIndex + numberOfFrames) % bufferLength; + + return p; +} + +void ReverbInputBuffer::reset() +{ + m_buffer.zero(); + m_writeIndex = 0; +} + +} // namespace WebCore + +#endif // ENABLE(WEB_AUDIO) diff --git a/WebCore/platform/audio/ReverbInputBuffer.h b/WebCore/platform/audio/ReverbInputBuffer.h new file mode 100644 index 0000000..aa9cf41 --- /dev/null +++ b/WebCore/platform/audio/ReverbInputBuffer.h @@ -0,0 +1,64 @@ +/* + * 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 ReverbInputBuffer_h +#define ReverbInputBuffer_h + +#include "AudioFloatArray.h" + +namespace WebCore { + +// ReverbInputBuffer is used to buffer input samples for deferred processing by the background threads. +class ReverbInputBuffer { +public: + ReverbInputBuffer(size_t length); + + // The realtime audio thread keeps writing samples here. + // The assumption is that the buffer's length is evenly divisible by numberOfFrames (for nearly all cases this will be fine). + // FIXME: remove numberOfFrames restriction... + void write(float* sourceP, size_t numberOfFrames); + + // Background threads can call this to check if there's anything to read... + size_t writeIndex() const { return m_writeIndex; } + + // The individual background threads read here (and hope that they can keep up with the buffer writing). + // readIndex is updated with the next readIndex to read from... + // The assumption is that the buffer's length is evenly divisible by numberOfFrames. + // FIXME: remove numberOfFrames restriction... + float* directReadFrom(int* readIndex, size_t numberOfFrames); + + void reset(); + +private: + AudioFloatArray m_buffer; + size_t m_writeIndex; +}; + +} // namespace WebCore + +#endif // ReverbInputBuffer_h diff --git a/WebCore/platform/brew/SharedBufferBrew.cpp b/WebCore/platform/brew/SharedBufferBrew.cpp new file mode 100644 index 0000000..597825c --- /dev/null +++ b/WebCore/platform/brew/SharedBufferBrew.cpp @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2010 Company 100, Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "SharedBuffer.h" + +#include "FileSystem.h" +#include "ShellBrew.h" + +#include <AEEAppGen.h> +#include <AEEFile.h> +#include <AEEStdLib.h> + +#include <wtf/OwnPtr.h> +#include <wtf/text/CString.h> + +namespace WebCore { + +PassRefPtr<SharedBuffer> SharedBuffer::createWithContentsOfFile(const String& filePath) +{ + if (filePath.isEmpty()) + return 0; + + long long fileSize; + if (!fileExists(filePath) || !getFileSize(filePath, fileSize)) + return 0; + + RefPtr<SharedBuffer> result = create(); + result->m_buffer.grow(fileSize); + + OwnPtr<IFileMgr> fileMgr = createInstance<IFileMgr>(AEECLSID_FILEMGR); + + CString filename = fileSystemRepresentation(filePath); + OwnPtr<IFile> file(IFILEMGR_OpenFile(fileMgr.get(), filename.data(), _OFM_READ)); + + if (!file) { + LOG_ERROR("Failed to open file %s to create shared buffer, errno(%i)", filePath.ascii().data(), IFILEMGR_GetLastError(fileMgr.get())); + return 0; + } + + size_t totalBytesRead = 0; + int32 bytesRead; + while ((bytesRead = IFILE_Read(file.get(), result->m_buffer.data() + totalBytesRead, fileSize - totalBytesRead)) > 0) + totalBytesRead += bytesRead; + + if (totalBytesRead != fileSize) { + LOG_ERROR("Failed to fully read contents of file %s - errno(%i)", filePath.ascii().data(), IFILEMGR_GetLastError(fileMgr.get())); + return 0; + } + + return result.release(); +} + +} // namespace WebCore diff --git a/WebCore/platform/chromium/ChromiumBridge.h b/WebCore/platform/chromium/ChromiumBridge.h index 35ace89..bc86de2 100644 --- a/WebCore/platform/chromium/ChromiumBridge.h +++ b/WebCore/platform/chromium/ChromiumBridge.h @@ -102,7 +102,7 @@ namespace WebCore { static void clipboardWritePlainText(const String&); static void clipboardWriteURL(const KURL&, const String&); static void clipboardWriteImage(NativeImagePtr, const KURL&, const String&); - static void clipboardWriteData(ClipboardData*); + static void clipboardWriteData(const String& type, const String& data, const String& metadata); // Interface for handling copy and paste, drag and drop, and selection copy. static HashSet<String> clipboardReadAvailableTypes(PasteboardPrivate::ClipboardBuffer, bool* containsFilenames); diff --git a/WebCore/platform/chromium/ClipboardMimeTypes.cpp b/WebCore/platform/chromium/ClipboardMimeTypes.cpp new file mode 100644 index 0000000..b95744f8 --- /dev/null +++ b/WebCore/platform/chromium/ClipboardMimeTypes.cpp @@ -0,0 +1,40 @@ +/* + * 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 "ClipboardMimeTypes.h" + +namespace WebCore { + +const char textPlainType[] = "text/plain"; +const char textHtmlType[] = "text/html"; +const char textUriListType[] = "text/uri-list"; + +} // namespace WebCore diff --git a/WebCore/platform/chromium/ClipboardMimeTypes.h b/WebCore/platform/chromium/ClipboardMimeTypes.h new file mode 100644 index 0000000..d7468f2 --- /dev/null +++ b/WebCore/platform/chromium/ClipboardMimeTypes.h @@ -0,0 +1,42 @@ +/* + * 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 ClipboardMimeTypes_h +#define ClipboardMimeTypes_h + +namespace WebCore { + +extern const char textPlainType[]; +extern const char textHtmlType[]; +extern const char textUriListType[]; + +} // namespace WebCore + +#endif diff --git a/WebCore/platform/chromium/ReadableDataObject.cpp b/WebCore/platform/chromium/ReadableDataObject.cpp new file mode 100644 index 0000000..1a333bb --- /dev/null +++ b/WebCore/platform/chromium/ReadableDataObject.cpp @@ -0,0 +1,120 @@ +/* + * 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 "ReadableDataObject.h" + +#include "ChromiumBridge.h" +#include "ClipboardMimeTypes.h" + +namespace WebCore { + +static PasteboardPrivate::ClipboardBuffer clipboardBuffer(bool isForDragging) +{ + return isForDragging ? PasteboardPrivate::DragBuffer : PasteboardPrivate::StandardBuffer; +} + +PassRefPtr<ReadableDataObject> ReadableDataObject::create(bool isForDragging) +{ + return adoptRef(new ReadableDataObject(isForDragging)); +} + +ReadableDataObject::ReadableDataObject(bool isForDragging) + : m_isForDragging(isForDragging) + , m_containsFilenames(false) + , m_isTypeCacheInitialized(false) +{ +} + +bool ReadableDataObject::hasData() const +{ + ensureTypeCacheInitialized(); + return !m_types.isEmpty() || m_containsFilenames; +} + +HashSet<String> ReadableDataObject::types() const +{ + ensureTypeCacheInitialized(); + return m_types; +} + +String ReadableDataObject::getData(const String& type, bool& succeeded) const +{ + String data; + String ignoredMetadata; + succeeded = ChromiumBridge::clipboardReadData( + clipboardBuffer(m_isForDragging), type, data, ignoredMetadata); + return data; +} + +String ReadableDataObject::getURL(String* title) const +{ + String url; + String ignoredTitle; + if (!title) + title = &ignoredTitle; + ChromiumBridge::clipboardReadData( + clipboardBuffer(m_isForDragging), textUriListType, url, *title); + return url; +} + +String ReadableDataObject::getHTML(String* baseURL) const +{ + String html; + String ignoredBaseURL; + if (!baseURL) + baseURL = &ignoredBaseURL; + ChromiumBridge::clipboardReadData( + clipboardBuffer(m_isForDragging), textHtmlType, html, *baseURL); + return html; +} + +bool ReadableDataObject::hasFilenames() const +{ + ensureTypeCacheInitialized(); + return m_containsFilenames; +} + +Vector<String> ReadableDataObject::filenames() const +{ + return ChromiumBridge::clipboardReadFilenames(clipboardBuffer(m_isForDragging)); +} + +void ReadableDataObject::ensureTypeCacheInitialized() const +{ + if (m_isTypeCacheInitialized) + return; + + m_types = ChromiumBridge::clipboardReadAvailableTypes( + clipboardBuffer(m_isForDragging), &m_containsFilenames); + m_isTypeCacheInitialized = true; +} + +} // namespace WebCore diff --git a/WebCore/platform/chromium/ReadableDataObject.h b/WebCore/platform/chromium/ReadableDataObject.h new file mode 100644 index 0000000..60f6d45 --- /dev/null +++ b/WebCore/platform/chromium/ReadableDataObject.h @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ReadableDataObject_h +#define ReadableDataObject_h + +#include "PlatformString.h" +#include <wtf/HashSet.h> +#include <wtf/RefCounted.h> +#include <wtf/RefPtr.h> +#include <wtf/text/StringHash.h> + +namespace WebCore { + +// Used for one way communication of drag/drop and copy/paste data from the +// browser to the renderer. +class ReadableDataObject : public RefCounted<ReadableDataObject> { +public: + static PassRefPtr<ReadableDataObject> create(bool isForDragging); + + virtual bool hasData() const; + virtual HashSet<String> types() const; + virtual String getData(const String& type, bool& succeeded) const; + + virtual String getURL(String* title) const; + virtual String getHTML(String* baseURL) const; + + virtual bool hasFilenames() const; + virtual Vector<String> filenames() const; + +private: + explicit ReadableDataObject(bool isForDragging); + + // This isn't always const... but most of the time it is. + void ensureTypeCacheInitialized() const; + + + bool m_isForDragging; + + // To avoid making a lot of IPC calls for each drag event, we cache some + // values in the renderer. + mutable HashSet<String> m_types; + mutable bool m_containsFilenames; + mutable bool m_isTypeCacheInitialized; +}; + +} // namespace WebCore + +#endif diff --git a/WebCore/platform/chromium/WritableDataObject.cpp b/WebCore/platform/chromium/WritableDataObject.cpp new file mode 100644 index 0000000..6e7c283 --- /dev/null +++ b/WebCore/platform/chromium/WritableDataObject.cpp @@ -0,0 +1,152 @@ +/* + * 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 "WritableDataObject.h" + +#include "ChromiumBridge.h" +#include "ClipboardMimeTypes.h" + +namespace WebCore { + +PassRefPtr<WritableDataObject> WritableDataObject::create(bool isForDragging) +{ + return adoptRef(new WritableDataObject(isForDragging)); +} + +WritableDataObject::WritableDataObject(bool isForDragging) + : m_isForDragging(isForDragging) +{ +} + +void WritableDataObject::clearData(const String& type) +{ + m_dataMap.remove(type); + if (type == textUriListType) + m_urlTitle = ""; + else if (type == textHtmlType) + m_htmlBaseURL = KURL(); +} + +void WritableDataObject::clearAllExceptFiles() +{ + // FIXME: The spec does not provide a way to populate FileList currently. In + // fact, the spec explicitly states that dragging files can only happen from + // outside a browsing context. + clearAll(); +} + +void WritableDataObject::clearAll() +{ + m_dataMap.clear(); + m_urlTitle = ""; + m_htmlBaseURL = KURL(); + m_fileContentFilename = ""; + if (m_fileContent) + m_fileContent->clear(); + m_fileExtension = ""; +} + +bool WritableDataObject::setData(const String& type, const String& data) +{ + if (!m_isForDragging) { + ChromiumBridge::clipboardWriteData(type, data, ""); + return true; + } + m_dataMap.set(type, data); + if (type == textUriListType) + m_urlTitle = ""; + else if (type == textHtmlType) + m_htmlBaseURL = KURL(); + return true; +} + +void WritableDataObject::setURL(const String& url, const String& title) +{ + setData(textUriListType, url); + m_urlTitle = title; +} + +void WritableDataObject::setHTML(const String& html, const KURL& baseURL) +{ + setData(textHtmlType, html); + m_htmlBaseURL = baseURL; +} + +// Accessors used when transferring drag data from the renderer to the +// browser. +HashMap<String, String> WritableDataObject::dataMap() const +{ + return m_dataMap; +} + +String WritableDataObject::urlTitle() const +{ + return m_urlTitle; +} + +KURL WritableDataObject::htmlBaseURL() const +{ + return m_htmlBaseURL; +} + +// Used for transferring file data from the renderer to the browser. +String WritableDataObject::fileExtension() const +{ + return m_fileExtension; +} + +String WritableDataObject::fileContentFilename() const +{ + return m_fileContentFilename; +} + +PassRefPtr<SharedBuffer> WritableDataObject::fileContent() const +{ + return m_fileContent; +} + +void WritableDataObject::setFileExtension(const String& fileExtension) +{ + m_fileExtension = fileExtension; +} + +void WritableDataObject::setFileContentFilename(const String& fileContentFilename) +{ + m_fileContentFilename = fileContentFilename; +} + +void WritableDataObject::setFileContent(PassRefPtr<SharedBuffer> fileContent) +{ + m_fileContent = fileContent; +} + + +} // namespace WebCore diff --git a/WebCore/platform/chromium/WritableDataObject.h b/WebCore/platform/chromium/WritableDataObject.h new file mode 100644 index 0000000..71e2e26 --- /dev/null +++ b/WebCore/platform/chromium/WritableDataObject.h @@ -0,0 +1,87 @@ +/* + * 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 WritableDataObject_h +#define WritableDataObject_h + +#include "KURL.h" +#include "PlatformString.h" +#include "SharedBuffer.h" +#include <wtf/HashMap.h> +#include <wtf/RefCounted.h> +#include <wtf/RefPtr.h> +#include <wtf/text/StringHash.h> + +namespace WebCore { + +// Used for one way communication of drag/drop and copy/paste data from the +// renderer to the browser. This is intenteded to be used in dragstart/copy/cut +// events. Due to shortcomings, writes to the pasteboard cannot be performed +// atomically. +class WritableDataObject : public RefCounted<WritableDataObject> { +public: + static PassRefPtr<WritableDataObject> create(bool isForDragging); + + virtual void clearData(const String& type); + virtual void clearAllExceptFiles(); + virtual void clearAll(); + virtual bool setData(const String& type, const String& data); + + virtual void setURL(const String& url, const String& title); + virtual void setHTML(const String& html, const KURL& baseURL); + + // Used for transferring drag data from the renderer to the browser. + virtual HashMap<String, String> dataMap() const; + virtual String urlTitle() const; + virtual KURL htmlBaseURL() const; + + virtual String fileExtension() const; + virtual String fileContentFilename() const; + virtual PassRefPtr<SharedBuffer> fileContent() const; + virtual void setFileExtension(const String&); + virtual void setFileContentFilename(const String&); + virtual void setFileContent(PassRefPtr<SharedBuffer>); + +private: + explicit WritableDataObject(bool isForDragging); + + bool m_isForDragging; + + HashMap<String, String> m_dataMap; + String m_urlTitle; + KURL m_htmlBaseURL; + String m_fileExtension; + String m_fileContentFilename; + RefPtr<SharedBuffer> m_fileContent; +}; + +} // namespace WebCore + +#endif diff --git a/WebCore/platform/efl/ClipboardEfl.cpp b/WebCore/platform/efl/ClipboardEfl.cpp index caff813..6fc80dc 100644 --- a/WebCore/platform/efl/ClipboardEfl.cpp +++ b/WebCore/platform/efl/ClipboardEfl.cpp @@ -29,7 +29,7 @@ namespace WebCore { PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame*) { - return new ClipboardEfl(policy, false); + return ClipboardEfl::create(policy, false); } PassRefPtr<Clipboard> Clipboard::create(ClipboardAccessPolicy, DragData*, Frame*) diff --git a/WebCore/platform/efl/ClipboardEfl.h b/WebCore/platform/efl/ClipboardEfl.h index d5b17c0..5db2fed 100644 --- a/WebCore/platform/efl/ClipboardEfl.h +++ b/WebCore/platform/efl/ClipboardEfl.h @@ -28,7 +28,10 @@ class CachedImage; class ClipboardEfl : public Clipboard { public: - ClipboardEfl(ClipboardAccessPolicy, bool); + static PassRefPtr<ClipboardEfl> create(ClipboardAccessPolicy policy, bool forDragging = false) + { + return adoptRef(new ClipboardEfl(policy, forDragging)); + } ~ClipboardEfl(); void clearData(const String&); @@ -53,6 +56,9 @@ public: virtual bool hasData(); virtual void writePlainText(const WTF::String&); + +private: + ClipboardEfl(ClipboardAccessPolicy, bool); }; } diff --git a/WebCore/platform/efl/ScrollbarEfl.cpp b/WebCore/platform/efl/ScrollbarEfl.cpp index 1030ebd..e413260 100644 --- a/WebCore/platform/efl/ScrollbarEfl.cpp +++ b/WebCore/platform/efl/ScrollbarEfl.cpp @@ -125,7 +125,7 @@ void ScrollbarEfl::setParent(ScrollView* view) int err = edje_object_load_error_get(o); const char* errmsg = edje_load_error_str(err); EINA_LOG_ERR("Could not load theme '%s' from file '%s': #%d '%s'", - theme.utf8().data(), group, err, errmsg); + group, theme.utf8().data(), err, errmsg); return; } diff --git a/WebCore/platform/graphics/FloatPoint.cpp b/WebCore/platform/graphics/FloatPoint.cpp index cf3d548..7e85b52 100644 --- a/WebCore/platform/graphics/FloatPoint.cpp +++ b/WebCore/platform/graphics/FloatPoint.cpp @@ -30,6 +30,7 @@ #include "TransformationMatrix.h" #include "FloatConversion.h" #include "IntPoint.h" +#include <math.h> namespace WebCore { @@ -37,6 +38,21 @@ FloatPoint::FloatPoint(const IntPoint& p) : m_x(p.x()), m_y(p.y()) { } +void FloatPoint::normalize() +{ + float tempLength = length(); + + if (tempLength) { + m_x /= tempLength; + m_y /= tempLength; + } +} + +float FloatPoint::length() const +{ + return sqrtf(lengthSquared()); +} + FloatPoint FloatPoint::matrixTransform(const AffineTransform& transform) const { double newX, newY; diff --git a/WebCore/platform/graphics/FloatPoint.h b/WebCore/platform/graphics/FloatPoint.h index 5018f1d..73a1bac 100644 --- a/WebCore/platform/graphics/FloatPoint.h +++ b/WebCore/platform/graphics/FloatPoint.h @@ -80,6 +80,11 @@ public: void setX(float x) { m_x = x; } void setY(float y) { m_y = y; } + void set(float x, float y) + { + m_x = x; + m_y = y; + } void move(float dx, float dy) { m_x += dx; @@ -91,6 +96,19 @@ public: m_y *= sy; } + void normalize(); + + float dot(const FloatPoint& a) const + { + return m_x * a.x() + m_y * a.y(); + } + + float length() const; + float lengthSquared() const + { + return m_x * m_x + m_y * m_y; + } + #if PLATFORM(CG) FloatPoint(const CGPoint&); operator CGPoint() const; @@ -173,6 +191,12 @@ inline bool operator!=(const FloatPoint& a, const FloatPoint& b) return a.x() != b.x() || a.y() != b.y(); } +inline float operator*(const FloatPoint& a, const FloatPoint& b) +{ + // dot product + return a.dot(b); +} + inline IntPoint roundedIntPoint(const FloatPoint& p) { return IntPoint(static_cast<int>(roundf(p.x())), static_cast<int>(roundf(p.y()))); diff --git a/WebCore/platform/graphics/FloatPoint3D.cpp b/WebCore/platform/graphics/FloatPoint3D.cpp index 3d37eea..bb05e7f 100644 --- a/WebCore/platform/graphics/FloatPoint3D.cpp +++ b/WebCore/platform/graphics/FloatPoint3D.cpp @@ -21,21 +21,27 @@ #include "config.h" -#include <math.h> #include "FloatPoint3D.h" +#include <math.h> + namespace WebCore { void FloatPoint3D::normalize() { - float length = sqrtf(m_x * m_x + m_y * m_y + m_z * m_z); + float tempLength = length(); - if (length != 0) { - m_x /= length; - m_y /= length; - m_z /= length; + if (tempLength) { + m_x /= tempLength; + m_y /= tempLength; + m_z /= tempLength; } } +float FloatPoint3D::length() const +{ + return sqrtf(lengthSquared()); +} + } // namespace WebCore diff --git a/WebCore/platform/graphics/FloatPoint3D.h b/WebCore/platform/graphics/FloatPoint3D.h index d10e3c1..9ee548d 100644 --- a/WebCore/platform/graphics/FloatPoint3D.h +++ b/WebCore/platform/graphics/FloatPoint3D.h @@ -65,15 +65,85 @@ public: float z() const { return m_z; } void setZ(float z) { m_z = z; } + void set(float x, float y, float z) + { + m_x = x; + m_y = y; + m_z = z; + } + void move(float dx, float dy, float dz) + { + m_x += dx; + m_y += dy; + m_z += dz; + } + void scale(float sx, float sy, float sz) + { + m_x *= sx; + m_y *= sy; + m_z *= sz; + } void normalize(); + float dot(const FloatPoint3D& a) const + { + return m_x * a.x() + m_y * a.y() + m_z * a.z(); + } + + // Sets this FloatPoint3D to the cross product of the passed two. + // It is safe for "this" to be the same as either or both of the + // arguments. + void cross(const FloatPoint3D& a, const FloatPoint3D& b) + { + float x = a.y() * b.z() - a.z() * b.y(); + float y = a.z() * b.x() - a.x() * b.z(); + float z = a.x() * b.y() - a.y() * b.x(); + m_x = x; + m_y = y; + m_z = z; + } + + // Convenience function returning "this cross point" as a + // stack-allocated result. + FloatPoint3D cross(const FloatPoint3D& point) const + { + FloatPoint3D result; + result.cross(*this, point); + return result; + } + + float length() const; + float lengthSquared() const { return this->dot(*this); } + private: float m_x; float m_y; float m_z; }; +inline FloatPoint3D& operator +=(FloatPoint3D& a, const FloatPoint3D& b) +{ + a.move(b.x(), b.y(), b.z()); + return a; +} + +inline FloatPoint3D& operator -=(FloatPoint3D& a, const FloatPoint3D& b) +{ + a.move(-b.x(), -b.y(), -b.z()); + return a; +} + +inline FloatPoint3D operator+(const FloatPoint3D& a, const FloatPoint3D& b) +{ + return FloatPoint3D(a.x() + b.x(), a.y() + b.y(), a.z() + b.z()); +} + +inline FloatPoint3D operator-(const FloatPoint3D& a, const FloatPoint3D& b) +{ + return FloatPoint3D(a.x() - b.x(), a.y() - b.y(), a.z() - b.z()); +} + inline bool operator==(const FloatPoint3D& a, const FloatPoint3D& b) { return a.x() == b.x() && a.y() == b.y() && a.z() == b.z(); @@ -87,7 +157,7 @@ inline bool operator!=(const FloatPoint3D& a, const FloatPoint3D& b) inline float operator*(const FloatPoint3D& a, const FloatPoint3D& b) { // dot product - return a.x() * b.x() + a.y() * b.y() + a.z() * b.z(); + return a.dot(b); } } // namespace WebCore diff --git a/WebCore/platform/graphics/FloatRect.cpp b/WebCore/platform/graphics/FloatRect.cpp index 6dfa808..0d8a24e 100644 --- a/WebCore/platform/graphics/FloatRect.cpp +++ b/WebCore/platform/graphics/FloatRect.cpp @@ -76,10 +76,7 @@ void FloatRect::intersect(const FloatRect& other) b = 0; } - m_location.setX(l); - m_location.setY(t); - m_size.setWidth(r - l); - m_size.setHeight(b - t); + setLocationAndSizeFromEdges(l, t, r, b); } void FloatRect::unite(const FloatRect& other) @@ -97,10 +94,7 @@ void FloatRect::unite(const FloatRect& other) float r = max(right(), other.right()); float b = max(bottom(), other.bottom()); - m_location.setX(l); - m_location.setY(t); - m_size.setWidth(r - l); - m_size.setHeight(b - t); + setLocationAndSizeFromEdges(l, t, r, b); } void FloatRect::scale(float sx, float sy) @@ -111,6 +105,65 @@ void FloatRect::scale(float sx, float sy) m_size.setHeight(height() * sy); } +void FloatRect::fitToPoints(const FloatPoint& p0, const FloatPoint& p1) +{ + float left = min(p0.x(), p1.x()); + float top = min(p0.y(), p1.y()); + float right = max(p0.x(), p1.x()); + float bottom = max(p0.y(), p1.y()); + + setLocationAndSizeFromEdges(left, top, right, bottom); +} + +namespace { +// Helpers for 3- and 4-way max and min. + +template <typename T> +T min3(const T& v1, const T& v2, const T& v3) +{ + return min(min(v1, v2), v3); +} + +template <typename T> +T max3(const T& v1, const T& v2, const T& v3) +{ + return max(max(v1, v2), v3); +} + +template <typename T> +T min4(const T& v1, const T& v2, const T& v3, const T& v4) +{ + return min(min(v1, v2), min(v3, v4)); +} + +template <typename T> +T max4(const T& v1, const T& v2, const T& v3, const T& v4) +{ + return max(max(v1, v2), max(v3, v4)); +} + +} // anonymous namespace + +void FloatRect::fitToPoints(const FloatPoint& p0, const FloatPoint& p1, const FloatPoint& p2) +{ + float left = min3(p0.x(), p1.x(), p2.x()); + float top = min3(p0.y(), p1.y(), p2.y()); + float right = max3(p0.x(), p1.x(), p2.x()); + float bottom = max3(p0.y(), p1.y(), p2.y()); + + setLocationAndSizeFromEdges(left, top, right, bottom); +} + +void FloatRect::fitToPoints(const FloatPoint& p0, const FloatPoint& p1, const FloatPoint& p2, const FloatPoint& p3) +{ + float left = min4(p0.x(), p1.x(), p2.x(), p3.x()); + float top = min4(p0.y(), p1.y(), p2.y(), p3.y()); + float right = max4(p0.x(), p1.x(), p2.x(), p3.x()); + float bottom = max4(p0.y(), p1.y(), p2.y(), p3.y()); + + setLocationAndSizeFromEdges(left, top, right, bottom); +} + static inline int safeFloatToInt(float x) { static const int s_intMax = std::numeric_limits<int>::max(); diff --git a/WebCore/platform/graphics/FloatRect.h b/WebCore/platform/graphics/FloatRect.h index 2b23576..e387927 100644 --- a/WebCore/platform/graphics/FloatRect.h +++ b/WebCore/platform/graphics/FloatRect.h @@ -96,7 +96,9 @@ public: bool isEmpty() const { return m_size.isEmpty(); } + float left() const { return x(); } float right() const { return x() + width(); } + float top() const { return y(); } float bottom() const { return y() + height(); } FloatPoint center() const { return FloatPoint(x() + width() / 2, y() + height() / 2); } @@ -129,6 +131,11 @@ public: void scale(float s) { scale(s, s); } void scale(float sx, float sy); + // Re-initializes this rectangle to fit the sets of passed points. + void fitToPoints(const FloatPoint& p0, const FloatPoint& p1); + void fitToPoints(const FloatPoint& p0, const FloatPoint& p1, const FloatPoint& p2); + void fitToPoints(const FloatPoint& p0, const FloatPoint& p1, const FloatPoint& p2, const FloatPoint& p3); + #if PLATFORM(CG) FloatRect(const CGRect&); operator CGRect() const; @@ -168,6 +175,13 @@ public: private: FloatPoint m_location; FloatSize m_size; + + void setLocationAndSizeFromEdges(float left, float top, float right, float bottom) + { + m_location.set(left, top); + m_size.setWidth(right - left); + m_size.setHeight(bottom - top); + } }; inline FloatRect intersection(const FloatRect& a, const FloatRect& b) diff --git a/WebCore/platform/graphics/FloatSize.cpp b/WebCore/platform/graphics/FloatSize.cpp index 86fa4c0..c199297 100644 --- a/WebCore/platform/graphics/FloatSize.cpp +++ b/WebCore/platform/graphics/FloatSize.cpp @@ -29,6 +29,7 @@ #include "FloatConversion.h" #include "IntSize.h" +#include <math.h> namespace WebCore { @@ -36,6 +37,11 @@ FloatSize::FloatSize(const IntSize& size) : m_width(size.width()), m_height(size { } +float FloatSize::diagonalLength() const +{ + return sqrtf(diagonalLengthSquared()); +} + FloatSize FloatSize::narrowPrecision(double width, double height) { return FloatSize(narrowPrecisionToFloat(width), narrowPrecisionToFloat(height)); diff --git a/WebCore/platform/graphics/FloatSize.h b/WebCore/platform/graphics/FloatSize.h index ff3d4de..160fc9a 100644 --- a/WebCore/platform/graphics/FloatSize.h +++ b/WebCore/platform/graphics/FloatSize.h @@ -83,6 +83,12 @@ public: m_height < other.m_height ? m_height : other.m_height); } + float diagonalLength() const; + float diagonalLengthSquared() const + { + return m_width * m_width + m_height * m_height; + } + #if PLATFORM(CG) || (PLATFORM(WX) && OS(DARWIN)) explicit FloatSize(const CGSize&); // don't do this implicitly since it's lossy operator CGSize() const; diff --git a/WebCore/platform/graphics/GraphicsContext.cpp b/WebCore/platform/graphics/GraphicsContext.cpp index bb4f858..94f3424 100644 --- a/WebCore/platform/graphics/GraphicsContext.cpp +++ b/WebCore/platform/graphics/GraphicsContext.cpp @@ -130,29 +130,29 @@ void GraphicsContext::setStrokeColor(const Color& color, ColorSpace colorSpace) setPlatformStrokeColor(color, colorSpace); } -void GraphicsContext::setShadow(const FloatSize& size, float blur, const Color& color, ColorSpace colorSpace) +void GraphicsContext::setShadow(const FloatSize& offset, float blur, const Color& color, ColorSpace colorSpace) { - m_common->state.shadowSize = size; + m_common->state.shadowOffset = offset; m_common->state.shadowBlur = blur; m_common->state.shadowColor = color; - setPlatformShadow(size, blur, color, colorSpace); + setPlatformShadow(offset, blur, color, colorSpace); } void GraphicsContext::clearShadow() { - m_common->state.shadowSize = IntSize(); + m_common->state.shadowOffset = FloatSize(); m_common->state.shadowBlur = 0; m_common->state.shadowColor = Color(); clearPlatformShadow(); } -bool GraphicsContext::getShadow(FloatSize& size, float& blur, Color& color) const +bool GraphicsContext::getShadow(FloatSize& offset, float& blur, Color& color) const { - size = m_common->state.shadowSize; + offset = m_common->state.shadowOffset; blur = m_common->state.shadowBlur; color = m_common->state.shadowColor; - return color.isValid() && color.alpha() && (blur || size.width() || size.height()); + return color.isValid() && color.alpha() && (blur || offset.width() || offset.height()); } float GraphicsContext::strokeThickness() const diff --git a/WebCore/platform/graphics/GraphicsContext.h b/WebCore/platform/graphics/GraphicsContext.h index 1056d81..c5440f3 100644 --- a/WebCore/platform/graphics/GraphicsContext.h +++ b/WebCore/platform/graphics/GraphicsContext.h @@ -40,6 +40,7 @@ #if PLATFORM(CG) typedef struct CGContext PlatformGraphicsContext; #elif PLATFORM(CAIRO) +#include "PlatformRefPtrCairo.h" typedef struct _cairo PlatformGraphicsContext; #elif PLATFORM(OPENVG) namespace WebCore { @@ -306,7 +307,12 @@ namespace WebCore { FloatRect roundToDevicePixels(const FloatRect&); void drawLineForText(const IntPoint&, int width, bool printing); - void drawLineForMisspellingOrBadGrammar(const IntPoint&, int width, bool grammar); + enum TextCheckingLineStyle { + TextCheckingSpellingLineStyle, + TextCheckingGrammarLineStyle, + TextCheckingReplacementLineStyle + }; + void drawLineForTextChecking(const IntPoint&, int width, TextCheckingLineStyle); bool paintingDisabled() const; void setPaintingDisabled(bool); @@ -332,8 +338,11 @@ namespace WebCore { void setAlpha(float); #if PLATFORM(CAIRO) float getAlpha(); - void createPlatformShadow(PassOwnPtr<ImageBuffer> buffer, const Color& shadowColor, const FloatRect& shadowRect, float radius); - static void calculateShadowBufferDimensions(IntSize& shadowBufferSize, FloatRect& shadowRect, float& radius, const FloatRect& sourceRect, const FloatSize& shadowSize, float shadowBlur); + void applyPlatformShadow(PassOwnPtr<ImageBuffer> buffer, const Color& shadowColor, const FloatRect& shadowRect, float radius); + PlatformRefPtr<cairo_surface_t> createShadowMask(PassOwnPtr<ImageBuffer>, const FloatRect&, float radius); + + static void calculateShadowBufferDimensions(IntSize& shadowBufferSize, FloatRect& shadowRect, float& radius, const FloatRect& sourceRect, const FloatSize& shadowOffset, float shadowBlur); + void drawTiledShadow(const IntRect& rect, const FloatSize& topLeftRadius, const FloatSize& topRightRadius, const FloatSize& bottomLeftRadius, const FloatSize& bottomRightRadius, ColorSpace colorSpace); #endif void setCompositeOperation(CompositeOperator); diff --git a/WebCore/platform/graphics/GraphicsContextPrivate.h b/WebCore/platform/graphics/GraphicsContextPrivate.h index 6bf465b..903c7e3 100644 --- a/WebCore/platform/graphics/GraphicsContextPrivate.h +++ b/WebCore/platform/graphics/GraphicsContextPrivate.h @@ -72,7 +72,7 @@ namespace WebCore { bool paintingDisabled; - FloatSize shadowSize; + FloatSize shadowOffset; float shadowBlur; Color shadowColor; diff --git a/WebCore/platform/graphics/MediaPlayer.cpp b/WebCore/platform/graphics/MediaPlayer.cpp index 87060a4..a5db85f 100644 --- a/WebCore/platform/graphics/MediaPlayer.cpp +++ b/WebCore/platform/graphics/MediaPlayer.cpp @@ -564,17 +564,10 @@ MediaPlayer::SupportsType MediaPlayer::supportsType(ContentType contentType) String type = contentType.type().lower(); String typeCodecs = contentType.parameter(codecs()); - // 4.8.10.3 MIME types - In the absence of a specification to the contrary, the MIME type "application/octet-stream" - // when used with parameters, e.g. "application/octet-stream;codecs=theora", is a type that the user agent knows - // it cannot render. - if (type == applicationOctetStream()) { - if (!typeCodecs.isEmpty()) - return IsNotSupported; - - // The MIME type "application/octet-stream" with no parameters is never a type that the user agent knows it - // cannot render. - return MayBeSupported; - } + // 4.8.10.3 MIME types - The canPlayType(type) method must return the empty string if type is a type that the + // user agent knows it cannot render or is the type "application/octet-stream" + if (type == applicationOctetStream()) + return IsNotSupported; MediaPlayerFactory* engine = chooseBestEngineForTypeAndCodecs(type, typeCodecs); if (!engine) diff --git a/WebCore/platform/graphics/PathTraversalState.cpp b/WebCore/platform/graphics/PathTraversalState.cpp index d202649..ecdcb1b 100644 --- a/WebCore/platform/graphics/PathTraversalState.cpp +++ b/WebCore/platform/graphics/PathTraversalState.cpp @@ -160,7 +160,7 @@ PathTraversalState::PathTraversalState(PathTraversalAction action) float PathTraversalState::closeSubpath() { float distance = distanceLine(m_current, m_start); - m_start = m_control1 = m_control2 = m_current; + m_current = m_control1 = m_control2 = m_start; return distance; } diff --git a/WebCore/platform/graphics/cairo/FontCairo.cpp b/WebCore/platform/graphics/cairo/FontCairo.cpp index f6d8f3d..cd5d362 100644 --- a/WebCore/platform/graphics/cairo/FontCairo.cpp +++ b/WebCore/platform/graphics/cairo/FontCairo.cpp @@ -70,11 +70,11 @@ void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, cons } // Text shadow, inspired by FontMac - FloatSize shadowSize; + FloatSize shadowOffset; float shadowBlur = 0; Color shadowColor; bool hasShadow = context->textDrawingMode() & cTextFill - && context->getShadow(shadowSize, shadowBlur, shadowColor); + && context->getShadow(shadowOffset, shadowBlur, shadowColor); // TODO: Blur support if (hasShadow) { @@ -95,7 +95,7 @@ void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, cons IntSize shadowBufferSize; FloatRect shadowRect; float radius = 0; - context->calculateShadowBufferDimensions(shadowBufferSize, shadowRect, radius, rect, shadowSize, shadowBlur); + context->calculateShadowBufferDimensions(shadowBufferSize, shadowRect, radius, rect, shadowOffset, shadowBlur); // Draw shadow into a new ImageBuffer OwnPtr<ImageBuffer> shadowBuffer = ImageBuffer::create(shadowBufferSize); @@ -113,9 +113,9 @@ void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, cons cairo_restore(shadowCr); } cairo_translate(cr, 0.0, -extents.height); - context->createPlatformShadow(shadowBuffer.release(), shadowColor, shadowRect, radius); + context->applyPlatformShadow(shadowBuffer.release(), shadowColor, shadowRect, radius); #else - cairo_translate(cr, shadowSize.width(), shadowSize.height()); + cairo_translate(cr, shadowOffset.width(), shadowOffset.height()); cairo_show_glyphs(cr, glyphs, numGlyphs); if (font->syntheticBoldOffset()) { cairo_save(cr); @@ -195,7 +195,7 @@ void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, cons // Re-enable the platform shadow we disabled earlier if (hasShadow) - context->setShadow(shadowSize, shadowBlur, shadowColor, DeviceColorSpace); + context->setShadow(shadowOffset, shadowBlur, shadowColor, DeviceColorSpace); cairo_restore(cr); } diff --git a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp index 3a667ac..19cc518 100644 --- a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp +++ b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp @@ -44,6 +44,7 @@ #include "NotImplemented.h" #include "Path.h" #include "Pattern.h" +#include "PlatformRefPtrCairo.h" #include "SimpleFontData.h" #include "SourceGraphic.h" @@ -175,7 +176,7 @@ static void addConvexPolygonToContext(cairo_t* context, size_t numPoints, const cairo_close_path(context); } -void GraphicsContext::calculateShadowBufferDimensions(IntSize& shadowBufferSize, FloatRect& shadowRect, float& radius, const FloatRect& sourceRect, const FloatSize& shadowSize, float shadowBlur) +void GraphicsContext::calculateShadowBufferDimensions(IntSize& shadowBufferSize, FloatRect& shadowRect, float& radius, const FloatRect& sourceRect, const FloatSize& shadowOffset, float shadowBlur) { #if ENABLE(FILTERS) // limit radius to 128 @@ -185,17 +186,17 @@ void GraphicsContext::calculateShadowBufferDimensions(IntSize& shadowBufferSize, // determine dimensions of shadow rect shadowRect = FloatRect(sourceRect.location(), shadowBufferSize); - shadowRect.move(shadowSize.width() - radius, shadowSize.height() - radius); + shadowRect.move(shadowOffset.width() - radius, shadowOffset.height() - radius); #endif } static inline void drawPathShadow(GraphicsContext* context, GraphicsContextPrivate* gcp, bool fillShadow, bool strokeShadow) { #if ENABLE(FILTERS) - FloatSize shadowSize; + FloatSize shadowOffset; float shadowBlur; Color shadowColor; - if (!context->getShadow(shadowSize, shadowBlur, shadowColor)) + if (!context->getShadow(shadowOffset, shadowBlur, shadowColor)) return; // Calculate filter values to create appropriate shadow. @@ -211,7 +212,7 @@ static inline void drawPathShadow(GraphicsContext* context, GraphicsContextPriva IntSize shadowBufferSize; FloatRect shadowRect; float radius = 0; - GraphicsContext::calculateShadowBufferDimensions(shadowBufferSize, shadowRect, radius, rect, shadowSize, shadowBlur); + GraphicsContext::calculateShadowBufferDimensions(shadowBufferSize, shadowRect, radius, rect, shadowOffset, shadowBlur); // Create suitably-sized ImageBuffer to hold the shadow. OwnPtr<ImageBuffer> shadowBuffer = ImageBuffer::create(shadowBufferSize); @@ -228,7 +229,7 @@ static inline void drawPathShadow(GraphicsContext* context, GraphicsContextPriva if (strokeShadow) setPlatformStroke(context, shadowContext, gcp); - context->createPlatformShadow(shadowBuffer.release(), shadowColor, shadowRect, radius); + context->applyPlatformShadow(shadowBuffer.release(), shadowColor, shadowRect, radius); #endif } @@ -623,24 +624,38 @@ void GraphicsContext::fillRect(const FloatRect& rect) static void drawBorderlessRectShadow(GraphicsContext* context, const FloatRect& rect, const Color& rectColor) { #if ENABLE(FILTERS) - FloatSize shadowSize; + AffineTransform transform = context->getCTM(); + // drawTiledShadow still does not work with rotations. + if ((transform.isIdentityOrTranslationOrFlipped())) { + cairo_t* cr = context->platformContext(); + cairo_save(cr); + appendWebCorePathToCairoContext(cr, Path::createRectangle(rect)); + FloatSize corner; + IntRect shadowRect(rect); + context->drawTiledShadow(shadowRect, corner, corner, corner, corner, DeviceColorSpace); + cairo_restore(cr); + + return; + } + + FloatSize shadowOffset; float shadowBlur; Color shadowColor; - if (!context->getShadow(shadowSize, shadowBlur, shadowColor)) + if (!context->getShadow(shadowOffset, shadowBlur, shadowColor)) return; IntSize shadowBufferSize; FloatRect shadowRect; float radius = 0; - GraphicsContext::calculateShadowBufferDimensions(shadowBufferSize, shadowRect, radius, rect, shadowSize, shadowBlur); + GraphicsContext::calculateShadowBufferDimensions(shadowBufferSize, shadowRect, radius, rect, shadowOffset, shadowBlur); // Draw shadow into a new ImageBuffer OwnPtr<ImageBuffer> shadowBuffer = ImageBuffer::create(shadowBufferSize); GraphicsContext* shadowContext = shadowBuffer->context(); shadowContext->fillRect(FloatRect(FloatPoint(radius, radius), rect.size()), rectColor, DeviceColorSpace); - context->createPlatformShadow(shadowBuffer.release(), shadowColor, shadowRect, radius); + context->applyPlatformShadow(shadowBuffer.release(), shadowColor, shadowRect, radius); #endif } @@ -759,7 +774,7 @@ void GraphicsContext::drawLineForText(const IntPoint& origin, int width, bool pr #include "DrawErrorUnderline.h" #endif -void GraphicsContext::drawLineForMisspellingOrBadGrammar(const IntPoint& origin, int width, bool grammar) +void GraphicsContext::drawLineForTextChecking(const IntPoint& origin, int width, TextCheckingLineStyle style) { if (paintingDisabled()) return; @@ -767,12 +782,17 @@ void GraphicsContext::drawLineForMisspellingOrBadGrammar(const IntPoint& origin, cairo_t* cr = m_data->cr; cairo_save(cr); - // Convention is green for grammar, red for spelling - // These need to become configurable - if (grammar) - cairo_set_source_rgb(cr, 0, 1, 0); - else + switch (style) { + case TextCheckingSpellingLineStyle: cairo_set_source_rgb(cr, 1, 0, 0); + break; + case TextCheckingGrammarLineStyle: + cairo_set_source_rgb(cr, 0, 1, 0); + break; + default: + cairo_restore(cr); + return; + } #if PLATFORM(GTK) // We ignore most of the provided constants in favour of the platform style @@ -917,24 +937,29 @@ void GraphicsContext::setPlatformShadow(FloatSize const& size, float, Color cons if (m_common->state.shadowsIgnoreTransforms) { // Meaning that this graphics context is associated with a CanvasRenderingContext // We flip the height since CG and HTML5 Canvas have opposite Y axis - m_common->state.shadowSize = FloatSize(size.width(), -size.height()); + m_common->state.shadowOffset = FloatSize(size.width(), -size.height()); } } -void GraphicsContext::createPlatformShadow(PassOwnPtr<ImageBuffer> buffer, const Color& shadowColor, const FloatRect& shadowRect, float radius) +void GraphicsContext::applyPlatformShadow(PassOwnPtr<ImageBuffer> buffer, const Color& shadowColor, const FloatRect& shadowRect, float radius) { #if ENABLE(FILTERS) - cairo_t* cr = m_data->cr; + setColor(m_data->cr, shadowColor); + PlatformRefPtr<cairo_surface_t> shadowMask(createShadowMask(buffer, shadowRect, radius)); + cairo_mask_surface(m_data->cr, shadowMask.get(), shadowRect.x(), shadowRect.y()); +#endif +} - // calculate the standard deviation - float sd = FEGaussianBlur::calculateStdDeviation(radius); +PlatformRefPtr<cairo_surface_t> GraphicsContext::createShadowMask(PassOwnPtr<ImageBuffer> buffer, const FloatRect& shadowRect, float radius) +{ +#if ENABLE(FILTERS) + if (!radius) + return buffer->m_data.m_surface; - // draw the shadow without blurring, if radius is zero - if (!radius || !sd) { - setColor(cr, shadowColor); - cairo_mask_surface(cr, buffer->m_data.m_surface, shadowRect.x(), shadowRect.y()); - return; - } + FloatPoint blurRadius = FloatPoint(radius, radius); + float sd = FEGaussianBlur::calculateStdDeviation(radius); + if (!sd) + return buffer->m_data.m_surface; // create filter RefPtr<Filter> filter = ImageBufferFilter::create(); @@ -945,14 +970,11 @@ void GraphicsContext::createPlatformShadow(PassOwnPtr<ImageBuffer> buffer, const RefPtr<FilterEffect> blur = FEGaussianBlur::create(source.get(), sd, sd); blur->setScaledSubRegion(FloatRect(FloatPoint(), shadowRect.size())); blur->apply(filter.get()); - - // Mask the filter with the shadow color and draw it to the context. - // Masking makes it possible to just blur the alpha channel. - setColor(cr, shadowColor); - cairo_mask_surface(cr, blur->resultImage()->m_data.m_surface, shadowRect.x(), shadowRect.y()); + return blur->resultImage()->m_data.m_surface; #endif } + void GraphicsContext::clearPlatformShadow() { notImplemented(); @@ -1218,6 +1240,200 @@ void GraphicsContext::clipOutEllipseInRect(const IntRect& r) clipOut(p); } +static inline FloatPoint getPhase(const FloatRect& dest, const FloatRect& tile) +{ + FloatPoint phase = dest.location(); + phase.move(-tile.x(), -tile.y()); + + return phase; +} + +/* + This function uses tiling to improve the performance of the shadow + drawing of rounded rectangles. The code basically does the following + steps: + + 1. Calculate the minimum rectangle size required to create the + tiles + + 2. If that size is smaller than the real rectangle render the new + small rectangle and its shadow in a new surface, in other case + render the shadow of the real rectangle in the destination + surface. + + 3. Calculate the sizes and positions of the tiles and their + destinations and use drawPattern to render the final shadow. The + code divides the rendering in 8 tiles: + + 1 | 2 | 3 + ----------- + 4 | | 5 + ----------- + 6 | 7 | 8 + + The corners are directly copied from the small rectangle to the + real one and the side tiles are 1 pixel width, we use them as + + tiles to cover the destination side. The corner tiles are bigger + than just the side of the rounded corner, we need to increase it + because the modifications caused by the corner over the blur + effect. We fill the central part with solid color to complete the + shadow. + */ +void GraphicsContext::drawTiledShadow(const IntRect& rect, const FloatSize& topLeftRadius, const FloatSize& topRightRadius, const FloatSize& bottomLeftRadius, const FloatSize& bottomRightRadius, ColorSpace colorSpace) +{ +#if ENABLE(FILTERS) + FloatSize shadowSize; + float shadowBlur; + Color shadowColor; + if (!getShadow(shadowSize, shadowBlur, shadowColor)) + return; + + // Calculate filter values to create appropriate shadow. + cairo_t* cr = m_data->cr; + + IntSize shadowBufferSize; + FloatRect shadowRect; + float blurRadius = 0; + GraphicsContext::calculateShadowBufferDimensions(shadowBufferSize, shadowRect, blurRadius, rect, shadowSize, shadowBlur); + + // Size of the tiling side. + int sideTileWidth = 1; + float radiusTwice = blurRadius * 2; + + // Find the extra space needed from the curve of the corners. + int extraWidthFromCornerRadii = radiusTwice + max(topLeftRadius.width(), bottomLeftRadius.width()) + + radiusTwice + max(topRightRadius.width(), bottomRightRadius.width()); + int extraHeightFromCornerRadii = radiusTwice + max(topLeftRadius.height(), topRightRadius.height()) + + radiusTwice + max(bottomLeftRadius.height(), bottomRightRadius.height()); + + // The length of a side of the buffer is the enough space for four blur radii, + // the radii of the corners, and then 1 pixel to draw the side tiles. + IntSize smallBufferSize = IntSize(sideTileWidth + extraWidthFromCornerRadii, + sideTileWidth + extraHeightFromCornerRadii); + + if ((smallBufferSize.width() > shadowBufferSize.width()) || (smallBufferSize.height() > shadowBufferSize.height()) || (blurRadius <= 0)) { + // Create suitably-sized ImageBuffer to hold the shadow. + OwnPtr<ImageBuffer> shadowBuffer = ImageBuffer::create(shadowBufferSize); + if (!shadowBuffer) + return; + + // Draw shadow into a new ImageBuffer. + cairo_t* shadowContext = shadowBuffer->context()->platformContext(); + copyContextProperties(cr, shadowContext); + cairo_translate(shadowContext, -rect.x() + blurRadius, -rect.y() + blurRadius); + cairo_new_path(shadowContext); + cairo_path_t* path = cairo_copy_path(cr); + cairo_append_path(shadowContext, path); + cairo_path_destroy(path); + + setPlatformFill(this, shadowContext, m_common); + + applyPlatformShadow(shadowBuffer.release(), shadowColor, shadowRect, blurRadius); + + return; + } + + OwnPtr<ImageBuffer> smallBuffer = ImageBuffer::create(smallBufferSize); + if (!smallBuffer) + return; + + IntRect smallRect = IntRect(blurRadius, blurRadius, smallBufferSize.width() - radiusTwice, smallBufferSize.height() - radiusTwice); + + // Draw shadow into a new ImageBuffer. + cairo_t* smallBufferContext = smallBuffer->context()->platformContext(); + copyContextProperties(cr, smallBufferContext); + appendWebCorePathToCairoContext(smallBuffer->context()->platformContext(), Path::createRoundedRectangle(smallRect, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius)); + setPlatformFill(this, smallBufferContext, m_common); + + OwnPtr<ImageBuffer> shadowBuffer = ImageBuffer::create(smallBufferSize); + if (!shadowBuffer) + return; + + smallRect.setSize(smallBufferSize); + + PlatformRefPtr<cairo_surface_t> shadowMask(createShadowMask(smallBuffer.release(), smallRect, blurRadius)); + + cairo_t* shadowContext = shadowBuffer->context()->platformContext(); + setColor(shadowContext, shadowColor); + cairo_mask_surface(shadowContext, shadowMask.get(), 0, 0); + + // Fill the internal part of the shadow. + shadowRect.inflate(-radiusTwice); + if (!shadowRect.isEmpty()) { + cairo_save(cr); + appendWebCorePathToCairoContext(cr, Path::createRoundedRectangle(shadowRect, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius)); + setColor(cr, shadowColor); + cairo_fill(cr); + cairo_restore(cr); + } + shadowRect.inflate(radiusTwice); + + // Draw top side. + FloatRect tileRect = FloatRect(radiusTwice + topLeftRadius.width(), 0, sideTileWidth, radiusTwice); + FloatRect destRect = tileRect; + destRect.move(shadowRect.x(), shadowRect.y()); + destRect.setWidth(shadowRect.width() - topLeftRadius.width() - topRightRadius.width() - blurRadius * 4); + FloatPoint phase = getPhase(destRect, tileRect); + AffineTransform patternTransform; + patternTransform.makeIdentity(); + shadowBuffer->drawPattern(this, tileRect, patternTransform, phase, colorSpace, CompositeSourceOver, destRect); + + // Draw the bottom side. + tileRect = FloatRect(radiusTwice + bottomLeftRadius.width(), smallBufferSize.height() - radiusTwice, sideTileWidth, radiusTwice); + destRect = tileRect; + destRect.move(shadowRect.x(), shadowRect.y() + radiusTwice + rect.height() - smallBufferSize.height()); + destRect.setWidth(shadowRect.width() - bottomLeftRadius.width() - bottomRightRadius.width() - blurRadius * 4); + phase = getPhase(destRect, tileRect); + shadowBuffer->drawPattern(this, tileRect, patternTransform, phase, colorSpace, CompositeSourceOver, destRect); + + // Draw the right side. + tileRect = FloatRect(smallBufferSize.width() - radiusTwice, radiusTwice + topRightRadius.height(), radiusTwice, sideTileWidth); + destRect = tileRect; + destRect.move(shadowRect.x() + radiusTwice + rect.width() - smallBufferSize.width(), shadowRect.y()); + destRect.setHeight(shadowRect.height() - topRightRadius.height() - bottomRightRadius.height() - blurRadius * 4); + phase = getPhase(destRect, tileRect); + shadowBuffer->drawPattern(this, tileRect, patternTransform, phase, colorSpace, CompositeSourceOver, destRect); + + // Draw the left side. + tileRect = FloatRect(0, radiusTwice + topLeftRadius.height(), radiusTwice, sideTileWidth); + destRect = tileRect; + destRect.move(shadowRect.x(), shadowRect.y()); + destRect.setHeight(shadowRect.height() - topLeftRadius.height() - bottomLeftRadius.height() - blurRadius * 4); + phase = FloatPoint(destRect.x() - tileRect.x(), destRect.y() - tileRect.y()); + shadowBuffer->drawPattern(this, tileRect, patternTransform, + phase, colorSpace, CompositeSourceOver, destRect); + + // Draw the top left corner. + tileRect = FloatRect(0, 0, radiusTwice + topLeftRadius.width(), radiusTwice + topLeftRadius.height()); + destRect = tileRect; + destRect.move(shadowRect.x(), shadowRect.y()); + phase = getPhase(destRect, tileRect); + shadowBuffer->drawPattern(this, tileRect, patternTransform, phase, colorSpace, CompositeSourceOver, destRect); + + // Draw the top right corner. + tileRect = FloatRect(smallBufferSize.width() - radiusTwice - topRightRadius.width(), 0, radiusTwice + topRightRadius.width(), radiusTwice + topRightRadius.height()); + destRect = tileRect; + destRect.move(shadowRect.x() + rect.width() - smallBufferSize.width() + radiusTwice, shadowRect.y()); + phase = getPhase(destRect, tileRect); + shadowBuffer->drawPattern(this, tileRect, patternTransform, phase, colorSpace, CompositeSourceOver, destRect); + + // Draw the bottom right corner. + tileRect = FloatRect(smallBufferSize.width() - radiusTwice - bottomRightRadius.width(), smallBufferSize.height() - radiusTwice - bottomRightRadius.height(), radiusTwice + bottomRightRadius.width(), radiusTwice + bottomRightRadius.height()); + destRect = tileRect; + destRect.move(shadowRect.x() + rect.width() - smallBufferSize.width() + radiusTwice, shadowRect.y() + rect.height() - smallBufferSize.height() + radiusTwice); + phase = getPhase(destRect, tileRect); + shadowBuffer->drawPattern(this, tileRect, patternTransform, phase, colorSpace, CompositeSourceOver, destRect); + + // Draw the bottom left corner. + tileRect = FloatRect(0, smallBufferSize.height() - radiusTwice - bottomLeftRadius.height(), radiusTwice + bottomLeftRadius.width(), radiusTwice + bottomLeftRadius.height()); + destRect = tileRect; + destRect.move(shadowRect.x(), shadowRect.y() + rect.height() - smallBufferSize.height() + radiusTwice); + phase = getPhase(destRect, tileRect); + shadowBuffer->drawPattern(this, tileRect, patternTransform, phase, colorSpace, CompositeSourceOver, destRect); +#endif +} + void GraphicsContext::fillRoundedRect(const IntRect& r, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight, const Color& color, ColorSpace colorSpace) { if (paintingDisabled()) @@ -1227,7 +1443,12 @@ void GraphicsContext::fillRoundedRect(const IntRect& r, const IntSize& topLeft, cairo_save(cr); appendWebCorePathToCairoContext(cr, Path::createRoundedRectangle(r, topLeft, topRight, bottomLeft, bottomRight)); setColor(cr, color); - drawPathShadow(this, m_common, true, false); + AffineTransform transform = this->getCTM(); + // drawTiledShadow still does not work with rotations. + if (transform.isIdentityOrTranslationOrFlipped()) + drawTiledShadow(r, topLeft, topRight, bottomLeft, bottomRight, colorSpace); + else + drawPathShadow(this, m_common, true, false); cairo_fill(cr); cairo_restore(cr); } diff --git a/WebCore/platform/graphics/cairo/ImageCairo.cpp b/WebCore/platform/graphics/cairo/ImageCairo.cpp index d9eb5e6..904e819 100644 --- a/WebCore/platform/graphics/cairo/ImageCairo.cpp +++ b/WebCore/platform/graphics/cairo/ImageCairo.cpp @@ -135,14 +135,14 @@ void BitmapImage::draw(GraphicsContext* context, const FloatRect& dst, const Flo // Draw the shadow #if ENABLE(FILTERS) - FloatSize shadowSize; + FloatSize shadowOffset; float shadowBlur; Color shadowColor; - if (context->getShadow(shadowSize, shadowBlur, shadowColor)) { + if (context->getShadow(shadowOffset, shadowBlur, shadowColor)) { IntSize shadowBufferSize; FloatRect shadowRect; float radius = 0; - context->calculateShadowBufferDimensions(shadowBufferSize, shadowRect, radius, dstRect, shadowSize, shadowBlur); + context->calculateShadowBufferDimensions(shadowBufferSize, shadowRect, radius, dstRect, shadowOffset, shadowBlur); shadowColor = colorWithOverrideAlpha(shadowColor.rgb(), (shadowColor.alpha() * context->getAlpha()) / 255.f); //draw shadow into a new ImageBuffer @@ -153,7 +153,7 @@ void BitmapImage::draw(GraphicsContext* context, const FloatRect& dst, const Flo cairo_rectangle(shadowContext, 0, 0, dstRect.width(), dstRect.height()); cairo_fill(shadowContext); - context->createPlatformShadow(shadowBuffer.release(), shadowColor, shadowRect, radius); + context->applyPlatformShadow(shadowBuffer.release(), shadowColor, shadowRect, radius); } #endif diff --git a/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp b/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp index df14f9d..c4008cc 100644 --- a/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp +++ b/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp @@ -34,6 +34,7 @@ #include <CoreGraphics/CGBitmapContext.h> #include <CoreGraphics/CGContext.h> +#include <CoreGraphics/CGDataProvider.h> #include <CoreGraphics/CGImage.h> #include <wtf/RetainPtr.h> @@ -48,62 +49,108 @@ bool GraphicsContext3D::getImageData(Image* image, { if (!image) return false; - CGImageRef cgImage = image->nativeImageForCurrentFrame(); + CGImageRef cgImage; + RetainPtr<CGImageRef> decodedImage; + if (image->data()) { + ImageSource decoder(false); + decoder.setData(image->data(), true); + if (!decoder.frameCount()) + return false; + decodedImage = decoder.createFrameAtIndex(0); + cgImage = decodedImage.get(); + } else + cgImage = image->nativeImageForCurrentFrame(); if (!cgImage) return false; - int width = CGImageGetWidth(cgImage); - int height = CGImageGetHeight(cgImage); - // FIXME: we should get rid of this temporary copy where possible. - int tempRowBytes = width * 4; - Vector<uint8_t> tempVector; - tempVector.resize(height * tempRowBytes); - // Try to reuse the color space from the image to preserve its colors. - // Some images use a color space (such as indexed) unsupported by the bitmap context. - CGColorSpaceRef colorSpace = CGImageGetColorSpace(cgImage); - bool releaseColorSpace = false; - CGColorSpaceModel colorSpaceModel = CGColorSpaceGetModel(colorSpace); - switch (colorSpaceModel) { - case kCGColorSpaceModelMonochrome: - case kCGColorSpaceModelRGB: - case kCGColorSpaceModelCMYK: - case kCGColorSpaceModelLab: - case kCGColorSpaceModelDeviceN: + size_t width = CGImageGetWidth(cgImage); + size_t height = CGImageGetHeight(cgImage); + if (!width || !height || CGImageGetBitsPerComponent(cgImage) != 8) + return false; + size_t componentsPerPixel = CGImageGetBitsPerPixel(cgImage) / 8; + SourceDataFormat srcDataFormat = kSourceFormatRGBA8; + AlphaOp neededAlphaOp = kAlphaDoNothing; + switch (CGImageGetAlphaInfo(cgImage)) { + case kCGImageAlphaPremultipliedFirst: + case kCGImageAlphaFirst: + case kCGImageAlphaNoneSkipFirst: + return false; + case kCGImageAlphaPremultipliedLast: + // This is a special case for texImage2D with HTMLCanvasElement input, + // in which case image->data() should be null. + ASSERT(!image->data()); + if (!premultiplyAlpha) + neededAlphaOp = kAlphaDoUnmultiply; + switch (componentsPerPixel) { + case 2: + srcDataFormat = kSourceFormatRA8; + break; + case 4: + srcDataFormat = kSourceFormatRGBA8; + break; + default: + return false; + } break; - default: - colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGBLinear); - releaseColorSpace = true; + case kCGImageAlphaLast: + if (premultiplyAlpha) + neededAlphaOp = kAlphaDoPremultiply; + switch (componentsPerPixel) { + case 1: + srcDataFormat = kSourceFormatA8; + break; + case 2: + srcDataFormat = kSourceFormatRA8; + break; + case 4: + srcDataFormat = kSourceFormatRGBA8; + break; + default: + return false; + } break; - } - CGContextRef tempContext = CGBitmapContextCreate(tempVector.data(), - width, height, 8, tempRowBytes, - colorSpace, - // FIXME: change this! - kCGImageAlphaPremultipliedLast); - if (releaseColorSpace) - CGColorSpaceRelease(colorSpace); - if (!tempContext) + case kCGImageAlphaNoneSkipLast: + switch (componentsPerPixel) { + case 2: + srcDataFormat = kSourceFormatRA8; + break; + case 4: + srcDataFormat = kSourceFormatRGBA8; + break; + default: + return false; + } + case kCGImageAlphaNone: + switch (componentsPerPixel) { + case 1: + srcDataFormat = kSourceFormatR8; + break; + case 3: + srcDataFormat = kSourceFormatRGB8; + break; + default: + return false; + } + break; + default: return false; - CGContextSetBlendMode(tempContext, kCGBlendModeCopy); - CGContextDrawImage(tempContext, - CGRectMake(0, 0, static_cast<CGFloat>(width), static_cast<CGFloat>(height)), - cgImage); - CGContextRelease(tempContext); - // Pack the pixel data into the output vector. - unsigned long componentsPerPixel, bytesPerComponent; - if (!computeFormatAndTypeParameters(format, type, &componentsPerPixel, &bytesPerComponent)) + } + RetainPtr<CFDataRef> pixelData; + pixelData.adoptCF(CGDataProviderCopyData(CGImageGetDataProvider(cgImage))); + if (!pixelData) return false; - int rowBytes = width * componentsPerPixel * bytesPerComponent; - outputVector.resize(height * rowBytes); - CGImageAlphaInfo info = CGImageGetAlphaInfo(cgImage); - bool hasAlphaChannel = (info != kCGImageAlphaNone - && info != kCGImageAlphaNoneSkipLast - && info != kCGImageAlphaNoneSkipFirst); - AlphaOp neededAlphaOp = kAlphaDoNothing; - if (!premultiplyAlpha && hasAlphaChannel) - // FIXME: must fetch the image data before the premultiplication step. - neededAlphaOp = kAlphaDoUnmultiply; - return packPixels(tempVector.data(), kSourceFormatRGBA8, width, height, 0, - format, type, neededAlphaOp, outputVector.data()); + const UInt8* rgba = CFDataGetBytePtr(pixelData.get()); + outputVector.resize(width * height * 4); + unsigned int srcUnpackAlignment = 0; + size_t bytesPerRow = CGImageGetBytesPerRow(cgImage); + unsigned int padding = bytesPerRow - componentsPerPixel * width; + if (padding) { + srcUnpackAlignment = padding + 1; + while (bytesPerRow % srcUnpackAlignment) + ++srcUnpackAlignment; + } + bool rt = packPixels(rgba, srcDataFormat, width, height, srcUnpackAlignment, + format, type, neededAlphaOp, outputVector.data()); + return rt; } void GraphicsContext3D::paintToCanvas(const unsigned char* imagePixels, int imageWidth, int imageHeight, int canvasWidth, int canvasHeight, CGContextRef context) diff --git a/WebCore/platform/graphics/chromium/CrossProcessFontLoading.h b/WebCore/platform/graphics/chromium/CrossProcessFontLoading.h new file mode 100644 index 0000000..e1fb740 --- /dev/null +++ b/WebCore/platform/graphics/chromium/CrossProcessFontLoading.h @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * 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 CrossProcessFontLoading_h +#define CrossProcessFontLoading_h + +#import <wtf/RefCounted.h> +#import <wtf/RetainPtr.h> + +typedef struct CGFont* CGFontRef; +typedef UInt32 ATSFontContainerRef; +typedef UInt32 ATSFontRef; + +namespace WebCore { + +// MemoryActivatedFont encapsulates a font loaded from another process and +// activated from memory. +// +// Responsibilities: +// * Holder for the CGFontRef & ATSFontRef belonging to the activated font. +// * Responsible for unloading the font container when done. +// +// Memory Management: +// The class is reference counted, with each instance of FontPlatformData that +// uses this class holding a reference to it. +// Entries are kept track of internally in a hash to allow quick lookup +// of existing instances for reuse: +// - fontCacheBySrcFontContainerRef() - key is the ATSFontContainerRef +// corresponding to the *original in-process NSFont* whose loading was blocked +// by the sandbox. +// This is needed to allow lookup of a pre-existing MemoryActivatedFont when +// creating a new FontPlatformData object. +// +// Assumptions: +// This code assumes that an ATSFontRef is a unique identifier tied to an +// activated font. i.e. After we activate a font, its ATSFontRef doesn't +// change. +// It also assumes that the ATSFoncontainerRef for two in-memory NSFonts that +// correspond to the same on-disk font file are always the same and don't change +// with time. +// +// Flushing caches: +// When the system notifies us of a system font cache flush, all FontDataCache +// objects are destroyed. This should in turn dereference all +// MemoryActivatedFonts and thus unload all in-memory fonts. +class MemoryActivatedFont : public RefCounted<MemoryActivatedFont> { +public: + // Use to create a new object, see docs on constructor below. + static PassRefPtr<MemoryActivatedFont> create(ATSFontContainerRef srcFontContainerRef, ATSFontContainerRef container); + ~MemoryActivatedFont(); + + // Get cached CGFontRef corresponding to the in-memory font. + CGFontRef cgFont() { return m_cgFont.get(); } + + // Get cached ATSFontRef corresponding to the in-memory font. + ATSFontRef atsFontRef() { return m_atsFontRef; } + +private: + // srcFontRef - ATSFontRef belonging to the NSFont object that failed to + // load in-process. + // container - a font container corresponding to an identical font that + // we loaded cross-process. + MemoryActivatedFont(ATSFontContainerRef srcFontContainerRef, ATSFontContainerRef container); + + ATSFontContainerRef m_fontContainer; + WTF::RetainPtr<CGFontRef> m_cgFont; + ATSFontRef m_atsFontRef; + ATSFontContainerRef m_srcFontContainerRef; +}; + +} // namespace WebCore + +#endif // CrossProcessFontLoading_h diff --git a/WebCore/platform/graphics/chromium/CrossProcessFontLoading.mm b/WebCore/platform/graphics/chromium/CrossProcessFontLoading.mm new file mode 100644 index 0000000..a7ec03a --- /dev/null +++ b/WebCore/platform/graphics/chromium/CrossProcessFontLoading.mm @@ -0,0 +1,217 @@ +/* + * This file is part of the internal font implementation. + * + * Copyright (c) 2010 Google Inc. All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * 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. + * + */ + +// This file provides additional functionality to the Mac FontPlatformData class +// defined in WebCore/platform/cocoa/FontPlatformDataCocoa.mm . +// Because we want to support loading fonts between processes in the face of +// font loading being blocked by the sandbox, we need a mechnasim to both +// do the loading of in-memory fonts and keep track of them. + +#import "config.h" +#import "CrossProcessFontLoading.h" + +#import "../graphics/cocoa/FontPlatformData.h" +#import "ChromiumBridge.h" +#import <AppKit/NSFont.h> +#import <wtf/HashMap.h> + +namespace WebCore { + +namespace { + +typedef HashMap<ATSFontContainerRef, MemoryActivatedFont*> FontContainerRefMemoryFontHash; + +// On 10.5, font loading is not blocked by the sandbox and thus there is no +// need for the cross-process font loading mechanim. +// On system versions >=10.6 cross-process font loading is required. +bool OutOfProcessFontLoadingEnabled() +{ + static SInt32 systemVersion = 0; + if (!systemVersion) { + if (Gestalt(gestaltSystemVersion, &systemVersion) != noErr) + return false; + } + + return systemVersion >= 0x1060; +} + +FontContainerRefMemoryFontHash& fontCacheBySrcFontContainerRef() +{ + DEFINE_STATIC_LOCAL(FontContainerRefMemoryFontHash, srcFontRefCache, ()); + return srcFontRefCache; +} + +ATSFontContainerRef fontContainerRefFromNSFont(NSFont* srcFont) +{ + ATSFontRef fontRef = CTFontGetPlatformFont(toCTFontRef(srcFont), 0); + if (!fontRef) + return kATSFontContainerRefUnspecified; + ATSFontContainerRef fontContainer = kATSFontContainerRefUnspecified; + if (ATSFontGetContainer(fontRef, 0, &fontContainer) != noErr) + return kATSFontContainerRefUnspecified; + return fontContainer; +} + +// The only way we can tell that an in-process font has failed to load +// is if CTFontCopyGraphicsFont() returns the LastResort font. +bool isLastResortFont(CGFontRef cgFont) +{ + NSString* fontName = (NSString*)CGFontCopyPostScriptName(cgFont); + return [fontName isEqualToString:@"LastResort"]; +} + +// Given an in-process font which has failed to load, return a +// MemoryActivatedFont* corresponding to an in-memory representation of the +// same font loaded from the browser process. +// On failure this function returns a PassRefPtr pointing to 0. +PassRefPtr<MemoryActivatedFont> loadFontFromBrowserProcess(NSFont* nsFont) +{ + ATSFontContainerRef container; + // Send cross-process request to load font. + if (!ChromiumBridge::loadFont(nsFont, &container)) + return 0; + + ATSFontContainerRef srcFontContainerRef = fontContainerRefFromNSFont(nsFont); + if (!srcFontContainerRef) { + ATSFontDeactivate(container, 0, kATSOptionFlagsDefault); + return 0; + } + + PassRefPtr<MemoryActivatedFont> font = adoptRef(fontCacheBySrcFontContainerRef().get(srcFontContainerRef)); + if (font.get()) + return font; + + return MemoryActivatedFont::create(srcFontContainerRef, container); +} + +} // namespace + +PassRefPtr<MemoryActivatedFont> MemoryActivatedFont::create(ATSFontContainerRef srcFontContainerRef, ATSFontContainerRef container) +{ + MemoryActivatedFont* font = new MemoryActivatedFont(srcFontContainerRef, container); + if (!font->cgFont()) // Object construction failed. + { + delete font; + return 0; + } + return adoptRef(font); +} + +MemoryActivatedFont::MemoryActivatedFont(ATSFontContainerRef srcFontContainerRef, ATSFontContainerRef container) + : m_fontContainer(container) + , m_atsFontRef(kATSFontRefUnspecified) + , m_srcFontContainerRef(srcFontContainerRef) +{ + if (!container) + return; + + // Count the number of fonts in the container. + ItemCount fontCount = 0; + OSStatus err = ATSFontFindFromContainer(container, kATSOptionFlagsDefault, 0, 0, &fontCount); + if (err != noErr || fontCount < 1) + return; + + // For now always assume that we want the first font in the container. + ATSFontFindFromContainer(container, kATSOptionFlagsDefault, 1, &m_atsFontRef, 0); + + if (!m_atsFontRef) + return; + + // Cache CGFont representation of the font. + m_cgFont.adoptCF(CGFontCreateWithPlatformFont(&m_atsFontRef)); + + if (!m_cgFont.get()) + return; + + // Add ourselves to cache. + fontCacheBySrcFontContainerRef().add(m_srcFontContainerRef, this); +} + +// Destructor - Unload font container from memory and remove ourselves +// from cache. +MemoryActivatedFont::~MemoryActivatedFont() +{ + if (m_cgFont.get()) { + // First remove ourselves from the caches. + ASSERT(fontCacheBySrcFontContainerRef().contains(m_srcFontContainerRef)); + + fontCacheBySrcFontContainerRef().remove(m_srcFontContainerRef); + + // Make sure the CGFont is destroyed before its font container. + m_cgFont.releaseRef(); + } + + if (m_fontContainer != kATSFontContainerRefUnspecified) + ATSFontDeactivate(m_fontContainer, 0, kATSOptionFlagsDefault); +} + +// Given an NSFont, try to load a representation of that font into the cgFont +// parameter. If loading is blocked by the sandbox, the font may be loaded +// cross-process. +// If sandbox loading also fails, a fallback font is loaded. +// +// Considerations: +// * cgFont must be CFRelease()ed by the caller when done. +// +// Parameters: +// * nsFont - The font we wish to load. +// * fontSize - point size of the font we wish to load. +// * outNSFont - The font that was actually loaded, may be different from nsFont +// if a fallback font was used. +// * cgFont - on output this contains the CGFontRef corresponding to the NSFont +// that was picked in the end. The caller is responsible for calling +// CFRelease() on this parameter when done with it. +// * fontID - on output, the ID corresponding to nsFont. +void FontPlatformData::loadFont(NSFont* nsFont, float fontSize, NSFont*& outNSFont, CGFontRef& cgFont, ATSUFontID& fontID) +{ + outNSFont = nsFont; + cgFont = CTFontCopyGraphicsFont(toCTFontRef(outNSFont), 0); + MemoryActivatedFont* memFont = 0; + if (OutOfProcessFontLoadingEnabled() && outNSFont && cgFont && isLastResortFont(cgFont)) { + // Release old CGFontRef since it points at the LastResort font which we don't want. + CFRelease(cgFont); + cgFont = 0; + + // Font loading was blocked by the Sandbox. + m_inMemoryFont = loadFontFromBrowserProcess(outNSFont); + if (m_inMemoryFont.get()) { + cgFont = m_inMemoryFont->cgFont(); + + // Need to add an extra retain so output semantics of this function + // are consistent. + CFRetain(cgFont); + } else { + // If we still can't load the font, then return Times, + // rather than the LastResort font. + outNSFont = [NSFont fontWithName:@"Times" size:fontSize]; + cgFont = CTFontCopyGraphicsFont(toCTFontRef(outNSFont), 0); + } + } + + if (memFont) { + fontID = m_inMemoryFont->atsFontRef(); + } else { + fontID = CTFontGetPlatformFont(toCTFontRef(outNSFont), 0); + } +} + +} // namespace WebCore diff --git a/WebCore/platform/graphics/chromium/FontChromiumWin.cpp b/WebCore/platform/graphics/chromium/FontChromiumWin.cpp index 5b8bad3..78b7517 100644 --- a/WebCore/platform/graphics/chromium/FontChromiumWin.cpp +++ b/WebCore/platform/graphics/chromium/FontChromiumWin.cpp @@ -273,10 +273,10 @@ bool TransparencyAwareGlyphPainter::drawGlyphs(int numGlyphs, // If there is a non-blur shadow and both the fill color and shadow color // are opaque, handle without skia. - FloatSize shadowSize; + FloatSize shadowOffset; float shadowBlur; Color shadowColor; - if (m_graphicsContext->getShadow(shadowSize, shadowBlur, shadowColor)) { + if (m_graphicsContext->getShadow(shadowOffset, shadowBlur, shadowColor)) { // If there is a shadow and this code is reached, windowsCanHandleDrawTextShadow() // will have already returned true during the ctor initiatization of m_useGDI ASSERT(shadowColor.alpha() == 255); @@ -285,7 +285,7 @@ bool TransparencyAwareGlyphPainter::drawGlyphs(int numGlyphs, COLORREF textColor = skia::SkColorToCOLORREF(SkColorSetARGB(255, shadowColor.red(), shadowColor.green(), shadowColor.blue())); COLORREF savedTextColor = GetTextColor(m_hdc); SetTextColor(m_hdc, textColor); - ExtTextOut(m_hdc, x + shadowSize.width(), y + shadowSize.height(), ETO_GLYPH_INDEX, 0, reinterpret_cast<const wchar_t*>(&glyphs[0]), numGlyphs, &advances[0]); + ExtTextOut(m_hdc, x + shadowOffset.width(), y + shadowOffset.height(), ETO_GLYPH_INDEX, 0, reinterpret_cast<const wchar_t*>(&glyphs[0]), numGlyphs, &advances[0]); SetTextColor(m_hdc, savedTextColor); } @@ -483,15 +483,15 @@ void Font::drawComplexText(GraphicsContext* graphicsContext, // If there is a non-blur shadow and both the fill color and shadow color // are opaque, handle without skia. - FloatSize shadowSize; + FloatSize shadowOffset; float shadowBlur; Color shadowColor; - if (graphicsContext->getShadow(shadowSize, shadowBlur, shadowColor) && windowsCanHandleDrawTextShadow(graphicsContext)) { + if (graphicsContext->getShadow(shadowOffset, shadowBlur, shadowColor) && windowsCanHandleDrawTextShadow(graphicsContext)) { COLORREF textColor = skia::SkColorToCOLORREF(SkColorSetARGB(255, shadowColor.red(), shadowColor.green(), shadowColor.blue())); COLORREF savedTextColor = GetTextColor(hdc); SetTextColor(hdc, textColor); - state.draw(graphicsContext, hdc, static_cast<int>(point.x()) + shadowSize.width(), - static_cast<int>(point.y() - ascent()) + shadowSize.height(), from, to); + state.draw(graphicsContext, hdc, static_cast<int>(point.x()) + shadowOffset.width(), + static_cast<int>(point.y() - ascent()) + shadowOffset.height(), from, to); SetTextColor(hdc, savedTextColor); } diff --git a/WebCore/platform/graphics/chromium/FontPlatformDataChromiumMac.mm b/WebCore/platform/graphics/chromium/FontPlatformDataChromiumMac.mm deleted file mode 100644 index ad7ebba..0000000 --- a/WebCore/platform/graphics/chromium/FontPlatformDataChromiumMac.mm +++ /dev/null @@ -1,458 +0,0 @@ -/* - * This file is part of the internal font implementation. - * - * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. - * Copyright (c) 2010 Google Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * 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. - * - */ - -// This file is a clone of platform/graphics/mac/FontPlatformDataMac.mm. -// Because we want to support loading fonts between processes in the face of -// font loading being blocked by the sandbox, we must maintain a fork. -// Please maintain this file by performing parallel changes to it. -// -// The only changes from FontPlatformDataMac should be: -// - The functions at the top of this file for loading and caching fonts -// cross-process. -// - Changes to FontPlatformData::FontPlatformData(NSFont,bool,bool) -// - Changes to FontPlatformData::setFont() -// - Changes to FontPlatformData::~FontPlatformData() -// - Calls to refMemoryFont() in FontPlatformData::operator= and copy -// constructor. -// -// All changes are marked with "Start/End Chromium Change" -// -// For all other differences, if it was introduced in this file, then the -// maintainer forgot to include it in the list; otherwise it is an update that -// should have been applied to this file but was not. - - -// Start Chromium Change -#import "config.h" -#import "../graphics/mac/FontPlatformData.h" - -#import "ChromiumBridge.h" -#import "PlatformString.h" -#import "WebCoreSystemInterface.h" -#import <AppKit/NSFont.h> -#import <wtf/HashMap.h> -#import <wtf/RefCounted.h> -#import <wtf/RetainPtr.h> -#import <wtf/Vector.h> - -namespace WebCore { - -namespace { - -class MemoryActivatedFont; -typedef HashMap<ATSFontRef, MemoryActivatedFont*> FontRefMemoryFontHash; -typedef HashMap<ATSFontContainerRef, MemoryActivatedFont*> FontContainerRefMemoryFontHash; - -// On 10.5, font loading is not blocked by the sandbox and thus there is no -// need for the cross-process font loading mechanim. -// On system versions >=10.6 cross-process font loading is required. -bool OutOfProcessFontLoadingEnabled() -{ - static SInt32 systemVersion = 0; - if (!systemVersion) { - if (Gestalt(gestaltSystemVersion, &systemVersion) != noErr) - return false; - } - - return systemVersion >= 0x1060; -} - -FontContainerRefMemoryFontHash& fontCacheBySrcFontContainerRef() -{ - DEFINE_STATIC_LOCAL(FontContainerRefMemoryFontHash, srcFontRefCache, ()); - return srcFontRefCache; -} - -FontRefMemoryFontHash& fontCacheByActualFontRef() -{ - DEFINE_STATIC_LOCAL(FontRefMemoryFontHash, realFontRefCache, ()); - return realFontRefCache; -} - -ATSFontContainerRef fontContainerRefFromNSFont(NSFont* srcFont) -{ - ATSFontRef fontRef = CTFontGetPlatformFont(toCTFontRef(srcFont), 0); - if (!fontRef) - return kATSFontContainerRefUnspecified; - ATSFontContainerRef fontContainer = kATSFontContainerRefUnspecified; - if (ATSFontGetContainer(fontRef, 0, &fontContainer) != noErr) - return kATSFontContainerRefUnspecified; - return fontContainer; -} - -// MemoryActivatedFont encapsulates a font loaded from another process and -// activated from memory. -// -// Responsibilities: -// * Holder for the CGFontRef & ATSFontRef belonging to the activated font. -// * Responsible for unloading the font container when done. -// -// Memory Management: -// The class is reference counted, with each instance of FontPlatformData that -// uses this class holding a reference to it. -// Entries in 2 hashes are maintained internally to allow quick lookup -// of existing instances for reuse: -// - fontCacheBySrcFontContainerRef() - key is the ATSFontContainerRef -// corresponding to the *original in-process NSFont* whose loading was blocked -// by the sandbox. -// This is needed to allow lookup of a pre-existing MemoryActivatedFont when -// creating a new FontPlatformData object. -// - fontCacheByActualFontRef() - key is the ATSFontRef corresponding to the -// *new in-memory font* that we got from the browser process. -// This is needed so that a FontPlatformData object can refer back to the -// MemoryActivatedFont it's using. Currently this is only needed to release -// the font on FontPlatformData destruction. -// -// Assumptions: -// This code assumes that an ATSFontRef is a unique identifier tied to an -// activated font. i.e. After we activate a font, its ATSFontRef doesn't -// change. -// It also assumes that the ATSFoncontainerRef for two in-memory NSFonts that -// correspond to the same on-disk font file are always the same and don't change -// with time. -// -// Flushing caches: -// When the system notifies us of a system font cache flush, all FontDataCache -// objects are destroyed. This should in turn dereference all -// MemoryActivatedFonts and thus unload all in-memory fonts. -class MemoryActivatedFont : public RefCounted<MemoryActivatedFont> { -public: - // srcFontRef - ATSFontRef belonging to the NSFont object that failed to - // load in-process. - // container - a font container corresponding to an identical font that - // we loaded cross-process. - MemoryActivatedFont(ATSFontContainerRef srcFontContainerRef, ATSFontContainerRef container) - : m_fontContainer(container) - , m_atsFontRef(kATSFontRefUnspecified) - , m_srcFontContainerRef(srcFontContainerRef) - { - if (!container) - return; - - // Count the number of fonts in the container. - ItemCount fontCount = 0; - OSStatus err = ATSFontFindFromContainer(container, kATSOptionFlagsDefault, 0, 0, &fontCount); - if (err != noErr || fontCount < 1) - return; - - // For now always assume that we want the first font in the container. - ATSFontFindFromContainer(container, kATSOptionFlagsDefault, 1, &m_atsFontRef, 0); - - if (!m_atsFontRef) - return; - - // Cache CGFont representation of the font. - m_cgFont.adoptCF(CGFontCreateWithPlatformFont(&m_atsFontRef)); - - if (!m_cgFont.get()) - return; - - // Add ourselves to caches. - fontCacheBySrcFontContainerRef().add(m_srcFontContainerRef, this); - fontCacheByActualFontRef().add(m_atsFontRef, this); - } - - // Get cached CGFontRef corresponding to the in-memory font. - CGFontRef cgFont() - { - return m_cgFont.get(); - } - - // Get cached ATSFontRef corresponding to the in-memory font. - ATSFontRef atsFontRef() - { - return m_atsFontRef; - } - - // Destructor - Unload font container from memory and remove ourselves - // from hashes. - ~MemoryActivatedFont() - { - if (m_cgFont.get()) { // Object construction succeeded. - // First remove ourselves from the caches. - ASSERT(fontCacheBySrcFontContainerRef().contains(m_srcFontContainerRef)); - ASSERT(fontCacheByActualFontRef().contains(m_atsFontRef)); - - fontCacheBySrcFontContainerRef().remove(m_srcFontContainerRef); - fontCacheByActualFontRef().remove(m_atsFontRef); - - // Make sure the CGFont is destroyed before its font container. - m_cgFont.releaseRef(); - } - - if (m_fontContainer != kATSFontContainerRefUnspecified) - ATSFontDeactivate(m_fontContainer, 0, kATSOptionFlagsDefault); - } - -private: - ATSFontContainerRef m_fontContainer; - WTF::RetainPtr<CGFontRef> m_cgFont; - ATSFontRef m_atsFontRef; - ATSFontContainerRef m_srcFontContainerRef; -}; - -// The only way we can tell that an in-process font has failed to load -// is if CTFontCopyGraphicsFont() returns the LastResort font. -bool isLastResortFont(CGFontRef cgFont) -{ - NSString* fontName = (NSString*)CGFontCopyPostScriptName(cgFont); - return [fontName isEqualToString:@"LastResort"]; -} - -// Given an in-process font which has failed to load, return a -// MemoryActivatedFont* corresponding to an in-memory representation of the -// same font loaded from the browser process. -// The caller is responsbile for calling derefMemoryFont() on the ATSFontRef -// of the returned font. -// On failure this function returns 0, in which case the caller doesn't need -// to perform any additional cleanup. -MemoryActivatedFont* loadFontFromBrowserProcess(NSFont* nsFont) -{ - ATSFontContainerRef container; - // Send cross-process request to load font. - if (!ChromiumBridge::loadFont(nsFont, &container)) - return 0; - - ATSFontContainerRef srcFontContainerRef = fontContainerRefFromNSFont(nsFont); - if (!srcFontContainerRef) { - ATSFontDeactivate(container, 0, kATSOptionFlagsDefault); - return 0; - } - - MemoryActivatedFont* font = fontCacheBySrcFontContainerRef().get(srcFontContainerRef); - if (!font) { - font = new MemoryActivatedFont(srcFontContainerRef, container); - if (!font->cgFont()) { - delete font; - return 0; - } - } else { - font->ref(); - } - - return font; -} - -// deref() the MemoryActivatedFont corresponding to the given ATSFontRef. If no -// corresponding MemoryActivatedFont object exists, no action is performed. -void derefMemoryFont(ATSFontRef fontRef) -{ - if (fontRef == kATSFontRefUnspecified) - return; - MemoryActivatedFont* font = fontCacheByActualFontRef().get(fontRef); - if (font) - font->deref(); -} - -// ref() the MemoryActivatedFont corresponding to the given ATSFontRef. If no -// corresponding MemoryActivatedFont object exists, no action is performed. -void refMemoryFont(ATSFontRef fontRef) -{ - if (fontRef == kATSFontRefUnspecified) - return; - MemoryActivatedFont* font = fontCacheByActualFontRef().get(fontRef); - if (font) - font->ref(); -} - -// Given an NSFont, try to load a representation of that font into the cgFont -// parameter. If loading is blocked by the sandbox, the font may be loaded -// cross-process. -// If sandbox loading also fails, a fallback font is loaded. -// -// Considerations: -// * cgFont must be CFReleas()ed by the caller when done. -// -// Parameters: -// * nsFont - The font we wish to load. -// * fontSize - point size of the font we wish to load. -// * outNSFont - The font that was actually loaded, may be different from nsFont -// if a fallback font was used. -// * cgFont - on output this contains the CGFontRef corresponding to the NSFont -// that was picked in the end. The caller is responsible for calling -// CFRelease() on this parameter when done with it. -// * fontID - on output, the ID corresponding to nsFont. -void loadFont(NSFont* nsFont, float fontSize, NSFont*& outNSFont, CGFontRef& cgFont, ATSUFontID& fontID) -{ - outNSFont = nsFont; - cgFont = CTFontCopyGraphicsFont(toCTFontRef(outNSFont), 0); - MemoryActivatedFont* memFont = 0; - if (OutOfProcessFontLoadingEnabled() && outNSFont && cgFont && isLastResortFont(cgFont)) { - // Release old CGFontRef since it points at the LastResort font which we don't want. - CFRelease(cgFont); - cgFont = 0; - - // Font loading was blocked by the Sandbox. - memFont = loadFontFromBrowserProcess(outNSFont); - if (memFont) { - cgFont = memFont->cgFont(); - - // Need to add an extra retain so output semantics of this function - // are consistent. - CFRetain(cgFont); - } else { - // If we still can't load the font, then return Times, - // rather than the LastResort font. - outNSFont = [NSFont fontWithName:@"Times" size:fontSize]; - cgFont = CTFontCopyGraphicsFont(toCTFontRef(outNSFont), 0); - } - } - - if (memFont) { - fontID = memFont->atsFontRef(); - } else { - fontID = CTFontGetPlatformFont(toCTFontRef(outNSFont), 0); - } -} - -} // namespace -// End Chromium Change - -FontPlatformData::FontPlatformData(NSFont *nsFont, bool syntheticBold, bool syntheticOblique) - : m_syntheticBold(syntheticBold) - , m_syntheticOblique(syntheticOblique) - , m_font(nsFont) -#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) - , m_isColorBitmapFont(CTFontGetSymbolicTraits(toCTFontRef(nsFont)) & kCTFontColorGlyphsTrait) -#else - , m_isColorBitmapFont(false) -#endif -{ -// Start Chromium Change - m_size = nsFont ? [nsFont pointSize] : 0.0f; - CGFontRef cgFont = 0; - NSFont* loadedFont = 0; - loadFont(nsFont, m_size, loadedFont, cgFont, m_atsuFontID); - m_font = loadedFont; - if (m_font) - CFRetain(m_font); - m_cgFont.adoptCF(cgFont); -// End Chromium Change -} - -FontPlatformData::FontPlatformData(const FontPlatformData& f) -{ - m_font = f.m_font && f.m_font != reinterpret_cast<NSFont *>(-1) ? const_cast<NSFont *>(static_cast<const NSFont *>(CFRetain(f.m_font))) : f.m_font; - - m_syntheticBold = f.m_syntheticBold; - m_syntheticOblique = f.m_syntheticOblique; - m_size = f.m_size; - m_cgFont = f.m_cgFont; - m_atsuFontID = f.m_atsuFontID; - m_isColorBitmapFont = f.m_isColorBitmapFont; - // Start Chromium Change - refMemoryFont(m_atsuFontID); - // End Chromium Change -} - -FontPlatformData::~FontPlatformData() -{ - if (m_font && m_font != reinterpret_cast<NSFont *>(-1)) - CFRelease(m_font); - - // Start Chromium Change - derefMemoryFont(m_atsuFontID); - // End Chromium Change -} - -const FontPlatformData& FontPlatformData::operator=(const FontPlatformData& f) -{ - m_syntheticBold = f.m_syntheticBold; - m_syntheticOblique = f.m_syntheticOblique; - m_size = f.m_size; - m_cgFont = f.m_cgFont; - m_atsuFontID = f.m_atsuFontID; - if (m_font == f.m_font) - return *this; - if (f.m_font && f.m_font != reinterpret_cast<NSFont *>(-1)) - CFRetain(f.m_font); - if (m_font && m_font != reinterpret_cast<NSFont *>(-1)) - CFRelease(m_font); - m_font = f.m_font; - m_isColorBitmapFont = f.m_isColorBitmapFont; - // Start Chromium Change - refMemoryFont(m_atsuFontID); - // End Chromium Change - return *this; -} - -void FontPlatformData::setFont(NSFont *font) -{ - if (m_font == font) - return; - if (font) - CFRetain(font); - if (m_font && m_font != reinterpret_cast<NSFont *>(-1)) - CFRelease(m_font); - m_font = font; - m_size = font ? [font pointSize] : 0.0f; - - // Start Chromium Change - CGFontRef cgFont = 0; - NSFont* loadedFont = 0; - loadFont(m_font, m_size, loadedFont, cgFont, m_atsuFontID); - - // If loadFont replaced m_font with a fallback font, then release the - // previous font to counter the retain above. Then retain the new font. - if (loadedFont != m_font) { - CFRelease(m_font); - m_font = loadedFont; - CFRetain(m_font); - } - m_cgFont.adoptCF(cgFont); -#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) - m_isColorBitmapFont = CTFontGetSymbolicTraits(toCTFontRef(m_font)) & kCTFontColorGlyphsTrait; -#endif - // End Chromium Change -} - -bool FontPlatformData::roundsGlyphAdvances() const -{ - return [m_font renderingMode] == NSFontAntialiasedIntegerAdvancementsRenderingMode; -} - -bool FontPlatformData::allowsLigatures() const -{ - return ![[m_font coveredCharacterSet] characterIsMember:'a']; -} - -#if USE(CORE_TEXT) -CTFontRef FontPlatformData::ctFont() const -{ - if (m_font) - return toCTFontRef(m_font); - if (!m_CTFont) - m_CTFont.adoptCF(CTFontCreateWithGraphicsFont(m_cgFont.get(), m_size, 0, 0)); - return m_CTFont.get(); -} -#endif // USE(CORE_TEXT) - -#ifndef NDEBUG -String FontPlatformData::description() const -{ - RetainPtr<CFStringRef> cgFontDescription(AdoptCF, CFCopyDescription(cgFont())); - return String(cgFontDescription.get()) + " " + String::number(m_size) + (m_syntheticBold ? " synthetic bold" : "") + (m_syntheticOblique ? " synthetic oblique" : ""); -} -#endif - -} // namespace WebCore diff --git a/WebCore/platform/graphics/chromium/GLES2Canvas.cpp b/WebCore/platform/graphics/chromium/GLES2Canvas.cpp index c0cb87c..82d4c0b 100644 --- a/WebCore/platform/graphics/chromium/GLES2Canvas.cpp +++ b/WebCore/platform/graphics/chromium/GLES2Canvas.cpp @@ -30,15 +30,15 @@ #include "config.h" -#if USE(GLES2_RENDERING) - #include "GLES2Canvas.h" #include "FloatRect.h" -#include "GLES2Texture.h" #include "GraphicsContext3D.h" #include "IntRect.h" #include "PlatformString.h" +#include "SolidFillShader.h" +#include "TexShader.h" +#include "Texture.h" #define _USE_MATH_DEFINES #include <math.h> @@ -48,19 +48,6 @@ namespace WebCore { -static inline void affineTo3x3(const AffineTransform& transform, float mat[9]) -{ - mat[0] = transform.a(); - mat[1] = transform.b(); - mat[2] = 0.0f; - mat[3] = transform.c(); - mat[4] = transform.d(); - mat[5] = 0.0f; - mat[6] = transform.e(); - mat[7] = transform.f(); - mat[8] = 1.0f; -} - struct GLES2Canvas::State { State() : m_fillColor(0, 0, 0, 255) @@ -76,18 +63,10 @@ struct GLES2Canvas::State { GLES2Canvas::GLES2Canvas(GraphicsContext3D* context, const IntSize& size) : m_context(context) - , m_quadVertices(0) - , m_simpleProgram(0) - , m_texProgram(0) - , m_simpleMatrixLocation(-1) - , m_simpleColorLocation(-1) - , m_simplePositionLocation(-1) - , m_texMatrixLocation(-1) - , m_texTexMatrixLocation(-1) - , m_texSamplerLocation(-1) - , m_texAlphaLocation(-1) - , m_texPositionLocation(-1) , m_state(0) + , m_quadVertices(0) + , m_solidFillShader(SolidFillShader::create(context)) + , m_texShader(TexShader::create(context)) { m_flipMatrix.translate(-1.0f, 1.0f); m_flipMatrix.scale(2.0f / size.width(), -2.0f / size.height()); @@ -105,8 +84,6 @@ GLES2Canvas::GLES2Canvas(GraphicsContext3D* context, const IntSize& size) GLES2Canvas::~GLES2Canvas() { - m_context->deleteProgram(m_simpleProgram); - m_context->deleteProgram(m_texProgram); m_context->deleteBuffer(m_quadVertices); } @@ -131,23 +108,11 @@ void GLES2Canvas::fillRect(const FloatRect& rect, const Color& color, ColorSpace m_context->bindBuffer(GraphicsContext3D::ARRAY_BUFFER, getQuadVertices()); - m_context->useProgram(getSimpleProgram()); - - float rgba[4]; - color.getRGBA(rgba[0], rgba[1], rgba[2], rgba[3]); - m_context->uniform4f(m_simpleColorLocation, rgba[0] * rgba[3], rgba[1] * rgba[3], rgba[2] * rgba[3], rgba[3]); - AffineTransform matrix(m_flipMatrix); matrix.multLeft(m_state->m_ctm); matrix.translate(rect.x(), rect.y()); matrix.scale(rect.width(), rect.height()); - float mat[9]; - affineTo3x3(matrix, mat); - m_context->uniformMatrix3fv(m_simpleMatrixLocation, false /*transpose*/, mat, 1 /*count*/); - - m_context->vertexAttribPointer(m_simplePositionLocation, 3, GraphicsContext3D::FLOAT, false, 0, 0); - - m_context->enableVertexAttribArray(m_simplePositionLocation); + m_solidFillShader->use(matrix, color); m_context->drawArrays(GraphicsContext3D::TRIANGLE_STRIP, 0, 4); } @@ -200,49 +165,35 @@ void GLES2Canvas::restore() m_state = &m_stateStack.last(); } -void GLES2Canvas::drawTexturedRect(GLES2Texture* texture, const FloatRect& srcRect, const FloatRect& dstRect, ColorSpace colorSpace, CompositeOperator compositeOp) +void GLES2Canvas::drawTexturedRect(Texture* texture, const FloatRect& srcRect, const FloatRect& dstRect, ColorSpace colorSpace, CompositeOperator compositeOp) { drawTexturedRect(texture, srcRect, dstRect, m_state->m_ctm, m_state->m_alpha, colorSpace, compositeOp); } -void GLES2Canvas::drawTexturedRect(GLES2Texture* texture, const FloatRect& srcRect, const FloatRect& dstRect, const AffineTransform& transform, float alpha, ColorSpace colorSpace, CompositeOperator compositeOp) +void GLES2Canvas::drawTexturedRect(Texture* texture, const FloatRect& srcRect, const FloatRect& dstRect, const AffineTransform& transform, float alpha, ColorSpace colorSpace, CompositeOperator compositeOp) { applyCompositeOperator(compositeOp); m_context->bindBuffer(GraphicsContext3D::ARRAY_BUFFER, getQuadVertices()); checkGLError("glBindBuffer"); - m_context->useProgram(getTexProgram()); - checkGLError("glUseProgram"); - - m_context->activeTexture(GraphicsContext3D::TEXTURE0); - - m_context->uniform1i(m_texSamplerLocation, 0); - checkGLError("glUniform1i"); - - m_context->uniform1f(m_texAlphaLocation, alpha); - checkGLError("glUniform1f for alpha"); - - m_context->vertexAttribPointer(m_texPositionLocation, 3, GraphicsContext3D::FLOAT, false, 0, 0); - - m_context->enableVertexAttribArray(m_texPositionLocation); - const TilingData& tiles = texture->tiles(); IntRect tileIdxRect = tiles.overlappedTileIndices(srcRect); for (int y = tileIdxRect.y(); y <= tileIdxRect.bottom(); y++) { for (int x = tileIdxRect.x(); x <= tileIdxRect.right(); x++) - drawTexturedRectTile(texture, tiles.tileIndex(x, y), srcRect, dstRect, transform); + drawTexturedRectTile(texture, tiles.tileIndex(x, y), srcRect, dstRect, transform, alpha); } } -void GLES2Canvas::drawTexturedRectTile(GLES2Texture* texture, int tile, const FloatRect& srcRect, const FloatRect& dstRect, const AffineTransform& transform) +void GLES2Canvas::drawTexturedRectTile(Texture* texture, int tile, const FloatRect& srcRect, const FloatRect& dstRect, const AffineTransform& transform, float alpha) { if (dstRect.isEmpty()) return; const TilingData& tiles = texture->tiles(); + m_context->activeTexture(GraphicsContext3D::TEXTURE0); texture->bindTile(tile); FloatRect srcRectClippedInTileSpace; @@ -255,19 +206,13 @@ void GLES2Canvas::drawTexturedRectTile(GLES2Texture* texture, int tile, const Fl matrix.multLeft(transform); matrix.translate(dstRectIntersected.x(), dstRectIntersected.y()); matrix.scale(dstRectIntersected.width(), dstRectIntersected.height()); - float mat[9]; - affineTo3x3(matrix, mat); - m_context->uniformMatrix3fv(m_texMatrixLocation, false /*transpose*/, mat, 1 /*count*/); - checkGLError("glUniformMatrix3fv"); AffineTransform texMatrix; texMatrix.scale(1.0f / tileBoundsWithBorder.width(), 1.0f / tileBoundsWithBorder.height()); texMatrix.translate(srcRectClippedInTileSpace.x(), srcRectClippedInTileSpace.y()); texMatrix.scale(srcRectClippedInTileSpace.width(), srcRectClippedInTileSpace.height()); - float texMat[9]; - affineTo3x3(texMatrix, texMat); - m_context->uniformMatrix3fv(m_texTexMatrixLocation, false /*transpose*/, texMat, 1 /*count*/); - checkGLError("glUniformMatrix3fv"); + + m_texShader->use(matrix, texMatrix, 0, alpha); m_context->drawArrays(GraphicsContext3D::TRIANGLE_STRIP, 0, 4); checkGLError("glDrawArrays"); @@ -354,131 +299,21 @@ unsigned GLES2Canvas::getQuadVertices() return m_quadVertices; } - -static unsigned loadShader(GraphicsContext3D* context, unsigned type, const char* shaderSource) +Texture* GLES2Canvas::createTexture(NativeImagePtr ptr, Texture::Format format, int width, int height) { - unsigned shader = context->createShader(type); - if (!shader) - return 0; - - String shaderSourceStr(shaderSource); - context->shaderSource(shader, shaderSourceStr); - context->compileShader(shader); - int compileStatus; - context->getShaderiv(shader, GraphicsContext3D::COMPILE_STATUS, &compileStatus); - if (!compileStatus) { - String infoLog = context->getShaderInfoLog(shader); - LOG_ERROR(infoLog.utf8().data()); - context->deleteShader(shader); - return 0; - } - return shader; -} - -unsigned GLES2Canvas::getSimpleProgram() -{ - if (!m_simpleProgram) { - unsigned vertexShader = loadShader(m_context, GraphicsContext3D::VERTEX_SHADER, - "uniform mat3 matrix;\n" - "uniform vec4 color;\n" - "attribute vec3 position;\n" - "void main() {\n" - " gl_Position = vec4(matrix * position, 1.0);\n" - "}\n"); - if (!vertexShader) - return 0; - unsigned fragmentShader = loadShader(m_context, GraphicsContext3D::FRAGMENT_SHADER, - "precision mediump float;\n" - "uniform mat3 matrix;\n" - "uniform vec4 color;\n" - "void main() {\n" - " gl_FragColor = color;\n" - "}\n"); - if (!fragmentShader) - return 0; - m_simpleProgram = m_context->createProgram(); - if (!m_simpleProgram) - return 0; - m_context->attachShader(m_simpleProgram, vertexShader); - m_context->attachShader(m_simpleProgram, fragmentShader); - m_context->linkProgram(m_simpleProgram); - int linkStatus; - m_context->getProgramiv(m_simpleProgram, GraphicsContext3D::LINK_STATUS, &linkStatus); - if (!linkStatus) { - m_context->deleteProgram(m_simpleProgram); - m_simpleProgram = 0; - } - m_context->deleteShader(vertexShader); - m_context->deleteShader(fragmentShader); - m_simplePositionLocation = m_context->getAttribLocation(m_simpleProgram, "position"); - m_simpleMatrixLocation = m_context->getUniformLocation(m_simpleProgram, "matrix"); - m_simpleColorLocation = m_context->getUniformLocation(m_simpleProgram, "color"); - } - return m_simpleProgram; -} - -unsigned GLES2Canvas::getTexProgram() -{ - if (!m_texProgram) { - unsigned vertexShader = loadShader(m_context, GraphicsContext3D::VERTEX_SHADER, - "uniform mat3 matrix;\n" - "uniform mat3 texMatrix;\n" - "attribute vec3 position;\n" - "varying vec3 texCoord;\n" - "void main() {\n" - " texCoord = texMatrix * position;\n" - " gl_Position = vec4(matrix * position, 1.0);\n" - "}\n"); - if (!vertexShader) - return 0; - unsigned fragmentShader = loadShader(m_context, GraphicsContext3D::FRAGMENT_SHADER, - "precision mediump float;\n" - "uniform sampler2D sampler;\n" - "uniform float alpha;\n" - "varying vec3 texCoord;\n" - "void main() {\n" - " gl_FragColor = texture2D(sampler, texCoord.xy)* vec4(alpha);\n" - "}\n"); - if (!fragmentShader) - return 0; - m_texProgram = m_context->createProgram(); - if (!m_texProgram) - return 0; - m_context->attachShader(m_texProgram, vertexShader); - m_context->attachShader(m_texProgram, fragmentShader); - m_context->linkProgram(m_texProgram); - int linkStatus; - m_context->getProgramiv(m_texProgram, GraphicsContext3D::LINK_STATUS, &linkStatus); - if (!linkStatus) { - m_context->deleteProgram(m_texProgram); - m_texProgram = 0; - } - m_context->deleteShader(vertexShader); - m_context->deleteShader(fragmentShader); - m_texMatrixLocation = m_context->getUniformLocation(m_texProgram, "matrix"); - m_texSamplerLocation = m_context->getUniformLocation(m_texProgram, "sampler"); - m_texTexMatrixLocation = m_context->getUniformLocation(m_texProgram, "texMatrix"); - m_texPositionLocation = m_context->getAttribLocation(m_texProgram, "position"); - m_texAlphaLocation = m_context->getUniformLocation(m_texProgram, "alpha"); - } - return m_texProgram; -} - -GLES2Texture* GLES2Canvas::createTexture(NativeImagePtr ptr, GLES2Texture::Format format, int width, int height) -{ - PassRefPtr<GLES2Texture> texture = m_textures.get(ptr); + PassRefPtr<Texture> texture = m_textures.get(ptr); if (texture) return texture.get(); - texture = GLES2Texture::create(m_context, format, width, height); - GLES2Texture* t = texture.get(); + texture = Texture::create(m_context, format, width, height); + Texture* t = texture.get(); m_textures.set(ptr, texture); return t; } -GLES2Texture* GLES2Canvas::getTexture(NativeImagePtr ptr) +Texture* GLES2Canvas::getTexture(NativeImagePtr ptr) { - PassRefPtr<GLES2Texture> texture = m_textures.get(ptr); + PassRefPtr<Texture> texture = m_textures.get(ptr); return texture ? texture.get() : 0; } @@ -515,4 +350,3 @@ void GLES2Canvas::checkGLError(const char* header) } -#endif diff --git a/WebCore/platform/graphics/chromium/GLES2Canvas.h b/WebCore/platform/graphics/chromium/GLES2Canvas.h index d00510a..f49ac8b 100644 --- a/WebCore/platform/graphics/chromium/GLES2Canvas.h +++ b/WebCore/platform/graphics/chromium/GLES2Canvas.h @@ -31,14 +31,12 @@ #ifndef GLES2Canvas_h #define GLES2Canvas_h -#if USE(GLES2_RENDERING) - #include "AffineTransform.h" #include "Color.h" #include "ColorSpace.h" -#include "GLES2Texture.h" #include "GraphicsTypes.h" #include "ImageSource.h" +#include "Texture.h" #include <wtf/HashMap.h> #include <wtf/Noncopyable.h> @@ -49,8 +47,10 @@ namespace WebCore { class Color; class FloatRect; class GraphicsContext3D; +class SolidFillShader; +class TexShader; -typedef HashMap<NativeImagePtr, RefPtr<GLES2Texture> > TextureHashMap; +typedef HashMap<NativeImagePtr, RefPtr<Texture> > TextureHashMap; class GLES2Canvas : public Noncopyable { public: @@ -74,35 +74,25 @@ public: // non-standard functions // These are not standard GraphicsContext functions, and should be pushed // down into a PlatformContextGLES2 at some point. - void drawTexturedRect(GLES2Texture*, const FloatRect& srcRect, const FloatRect& dstRect, const AffineTransform&, float alpha, ColorSpace, CompositeOperator); - void drawTexturedRect(GLES2Texture*, const FloatRect& srcRect, const FloatRect& dstRect, ColorSpace, CompositeOperator); + void drawTexturedRect(Texture*, const FloatRect& srcRect, const FloatRect& dstRect, const AffineTransform&, float alpha, ColorSpace, CompositeOperator); + void drawTexturedRect(Texture*, const FloatRect& srcRect, const FloatRect& dstRect, ColorSpace, CompositeOperator); GraphicsContext3D* context() { return m_context; } - GLES2Texture* createTexture(NativeImagePtr, GLES2Texture::Format, int width, int height); - GLES2Texture* getTexture(NativeImagePtr); + Texture* createTexture(NativeImagePtr, Texture::Format, int width, int height); + Texture* getTexture(NativeImagePtr); private: - void drawTexturedRectTile(GLES2Texture* texture, int tile, const FloatRect& srcRect, const FloatRect& dstRect, const AffineTransform&); + void drawTexturedRectTile(Texture* texture, int tile, const FloatRect& srcRect, const FloatRect& dstRect, const AffineTransform&, float alpha); void applyCompositeOperator(CompositeOperator); void checkGLError(const char* header); unsigned getQuadVertices(); - unsigned getSimpleProgram(); - unsigned getTexProgram(); GraphicsContext3D* m_context; struct State; WTF::Vector<State> m_stateStack; State* m_state; unsigned m_quadVertices; - unsigned m_simpleProgram; - unsigned m_texProgram; - int m_simpleMatrixLocation; - int m_simpleColorLocation; - int m_simplePositionLocation; - int m_texMatrixLocation; - int m_texTexMatrixLocation; - int m_texSamplerLocation; - int m_texAlphaLocation; - int m_texPositionLocation; + OwnPtr<SolidFillShader> m_solidFillShader; + OwnPtr<TexShader> m_texShader; AffineTransform m_flipMatrix; TextureHashMap m_textures; CompositeOperator m_lastCompositeOp; // This is the one last set, not necessarily the one in the state stack. @@ -110,6 +100,4 @@ private: } -#endif - #endif // GLES2Canvas_h diff --git a/WebCore/platform/graphics/chromium/LayerChromium.cpp b/WebCore/platform/graphics/chromium/LayerChromium.cpp index 3553878..6519f1f 100644 --- a/WebCore/platform/graphics/chromium/LayerChromium.cpp +++ b/WebCore/platform/graphics/chromium/LayerChromium.cpp @@ -109,7 +109,7 @@ LayerChromium::SharedValues::SharedValues() "uniform vec4 color; \n" "void main() \n" "{ \n" - " gl_FragColor = color; \n" + " gl_FragColor = vec4(color.xyz * color.w, color.w);\n" "} \n"; m_borderShaderProgram = createShaderProgram(borderVertexShaderString, borderFragmentShaderString); @@ -431,6 +431,37 @@ void LayerChromium::drawDebugBorder() GLC(glDrawElements(GL_LINE_LOOP, 4, GL_UNSIGNED_SHORT, (void*)(6 * sizeof(unsigned short)))); } +const FloatRect LayerChromium::getDrawRect() const +{ + // Form the matrix used by the shader to map the corners of the layer's + // bounds into the view space. + TransformationMatrix renderMatrix = drawTransform(); + renderMatrix.scale3d(bounds().width(), bounds().height(), 1); + + FloatRect layerRect(-0.5, -0.5, 1, 1); + FloatRect mappedRect = renderMatrix.mapRect(layerRect); + return mappedRect; +} + +// Draws the layer with a single colored shader. This method is used to do +// quick draws into the stencil buffer. +void LayerChromium::drawAsMask() +{ + ASSERT(layerRenderer()); + const SharedValues* sv = layerRenderer()->layerSharedValues(); + ASSERT(sv && sv->initialized()); + layerRenderer()->useShader(sv->borderShaderProgram()); + + // 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)); + + drawTexturedQuad(layerRenderer()->projectionMatrix(), drawTransform(), + bounds().width(), bounds().height(), drawOpacity(), + sv->borderShaderMatrixLocation(), -1); +} + // static void LayerChromium::prepareForDraw(const SharedValues* sv) { diff --git a/WebCore/platform/graphics/chromium/LayerChromium.h b/WebCore/platform/graphics/chromium/LayerChromium.h index 0d0d362..ba15088 100644 --- a/WebCore/platform/graphics/chromium/LayerChromium.h +++ b/WebCore/platform/graphics/chromium/LayerChromium.h @@ -151,6 +151,9 @@ public: bool contentsDirty() { return m_contentsDirty; } + // Returns the rect containtaining this layer in the current view's coordinate system. + const FloatRect getDrawRect() const; + // These methods typically need to be overwritten by derived classes. virtual bool drawsContent() { return false; } virtual void updateContents() { }; @@ -158,6 +161,9 @@ public: void drawDebugBorder(); + // Draws the layer without a texture. This is used for stencil operations. + void drawAsMask(); + // Stores values that are shared between instances of this class that are // associated with the same LayerRendererChromium (and hence the same GL // context). diff --git a/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp b/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp index cf23871..50338d2 100644 --- a/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp +++ b/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp @@ -183,9 +183,11 @@ void LayerRendererChromium::drawLayers(const IntRect& updateRect, const IntRect& // 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)); if (m_scrollPosition == IntPoint(-1, -1)) m_scrollPosition = scrollPosition; @@ -299,14 +301,23 @@ 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(glScissor(0, visibleRect.height() - contentRect.height(), contentRect.width(), contentRect.height())); + 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)); + // Disable writes to the stencil buffer. + GLC(glStencilMask(0)); // Traverse the layer tree one more time to draw the layers. - m_visibleRect = visibleRect; for (i = 0; i < sublayers.size(); i++) - drawLayersRecursive(sublayers[i].get()); + drawLayersRecursive(sublayers[i].get(), scissorRect); GLC(glDisable(GL_SCISSOR_TEST)); @@ -419,13 +430,35 @@ void LayerRendererChromium::updateLayersRecursive(LayerChromium* layer, const Tr layer->setLayerRenderer(this); } +// Does a quick draw of the given layer into the stencil buffer. If decrement +// is true then it decrements the current stencil values otherwise it increments them. +void LayerRendererChromium::drawLayerIntoStencilBuffer(LayerChromium* layer, bool decrement) +{ + // 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(glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE)); + + layer->drawAsMask(); + + // Disable writes to the stencil buffer. + GLC(glStencilMask(0)); + GLC(glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE)); +} + // Recursively walk the layer tree and draw the layers. -void LayerRendererChromium::drawLayersRecursive(LayerChromium* layer) +void LayerRendererChromium::drawLayersRecursive(LayerChromium* layer, const FloatRect& scissorRect) { static bool depthTestEnabledForSubtree = false; + static int currentStencilValue = 0; // Check if the layer falls within the visible bounds of the page. - bool layerVisible = isLayerVisible(layer, layer->drawTransform(), m_visibleRect); + FloatRect layerRect = layer->getDrawRect(); + bool isLayerVisible = scissorRect.intersects(layerRect); // Enable depth testing for this layer and all its descendants if preserves3D is set. bool mustClearDepth = false; @@ -439,9 +472,50 @@ void LayerRendererChromium::drawLayersRecursive(LayerChromium* layer) } } - if (layerVisible) + if (isLayerVisible) drawLayer(layer); + // FIXME: We should check here if the layer has descendants that draw content + // before we setup for clipping. + FloatRect currentScissorRect = scissorRect; + bool mustResetScissorRect = false; + bool didStencilDraw = false; + if (layer->masksToBounds()) { + // If the layer isn't rotated then we can use scissoring otherwise we need + // to clip using the stencil buffer. + if (layer->drawTransform().isIdentityOrTranslation()) { + currentScissorRect.intersect(layerRect); + if (currentScissorRect != scissorRect) { + scissorToRect(currentScissorRect); + mustResetScissorRect = true; + } + } else if (currentStencilValue < ((1 << m_numStencilBits) - 1)) { + // Clipping using the stencil buffer works as follows: When we encounter + // a clipping layer we increment the stencil buffer values for all the pixels + // the layer touches. As a result 1's will be stored in the stencil buffer for pixels under + // the first clipping layer found in a traversal, 2's for pixels in the intersection + // of two nested clipping layers, etc. When the sublayers of a clipping layer are drawn + // we turn on stencil testing to render only pixels that have the correct stencil + // value (one that matches the value of currentStencilValue). As the recursion unravels, + // we decrement the stencil buffer values for each clipping layer. When the entire layer tree + // 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)); + + drawLayerIntoStencilBuffer(layer, false); + + currentStencilValue++; + didStencilDraw = true; + } + } + // Sublayers will render only if the value in the stencil buffer is equal to + // currentStencilValue. + if (didStencilDraw) { + // The sublayers will render only if the stencil test passes. + GLC(glStencilFunc(GL_EQUAL, currentStencilValue, 0xff)); + } + // If we're using depth testing then we need to sort the children in Z to // get the transparency to work properly. if (depthTestEnabledForSubtree) { @@ -456,11 +530,27 @@ void LayerRendererChromium::drawLayersRecursive(LayerChromium* layer) std::stable_sort(sublayerList.begin(), sublayerList.end(), compareLayerZ); for (i = 0; i < sublayerList.size(); i++) - drawLayersRecursive(sublayerList[i]); + drawLayersRecursive(sublayerList[i], currentScissorRect); } else { const Vector<RefPtr<LayerChromium> >& sublayers = layer->getSublayers(); for (size_t i = 0; i < sublayers.size(); i++) - drawLayersRecursive(sublayers[i].get()); + drawLayersRecursive(sublayers[i].get(), currentScissorRect); + } + + if (didStencilDraw) { + // Draw into the stencil buffer subtracting 1 for every pixel hit + // effectively removing this mask + drawLayerIntoStencilBuffer(layer, true); + currentStencilValue--; + if (!currentStencilValue) { + // Disable stencil testing. + GLC(glDisable(GL_STENCIL_TEST)); + GLC(glStencilFunc(GL_ALWAYS, 0, 0xff)); + } + } + + if (mustResetScissorRect) { + scissorToRect(scissorRect); } if (mustClearDepth) { @@ -494,6 +584,15 @@ void LayerRendererChromium::drawLayer(LayerChromium* layer) layer->drawDebugBorder(); } +// Sets the scissor region to the given rectangle. The coordinate system for the +// scissorRect has its origin at the top left corner of the current visible rect. +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())); +} + bool LayerRendererChromium::makeContextCurrent() { return m_gles2Context->makeCurrent(); @@ -565,6 +664,9 @@ bool LayerRendererChromium::initializeSharedObjects() // Get the max texture size supported by the system. GLC(glGetIntegerv(GL_MAX_TEXTURE_SIZE, &m_maxTextureSize)); + // Get the number of bits available in the stencil buffer. + GLC(glGetIntegerv(GL_STENCIL_BITS, &m_numStencilBits)); + m_layerSharedValues = adoptPtr(new LayerChromium::SharedValues()); m_contentLayerSharedValues = adoptPtr(new ContentLayerChromium::SharedValues()); m_canvasLayerSharedValues = adoptPtr(new CanvasLayerChromium::SharedValues()); diff --git a/WebCore/platform/graphics/chromium/LayerRendererChromium.h b/WebCore/platform/graphics/chromium/LayerRendererChromium.h index 24bbe65..8f44afe 100644 --- a/WebCore/platform/graphics/chromium/LayerRendererChromium.h +++ b/WebCore/platform/graphics/chromium/LayerRendererChromium.h @@ -93,12 +93,16 @@ public: private: void updateLayersRecursive(LayerChromium* layer, const TransformationMatrix& parentMatrix, float opacity); - void drawLayersRecursive(LayerChromium*); + void drawLayersRecursive(LayerChromium*, const FloatRect& scissorRect); void drawLayer(LayerChromium*); bool isLayerVisible(LayerChromium*, const TransformationMatrix&, const IntRect& visibleRect); + void drawLayerIntoStencilBuffer(LayerChromium*, bool decrement); + + void scissorToRect(const FloatRect&); + bool makeContextCurrent(); bool initializeSharedObjects(); @@ -135,10 +139,12 @@ private: IntSize m_rootLayerCanvasSize; - IntRect m_visibleRect; + IntRect m_rootVisibleRect; int m_maxTextureSize; + int m_numStencilBits; + // Store values that are shared between instances of each layer type // associated with this instance of the compositor. Since there can be // multiple instances of the compositor running in the same renderer process diff --git a/WebCore/platform/graphics/mac/FontPlatformData.h b/WebCore/platform/graphics/cocoa/FontPlatformData.h index dc876a8..034e23b 100644 --- a/WebCore/platform/graphics/mac/FontPlatformData.h +++ b/WebCore/platform/graphics/cocoa/FontPlatformData.h @@ -42,7 +42,13 @@ typedef const struct __CTFont* CTFontRef; #include <wtf/Forward.h> #include <wtf/RetainPtr.h> +#if PLATFORM(CHROMIUM) && OS(DARWIN) +#include "CrossProcessFontLoading.h" +#endif + + typedef UInt32 ATSUFontID; +typedef UInt32 ATSFontRef; namespace WebCore { @@ -133,6 +139,15 @@ class FontPlatformData { private: static NSFont *hashTableDeletedFontValue() { return reinterpret_cast<NSFont *>(-1); } + + // Load various data about the font specified by |nsFont| with the size fontSize into the following output paramters: + // Note: Callers should always take into account that for the Chromium port, |outNSFont| isn't necessarily the same + // font as |nsFont|. This because the sandbox may block loading of the original font. + // * outNSFont - The font that was actually loaded, for the Chromium port this may be different than nsFont. + // The caller is responsible for calling CFRelease() on this parameter when done with it. + // * cgFont - CGFontRef representing the input font at the specified point size. + // * fontID - ID of loaded font. + void loadFont(NSFont* nsFont, float fontSize, NSFont*& outNSFont, CGFontRef& cgFont, ATSUFontID& fontID); NSFont *m_font; @@ -147,8 +162,12 @@ private: #endif bool m_isColorBitmapFont; + +#if PLATFORM(CHROMIUM) && OS(DARWIN) + RefPtr<MemoryActivatedFont> m_inMemoryFont; +#endif }; -} +} // namespace WebCore #endif diff --git a/WebCore/platform/graphics/mac/FontPlatformDataMac.mm b/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm index d905b62..bd49dcc 100644 --- a/WebCore/platform/graphics/mac/FontPlatformDataMac.mm +++ b/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm @@ -2,6 +2,7 @@ * This file is part of the internal font implementation. * * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. + * Copyright (c) 2010 Google Inc. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -29,11 +30,27 @@ namespace WebCore { +#if PLATFORM(MAC) +void FontPlatformData::loadFont(NSFont* nsFont, float, NSFont*& outNSFont, CGFontRef& cgFont, ATSUFontID& fontID) +{ + outNSFont = nsFont; +#ifndef BUILDING_ON_TIGER + cgFont = CTFontCopyGraphicsFont(toCTFontRef(nsFont), 0); + fontID = CTFontGetPlatformFont(toCTFontRef(nsFont), 0); +#else + cgFont = wkGetCGFontFromNSFont(nsFont); + fontID = wkGetNSFontATSUFontId(nsFont); +#endif +} +#endif // PLATFORM(MAC) + FontPlatformData::FontPlatformData(NSFont *nsFont, bool syntheticBold, bool syntheticOblique) : m_syntheticBold(syntheticBold) , m_syntheticOblique(syntheticOblique) , m_font(nsFont) #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) + // FIXME: Chromium: The following code isn't correct for the Chromium port since the sandbox might + // have blocked font loading, in which case we'll only have the real loaded font file after the call to loadFont(). , m_isColorBitmapFont(CTFontGetSymbolicTraits(toCTFontRef(nsFont)) & kCTFontColorGlyphsTrait) #else , m_isColorBitmapFont(false) @@ -41,14 +58,18 @@ FontPlatformData::FontPlatformData(NSFont *nsFont, bool syntheticBold, bool synt { ASSERT_ARG(nsFont, nsFont); - CFRetain(nsFont); m_size = [nsFont pointSize]; + + CGFontRef cgFont = 0; + loadFont(nsFont, m_size, m_font, cgFont, m_atsuFontID); + + if (m_font) + CFRetain(m_font); + #ifndef BUILDING_ON_TIGER - m_cgFont.adoptCF(CTFontCopyGraphicsFont(toCTFontRef(nsFont), 0)); - m_atsuFontID = CTFontGetPlatformFont(toCTFontRef(nsFont), 0); + m_cgFont.adoptCF(cgFont); #else - m_cgFont = wkGetCGFontFromNSFont(nsFont); - m_atsuFontID = wkGetNSFontATSUFontId(nsFont); + m_cgFont = cgFont; #endif } @@ -65,6 +86,9 @@ FontPlatformData::FontPlatformData(const FontPlatformData& f) #if USE(CORE_TEXT) m_CTFont = f.m_CTFont; #endif +#if PLATFORM(CHROMIUM) && OS(DARWIN) + m_inMemoryFont = f.m_inMemoryFont; +#endif } FontPlatformData:: ~FontPlatformData() @@ -91,6 +115,9 @@ const FontPlatformData& FontPlatformData::operator=(const FontPlatformData& f) #if USE(CORE_TEXT) m_CTFont = f.m_CTFont; #endif +#if PLATFORM(CHROMIUM) && OS(DARWIN) + m_inMemoryFont = f.m_inMemoryFont; +#endif return *this; } @@ -107,15 +134,28 @@ void FontPlatformData::setFont(NSFont *font) CFRelease(m_font); m_font = font; m_size = [font pointSize]; + + CGFontRef cgFont = 0; + NSFont* loadedFont = 0; + loadFont(m_font, m_size, loadedFont, cgFont, m_atsuFontID); + +#if PLATFORM(CHROMIUM) && OS(DARWIN) + // If loadFont replaced m_font with a fallback font, then release the + // previous font to counter the retain above. Then retain the new font. + if (loadedFont != m_font) { + CFRelease(m_font); + CFRetain(loadedFont); + m_font = loadedFont; + } +#endif + #ifndef BUILDING_ON_TIGER - m_cgFont.adoptCF(CTFontCopyGraphicsFont(toCTFontRef(font), 0)); - m_atsuFontID = CTFontGetPlatformFont(toCTFontRef(font), 0); + m_cgFont.adoptCF(cgFont); #else - m_cgFont = wkGetCGFontFromNSFont(font); - m_atsuFontID = wkGetNSFontATSUFontId(font); + m_cgFont = cgFont; #endif #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) - m_isColorBitmapFont = CTFontGetSymbolicTraits(toCTFontRef(font)) & kCTFontColorGlyphsTrait; + m_isColorBitmapFont = CTFontGetSymbolicTraits(toCTFontRef(m_font)) & kCTFontColorGlyphsTrait; #endif #if USE(CORE_TEXT) m_CTFont = 0; diff --git a/WebCore/platform/graphics/gpu/Shader.cpp b/WebCore/platform/graphics/gpu/Shader.cpp new file mode 100644 index 0000000..59c50a7 --- /dev/null +++ b/WebCore/platform/graphics/gpu/Shader.cpp @@ -0,0 +1,111 @@ +/* + * 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 "Shader.h" + +#include "AffineTransform.h" +#include "GraphicsContext3D.h" + +#include <wtf/text/CString.h> + +namespace WebCore { + +// static +void Shader::affineTo3x3(const AffineTransform& transform, float mat[9]) +{ + mat[0] = transform.a(); + mat[1] = transform.b(); + mat[2] = 0.0f; + mat[3] = transform.c(); + mat[4] = transform.d(); + mat[5] = 0.0f; + mat[6] = transform.e(); + mat[7] = transform.f(); + mat[8] = 1.0f; +} + +// static +unsigned Shader::loadShader(GraphicsContext3D* context, unsigned type, const char* shaderSource) +{ + unsigned shader = context->createShader(type); + if (!shader) + return 0; + + String shaderSourceStr(shaderSource); + context->shaderSource(shader, shaderSourceStr); + context->compileShader(shader); + int compileStatus; + context->getShaderiv(shader, GraphicsContext3D::COMPILE_STATUS, &compileStatus); + if (!compileStatus) { + String infoLog = context->getShaderInfoLog(shader); + LOG_ERROR("%s", infoLog.utf8().data()); + context->deleteShader(shader); + return 0; + } + return shader; +} + +// static +unsigned Shader::loadProgram(GraphicsContext3D* context, const char* vertexShaderSource, const char* fragmentShaderSource) +{ + unsigned vertexShader = loadShader(context, GraphicsContext3D::VERTEX_SHADER, vertexShaderSource); + if (!vertexShader) + return 0; + unsigned fragmentShader = loadShader(context, GraphicsContext3D::FRAGMENT_SHADER, fragmentShaderSource); + if (!fragmentShader) + return 0; + unsigned program = context->createProgram(); + if (!program) + return 0; + context->attachShader(program, vertexShader); + context->attachShader(program, fragmentShader); + context->linkProgram(program); + int linkStatus; + context->getProgramiv(program, GraphicsContext3D::LINK_STATUS, &linkStatus); + if (!linkStatus) + context->deleteProgram(program); + context->deleteShader(vertexShader); + context->deleteShader(fragmentShader); + return program; +} + +Shader::Shader(GraphicsContext3D* context, unsigned program) + : m_context(context) + , m_program(program) +{ +} + +Shader::~Shader() +{ + m_context->deleteProgram(m_program); +} + +} diff --git a/WebCore/platform/graphics/gpu/Shader.h b/WebCore/platform/graphics/gpu/Shader.h new file mode 100644 index 0000000..e5bd8de --- /dev/null +++ b/WebCore/platform/graphics/gpu/Shader.h @@ -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. + */ + +#ifndef Shader_h +#define Shader_h + +#include <wtf/Noncopyable.h> +#include <wtf/PassOwnPtr.h> + +namespace WebCore { + +class AffineTransform; +class GraphicsContext3D; +class Color; + +class Shader : public Noncopyable { +protected: + Shader(GraphicsContext3D*, unsigned program); + ~Shader(); + + static void affineTo3x3(const AffineTransform&, float mat[9]); + static unsigned loadShader(GraphicsContext3D*, unsigned type, const char* shaderSource); + static unsigned loadProgram(GraphicsContext3D*, const char* vertexShaderSource, const char* fragmentShaderSource); + + GraphicsContext3D* m_context; + unsigned m_program; +}; + +} + +#endif // Shader_h diff --git a/WebCore/platform/graphics/gpu/SolidFillShader.cpp b/WebCore/platform/graphics/gpu/SolidFillShader.cpp new file mode 100644 index 0000000..bbc4792 --- /dev/null +++ b/WebCore/platform/graphics/gpu/SolidFillShader.cpp @@ -0,0 +1,86 @@ +/* + * 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 "SolidFillShader.h" + +#include "Color.h" +#include "GraphicsContext3D.h" + +namespace WebCore { + +SolidFillShader::SolidFillShader(GraphicsContext3D* context, unsigned program) + : Shader(context, program) +{ + m_matrixLocation = context->getUniformLocation(program, "matrix"); + m_colorLocation = context->getUniformLocation(program, "color"); + m_positionLocation = context->getAttribLocation(program, "position"); +} + +PassOwnPtr<SolidFillShader> SolidFillShader::create(GraphicsContext3D* context) +{ + static const char* vertexShaderSource = + "uniform mat3 matrix;\n" + "uniform vec4 color;\n" + "attribute vec3 position;\n" + "void main() {\n" + " gl_Position = vec4(matrix * position, 1.0);\n" + "}\n"; + static const char* fragmentShaderSource = + "precision mediump float;\n" + "uniform mat3 matrix;\n" + "uniform vec4 color;\n" + "void main() {\n" + " gl_FragColor = color;\n" + "}\n"; + unsigned program = loadProgram(context, vertexShaderSource, fragmentShaderSource); + if (!program) + return 0; + return new SolidFillShader(context, program); +} + +void SolidFillShader::use(const AffineTransform& transform, const Color& color) +{ + m_context->useProgram(m_program); + + float rgba[4]; + color.getRGBA(rgba[0], rgba[1], rgba[2], rgba[3]); + m_context->uniform4f(m_colorLocation, rgba[0] * rgba[3], rgba[1] * rgba[3], rgba[2] * rgba[3], rgba[3]); + + float matrix[9]; + affineTo3x3(transform, matrix); + m_context->uniformMatrix3fv(m_matrixLocation, false /*transpose*/, matrix, 1 /*count*/); + + m_context->vertexAttribPointer(m_positionLocation, 3, GraphicsContext3D::FLOAT, false, 0, 0); + + m_context->enableVertexAttribArray(m_positionLocation); +} + +} diff --git a/WebCore/platform/graphics/gpu/SolidFillShader.h b/WebCore/platform/graphics/gpu/SolidFillShader.h new file mode 100644 index 0000000..1071e73 --- /dev/null +++ b/WebCore/platform/graphics/gpu/SolidFillShader.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2010, Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef SolidFillShader_h +#define SolidFillShader_h + +#include "Shader.h" + +namespace WebCore { + +class SolidFillShader : public Shader { +public: + static PassOwnPtr<SolidFillShader> create(GraphicsContext3D* context); + void use(const AffineTransform& transform, const Color& color); + +private: + SolidFillShader(GraphicsContext3D* context, unsigned program); + + int m_matrixLocation; + int m_colorLocation; + int m_positionLocation; +}; + +} + +#endif // SolidFillShader_h diff --git a/WebCore/platform/graphics/gpu/TexShader.cpp b/WebCore/platform/graphics/gpu/TexShader.cpp new file mode 100644 index 0000000..ba3ecdd --- /dev/null +++ b/WebCore/platform/graphics/gpu/TexShader.cpp @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2010, Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "TexShader.h" + +#include "GraphicsContext3D.h" + +namespace WebCore { + +TexShader::TexShader(GraphicsContext3D* context, unsigned program) + : Shader(context, program) +{ + m_matrixLocation = context->getUniformLocation(program, "matrix"); + m_texMatrixLocation = context->getUniformLocation(program, "texMatrix"); + m_alphaLocation = context->getUniformLocation(program, "alpha"); + m_positionLocation = context->getAttribLocation(program, "position"); + m_samplerLocation = context->getUniformLocation(program, "sampler"); +} + +PassOwnPtr<TexShader> TexShader::create(GraphicsContext3D* context) +{ + static const char* vertexShaderSource = + "uniform mat3 matrix;\n" + "uniform mat3 texMatrix;\n" + "attribute vec3 position;\n" + "varying vec3 texCoord;\n" + "void main() {\n" + " texCoord = texMatrix * position;\n" + " gl_Position = vec4(matrix * position, 1.0);\n" + "}\n"; + static const char* fragmentShaderSource = + "precision mediump float;\n" + "uniform sampler2D sampler;\n" + "uniform float alpha;\n" + "varying vec3 texCoord;\n" + "void main() {\n" + " gl_FragColor = texture2D(sampler, texCoord.xy)* vec4(alpha);\n" + "}\n"; + unsigned program = loadProgram(context, vertexShaderSource, fragmentShaderSource); + if (!program) + return 0; + return new TexShader(context, program); +} + +void TexShader::use(const AffineTransform& transform, const AffineTransform& texTransform, int sampler, float alpha) +{ + m_context->useProgram(m_program); + float matrix[9]; + affineTo3x3(transform, matrix); + m_context->uniformMatrix3fv(m_matrixLocation, false /*transpose*/, matrix, 1 /*count*/); + + float texMatrix[9]; + affineTo3x3(texTransform, texMatrix); + m_context->uniformMatrix3fv(m_texMatrixLocation, false /*transpose*/, texMatrix, 1 /*count*/); + + m_context->uniform1i(m_samplerLocation, sampler); + m_context->uniform1f(m_alphaLocation, alpha); + + m_context->vertexAttribPointer(m_positionLocation, 3, GraphicsContext3D::FLOAT, false, 0, 0); + + m_context->enableVertexAttribArray(m_positionLocation); + +} + +} diff --git a/WebCore/platform/graphics/gpu/TexShader.h b/WebCore/platform/graphics/gpu/TexShader.h new file mode 100644 index 0000000..535997d --- /dev/null +++ b/WebCore/platform/graphics/gpu/TexShader.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2010, Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef TexShader_h +#define TexShader_h + +#include "Shader.h" + +namespace WebCore { + +class TexShader : public Shader { +public: + static PassOwnPtr<TexShader> create(GraphicsContext3D* context); + void use(const AffineTransform& transform, const AffineTransform& texTransform, int sampler, float alpha); + +private: + TexShader(GraphicsContext3D* context, unsigned program); + + int m_matrixLocation; + int m_texMatrixLocation; + int m_samplerLocation; + int m_alphaLocation; + int m_positionLocation; +}; + +} + +#endif // TexShader_h diff --git a/WebCore/platform/graphics/chromium/GLES2Texture.cpp b/WebCore/platform/graphics/gpu/Texture.cpp index ae230db..557603c 100644 --- a/WebCore/platform/graphics/chromium/GLES2Texture.cpp +++ b/WebCore/platform/graphics/gpu/Texture.cpp @@ -30,9 +30,7 @@ #include "config.h" -#if USE(GLES2_RENDERING) - -#include "GLES2Texture.h" +#include "Texture.h" #include "GraphicsContext3D.h" #include "IntRect.h" @@ -41,7 +39,7 @@ namespace WebCore { -GLES2Texture::GLES2Texture(GraphicsContext3D* context, PassOwnPtr<Vector<unsigned int> > tileTextureIds, Format format, int width, int height, int maxTextureSize) +Texture::Texture(GraphicsContext3D* context, PassOwnPtr<Vector<unsigned int> > tileTextureIds, Format format, int width, int height, int maxTextureSize) : m_context(context) , m_format(format) , m_tiles(maxTextureSize, width, height, true) @@ -49,21 +47,21 @@ GLES2Texture::GLES2Texture(GraphicsContext3D* context, PassOwnPtr<Vector<unsigne { } -GLES2Texture::~GLES2Texture() +Texture::~Texture() { for (unsigned int i = 0; i < m_tileTextureIds->size(); i++) m_context->deleteTexture(m_tileTextureIds->at(i)); } -static void convertFormat(GraphicsContext3D* context, GLES2Texture::Format format, unsigned int* glFormat, unsigned int* glType, bool* swizzle) +static void convertFormat(GraphicsContext3D* context, Texture::Format format, unsigned int* glFormat, unsigned int* glType, bool* swizzle) { *swizzle = false; switch (format) { - case GLES2Texture::RGBA8: + case Texture::RGBA8: *glFormat = GraphicsContext3D::RGBA; *glType = GraphicsContext3D::UNSIGNED_BYTE; break; - case GLES2Texture::BGRA8: + case Texture::BGRA8: if (context->supportsBGRA()) { *glFormat = GraphicsContext3D::BGRA_EXT; *glType = GraphicsContext3D::UNSIGNED_BYTE; @@ -79,7 +77,7 @@ static void convertFormat(GraphicsContext3D* context, GLES2Texture::Format forma } } -PassRefPtr<GLES2Texture> GLES2Texture::create(GraphicsContext3D* context, Format format, int width, int height) +PassRefPtr<Texture> Texture::create(GraphicsContext3D* context, Format format, int width, int height) { int maxTextureSize = 0; context->getIntegerv(GraphicsContext3D::MAX_TEXTURE_SIZE, &maxTextureSize); @@ -101,7 +99,8 @@ PassRefPtr<GLES2Texture> GLES2Texture::create(GraphicsContext3D* context, Format IntRect tileBoundsWithBorder = tiling.tileBoundsWithBorder(i); - unsigned int glFormat, glType; + unsigned int glFormat = 0; + unsigned int glType = 0; bool swizzle; convertFormat(context, format, &glFormat, &glType, &swizzle); context->bindTexture(GraphicsContext3D::TEXTURE_2D, textureId); @@ -110,7 +109,7 @@ PassRefPtr<GLES2Texture> GLES2Texture::create(GraphicsContext3D* context, Format tileBoundsWithBorder.height(), 0, glFormat, glType, 0); } - return adoptRef(new GLES2Texture(context, textureIds.leakPtr(), format, width, height, maxTextureSize)); + return adoptRef(new Texture(context, textureIds.leakPtr(), format, width, height, maxTextureSize)); } template <bool swizzle> @@ -135,10 +134,11 @@ static uint32_t* copySubRect(uint32_t* src, int srcX, int srcY, uint32_t* dst, i return dst; } -void GLES2Texture::load(void* pixels) +void Texture::load(void* pixels) { uint32_t* pixels32 = static_cast<uint32_t*>(pixels); - unsigned int glFormat, glType; + unsigned int glFormat = 0; + unsigned int glType = 0; bool swizzle; convertFormat(m_context, m_format, &glFormat, &glType, &swizzle); if (swizzle) { @@ -168,7 +168,7 @@ void GLES2Texture::load(void* pixels) } } -void GLES2Texture::bindTile(int tile) +void Texture::bindTile(int tile) { m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_tileTextureIds->at(tile)); m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MIN_FILTER, GraphicsContext3D::LINEAR); @@ -178,5 +178,3 @@ void GLES2Texture::bindTile(int tile) } } - -#endif diff --git a/WebCore/platform/graphics/chromium/GLES2Texture.h b/WebCore/platform/graphics/gpu/Texture.h index 43a4955..7e4a72b 100644 --- a/WebCore/platform/graphics/chromium/GLES2Texture.h +++ b/WebCore/platform/graphics/gpu/Texture.h @@ -28,10 +28,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef GLES2Texture_h -#define GLES2Texture_h - -#if USE(GLES2_RENDERING) +#ifndef Texture_h +#define Texture_h #include "RefCounted.h" #include "RefPtr.h" @@ -43,17 +41,17 @@ namespace WebCore { class GraphicsContext3D; -class GLES2Texture : public RefCounted<GLES2Texture> { +class Texture : public RefCounted<Texture> { public: - ~GLES2Texture(); + ~Texture(); enum Format { RGBA8, BGRA8 }; - static PassRefPtr<GLES2Texture> create(GraphicsContext3D*, Format, int width, int height); + static PassRefPtr<Texture> create(GraphicsContext3D*, Format, int width, int height); void bindTile(int tile); void load(void* pixels); Format format() const { return m_format; } const TilingData& tiles() const { return m_tiles; } private: - GLES2Texture(GraphicsContext3D*, PassOwnPtr<Vector<unsigned int> > tileTextureIds, Format format, int width, int height, int maxTextureSize); + Texture(GraphicsContext3D*, PassOwnPtr<Vector<unsigned int> > tileTextureIds, Format format, int width, int height, int maxTextureSize); GraphicsContext3D* m_context; Format m_format; TilingData m_tiles; @@ -62,6 +60,4 @@ private: } -#endif - -#endif // GLES2Texture_h +#endif // Texture_h diff --git a/WebCore/platform/graphics/chromium/TilingData.cpp b/WebCore/platform/graphics/gpu/TilingData.cpp index 4da242b..4da242b 100755..100644 --- a/WebCore/platform/graphics/chromium/TilingData.cpp +++ b/WebCore/platform/graphics/gpu/TilingData.cpp diff --git a/WebCore/platform/graphics/chromium/TilingData.h b/WebCore/platform/graphics/gpu/TilingData.h index f12e66e..f12e66e 100755..100644 --- a/WebCore/platform/graphics/chromium/TilingData.h +++ b/WebCore/platform/graphics/gpu/TilingData.h diff --git a/WebCore/platform/graphics/gstreamer/GStreamerGWorld.cpp b/WebCore/platform/graphics/gstreamer/GStreamerGWorld.cpp index 96a639b..e1efdd4 100644 --- a/WebCore/platform/graphics/gstreamer/GStreamerGWorld.cpp +++ b/WebCore/platform/graphics/gstreamer/GStreamerGWorld.cpp @@ -115,13 +115,17 @@ bool GStreamerGWorld::enterFullscreen() GstQuery* query = gst_query_new_segment(GST_FORMAT_TIME); gboolean queryResult = gst_element_query(m_pipeline, query); - // See https://bugzilla.gnome.org/show_bug.cgi?id=620490. #if GST_CHECK_VERSION(0, 10, 30) if (!queryResult) { gst_query_unref(query); gst_object_unref(GST_OBJECT(srcPad)); return true; } +#else + // GStreamer < 0.10.30 doesn't set the query result correctly, so + // just ignore it to avoid a compilation warning. + // See https://bugzilla.gnome.org/show_bug.cgi?id=620490. + (void) queryResult; #endif GstFormat format; diff --git a/WebCore/platform/graphics/gstreamer/ImageGStreamer.h b/WebCore/platform/graphics/gstreamer/ImageGStreamer.h index 3d6d74a..9288df9 100644 --- a/WebCore/platform/graphics/gstreamer/ImageGStreamer.h +++ b/WebCore/platform/graphics/gstreamer/ImageGStreamer.h @@ -51,7 +51,6 @@ class ImageGStreamer : public RefCounted<ImageGStreamer> { #if PLATFORM(CAIRO) ImageGStreamer(GstBuffer*&, IntSize, cairo_format_t&); - cairo_surface_t* m_surface; #endif #if PLATFORM(MAC) diff --git a/WebCore/platform/graphics/gstreamer/ImageGStreamerCairo.cpp b/WebCore/platform/graphics/gstreamer/ImageGStreamerCairo.cpp index 6f975a4..aeaee19 100644 --- a/WebCore/platform/graphics/gstreamer/ImageGStreamerCairo.cpp +++ b/WebCore/platform/graphics/gstreamer/ImageGStreamerCairo.cpp @@ -49,13 +49,12 @@ PassRefPtr<ImageGStreamer> ImageGStreamer::createImage(GstBuffer* buffer) ImageGStreamer::ImageGStreamer(GstBuffer*& buffer, IntSize size, cairo_format_t& cairoFormat) : m_image(0) - , m_surface(0) { - m_surface = cairo_image_surface_create_for_data(GST_BUFFER_DATA(buffer), cairoFormat, + cairo_surface_t* surface = cairo_image_surface_create_for_data(GST_BUFFER_DATA(buffer), cairoFormat, size.width(), size.height(), cairo_format_stride_for_width(cairoFormat, size.width())); - ASSERT(cairo_surface_status(m_surface) == CAIRO_STATUS_SUCCESS); - m_image = BitmapImage::create(m_surface); + ASSERT(cairo_surface_status(surface) == CAIRO_STATUS_SUCCESS); + m_image = BitmapImage::create(surface); } ImageGStreamer::~ImageGStreamer() @@ -64,9 +63,4 @@ ImageGStreamer::~ImageGStreamer() m_image.clear(); m_image = 0; - - if (m_surface && cairo_surface_get_reference_count(m_surface)) - cairo_surface_destroy(m_surface); - - m_surface = 0; } diff --git a/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp b/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp index d9d2d97..5628eb3 100644 --- a/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp +++ b/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp @@ -1239,6 +1239,7 @@ static HashSet<String> mimeTypeCache() for (GList* iterator = factories; iterator; iterator = iterator->next) { GstTypeFindFactory* factory = GST_TYPE_FIND_FACTORY(iterator->data); GstCaps* caps = gst_type_find_factory_get_caps(factory); + gchar** extensions; if (!caps) continue; @@ -1316,6 +1317,16 @@ static HashSet<String> mimeTypeCache() g_strfreev(mimetype); } + + // As a last resort try some special cases depending + // on the file extensions registered with the typefind + // factory. + if (!cached && (extensions = gst_type_find_factory_get_extensions(factory))) { + for (int index = 0; extensions[index]; index++) { + if (g_str_equal(extensions[index], "m4v")) + cache.add(String("video/x-m4v")); + } + } } } diff --git a/WebCore/platform/graphics/gstreamer/PlatformVideoWindow.h b/WebCore/platform/graphics/gstreamer/PlatformVideoWindow.h index 83dc5dd..8d99f05 100644 --- a/WebCore/platform/graphics/gstreamer/PlatformVideoWindow.h +++ b/WebCore/platform/graphics/gstreamer/PlatformVideoWindow.h @@ -22,14 +22,10 @@ #if ENABLE(VIDEO) +#include "Widget.h" #include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> -#if PLATFORM(GTK) -#include <gtk/gtk.h> -typedef GtkWidget PlatformWindowType; -#endif - namespace WebCore { class PlatformVideoWindow : public RefCounted<PlatformVideoWindow> { @@ -39,13 +35,13 @@ class PlatformVideoWindow : public RefCounted<PlatformVideoWindow> { PlatformVideoWindow(); ~PlatformVideoWindow(); - PlatformWindowType* window() const { return m_window; } - gulong videoWindowId() const { return m_videoWindowId; } + PlatformWidget window() const { return m_window; } + unsigned long videoWindowId() const { return m_videoWindowId; } private: - gulong m_videoWindowId; - PlatformWindowType* m_videoWindow; - PlatformWindowType* m_window; + unsigned long m_videoWindowId; + PlatformWidget m_videoWindow; + PlatformWidget m_window; }; } diff --git a/WebCore/platform/graphics/gstreamer/PlatformVideoWindowEfl.cpp b/WebCore/platform/graphics/gstreamer/PlatformVideoWindowEfl.cpp new file mode 100644 index 0000000..5c0e6ea --- /dev/null +++ b/WebCore/platform/graphics/gstreamer/PlatformVideoWindowEfl.cpp @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2010 Samsung Electronics + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include "config.h" +#include "PlatformVideoWindow.h" + +#include "NotImplemented.h" + +using namespace WebCore; + +PlatformVideoWindow::PlatformVideoWindow() +{ + notImplemented(); +} + +PlatformVideoWindow::~PlatformVideoWindow() +{ + notImplemented(); +} diff --git a/WebCore/platform/graphics/gstreamer/PlatformVideoWindowGtk.cpp b/WebCore/platform/graphics/gstreamer/PlatformVideoWindowGtk.cpp index 185f535..c5f835c 100644 --- a/WebCore/platform/graphics/gstreamer/PlatformVideoWindowGtk.cpp +++ b/WebCore/platform/graphics/gstreamer/PlatformVideoWindowGtk.cpp @@ -20,6 +20,7 @@ #include "config.h" #include "PlatformVideoWindow.h" +#include <gtk/gtk.h> #ifdef GDK_WINDOWING_X11 #include <gdk/gdkx.h> // for GDK_WINDOW_XID #endif diff --git a/WebCore/platform/graphics/gtk/CairoUtilities.h b/WebCore/platform/graphics/gtk/CairoUtilities.h index 89eb458..594abc0 100644 --- a/WebCore/platform/graphics/gtk/CairoUtilities.h +++ b/WebCore/platform/graphics/gtk/CairoUtilities.h @@ -26,8 +26,6 @@ #ifndef CairoUtilities_h #define CairoUtilities_h -typedef struct _cairo_surface cairo_surface_t; -typedef struct _GdkPixbuf GdkPixbuf; GdkPixbuf* cairoImageSurfaceToGdkPixbuf(cairo_surface_t* surface); #endif // CairoUtilities_h diff --git a/WebCore/platform/graphics/gtk/FontGtk.cpp b/WebCore/platform/graphics/gtk/FontGtk.cpp index 92f8816..489bad7 100644 --- a/WebCore/platform/graphics/gtk/FontGtk.cpp +++ b/WebCore/platform/graphics/gtk/FontGtk.cpp @@ -241,11 +241,11 @@ void Font::drawComplexText(GraphicsContext* context, const TextRun& run, const F float red, green, blue, alpha; // Text shadow, inspired by FontMac - FloatSize shadowSize; + FloatSize shadowOffset; float shadowBlur = 0; Color shadowColor; bool hasShadow = context->textDrawingMode() == cTextFill && - context->getShadow(shadowSize, shadowBlur, shadowColor); + context->getShadow(shadowOffset, shadowBlur, shadowColor); // TODO: Blur support if (hasShadow) { @@ -257,7 +257,7 @@ void Font::drawComplexText(GraphicsContext* context, const TextRun& run, const F shadowFillColor.getRGBA(red, green, blue, alpha); cairo_set_source_rgba(cr, red, green, blue, alpha); - cairo_translate(cr, shadowSize.width(), shadowSize.height()); + cairo_translate(cr, shadowOffset.width(), shadowOffset.height()); if (partialRegion) { gdk_cairo_region(cr, partialRegion); @@ -290,7 +290,7 @@ void Font::drawComplexText(GraphicsContext* context, const TextRun& run, const F // Re-enable the platform shadow we disabled earlier if (hasShadow) - context->setShadow(shadowSize, shadowBlur, shadowColor, DeviceColorSpace); + context->setShadow(shadowOffset, shadowBlur, shadowColor, DeviceColorSpace); // Pango sometimes leaves behind paths we don't want cairo_new_path(cr); diff --git a/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp b/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp index 6561c11..252abd7 100644 --- a/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp +++ b/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp @@ -248,7 +248,7 @@ void GraphicsContext::drawLineForText(const IntPoint& origin, int width, bool pr drawLine(origin, endPoint); } -void GraphicsContext::drawLineForMisspellingOrBadGrammar(const IntPoint&, int width, bool grammar) +void GraphicsContext::drawLineForTextChecking(const IntPoint&, int width, TextCheckingLineStyle) { if (paintingDisabled()) return; diff --git a/WebCore/platform/graphics/mac/FontMac.mm b/WebCore/platform/graphics/mac/FontMac.mm index db77402..33a930b 100644 --- a/WebCore/platform/graphics/mac/FontMac.mm +++ b/WebCore/platform/graphics/mac/FontMac.mm @@ -135,11 +135,11 @@ void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, cons CGContextSetFontSize(cgContext, platformData.m_size); - FloatSize shadowSize; + FloatSize shadowOffset; float shadowBlur; Color shadowColor; ColorSpace fillColorSpace = context->fillColorSpace(); - context->getShadow(shadowSize, shadowBlur, shadowColor); + context->getShadow(shadowOffset, shadowBlur, shadowColor); bool hasSimpleShadow = context->textDrawingMode() == cTextFill && shadowColor.isValid() && !shadowBlur && !platformData.isColorBitmapFont(); if (hasSimpleShadow) { @@ -148,10 +148,10 @@ void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, cons Color fillColor = context->fillColor(); Color shadowFillColor(shadowColor.red(), shadowColor.green(), shadowColor.blue(), shadowColor.alpha() * fillColor.alpha() / 255); context->setFillColor(shadowFillColor, fillColorSpace); - CGContextSetTextPosition(cgContext, point.x() + shadowSize.width(), point.y() + shadowSize.height()); + CGContextSetTextPosition(cgContext, point.x() + shadowOffset.width(), point.y() + shadowOffset.height()); showGlyphsWithAdvances(platformData, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs); if (font->syntheticBoldOffset()) { - CGContextSetTextPosition(cgContext, point.x() + shadowSize.width() + font->syntheticBoldOffset(), point.y() + shadowSize.height()); + CGContextSetTextPosition(cgContext, point.x() + shadowOffset.width() + font->syntheticBoldOffset(), point.y() + shadowOffset.height()); showGlyphsWithAdvances(platformData, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs); } context->setFillColor(fillColor, fillColorSpace); @@ -165,7 +165,7 @@ void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, cons } if (hasSimpleShadow) - context->setShadow(shadowSize, shadowBlur, shadowColor, fillColorSpace); + context->setShadow(shadowOffset, shadowBlur, shadowColor, fillColorSpace); if (originalShouldUseFontSmoothing != newShouldUseFontSmoothing) CGContextSetShouldSmoothFonts(cgContext, originalShouldUseFontSmoothing); diff --git a/WebCore/platform/graphics/mac/GraphicsContextMac.mm b/WebCore/platform/graphics/mac/GraphicsContextMac.mm index 5f111f6..f3301d8 100644 --- a/WebCore/platform/graphics/mac/GraphicsContextMac.mm +++ b/WebCore/platform/graphics/mac/GraphicsContextMac.mm @@ -119,7 +119,7 @@ static NSColor* createPatternColor(NSString* name, NSColor* defaultColor, bool& } // WebKit on Mac is a standard platform component, so it must use the standard platform artwork for underline. -void GraphicsContext::drawLineForMisspellingOrBadGrammar(const IntPoint& point, int width, bool grammar) +void GraphicsContext::drawLineForTextChecking(const IntPoint& point, int width, TextCheckingLineStyle style) { if (paintingDisabled()) return; @@ -127,23 +127,41 @@ void GraphicsContext::drawLineForMisspellingOrBadGrammar(const IntPoint& point, // These are the same for misspelling or bad grammar. int patternHeight = cMisspellingLineThickness; int patternWidth = cMisspellingLinePatternWidth; - + bool usingDot; NSColor *patternColor; - if (grammar) { - // Constants for grammar pattern color. - static bool usingDotForGrammar = false; - DEFINE_STATIC_LOCAL(RetainPtr<NSColor>, grammarPatternColor, (createPatternColor(@"GrammarDot", [NSColor greenColor], usingDotForGrammar))); - - usingDot = usingDotForGrammar; - patternColor = grammarPatternColor.get(); - } else { - // Constants for spelling pattern color. - static bool usingDotForSpelling = false; - DEFINE_STATIC_LOCAL(RetainPtr<NSColor>, spellingPatternColor, (createPatternColor(@"SpellingDot", [NSColor redColor], usingDotForSpelling))); - - usingDot = usingDotForSpelling; - patternColor = spellingPatternColor.get(); + switch (style) { + case TextCheckingSpellingLineStyle: + { + // Constants for spelling pattern color. + static bool usingDotForSpelling = false; + DEFINE_STATIC_LOCAL(RetainPtr<NSColor>, spellingPatternColor, (createPatternColor(@"SpellingDot", [NSColor redColor], usingDotForSpelling))); + usingDot = usingDotForSpelling; + patternColor = spellingPatternColor.get(); + break; + } + case TextCheckingGrammarLineStyle: + { + // Constants for grammar pattern color. + static bool usingDotForGrammar = false; + DEFINE_STATIC_LOCAL(RetainPtr<NSColor>, grammarPatternColor, (createPatternColor(@"GrammarDot", [NSColor greenColor], usingDotForGrammar))); + usingDot = usingDotForGrammar; + patternColor = grammarPatternColor.get(); + break; + } +#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) + case TextCheckingReplacementLineStyle: + { + // Constants for spelling pattern color. + static bool usingDotForSpelling = false; + DEFINE_STATIC_LOCAL(RetainPtr<NSColor>, spellingPatternColor, (createPatternColor(@"CorrectionDot", [NSColor blueColor], usingDotForSpelling))); + usingDot = usingDotForSpelling; + patternColor = spellingPatternColor.get(); + break; + } +#endif + default: + return; } // Make sure to draw only complete dots. diff --git a/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm b/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm index 435e56e..7b0e7af 100644 --- a/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm +++ b/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm @@ -82,6 +82,7 @@ SOFT_LINK_POINTER(QTKit, QTMediaTypeSound, NSString *) SOFT_LINK_POINTER(QTKit, QTMediaTypeText, NSString *) SOFT_LINK_POINTER(QTKit, QTMediaTypeVideo, NSString *) SOFT_LINK_POINTER(QTKit, QTMovieAskUnresolvedDataRefsAttribute, NSString *) +SOFT_LINK_POINTER(QTKit, QTMovieLoopsAttribute, NSString *) SOFT_LINK_POINTER(QTKit, QTMovieDataSizeAttribute, NSString *) SOFT_LINK_POINTER(QTKit, QTMovieDidEndNotification, NSString *) SOFT_LINK_POINTER(QTKit, QTMovieHasVideoAttribute, NSString *) @@ -118,6 +119,7 @@ SOFT_LINK_POINTER(QTKit, QTMovieApertureModeAttribute, NSString *) #define QTMediaTypeText getQTMediaTypeText() #define QTMediaTypeVideo getQTMediaTypeVideo() #define QTMovieAskUnresolvedDataRefsAttribute getQTMovieAskUnresolvedDataRefsAttribute() +#define QTMovieLoopsAttribute getQTMovieLoopsAttribute() #define QTMovieDataSizeAttribute getQTMovieDataSizeAttribute() #define QTMovieDidEndNotification getQTMovieDidEndNotification() #define QTMovieHasVideoAttribute getQTMovieHasVideoAttribute() @@ -153,6 +155,10 @@ enum { }; #endif +@interface FakeQTMovieView : NSObject +- (WebCoreMovieObserver *)delegate; +@end + using namespace WebCore; using namespace std; @@ -243,6 +249,7 @@ void MediaPlayerPrivate::createQTMovie(const String& url) [NSNumber numberWithBool:YES], QTMoviePreventExternalURLLinksAttribute, [NSNumber numberWithBool:YES], QTSecurityPolicyNoCrossSiteAttribute, [NSNumber numberWithBool:NO], QTMovieAskUnresolvedDataRefsAttribute, + [NSNumber numberWithBool:NO], QTMovieLoopsAttribute, #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) [NSNumber numberWithBool:YES], @"QTMovieOpenForPlaybackAttribute", #endif @@ -254,8 +261,41 @@ void MediaPlayerPrivate::createQTMovie(const String& url) createQTMovie(cocoaURL, movieAttributes); } +static void disableComponentsOnce() +{ + static bool sComponentsDisabled = false; + if (sComponentsDisabled) + return; + sComponentsDisabled = true; + + // eat/PDF and grip/PDF components must be disabled twice since they are registered twice + // with different flags. However, there is currently a bug in 64-bit QTKit (<rdar://problem/8378237>) + // which causes subsequent disable component requests of exactly the same type to be ignored if + // QTKitServer has not yet started. As a result, we must pass in exactly the flags we want to + // disable per component. As a failsafe, if in the future these flags change, we will disable the + // PDF components for a third time with a wildcard flags field: + uint32_t componentsToDisable[11][5] = { + {'eat ', 'TEXT', 'text', 0, 0}, + {'eat ', 'TXT ', 'text', 0, 0}, + {'eat ', 'utxt', 'text', 0, 0}, + {'eat ', 'TEXT', 'tx3g', 0, 0}, + {'eat ', 'PDF ', 'vide', 0x44802, 0}, + {'eat ', 'PDF ', 'vide', 0x45802, 0}, + {'eat ', 'PDF ', 'vide', 0, 0}, + {'grip', 'PDF ', 'appl', 0x844a00, 0}, + {'grip', 'PDF ', 'appl', 0x845a00, 0}, + {'grip', 'PDF ', 'appl', 0, 0}, + {'imdc', 'pdf ', 'appl', 0, 0}, + }; + + for (size_t i = 0; i < sizeof(componentsToDisable)/sizeof(componentsToDisable[0]); ++i) + wkQTMovieDisableComponent(componentsToDisable[i]); +} + void MediaPlayerPrivate::createQTMovie(NSURL *url, NSDictionary *movieAttributes) { + disableComponentsOnce(); + [[NSNotificationCenter defaultCenter] removeObserver:m_objcObserver.get()]; bool recreating = false; @@ -315,11 +355,12 @@ void MediaPlayerPrivate::createQTMovie(NSURL *url, NSDictionary *movieAttributes static void mainThreadSetNeedsDisplay(id self, SEL) { - id movieView = [self superview]; - ASSERT(!movieView || [movieView isKindOfClass:[QTMovieView class]]); - if (!movieView || ![movieView isKindOfClass:[QTMovieView class]]) + id view = [self superview]; + ASSERT(!view || [view isKindOfClass:[QTMovieView class]]); + if (!view || ![view isKindOfClass:[QTMovieView class]]) return; + FakeQTMovieView *movieView = static_cast<FakeQTMovieView *>(view); WebCoreMovieObserver* delegate = [movieView delegate]; ASSERT(!delegate || [delegate isKindOfClass:[WebCoreMovieObserver class]]); if (!delegate || ![delegate isKindOfClass:[WebCoreMovieObserver class]]) @@ -1382,6 +1423,7 @@ void MediaPlayerPrivate::disableUnsupportedTracks() allowedTrackTypes->add("sdsm"); // MPEG-4 scene description stream allowedTrackTypes->add("tmcd"); // timecode allowedTrackTypes->add("tc64"); // timcode-64 + allowedTrackTypes->add("tmet"); // timed metadata } NSArray *tracks = [m_qtMovie.get() tracks]; diff --git a/WebCore/platform/graphics/mac/SimpleFontDataMac.mm b/WebCore/platform/graphics/mac/SimpleFontDataMac.mm index 126ef2d..94fcc5e 100644 --- a/WebCore/platform/graphics/mac/SimpleFontDataMac.mm +++ b/WebCore/platform/graphics/mac/SimpleFontDataMac.mm @@ -101,11 +101,11 @@ static NSString *webFallbackFontFamily(void) } #if !ERROR_DISABLED -#ifdef __LP64__ +#if defined(__LP64__) || (!defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)) static NSString* pathFromFont(NSFont*) { - // FMGetATSFontRefFromFont is not available in 64-bit. As pathFromFont is only used for debugging - // purposes, returning nil is acceptable. + // FMGetATSFontRefFromFont is not available. As pathFromFont is only used for debugging purposes, + // returning nil is acceptable. return nil; } #else diff --git a/WebCore/platform/graphics/openvg/GraphicsContextOpenVG.cpp b/WebCore/platform/graphics/openvg/GraphicsContextOpenVG.cpp index 0faf3ce..37fd8ad 100644 --- a/WebCore/platform/graphics/openvg/GraphicsContextOpenVG.cpp +++ b/WebCore/platform/graphics/openvg/GraphicsContextOpenVG.cpp @@ -273,7 +273,7 @@ void GraphicsContext::drawLineForText(const IntPoint& origin, int width, bool pr UNUSED_PARAM(printing); } -void GraphicsContext::drawLineForMisspellingOrBadGrammar(const IntPoint& origin, int width, bool grammar) +void GraphicsContext::drawLineForTextChecking(const IntPoint& origin, int width, TextCheckingLineStyle style) { if (paintingDisabled()) return; @@ -281,7 +281,7 @@ void GraphicsContext::drawLineForMisspellingOrBadGrammar(const IntPoint& origin, notImplemented(); UNUSED_PARAM(origin); UNUSED_PARAM(width); - UNUSED_PARAM(grammar); + UNUSED_PARAM(style); } FloatRect GraphicsContext::roundToDevicePixels(const FloatRect& rect) diff --git a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp index 41c9759..c9c74dd 100644 --- a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp +++ b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp @@ -845,7 +845,7 @@ void GraphicsContext::drawLineForText(const IntPoint& origin, int width, bool) drawLine(origin, endPoint); } -void GraphicsContext::drawLineForMisspellingOrBadGrammar(const IntPoint&, int, bool) +void GraphicsContext::drawLineForTextChecking(const IntPoint&, int, TextCheckingLineStyle) { if (paintingDisabled()) return; @@ -889,7 +889,7 @@ void GraphicsContext::setPlatformShadow(const FloatSize& size, float blur, const if (m_common->state.shadowsIgnoreTransforms) { // Meaning that this graphics context is associated with a CanvasRenderingContext // We flip the height since CG and HTML5 Canvas have opposite Y axis - m_common->state.shadowSize = FloatSize(size.width(), -size.height()); + m_common->state.shadowOffset = FloatSize(size.width(), -size.height()); m_data->shadow = ContextShadow(color, blur, size.width(), -size.height()); } else { m_data->shadow = ContextShadow(color, blur, size.width(), size.height()); diff --git a/WebCore/platform/graphics/qt/ImageQt.cpp b/WebCore/platform/graphics/qt/ImageQt.cpp index e0ac574..c0cfae4 100644 --- a/WebCore/platform/graphics/qt/ImageQt.cpp +++ b/WebCore/platform/graphics/qt/ImageQt.cpp @@ -190,12 +190,12 @@ void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& dst, QPainter::CompositionMode lastCompositionMode = painter->compositionMode(); painter->setCompositionMode(compositionMode); - FloatSize shadowSize; + FloatSize shadowOffset; float shadowBlur; Color shadowColor; - if (ctxt->getShadow(shadowSize, shadowBlur, shadowColor)) { + if (ctxt->getShadow(shadowOffset, shadowBlur, shadowColor)) { FloatRect shadowImageRect(normalizedDst); - shadowImageRect.move(shadowSize.width(), shadowSize.height()); + shadowImageRect.move(shadowOffset.width(), shadowOffset.height()); QImage shadowImage(QSize(static_cast<int>(normalizedSrc.width()), static_cast<int>(normalizedSrc.height())), QImage::Format_ARGB32_Premultiplied); QPainter p(&shadowImage); diff --git a/WebCore/platform/graphics/qt/StillImageQt.cpp b/WebCore/platform/graphics/qt/StillImageQt.cpp index 9c6acab..3038356 100644 --- a/WebCore/platform/graphics/qt/StillImageQt.cpp +++ b/WebCore/platform/graphics/qt/StillImageQt.cpp @@ -76,12 +76,12 @@ void StillImage::draw(GraphicsContext* ctxt, const FloatRect& dst, ctxt->setCompositeOperation(op); - FloatSize shadowSize; + FloatSize shadowOffset; float shadowBlur; Color shadowColor; - if (ctxt->getShadow(shadowSize, shadowBlur, shadowColor)) { + if (ctxt->getShadow(shadowOffset, shadowBlur, shadowColor)) { FloatRect shadowImageRect(normalizedDst); - shadowImageRect.move(shadowSize.width(), shadowSize.height()); + shadowImageRect.move(shadowOffset.width(), shadowOffset.height()); QImage shadowImage(QSize(static_cast<int>(normalizedSrc.width()), static_cast<int>(normalizedSrc.height())), QImage::Format_ARGB32_Premultiplied); QPainter p(&shadowImage); diff --git a/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp b/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp index 61039f2..c503307 100644 --- a/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp +++ b/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp @@ -44,28 +44,40 @@ bool GraphicsContext3D::getImageData(Image* image, bool premultiplyAlpha, Vector<uint8_t>& outputVector) { - if (!image || !image->data()) + if (!image) return false; - ImageSource decoder(false); - decoder.setData(image->data(), true); - if (!decoder.frameCount() || !decoder.frameIsCompleteAtIndex(0)) - return false; - bool hasAlpha = decoder.frameHasAlphaAtIndex(0); - OwnPtr<NativeImageSkia> pixels(decoder.createFrameAtIndex(0)); - if (!pixels.get() || !pixels->isDataComplete() || !pixels->width() || !pixels->height()) - return false; - SkBitmap::Config skiaConfig = pixels->config(); - if (skiaConfig != SkBitmap::kARGB_8888_Config) + OwnPtr<NativeImageSkia> pixels; + NativeImageSkia* skiaImage = 0; + AlphaOp neededAlphaOp = kAlphaDoNothing; + if (image->data()) { + ImageSource decoder(false); + decoder.setData(image->data(), true); + if (!decoder.frameCount() || !decoder.frameIsCompleteAtIndex(0)) + return false; + bool hasAlpha = decoder.frameHasAlphaAtIndex(0); + pixels = decoder.createFrameAtIndex(0); + if (!pixels.get() || !pixels->isDataComplete() || !pixels->width() || !pixels->height()) + return false; + SkBitmap::Config skiaConfig = pixels->config(); + if (skiaConfig != SkBitmap::kARGB_8888_Config) + return false; + skiaImage = pixels.get(); + if (hasAlpha && premultiplyAlpha) + neededAlphaOp = kAlphaDoPremultiply; + } else { + // This is a special case for texImage2D with HTMLCanvasElement input. + skiaImage = image->nativeImageForCurrentFrame(); + if (!premultiplyAlpha) + neededAlphaOp = kAlphaDoUnmultiply; + } + if (!skiaImage) return false; - SkBitmap& skiaImageRef = *pixels; + SkBitmap& skiaImageRef = *skiaImage; SkAutoLockPixels lock(skiaImageRef); - ASSERT(pixels->rowBytes() == pixels->width() * 4); - outputVector.resize(pixels->rowBytes() * pixels->height()); - AlphaOp neededAlphaOp = kAlphaDoNothing; - if (hasAlpha && premultiplyAlpha) - neededAlphaOp = kAlphaDoPremultiply; - return packPixels(reinterpret_cast<const uint8_t*>(pixels->getPixels()), - kSourceFormatBGRA8, pixels->width(), pixels->height(), 0, + ASSERT(skiaImage->rowBytes() == skiaImage->width() * 4); + outputVector.resize(skiaImage->rowBytes() * skiaImage->height()); + return packPixels(reinterpret_cast<const uint8_t*>(skiaImage->getPixels()), + kSourceFormatBGRA8, skiaImage->width(), skiaImage->height(), 0, format, type, neededAlphaOp, outputVector.data()); } diff --git a/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp b/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp index 1b20e26..1c80d49 100644 --- a/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp +++ b/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp @@ -34,6 +34,7 @@ #include "AffineTransform.h" #include "Color.h" #include "FloatRect.h" +#include "GLES2Canvas.h" #include "Gradient.h" #include "GraphicsContextPlatformPrivate.h" #include "GraphicsContextPrivate.h" @@ -55,10 +56,6 @@ #include <wtf/MathExtras.h> #include <wtf/UnusedParam.h> -#if USE(GLES2_RENDERING) -#include "GLES2Canvas.h" -#endif - using namespace std; namespace WebCore { @@ -248,10 +245,8 @@ void GraphicsContext::savePlatformState() if (paintingDisabled()) return; -#if USE(GLES2_RENDERING) if (platformContext()->useGPU()) platformContext()->gpuCanvas()->save(); -#endif // Save our private State. platformContext()->save(); @@ -262,10 +257,8 @@ void GraphicsContext::restorePlatformState() if (paintingDisabled()) return; -#if USE(GLES2_RENDERING) if (platformContext()->useGPU()) platformContext()->gpuCanvas()->restore(); -#endif // Restore our private State. platformContext()->restore(); @@ -345,13 +338,11 @@ void GraphicsContext::clearRect(const FloatRect& rect) if (paintingDisabled()) return; -#if USE(GLES2_RENDERING) if (platformContext()->useGPU()) { platformContext()->prepareForHardwareDraw(); platformContext()->gpuCanvas()->clearRect(rect); return; } -#endif platformContext()->prepareForSoftwareDraw(); @@ -459,10 +450,8 @@ void GraphicsContext::concatCTM(const AffineTransform& affine) if (paintingDisabled()) return; -#if USE(GLES2_RENDERING) if (platformContext()->useGPU()) platformContext()->gpuCanvas()->concatCTM(affine); -#endif platformContext()->canvas()->concat(affine); } @@ -626,9 +615,7 @@ void GraphicsContext::drawLine(const IntPoint& point1, const IntPoint& point2) platformContext()->canvas()->drawPoints(SkCanvas::kLines_PointMode, 2, pts, paint); } -void GraphicsContext::drawLineForMisspellingOrBadGrammar(const IntPoint& pt, - int width, - bool grammar) +void GraphicsContext::drawLineForTextChecking(const IntPoint& pt, int width, TextCheckingLineStyle style) { if (paintingDisabled()) return; @@ -780,13 +767,11 @@ void GraphicsContext::fillRect(const FloatRect& rect) ClipRectToCanvas(*platformContext()->canvas(), r, &r); } -#if USE(GLES2_RENDERING) if (platformContext()->useGPU() && !m_common->state.fillPattern && !m_common->state.fillGradient && !platformContext()->getDrawLooper()) { platformContext()->prepareForHardwareDraw(); platformContext()->gpuCanvas()->fillRect(rect); return; } -#endif platformContext()->save(); @@ -804,13 +789,11 @@ void GraphicsContext::fillRect(const FloatRect& rect, const Color& color, ColorS if (paintingDisabled()) return; -#if USE(GLES2_RENDERING) if (platformContext()->useGPU() && !m_common->state.fillPattern && !m_common->state.fillGradient) { platformContext()->prepareForHardwareDraw(); platformContext()->gpuCanvas()->fillRect(rect, color, colorSpace); return; } -#endif platformContext()->prepareForSoftwareDraw(); @@ -932,10 +915,8 @@ void GraphicsContext::scale(const FloatSize& size) if (paintingDisabled()) return; -#if USE(GLES2_RENDERING) if (platformContext()->useGPU()) platformContext()->gpuCanvas()->scale(size); -#endif platformContext()->canvas()->scale(WebCoreFloatToSkScalar(size.width()), WebCoreFloatToSkScalar(size.height())); @@ -945,10 +926,10 @@ void GraphicsContext::setAlpha(float alpha) { if (paintingDisabled()) return; -#if USE(GLES2_RENDERING) + if (platformContext()->useGPU()) platformContext()->gpuCanvas()->setAlpha(alpha); -#endif + platformContext()->setAlpha(alpha); } @@ -956,10 +937,10 @@ void GraphicsContext::setCompositeOperation(CompositeOperator op) { if (paintingDisabled()) return; -#if USE(GLES2_RENDERING) + if (platformContext()->useGPU()) platformContext()->gpuCanvas()->setCompositeOperation(op); -#endif + platformContext()->setXfermodeMode(WebCoreCompositeToSkiaComposite(op)); } @@ -1046,10 +1027,9 @@ void GraphicsContext::setPlatformFillColor(const Color& color, ColorSpace colorS { if (paintingDisabled()) return; -#if USE(GLES2_RENDERING) + if (platformContext()->useGPU()) platformContext()->gpuCanvas()->setFillColor(color, colorSpace); -#endif platformContext()->setFillColor(color.rgb()); } @@ -1241,10 +1221,8 @@ void GraphicsContext::rotate(float angleInRadians) if (paintingDisabled()) return; -#if USE(GLES2_RENDERING) if (platformContext()->useGPU()) platformContext()->gpuCanvas()->rotate(angleInRadians); -#endif platformContext()->canvas()->rotate(WebCoreFloatToSkScalar( angleInRadians * (180.0f / 3.14159265f))); @@ -1255,10 +1233,8 @@ void GraphicsContext::translate(float w, float h) if (paintingDisabled()) return; -#if USE(GLES2_RENDERING) if (platformContext()->useGPU()) platformContext()->gpuCanvas()->translate(w, h); -#endif platformContext()->canvas()->translate(WebCoreFloatToSkScalar(w), WebCoreFloatToSkScalar(h)); @@ -1266,19 +1242,12 @@ void GraphicsContext::translate(float w, float h) void GraphicsContext::setGraphicsContext3D(GraphicsContext3D* context3D, const IntSize& size) { -#if USE(GLES2_RENDERING) platformContext()->setGraphicsContext3D(context3D, size); -#else - UNUSED_PARAM(context3D); - UNUSED_PARAM(size); -#endif } void GraphicsContext::syncSoftwareCanvas() { -#if USE(GLES2_RENDERING) platformContext()->syncSoftwareCanvas(); -#endif } } // namespace WebCore diff --git a/WebCore/platform/graphics/skia/ImageSkia.cpp b/WebCore/platform/graphics/skia/ImageSkia.cpp index 1ff87cc..aed289f 100644 --- a/WebCore/platform/graphics/skia/ImageSkia.cpp +++ b/WebCore/platform/graphics/skia/ImageSkia.cpp @@ -36,22 +36,20 @@ #include "ChromiumBridge.h" #include "FloatConversion.h" #include "FloatRect.h" +#include "GLES2Canvas.h" +#include "GLES2Context.h" #include "GraphicsContext.h" #include "Logging.h" #include "NativeImageSkia.h" #include "PlatformContextSkia.h" #include "PlatformString.h" -#include "SkiaUtils.h" +#include "SkPixelRef.h" #include "SkRect.h" #include "SkShader.h" +#include "SkiaUtils.h" #include "skia/ext/image_operations.h" #include "skia/ext/platform_canvas.h" -#if USE(GLES2_RENDERING) -#include "GLES2Canvas.h" -#include "GLES2Context.h" -#include "SkPixelRef.h" -#endif namespace WebCore { @@ -409,23 +407,21 @@ void Image::drawPattern(GraphicsContext* context, context->platformContext()->paintSkPaint(destRect, paint); } -#if USE(GLES2_RENDERING) static void drawBitmapGLES2(GraphicsContext* ctxt, NativeImageSkia* bitmap, const FloatRect& srcRect, const FloatRect& dstRect, ColorSpace styleColorSpace, CompositeOperator compositeOp) { ctxt->platformContext()->prepareForHardwareDraw(); GLES2Canvas* gpuCanvas = ctxt->platformContext()->gpuCanvas(); - GLES2Texture* texture = gpuCanvas->getTexture(bitmap); + Texture* texture = gpuCanvas->getTexture(bitmap); if (!texture) { ASSERT(bitmap->config() == SkBitmap::kARGB_8888_Config); ASSERT(bitmap->rowBytes() == bitmap->width() * 4); - texture = gpuCanvas->createTexture(bitmap, GLES2Texture::BGRA8, bitmap->width(), bitmap->height()); + texture = gpuCanvas->createTexture(bitmap, Texture::BGRA8, bitmap->width(), bitmap->height()); SkAutoLockPixels lock(*bitmap); ASSERT(bitmap->getPixels()); texture->load(bitmap->getPixels()); } gpuCanvas->drawTexturedRect(texture, srcRect, dstRect, styleColorSpace, compositeOp); } -#endif // ================================================ // BitmapImage Class @@ -472,12 +468,11 @@ void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& dstRect, if (normSrcRect.isEmpty() || normDstRect.isEmpty()) return; // Nothing to draw. -#if USE(GLES2_RENDERING) if (ctxt->platformContext()->useGPU()) { drawBitmapGLES2(ctxt, bm, normSrcRect, normDstRect, colorSpace, compositeOp); return; } -#endif + ctxt->platformContext()->prepareForSoftwareDraw(); paintSkBitmap(ctxt->platformContext(), @@ -501,12 +496,10 @@ void BitmapImageSingleFrameSkia::draw(GraphicsContext* ctxt, if (normSrcRect.isEmpty() || normDstRect.isEmpty()) return; // Nothing to draw. -#if USE(GLES2_RENDERING) if (ctxt->platformContext()->useGPU()) { drawBitmapGLES2(ctxt, &m_nativeImage, srcRect, dstRect, styleColorSpace, compositeOp); return; } -#endif ctxt->platformContext()->prepareForSoftwareDraw(); diff --git a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp index b9de0a2..3b1d015 100644 --- a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp +++ b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp @@ -34,11 +34,13 @@ #include "AffineTransform.h" #include "CanvasLayerChromium.h" +#include "GLES2Canvas.h" #include "GraphicsContext.h" +#include "GraphicsContext3D.h" #include "ImageBuffer.h" #include "NativeImageSkia.h" -#include "PlatformContextSkia.h" #include "SkiaUtils.h" +#include "Texture.h" #include "TilingData.h" #include "skia/ext/image_operations.h" @@ -46,14 +48,8 @@ #include "SkBitmap.h" #include "SkColorPriv.h" -#include "SkShader.h" #include "SkDashPathEffect.h" - -#if USE(GLES2_RENDERING) -#include "GraphicsContext3D.h" -#include "GLES2Canvas.h" -#include "GLES2Texture.h" -#endif +#include "SkShader.h" #include <wtf/MathExtras.h> #include <wtf/OwnArrayPtr.h> @@ -210,11 +206,9 @@ PlatformContextSkia::PlatformContextSkia(skia::PlatformCanvas* canvas) #if OS(WINDOWS) , m_drawingToImageBuffer(false) #endif -#if USE(GLES2_RENDERING) , m_useGPU(false) , m_gpuCanvas(0) , m_backingStoreState(None) -#endif { m_stateStack.append(State()); m_state = &m_stateStack.last(); @@ -222,7 +216,7 @@ PlatformContextSkia::PlatformContextSkia(skia::PlatformCanvas* canvas) PlatformContextSkia::~PlatformContextSkia() { -#if USE(GLES2_RENDERING) && USE(ACCELERATED_COMPOSITING) +#if USE(ACCELERATED_COMPOSITING) if (m_gpuCanvas) { CanvasLayerChromium* layer = static_cast<CanvasLayerChromium*>(m_gpuCanvas->context()->platformLayer()); layer->setPrepareTextureCallback(0); @@ -684,7 +678,6 @@ void PlatformContextSkia::applyAntiAliasedClipPaths(WTF::Vector<SkPath>& paths) m_canvas->restore(); } -#if USE(GLES2_RENDERING) #if USE(ACCELERATED_COMPOSITING) class PrepareTextureCallbackImpl : public CanvasLayerChromium::PrepareTextureCallback { public: @@ -793,7 +786,7 @@ void PlatformContextSkia::uploadSoftwareToHardware(CompositeOperator op) const SkAutoLockPixels lock(bitmap); GraphicsContext3D* context = m_gpuCanvas->context(); if (!m_uploadTexture || m_uploadTexture->tiles().totalSizeX() < bitmap.width() || m_uploadTexture->tiles().totalSizeY() < bitmap.height()) - m_uploadTexture = GLES2Texture::create(context, GLES2Texture::BGRA8, bitmap.width(), bitmap.height()); + m_uploadTexture = Texture::create(context, Texture::BGRA8, bitmap.width(), bitmap.height()); m_uploadTexture->load(bitmap.getPixels()); IntRect rect(0, 0, bitmap.width(), bitmap.height()); AffineTransform identity; @@ -823,5 +816,4 @@ void PlatformContextSkia::readbackHardwareToSoftware() const } } -#endif } // namespace WebCore diff --git a/WebCore/platform/graphics/skia/PlatformContextSkia.h b/WebCore/platform/graphics/skia/PlatformContextSkia.h index 6c84797..82edc16 100644 --- a/WebCore/platform/graphics/skia/PlatformContextSkia.h +++ b/WebCore/platform/graphics/skia/PlatformContextSkia.h @@ -35,22 +35,20 @@ #include "Noncopyable.h" #include "SkDashPathEffect.h" -#include "SkDrawLooper.h" #include "SkDeque.h" -#include "skia/ext/platform_canvas.h" +#include "SkDrawLooper.h" #include "SkPaint.h" #include "SkPath.h" +#include "skia/ext/platform_canvas.h" #include <wtf/Vector.h> namespace WebCore { -#if USE(GLES2_RENDERING) enum CompositeOperator; class GLES2Canvas; -class GLES2Texture; +class Texture; class GraphicsContext3D; -#endif // This class holds the platform-specific state for GraphicsContext. We put // most of our Skia wrappers on this class. In theory, a lot of this stuff could @@ -182,24 +180,16 @@ public: void setImageResamplingHint(const IntSize& srcSize, const FloatSize& dstSize); void clearImageResamplingHint(); bool hasImageResamplingHint() const; -#if USE(GLES2_RENDERING) bool useGPU() { return m_useGPU; } void setGraphicsContext3D(GraphicsContext3D*, const IntSize&); GLES2Canvas* gpuCanvas() const { return m_gpuCanvas.get(); } -#endif -#if USE(GLES2_RENDERING) // Call these before making a call that manipulates the underlying // skia::PlatformCanvas or WebCore::GLES2Canvas void prepareForSoftwareDraw() const; void prepareForHardwareDraw() const; // Call to force the skia::PlatformCanvas to contain all rendering results. void syncSoftwareCanvas() const; -#else - void prepareForSoftwareDraw() const {} - void prepareForHardwareDraw() const {} - void syncSoftwareCanvas() const {} -#endif private: #if OS(LINUX) || OS(WINDOWS) @@ -209,10 +199,8 @@ private: #endif void applyAntiAliasedClipPaths(WTF::Vector<SkPath>& paths); -#if USE(GLES2_RENDERING) void uploadSoftwareToHardware(CompositeOperator) const; void readbackHardwareToSoftware() const; -#endif // Defines drawing style. struct State; @@ -237,12 +225,10 @@ private: #if OS(WINDOWS) bool m_drawingToImageBuffer; #endif -#if USE(GLES2_RENDERING) bool m_useGPU; OwnPtr<GLES2Canvas> m_gpuCanvas; mutable enum { None, Software, Mixed, Hardware } m_backingStoreState; - mutable RefPtr<GLES2Texture> m_uploadTexture; -#endif + mutable RefPtr<Texture> m_uploadTexture; }; } diff --git a/WebCore/platform/graphics/skia/SkiaFontWin.cpp b/WebCore/platform/graphics/skia/SkiaFontWin.cpp index 44003bb..9edb775 100644 --- a/WebCore/platform/graphics/skia/SkiaFontWin.cpp +++ b/WebCore/platform/graphics/skia/SkiaFontWin.cpp @@ -222,11 +222,11 @@ void SkiaWinOutlineCache::removePathsForFont(HFONT hfont) bool windowsCanHandleDrawTextShadow(GraphicsContext *context) { - FloatSize shadowSize; + FloatSize shadowOffset; float shadowBlur; Color shadowColor; - bool hasShadow = context->getShadow(shadowSize, shadowBlur, shadowColor); + bool hasShadow = context->getShadow(shadowOffset, shadowBlur, shadowColor); return (hasShadow && (shadowBlur == 0) && (shadowColor.alpha() == 255) && (context->fillColor().alpha() == 255)); } diff --git a/WebCore/platform/graphics/win/FontCGWin.cpp b/WebCore/platform/graphics/win/FontCGWin.cpp index 34f9b07..c6437f2 100644 --- a/WebCore/platform/graphics/win/FontCGWin.cpp +++ b/WebCore/platform/graphics/win/FontCGWin.cpp @@ -140,11 +140,11 @@ static void drawGDIGlyphs(GraphicsContext* graphicsContext, const SimpleFontData drawIntoBitmap = fillColor.alpha() != 255 || graphicsContext->inTransparencyLayer(); if (!drawIntoBitmap) { - FloatSize size; + FloatSize offset; float blur; Color color; - graphicsContext->getShadow(size, blur, color); - drawIntoBitmap = !size.isEmpty() || blur; + graphicsContext->getShadow(offset, blur, color); + drawIntoBitmap = offset.width() || offset.height() || blur; } } @@ -349,10 +349,10 @@ void Font::drawGlyphs(GraphicsContext* graphicsContext, const SimpleFontData* fo CGContextSetFontSize(cgContext, platformData.size()); wkSetCGContextFontRenderingStyle(cgContext, font->isSystemFont(), false, font->platformData().useGDI()); - FloatSize shadowSize; + FloatSize shadowOffset; float shadowBlur; Color shadowColor; - graphicsContext->getShadow(shadowSize, shadowBlur, shadowColor); + graphicsContext->getShadow(shadowOffset, shadowBlur, shadowColor); bool hasSimpleShadow = graphicsContext->textDrawingMode() == cTextFill && shadowColor.isValid() && !shadowBlur; if (hasSimpleShadow) { @@ -361,10 +361,10 @@ void Font::drawGlyphs(GraphicsContext* graphicsContext, const SimpleFontData* fo Color fillColor = graphicsContext->fillColor(); Color shadowFillColor(shadowColor.red(), shadowColor.green(), shadowColor.blue(), shadowColor.alpha() * fillColor.alpha() / 255); graphicsContext->setFillColor(shadowFillColor, DeviceColorSpace); - CGContextSetTextPosition(cgContext, point.x() + translation.width() + shadowSize.width(), point.y() + translation.height() + shadowSize.height()); + CGContextSetTextPosition(cgContext, point.x() + translation.width() + shadowOffset.width(), point.y() + translation.height() + shadowOffset.height()); CGContextShowGlyphsWithAdvances(cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs); if (font->syntheticBoldOffset()) { - CGContextSetTextPosition(cgContext, point.x() + translation.width() + shadowSize.width() + font->syntheticBoldOffset(), point.y() + translation.height() + shadowSize.height()); + CGContextSetTextPosition(cgContext, point.x() + translation.width() + shadowOffset.width() + font->syntheticBoldOffset(), point.y() + translation.height() + shadowOffset.height()); CGContextShowGlyphsWithAdvances(cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs); } graphicsContext->setFillColor(fillColor, DeviceColorSpace); @@ -378,7 +378,7 @@ void Font::drawGlyphs(GraphicsContext* graphicsContext, const SimpleFontData* fo } if (hasSimpleShadow) - graphicsContext->setShadow(shadowSize, shadowBlur, shadowColor, DeviceColorSpace); + graphicsContext->setShadow(shadowOffset, shadowBlur, shadowColor, DeviceColorSpace); wkRestoreFontSmoothingStyle(cgContext, oldFontSmoothingStyle); } diff --git a/WebCore/platform/graphics/win/GraphicsContextCGWin.cpp b/WebCore/platform/graphics/win/GraphicsContextCGWin.cpp index 84c4ce0..7b65e96 100644 --- a/WebCore/platform/graphics/win/GraphicsContextCGWin.cpp +++ b/WebCore/platform/graphics/win/GraphicsContextCGWin.cpp @@ -176,11 +176,14 @@ static const Color& grammarPatternColor() { return grammarColor; } -void GraphicsContext::drawLineForMisspellingOrBadGrammar(const IntPoint& point, int width, bool grammar) +void GraphicsContext::drawLineForTextChecking(const IntPoint& point, int width, TextCheckingLineStyle style) { if (paintingDisabled()) return; + if (style != TextCheckingSpellingLineStyle && style != TextCheckingGrammarLineStyle) + return; + // These are the same for misspelling or bad grammar const int patternHeight = 3; // 3 rows ASSERT(cMisspellingLineThickness == patternHeight); @@ -201,7 +204,7 @@ void GraphicsContext::drawLineForMisspellingOrBadGrammar(const IntPoint& point, CGContextRef context = platformContext(); CGContextSaveGState(context); - const Color& patternColor = grammar ? grammarPatternColor() : spellingPatternColor(); + const Color& patternColor = style == TextCheckingGrammarLineStyle ? grammarPatternColor() : spellingPatternColor(); setCGStrokeColor(context, patternColor); wkSetPatternPhaseInUserSpace(context, point); diff --git a/WebCore/platform/graphics/win/QTMovie.cpp b/WebCore/platform/graphics/win/QTMovie.cpp index 032b446..cc1349a 100644 --- a/WebCore/platform/graphics/win/QTMovie.cpp +++ b/WebCore/platform/graphics/win/QTMovie.cpp @@ -240,6 +240,9 @@ void QTMoviePrivate::createMovieController() m_movieController = NewMovieController(m_movie, &bounds, flags); if (!m_movieController) return; + + // Disable automatic looping. + MCDoAction(m_movieController, mcActionSetLooping, 0); } void QTMoviePrivate::cacheMovieScale() diff --git a/WebCore/platform/graphics/wince/FontPlatformData.h b/WebCore/platform/graphics/wince/FontPlatformData.h index 0b973b8..4a174f0 100644 --- a/WebCore/platform/graphics/wince/FontPlatformData.h +++ b/WebCore/platform/graphics/wince/FontPlatformData.h @@ -26,9 +26,9 @@ #define FontPlatformData_h #include "FontDescription.h" -#include "StringImpl.h" #include <wtf/Forward.h> #include <wtf/Noncopyable.h> +#include <wtf/text/StringImpl.h> typedef struct tagTEXTMETRICW TEXTMETRIC; typedef struct tagLOGFONTW LOGFONT; diff --git a/WebCore/platform/graphics/wince/GraphicsContextWince.cpp b/WebCore/platform/graphics/wince/GraphicsContextWince.cpp index e4466c8..990a31d 100644 --- a/WebCore/platform/graphics/wince/GraphicsContextWince.cpp +++ b/WebCore/platform/graphics/wince/GraphicsContextWince.cpp @@ -1062,7 +1062,7 @@ void GraphicsContext::drawLineForText(const IntPoint& origin, int width, bool pr setStrokeStyle(oldStyle); } -void GraphicsContext::drawLineForMisspellingOrBadGrammar(const IntPoint&, int width, bool grammar) +void GraphicsContext::drawLineForTextChecking(const IntPoint&, int width, TextCheckingLineStyle style) { notImplemented(); } @@ -1260,15 +1260,15 @@ void GraphicsContext::fillRoundedRect(const IntRect& fillRect, const IntSize& to if (!m_data->m_dc) return; - FloatSize shadowSize; + FloatSize shadowOffset; float shadowBlur = 0; Color shadowColor; - getShadow(shadowSize, shadowBlur, shadowColor); + getShadow(shadowOffset, shadowBlur, shadowColor); IntRect dstRect = fillRect; - dstRect.move(stableRound(shadowSize.width()), stableRound(shadowSize.height())); + dstRect.move(stableRound(shadowOffset.width()), stableRound(shadowOffset.height())); dstRect.inflate(stableRound(shadowBlur)); dstRect = m_data->mapRect(dstRect); @@ -1548,11 +1548,6 @@ AffineTransform GraphicsContext::getCTM() const return m_data->m_transform; } -void GraphicsContext::clipToImageBuffer(const FloatRect&, const ImageBuffer*) -{ - notImplemented(); -} - void GraphicsContext::fillRect(const FloatRect& rect) { savePlatformState(); @@ -1687,17 +1682,17 @@ void GraphicsContext::drawText(const SimpleFontData* fontData, const GlyphBuffer return; } - FloatSize shadowSize; + FloatSize shadowOffset; float shadowBlur = 0; Color shadowColor; bool hasShadow = textDrawingMode() == cTextFill - && getShadow(shadowSize, shadowBlur, shadowColor) + && getShadow(shadowOffset, shadowBlur, shadowColor) && shadowColor.alpha(); COLORREF shadowRGBColor; FloatPoint trShadowPoint; if (hasShadow) { shadowRGBColor = RGB(shadowColor.red(), shadowColor.green(), shadowColor.blue()); - trShadowPoint = m_data->mapPoint(startPoint + shadowSize); + trShadowPoint = m_data->mapPoint(startPoint + shadowOffset); } HGDIOBJ hOldFont = SelectObject(m_data->m_dc, hFont); diff --git a/WebCore/platform/graphics/wince/ImageBufferWince.cpp b/WebCore/platform/graphics/wince/ImageBufferWince.cpp index 1a25f4f..10e502d 100644 --- a/WebCore/platform/graphics/wince/ImageBufferWince.cpp +++ b/WebCore/platform/graphics/wince/ImageBufferWince.cpp @@ -95,12 +95,33 @@ GraphicsContext* ImageBuffer::context() const return m_context.get(); } -Image* ImageBuffer::image() const +bool ImageBuffer::drawsUsingCopy() const { - if (!m_image) - m_image = adoptRef(new BufferedImage(&m_data)); + return true; +} + +PassRefPtr<Image> ImageBuffer::copyImage() const +{ + return adoptRef(new BufferedImage(&m_data)); +} + +void ImageBuffer::clip(GraphicsContext*, const FloatRect&) const +{ + notImplemented(); +} + +void ImageBuffer::draw(GraphicsContext* context, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect, + CompositeOperator op , bool useLowQualityScale) +{ + RefPtr<Image> imageCopy = copyImage(); + context->drawImage(imageCopy.get(), styleColorSpace, destRect, srcRect, op, useLowQualityScale); +} - return m_image.get(); +void ImageBuffer::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const AffineTransform& patternTransform, + const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect) +{ + RefPtr<Image> imageCopy = copyImage(); + imageCopy->drawPattern(context, srcRect, patternTransform, phase, styleColorSpace, op, destRect); } template <bool premultiplied> PassRefPtr<ImageData> diff --git a/WebCore/platform/graphics/wx/GraphicsContextWx.cpp b/WebCore/platform/graphics/wx/GraphicsContextWx.cpp index 2428e7e..a39404a 100644 --- a/WebCore/platform/graphics/wx/GraphicsContextWx.cpp +++ b/WebCore/platform/graphics/wx/GraphicsContextWx.cpp @@ -357,14 +357,18 @@ void GraphicsContext::drawLineForText(const IntPoint& origin, int width, bool pr m_data->context->DrawLine(origin.x(), origin.y(), endPoint.x(), endPoint.y()); } - -void GraphicsContext::drawLineForMisspellingOrBadGrammar(const IntPoint& origin, int width, bool grammar) +void GraphicsContext::drawLineForTextChecking(const IntPoint& origin, int width, TextCheckingLineStyle style) { - if (grammar) - m_data->context->SetPen(wxPen(*wxGREEN, 2, wxLONG_DASH)); - else + switch (style) { + case TextCheckingSpellingLineStyle: m_data->context->SetPen(wxPen(*wxRED, 2, wxLONG_DASH)); - + break; + case TextCheckingGrammarLineStyle: + m_data->context->SetPen(wxPen(*wxGREEN, 2, wxLONG_DASH)); + break; + default: + return; + } m_data->context->DrawLine(origin.x(), origin.y(), origin.x() + width, origin.y()); } diff --git a/WebCore/platform/gtk/ClipboardGtk.h b/WebCore/platform/gtk/ClipboardGtk.h index 8b8ee38..f0af318 100644 --- a/WebCore/platform/gtk/ClipboardGtk.h +++ b/WebCore/platform/gtk/ClipboardGtk.h @@ -31,8 +31,6 @@ #include "Clipboard.h" #include "DataObjectGtk.h" -typedef struct _GtkClipboard GtkClipboard; - namespace WebCore { class CachedImage; class Frame; diff --git a/WebCore/platform/gtk/DataObjectGtk.h b/WebCore/platform/gtk/DataObjectGtk.h index 6f7149c..e6095da 100644 --- a/WebCore/platform/gtk/DataObjectGtk.h +++ b/WebCore/platform/gtk/DataObjectGtk.h @@ -27,10 +27,6 @@ #include <wtf/text/CString.h> #include <wtf/text/StringHash.h> -typedef struct _GdkPixbuf GdkPixbuf; -typedef struct _GdkDragContext GdkDragContext; -typedef struct _GtkClipboard GtkClipboard; - namespace WebCore { class DataObjectGtk : public RefCounted<DataObjectGtk> { diff --git a/WebCore/platform/gtk/FileSystemGtk.cpp b/WebCore/platform/gtk/FileSystemGtk.cpp index 7ad2a39..6f3fa19 100644 --- a/WebCore/platform/gtk/FileSystemGtk.cpp +++ b/WebCore/platform/gtk/FileSystemGtk.cpp @@ -187,8 +187,7 @@ String pathGetFileName(const String& pathName) String directoryName(const String& path) { /* No null checking needed */ - GOwnPtr<char> tmpFilename(const_cast<char*>(fileSystemRepresentation(path).data())); - GOwnPtr<char> dirname(g_path_get_dirname(tmpFilename.get())); + GOwnPtr<char> dirname(g_path_get_dirname(fileSystemRepresentation(path).data())); return String::fromUTF8(dirname.get()); } diff --git a/WebCore/platform/gtk/GOwnPtrGtk.h b/WebCore/platform/gtk/GOwnPtrGtk.h index 8341661..c5d9cdc 100644 --- a/WebCore/platform/gtk/GOwnPtrGtk.h +++ b/WebCore/platform/gtk/GOwnPtrGtk.h @@ -22,9 +22,6 @@ #include "GOwnPtr.h" -typedef union _GdkEvent GdkEvent; -typedef struct _GtkIconInfo GtkIconInfo; - namespace WTF { template <> void freeOwnedGPtr<GdkEvent>(GdkEvent*); diff --git a/WebCore/platform/gtk/GRefPtrGtk.h b/WebCore/platform/gtk/GRefPtrGtk.h index ea1b089..5e6ab78 100644 --- a/WebCore/platform/gtk/GRefPtrGtk.h +++ b/WebCore/platform/gtk/GRefPtrGtk.h @@ -23,9 +23,6 @@ #include "GRefPtr.h" -typedef struct _GtkTargetList GtkTargetList; -typedef struct _GdkCursor GdkCursor; - namespace WTF { template <> GtkTargetList* refPlatformPtr(GtkTargetList* ptr); diff --git a/WebCore/platform/gtk/GtkVersioning.cpp b/WebCore/platform/gtk/GtkVersioning.c index e7734a8..7dd601e 100644 --- a/WebCore/platform/gtk/GtkVersioning.cpp +++ b/WebCore/platform/gtk/GtkVersioning.c @@ -1,5 +1,6 @@ /* * Copyright (C) 2010 Collabora Ltd. + * Copyright (C) 2010 Igalia, S.L. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -17,7 +18,6 @@ * Boston, MA 02110-1301, USA. */ -#include "config.h" #include "GtkVersioning.h" #include <gtk/gtk.h> @@ -48,3 +48,22 @@ void gtk_adjustment_configure(GtkAdjustment* adjustment, gdouble value, gdouble gtk_adjustment_value_changed(adjustment); } #endif + +GdkDevice *getDefaultGDKPointerDevice(GdkWindow* window) +{ +#ifndef GTK_API_VERSION_2 + GdkDeviceManager *manager = gdk_display_get_device_manager(gdk_drawable_get_display(window)); + return gdk_device_manager_get_client_pointer(manager); +#else + return gdk_device_get_core_pointer(); +#endif // GTK_API_VERSION_2 +} + +#if !GTK_CHECK_VERSION(2, 17, 3) +static void gdk_window_get_root_coords(GdkWindow* window, gint x, gint y, gint* rootX, gint* rootY) +{ + gdk_window_get_root_origin(window, rootX, rootY); + *rootX = *rootX + x; + *rootY = *rootY + y; +} +#endif diff --git a/WebCore/platform/gtk/GtkVersioning.h b/WebCore/platform/gtk/GtkVersioning.h index 34e6081..eac3cb5 100644 --- a/WebCore/platform/gtk/GtkVersioning.h +++ b/WebCore/platform/gtk/GtkVersioning.h @@ -1,5 +1,6 @@ /* * Copyright (C) 2010 Collabora Ltd. + * Copyright (C) 2010 Igalia, S.L. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -22,6 +23,8 @@ #include <gtk/gtk.h> +G_BEGIN_DECLS + // Macros to avoid deprecation checking churn #if !GTK_CHECK_VERSION(2, 21, 2) #define gdk_visual_get_depth(visual) (visual)->depth @@ -51,6 +54,10 @@ #define gtk_widget_set_allocation(widget, alloc) ((widget)->allocation = *(alloc)) #endif // GTK_CHECK_VERSION(2, 18, 0) +#if !GTK_CHECK_VERSION(2, 17, 3) +static void gdk_window_get_root_coords(GdkWindow* window, gint x, gint y, gint* rootX, gint* rootY); +#endif //GTK_CHECK_VERSION(2, 17, 3) + #if !GTK_CHECK_VERSION(2, 14, 0) #define gtk_widget_get_window(widget) (widget)->window #define gtk_adjustment_get_value(adj) (adj)->value @@ -67,4 +74,8 @@ void gtk_adjustment_configure(GtkAdjustment* adjustment, gdouble value, gdouble void gtk_adjustment_set_value(GtkAdjustment* adjusment, gdouble value); #endif // GTK_CHECK_VERSION(2, 14, 0) +GdkDevice* getDefaultGDKPointerDevice(GdkWindow* window); + +G_END_DECLS + #endif // GtkVersioning_h diff --git a/WebCore/platform/gtk/PasteboardHelper.h b/WebCore/platform/gtk/PasteboardHelper.h index 33be1a8..bb1b580 100644 --- a/WebCore/platform/gtk/PasteboardHelper.h +++ b/WebCore/platform/gtk/PasteboardHelper.h @@ -32,13 +32,6 @@ #include "Frame.h" -typedef struct _GtkClipboard GtkClipboard; -typedef struct _GtkTargetList GtkTargetList; -typedef struct _GtkWidget GtkWidget; -typedef struct _GtkSelectionData GtkSelectionData; -typedef struct _GdkDragContext GdkDragContext; -typedef struct _GdkAtom* GdkAtom; - namespace WebCore { class DataObjectGtk; diff --git a/WebCore/platform/gtk/PopupMenuGtk.h b/WebCore/platform/gtk/PopupMenuGtk.h index d63e6d9..8848e06 100644 --- a/WebCore/platform/gtk/PopupMenuGtk.h +++ b/WebCore/platform/gtk/PopupMenuGtk.h @@ -29,10 +29,6 @@ #include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> -typedef struct _GtkMenu GtkMenu; -typedef struct _GtkMenuItem GtkMenuItem; -typedef struct _GtkWidget GtkWidget; - namespace WebCore { class FrameView; diff --git a/WebCore/platform/gtk/RenderThemeGtk.cpp b/WebCore/platform/gtk/RenderThemeGtk.cpp index 5019f35..9329179 100644 --- a/WebCore/platform/gtk/RenderThemeGtk.cpp +++ b/WebCore/platform/gtk/RenderThemeGtk.cpp @@ -34,8 +34,11 @@ #include "HTMLNames.h" #include "MediaControlElements.h" #include "NotImplemented.h" +#include "PlatformMouseEvent.h" #include "RenderBox.h" #include "RenderObject.h" +#include "Scrollbar.h" +#include "TimeRanges.h" #include "UserAgentStyleSheets.h" #include "gtkdrawing.h" #include <gdk/gdk.h> @@ -281,55 +284,24 @@ static void adjustMozillaStyle(const RenderThemeGtk* theme, RenderStyle* style, style->setPaddingBottom(Length(ypadding + bottom, Fixed)); } -static void setMozillaState(const RenderTheme* theme, GtkThemeWidgetType type, RenderObject* o, GtkWidgetState* state) -{ - state->active = theme->isPressed(o); - state->focused = theme->isFocused(o); - state->inHover = theme->isHovered(o); - // FIXME: Disabled does not always give the correct appearance for ReadOnly - state->disabled = !theme->isEnabled(o) || theme->isReadOnlyControl(o); - state->isDefault = false; - state->canDefault = false; - - - // FIXME: The depressed value should probably apply for other theme parts too. - // It must be used for range thumbs, because otherwise when the thumb is pressed, - // the rendering is incorrect. - if (type == MOZ_GTK_SCALE_THUMB_HORIZONTAL || type == MOZ_GTK_SCALE_THUMB_VERTICAL) - state->depressed = theme->isPressed(o); - else - state->depressed = false; -} - -static bool paintMozillaGtkWidget(const RenderThemeGtk* theme, GtkThemeWidgetType type, RenderObject* o, const PaintInfo& i, const IntRect& rect) +bool RenderThemeGtk::paintMozillaGtkWidget(GtkThemeWidgetType type, GraphicsContext* context, const IntRect& rect, GtkWidgetState* widgetState, int flags, GtkTextDirection textDirection) { // Painting is disabled so just claim to have succeeded - if (i.context->paintingDisabled()) + if (context->paintingDisabled()) return false; - GtkWidgetState widgetState; - setMozillaState(theme, type, o, &widgetState); - - // We might want to make setting flags the caller's job at some point rather than doing it here. - int flags = 0; - if (type == MOZ_GTK_BUTTON) - flags = GTK_RELIEF_NORMAL; - else if (type == MOZ_GTK_CHECKBUTTON || type == MOZ_GTK_RADIOBUTTON) - flags = theme->isChecked(o); - - PlatformRefPtr<GdkDrawable> drawable(i.context->gdkDrawable()); + PlatformRefPtr<GdkDrawable> drawable(context->gdkDrawable()); GdkRectangle paintRect, clipRect; if (drawable) { - AffineTransform ctm = i.context->getCTM(); + AffineTransform ctm = context->getCTM(); IntPoint pos = ctm.mapPoint(rect.location()); paintRect = IntRect(pos.x(), pos.y(), rect.width(), rect.height()); // Intersect the cairo rectangle with the target widget region. This will // prevent the theme drawing code from drawing into regions that cairo will // clip anyway. - cairo_t* cr = i.context->platformContext(); double clipX1, clipX2, clipY1, clipY2; - cairo_clip_extents(cr, &clipX1, &clipY1, &clipX2, &clipY2); + cairo_clip_extents(context->platformContext(), &clipX1, &clipY1, &clipX2, &clipY2); IntPoint clipPos = ctm.mapPoint(IntPoint(clipX1, clipY1)); clipRect.width = clipX2 - clipX1; @@ -346,13 +318,13 @@ static bool paintMozillaGtkWidget(const RenderThemeGtk* theme, GtkThemeWidgetTyp paintRect = clipRect = IntRect(0, 0, rect.width(), rect.height()); } - moz_gtk_use_theme_parts(theme->partsForDrawable(drawable.get())); - bool success = moz_gtk_widget_paint(type, drawable.get(), &paintRect, &clipRect, &widgetState, flags, gtkTextDirection(o->style()->direction())) == MOZ_GTK_SUCCESS; + moz_gtk_use_theme_parts(partsForDrawable(drawable.get())); + bool success = moz_gtk_widget_paint(type, drawable.get(), &paintRect, &clipRect, widgetState, flags, textDirection) == MOZ_GTK_SUCCESS; // If the drawing was successful and we rendered onto a pixmap, copy the // results back to the original GraphicsContext. - if (success && !i.context->gdkDrawable()) { - cairo_t* cairoContext = i.context->platformContext(); + if (success && !context->gdkDrawable()) { + cairo_t* cairoContext = context->platformContext(); cairo_save(cairoContext); gdk_cairo_set_source_pixmap(cairoContext, drawable.get(), rect.x(), rect.y()); cairo_paint(cairoContext); @@ -362,6 +334,34 @@ static bool paintMozillaGtkWidget(const RenderThemeGtk* theme, GtkThemeWidgetTyp return !success; } +bool RenderThemeGtk::paintRenderObject(GtkThemeWidgetType type, RenderObject* renderObject, GraphicsContext* context, const IntRect& rect, int flags) +{ + // Painting is disabled so just claim to have succeeded + if (context->paintingDisabled()) + return false; + + GtkWidgetState widgetState; + widgetState.active = isPressed(renderObject); + widgetState.focused = isFocused(renderObject); + widgetState.inHover = isHovered(renderObject); + + // FIXME: Disabled does not always give the correct appearance for ReadOnly + widgetState.disabled = !isEnabled(renderObject) || isReadOnlyControl(renderObject); + widgetState.isDefault = false; + widgetState.canDefault = false; + + // FIXME: The depressed value should probably apply for other theme parts too. + // It must be used for range thumbs, because otherwise when the thumb is pressed, + // the rendering is incorrect. + if (type == MOZ_GTK_SCALE_THUMB_HORIZONTAL || type == MOZ_GTK_SCALE_THUMB_VERTICAL) + widgetState.depressed = isPressed(renderObject); + else + widgetState.depressed = false; + + GtkTextDirection textDirection = gtkTextDirection(renderObject->style()->direction()); + return paintMozillaGtkWidget(type, context, rect, &widgetState, flags, textDirection); +} + static void setButtonPadding(RenderStyle* style) { // FIXME: This looks incorrect. @@ -411,7 +411,7 @@ void RenderThemeGtk::setCheckboxSize(RenderStyle* style) const bool RenderThemeGtk::paintCheckbox(RenderObject* o, const PaintInfo& i, const IntRect& rect) { - return paintMozillaGtkWidget(this, MOZ_GTK_CHECKBUTTON, o, i, rect); + return paintRenderObject(MOZ_GTK_CHECKBUTTON, o, i.context, rect, isChecked(o)); } void RenderThemeGtk::setRadioSize(RenderStyle* style) const @@ -421,7 +421,7 @@ void RenderThemeGtk::setRadioSize(RenderStyle* style) const bool RenderThemeGtk::paintRadio(RenderObject* o, const PaintInfo& i, const IntRect& rect) { - return paintMozillaGtkWidget(this, MOZ_GTK_RADIOBUTTON, o, i, rect); + return paintRenderObject(MOZ_GTK_RADIOBUTTON, o, i.context, rect, isChecked(o)); } void RenderThemeGtk::adjustButtonStyle(CSSStyleSelector* selector, RenderStyle* style, WebCore::Element* e) const @@ -442,7 +442,7 @@ void RenderThemeGtk::adjustButtonStyle(CSSStyleSelector* selector, RenderStyle* bool RenderThemeGtk::paintButton(RenderObject* o, const PaintInfo& i, const IntRect& rect) { - return paintMozillaGtkWidget(this, MOZ_GTK_BUTTON, o, i, rect); + return paintRenderObject(MOZ_GTK_BUTTON, o, i.context, rect, GTK_RELIEF_NORMAL); } void RenderThemeGtk::adjustMenuListStyle(CSSStyleSelector* selector, RenderStyle* style, WebCore::Element* e) const @@ -456,7 +456,7 @@ void RenderThemeGtk::adjustMenuListStyle(CSSStyleSelector* selector, RenderStyle bool RenderThemeGtk::paintMenuList(RenderObject* o, const PaintInfo& i, const IntRect& rect) { - return paintMozillaGtkWidget(this, MOZ_GTK_DROPDOWN, o, i, rect); + return paintRenderObject(MOZ_GTK_DROPDOWN, o, i.context, rect); } void RenderThemeGtk::adjustTextFieldStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const @@ -470,7 +470,7 @@ void RenderThemeGtk::adjustTextFieldStyle(CSSStyleSelector* selector, RenderStyl bool RenderThemeGtk::paintTextField(RenderObject* o, const PaintInfo& i, const IntRect& rect) { - return paintMozillaGtkWidget(this, MOZ_GTK_ENTRY, o, i, rect); + return paintRenderObject(MOZ_GTK_ENTRY, o, i.context, rect); } bool RenderThemeGtk::paintTextArea(RenderObject* o, const PaintInfo& i, const IntRect& r) @@ -550,7 +550,7 @@ bool RenderThemeGtk::paintSliderTrack(RenderObject* object, const PaintInfo& inf if (part == SliderVerticalPart) gtkPart = MOZ_GTK_SCALE_VERTICAL; - return paintMozillaGtkWidget(this, gtkPart, object, info, rect); + return paintRenderObject(gtkPart, object, info.context, rect); } void RenderThemeGtk::adjustSliderTrackStyle(CSSStyleSelector*, RenderStyle* style, Element*) const @@ -567,7 +567,7 @@ bool RenderThemeGtk::paintSliderThumb(RenderObject* object, const PaintInfo& inf if (part == SliderThumbVerticalPart) gtkPart = MOZ_GTK_SCALE_THUMB_VERTICAL; - return paintMozillaGtkWidget(this, gtkPart, object, info, rect); + return paintRenderObject(gtkPart, object, info.context, rect); } void RenderThemeGtk::adjustSliderThumbStyle(CSSStyleSelector*, RenderStyle* style, Element*) const @@ -732,6 +732,11 @@ GtkWidget* RenderThemeGtk::gtkTreeView() const return m_gtkTreeView; } +GtkWidget* RenderThemeGtk::gtkScrollbar() +{ + return moz_gtk_get_scrollbar_widget(); +} + void RenderThemeGtk::platformColorsDidChange() { #if ENABLE(VIDEO) @@ -806,33 +811,48 @@ bool RenderThemeGtk::paintMediaSliderTrack(RenderObject* o, const PaintInfo& pai return false; // Draw the buffered ranges. This code is highly inspired from - // Chrome. - // FIXME: Draw multiple ranges if there are multiple buffered - // ranges. The current implementation of the player is always - // buffering a single range anyway. - IntRect bufferedRect = r; - bufferedRect.inflate(-style->borderLeftWidth()); - bufferedRect.setWidth((bufferedRect.width() * mediaElement->percentLoaded())); - - // Don't bother drawing an empty area. - if (bufferedRect.isEmpty()) - return false; - - IntPoint sliderTopLeft = bufferedRect.location(); - IntPoint sliderTopRight = sliderTopLeft; - sliderTopRight.move(0, bufferedRect.height()); - - RefPtr<Gradient> gradient = Gradient::create(sliderTopLeft, sliderTopRight); - Color startColor = m_panelColor; - gradient->addColorStop(0.0, startColor); - gradient->addColorStop(1.0, Color(startColor.red() / 2, startColor.green() / 2, startColor.blue() / 2, startColor.alpha())); + // Chrome for the gradient code. + float mediaDuration = mediaElement->duration(); + RefPtr<TimeRanges> timeRanges = mediaElement->buffered(); + IntRect trackRect = r; + int totalWidth = trackRect.width(); + trackRect.inflate(-style->borderLeftWidth()); context->save(); context->setStrokeStyle(NoStroke); - context->setFillGradient(gradient); - context->fillRect(bufferedRect); - context->restore(); + for (unsigned index = 0; index < timeRanges->length(); ++index) { + ExceptionCode ignoredException; + float start = timeRanges->start(index, ignoredException); + float end = timeRanges->end(index, ignoredException); + int width = ((end - start) * totalWidth) / mediaDuration; + IntRect rangeRect; + if (!index) { + rangeRect = trackRect; + rangeRect.setWidth(width); + } else { + rangeRect.setLocation(IntPoint((start * totalWidth) / mediaDuration, trackRect.y())); + rangeRect.setSize(IntSize(width, trackRect.height())); + } + + // Don't bother drawing empty range. + if (rangeRect.isEmpty()) + continue; + + IntPoint sliderTopLeft = rangeRect.location(); + IntPoint sliderTopRight = sliderTopLeft; + sliderTopRight.move(0, rangeRect.height()); + + RefPtr<Gradient> gradient = Gradient::create(sliderTopLeft, sliderTopRight); + Color startColor = m_panelColor; + gradient->addColorStop(0.0, startColor); + gradient->addColorStop(1.0, Color(startColor.red() / 2, startColor.green() / 2, startColor.blue() / 2, startColor.alpha())); + + context->setFillGradient(gradient); + context->fillRect(rangeRect); + } + + context->restore(); return false; } @@ -873,7 +893,7 @@ bool RenderThemeGtk::paintProgressBar(RenderObject* renderObject, const PaintInf if (!progressBarWidget) return true; - if (paintMozillaGtkWidget(this, MOZ_GTK_PROGRESSBAR, renderObject, paintInfo, rect)) + if (paintRenderObject(MOZ_GTK_PROGRESSBAR, renderObject, paintInfo.context, rect)) return true; IntRect chunkRect(rect); @@ -888,7 +908,7 @@ bool RenderThemeGtk::paintProgressBar(RenderObject* renderObject, const PaintInf else chunkRect.setX(chunkRect.x() + style->xthickness); - return paintMozillaGtkWidget(this, MOZ_GTK_PROGRESS_CHUNK, renderObject, paintInfo, chunkRect); + return paintRenderObject(MOZ_GTK_PROGRESS_CHUNK, renderObject, paintInfo.context, chunkRect); } #endif diff --git a/WebCore/platform/gtk/RenderThemeGtk.h b/WebCore/platform/gtk/RenderThemeGtk.h index b9c076d..4e24c97 100644 --- a/WebCore/platform/gtk/RenderThemeGtk.h +++ b/WebCore/platform/gtk/RenderThemeGtk.h @@ -29,21 +29,9 @@ #define RenderThemeGtk_h #include "GRefPtr.h" +#include "gtkdrawing.h" #include "RenderTheme.h" -typedef struct _GtkWidget GtkWidget; -typedef struct _GtkStyle GtkStyle; -typedef struct _GtkContainer GtkContainer; -#ifdef GTK_API_VERSION_2 -typedef struct _GdkRectangle GdkRectangle; -#else -typedef struct _cairo_rectangle_int cairo_rectangle_int_t; -typedef cairo_rectangle_int_t GdkRectangle; -#endif -typedef struct _GdkDrawable GdkDrawable; -typedef struct _GtkBorder GtkBorder; -typedef struct _GtkThemeParts GtkThemeParts; - namespace WebCore { class RenderThemeGtk : public RenderTheme { @@ -95,7 +83,9 @@ public: virtual String extraMediaControlsStyleSheet(); #endif - GtkThemeParts* partsForDrawable(GdkDrawable*) const; + bool paintMozillaGtkWidget(GtkThemeWidgetType, GraphicsContext*, const IntRect&, GtkWidgetState*, int flags, GtkTextDirection = GTK_TEXT_DIR_NONE); + + GtkWidget* gtkScrollbar(); protected: virtual bool paintCheckbox(RenderObject* o, const PaintInfo& i, const IntRect& r); @@ -167,6 +157,9 @@ private: */ GtkContainer* gtkContainer() const; + bool paintRenderObject(GtkThemeWidgetType, RenderObject*, GraphicsContext*, const IntRect& rect, int flags = 0); + GtkThemeParts* partsForDrawable(GdkDrawable*) const; + mutable GtkWidget* m_gtkWindow; mutable GtkContainer* m_gtkContainer; mutable GtkWidget* m_gtkButton; diff --git a/WebCore/platform/gtk/ScrollbarGtk.h b/WebCore/platform/gtk/ScrollbarGtk.h index e02bb50..1a078c9 100644 --- a/WebCore/platform/gtk/ScrollbarGtk.h +++ b/WebCore/platform/gtk/ScrollbarGtk.h @@ -29,8 +29,6 @@ #include "Scrollbar.h" #include <wtf/PassRefPtr.h> -typedef struct _GtkAdjustment GtkAdjustment; - namespace WebCore { class ScrollbarGtk : public Scrollbar { diff --git a/WebCore/platform/gtk/ScrollbarThemeGtk.cpp b/WebCore/platform/gtk/ScrollbarThemeGtk.cpp index fee2c70..b6efe54 100644 --- a/WebCore/platform/gtk/ScrollbarThemeGtk.cpp +++ b/WebCore/platform/gtk/ScrollbarThemeGtk.cpp @@ -26,30 +26,339 @@ #include "config.h" #include "ScrollbarThemeGtk.h" +#include "PlatformMouseEvent.h" +#include "RenderThemeGtk.h" +#include "ScrollView.h" +#include "Scrollbar.h" #include "gtkdrawing.h" #include <gtk/gtk.h> namespace WebCore { +static HashSet<Scrollbar*>* gScrollbars; +static void gtkStyleSetCallback(GtkWidget*, GtkStyle*, ScrollbarThemeGtk*); + ScrollbarTheme* ScrollbarTheme::nativeTheme() { static ScrollbarThemeGtk theme; return &theme; } +ScrollbarThemeGtk::ScrollbarThemeGtk() +{ + updateThemeProperties(); + g_signal_connect(static_cast<RenderThemeGtk*>(RenderTheme::defaultTheme().get())->gtkScrollbar(), + "style-set", G_CALLBACK(gtkStyleSetCallback), this); +} + ScrollbarThemeGtk::~ScrollbarThemeGtk() { } -int ScrollbarThemeGtk::scrollbarThickness(ScrollbarControlSize controlSize) +void ScrollbarThemeGtk::registerScrollbar(Scrollbar* scrollbar) +{ + if (!gScrollbars) + gScrollbars = new HashSet<Scrollbar*>; + gScrollbars->add(scrollbar); +} + +void ScrollbarThemeGtk::unregisterScrollbar(Scrollbar* scrollbar) +{ + gScrollbars->remove(scrollbar); + if (gScrollbars->isEmpty()) { + delete gScrollbars; + gScrollbars = 0; + } +} + +void ScrollbarThemeGtk::updateThemeProperties() +{ + MozGtkScrollbarMetrics metrics; + moz_gtk_get_scrollbar_metrics(&metrics); + + m_thumbFatness = metrics.slider_width; + m_troughBorderWidth = metrics.trough_border; + m_stepperSize = metrics.stepper_size; + m_stepperSpacing = metrics.stepper_spacing; + m_minThumbLength = metrics.min_slider_size; + m_troughUnderSteppers = metrics.trough_under_steppers; + + if (!gScrollbars) + return; + + // Update the thickness of every interior frame scrollbar widget. The + // platform-independent scrollbar them code isn't yet smart enough to get + // this information when it paints. + HashSet<Scrollbar*>::iterator end = gScrollbars->end(); + for (HashSet<Scrollbar*>::iterator it = gScrollbars->begin(); it != end; ++it) { + Scrollbar* scrollbar = (*it); + + // Top-level scrollbar i.e. scrollbars who have a parent ScrollView + // with no parent are native, and thus do not need to be resized. + if (!scrollbar->parent() || !scrollbar->parent()->parent()) + return; + + int thickness = scrollbarThickness(scrollbar->controlSize()); + if (scrollbar->orientation() == HorizontalScrollbar) + scrollbar->setFrameRect(IntRect(0, scrollbar->parent()->height() - thickness, scrollbar->width(), thickness)); + else + scrollbar->setFrameRect(IntRect(scrollbar->parent()->width() - thickness, 0, thickness, scrollbar->height())); + } +} + +static void gtkStyleSetCallback(GtkWidget* widget, GtkStyle* previous, ScrollbarThemeGtk* scrollbarTheme) +{ + scrollbarTheme->updateThemeProperties(); +} + +bool ScrollbarThemeGtk::hasThumb(Scrollbar* scrollbar) +{ + // This method is just called as a paint-time optimization to see if + // painting the thumb can be skipped. We don't have to be exact here. + return thumbLength(scrollbar) > 0; +} + +IntRect ScrollbarThemeGtk::backButtonRect(Scrollbar* scrollbar, ScrollbarPart part, bool) +{ + // We do not support multiple steppers per end yet. + if (part == BackButtonEndPart) + return IntRect(); + + IntSize size = buttonSize(scrollbar); + return IntRect(scrollbar->x() + m_troughBorderWidth, scrollbar->y() + m_troughBorderWidth, size.width(), size.height()); +} + +IntRect ScrollbarThemeGtk::forwardButtonRect(Scrollbar* scrollbar, ScrollbarPart part, bool) +{ + // We do not support multiple steppers per end yet. + if (part == ForwardButtonStartPart) + return IntRect(); + + IntSize size = buttonSize(scrollbar); + int x, y; + if (scrollbar->orientation() == HorizontalScrollbar) { + x = scrollbar->x() + scrollbar->width() - size.width() - m_troughBorderWidth; + y = scrollbar->y() + m_troughBorderWidth; + } else { + x = scrollbar->x() + m_troughBorderWidth; + y = scrollbar->y() + scrollbar->height() - size.height() - m_troughBorderWidth; + } + return IntRect(x, y, size.width(), size.height()); +} + +IntRect ScrollbarThemeGtk::trackRect(Scrollbar* scrollbar, bool) +{ + // The padding along the thumb movement axis (from outside to in) + // is the size of trough border plus the size of the stepper (button) + // plus the size of stepper spacing (the space between the stepper and + // the place where the thumb stops). There is often no stepper spacing. + int movementAxisPadding = m_troughBorderWidth + m_stepperSize + m_stepperSpacing; + + // The fatness of the scrollbar on the non-movement axis. + int thickness = scrollbarThickness(scrollbar->controlSize()); + + if (scrollbar->orientation() == HorizontalScrollbar) { + // Once the scrollbar becomes smaller than the natural size of the + // two buttons, the track disappears. + if (scrollbar->width() < 2 * thickness) + return IntRect(); + return IntRect(scrollbar->x() + movementAxisPadding, scrollbar->y(), scrollbar->width() - (2 * movementAxisPadding), thickness); + } + + if (scrollbar->height() < 2 * thickness) + return IntRect(); + return IntRect(scrollbar->x(), scrollbar->y() + movementAxisPadding, thickness, scrollbar->height() - (2 * movementAxisPadding)); +} + +void ScrollbarThemeGtk::paintTrackBackground(GraphicsContext* context, Scrollbar* scrollbar, const IntRect& rect) +{ + GtkWidgetState state; + state.focused = FALSE; + state.isDefault = FALSE; + state.canDefault = FALSE; + state.disabled = FALSE; + state.active = FALSE; + state.inHover = FALSE; + + // Paint the track background. If the trough-under-steppers property is true, this + // should be the full size of the scrollbar, but if is false, it should only be the + // track rect. + IntRect fullScrollbarRect = rect; + if (m_troughUnderSteppers) + fullScrollbarRect = IntRect(scrollbar->x(), scrollbar->y(), scrollbar->width(), scrollbar->height()); + + GtkThemeWidgetType type = scrollbar->orientation() == VerticalScrollbar ? MOZ_GTK_SCROLLBAR_TRACK_VERTICAL : MOZ_GTK_SCROLLBAR_TRACK_HORIZONTAL; + static_cast<RenderThemeGtk*>(RenderTheme::defaultTheme().get())->paintMozillaGtkWidget(type, context, fullScrollbarRect, &state, 0); +} + +void ScrollbarThemeGtk::paintScrollbarBackground(GraphicsContext* context, Scrollbar* scrollbar) +{ + GtkWidgetState state; + state.focused = FALSE; + state.isDefault = FALSE; + state.canDefault = FALSE; + state.disabled = FALSE; + state.active = TRUE; + state.inHover = FALSE; + + IntRect fullScrollbarRect = IntRect(scrollbar->x(), scrollbar->y(), scrollbar->width(), scrollbar->height()); + static_cast<RenderThemeGtk*>(RenderTheme::defaultTheme().get())->paintMozillaGtkWidget(MOZ_GTK_SCROLLED_WINDOW, context, fullScrollbarRect, &state, 0); +} + +void ScrollbarThemeGtk::paintThumb(GraphicsContext* context, Scrollbar* scrollbar, const IntRect& rect) +{ + GtkWidgetState state; + state.focused = FALSE; + state.isDefault = FALSE; + state.canDefault = FALSE; + state.disabled = FALSE; + state.active = scrollbar->pressedPart() == ThumbPart; + state.inHover = scrollbar->hoveredPart() == ThumbPart; + state.maxpos = scrollbar->maximum(); + state.curpos = scrollbar->currentPos(); + + GtkThemeWidgetType type = scrollbar->orientation() == VerticalScrollbar ? MOZ_GTK_SCROLLBAR_THUMB_VERTICAL : MOZ_GTK_SCROLLBAR_THUMB_HORIZONTAL; + static_cast<RenderThemeGtk*>(RenderTheme::defaultTheme().get())->paintMozillaGtkWidget(type, context, rect, &state, 0); +} + +IntRect ScrollbarThemeGtk::thumbRect(Scrollbar* scrollbar, const IntRect& unconstrainedTrackRect) +{ + IntRect trackRect = constrainTrackRectToTrackPieces(scrollbar, unconstrainedTrackRect); + int thumbPos = thumbPosition(scrollbar); + if (scrollbar->orientation() == HorizontalScrollbar) + return IntRect(trackRect.x() + thumbPos, trackRect.y() + (trackRect.height() - m_thumbFatness) / 2, thumbLength(scrollbar), m_thumbFatness); + + // VerticalScrollbar + return IntRect(trackRect.x() + (trackRect.width() - m_thumbFatness) / 2, trackRect.y() + thumbPos, m_thumbFatness, thumbLength(scrollbar)); +} + +bool ScrollbarThemeGtk::paint(Scrollbar* scrollbar, GraphicsContext* graphicsContext, const IntRect& damageRect) { - static int size; - if (!size) { - MozGtkScrollbarMetrics metrics; - moz_gtk_get_scrollbar_metrics(&metrics); - size = metrics.slider_width; + // Create the ScrollbarControlPartMask based on the damageRect + ScrollbarControlPartMask scrollMask = NoPart; + + IntRect backButtonStartPaintRect; + IntRect backButtonEndPaintRect; + IntRect forwardButtonStartPaintRect; + IntRect forwardButtonEndPaintRect; + if (hasButtons(scrollbar)) { + backButtonStartPaintRect = backButtonRect(scrollbar, BackButtonStartPart, true); + if (damageRect.intersects(backButtonStartPaintRect)) + scrollMask |= BackButtonStartPart; + backButtonEndPaintRect = backButtonRect(scrollbar, BackButtonEndPart, true); + if (damageRect.intersects(backButtonEndPaintRect)) + scrollMask |= BackButtonEndPart; + forwardButtonStartPaintRect = forwardButtonRect(scrollbar, ForwardButtonStartPart, true); + if (damageRect.intersects(forwardButtonStartPaintRect)) + scrollMask |= ForwardButtonStartPart; + forwardButtonEndPaintRect = forwardButtonRect(scrollbar, ForwardButtonEndPart, true); + if (damageRect.intersects(forwardButtonEndPaintRect)) + scrollMask |= ForwardButtonEndPart; + } + + IntRect trackPaintRect = trackRect(scrollbar, true); + if (damageRect.intersects(trackPaintRect)) + scrollMask |= TrackBGPart; + + if (m_troughUnderSteppers && (scrollMask & BackButtonStartPart + || scrollMask & BackButtonEndPart + || scrollMask & ForwardButtonStartPart + || scrollMask & ForwardButtonEndPart)) + scrollMask |= TrackBGPart; + + bool thumbPresent = hasThumb(scrollbar); + IntRect currentThumbRect; + if (thumbPresent) { + IntRect track = trackRect(scrollbar, false); + currentThumbRect = thumbRect(scrollbar, track); + if (damageRect.intersects(currentThumbRect)) + scrollMask |= ThumbPart; } - return size; + + // Paint the scrollbar background (only used by custom CSS scrollbars). + paintScrollbarBackground(graphicsContext, scrollbar); + + if (scrollMask & TrackBGPart) + paintTrackBackground(graphicsContext, scrollbar, trackPaintRect); + + // Paint the back and forward buttons. + if (scrollMask & BackButtonStartPart) + paintButton(graphicsContext, scrollbar, backButtonStartPaintRect, BackButtonStartPart); + if (scrollMask & BackButtonEndPart) + paintButton(graphicsContext, scrollbar, backButtonEndPaintRect, BackButtonEndPart); + if (scrollMask & ForwardButtonStartPart) + paintButton(graphicsContext, scrollbar, forwardButtonStartPaintRect, ForwardButtonStartPart); + if (scrollMask & ForwardButtonEndPart) + paintButton(graphicsContext, scrollbar, forwardButtonEndPaintRect, ForwardButtonEndPart); + + // Paint the thumb. + if (scrollMask & ThumbPart) + paintThumb(graphicsContext, scrollbar, currentThumbRect); + + return true; +} + +void ScrollbarThemeGtk::paintButton(GraphicsContext* context, Scrollbar* scrollbar, const IntRect& rect, ScrollbarPart part) +{ + int flags = 0; + if (scrollbar->orientation() == VerticalScrollbar) + flags |= MOZ_GTK_STEPPER_VERTICAL; + + if (part == ForwardButtonEndPart) { + flags |= MOZ_GTK_STEPPER_DOWN; + flags |= MOZ_GTK_STEPPER_BOTTOM; + } + + GtkWidgetState state; + state.focused = TRUE; + state.isDefault = TRUE; + state.canDefault = TRUE; + + if ((BackButtonStartPart == part && scrollbar->currentPos()) + || (ForwardButtonEndPart == part && scrollbar->currentPos() != scrollbar->maximum())) { + state.disabled = FALSE; + state.active = part == scrollbar->pressedPart(); + state.inHover = part == scrollbar->hoveredPart(); + } else { + state.disabled = TRUE; + state.active = FALSE; + state.inHover = FALSE; + } + + static_cast<RenderThemeGtk*>(RenderTheme::defaultTheme().get())->paintMozillaGtkWidget(MOZ_GTK_SCROLLBAR_BUTTON, context, rect, &state, flags); +} + +void ScrollbarThemeGtk::paintScrollCorner(ScrollView* view, GraphicsContext* context, const IntRect& cornerRect) +{ + // ScrollbarThemeComposite::paintScrollCorner incorrectly assumes that the + // ScrollView is a FrameView (see FramelessScrollView), so we cannot let + // that code run. For FrameView's this is correct since we don't do custom + // scrollbar corner rendering, which ScrollbarThemeComposite supports. + ScrollbarTheme::paintScrollCorner(view, context, cornerRect); +} + +bool ScrollbarThemeGtk::shouldCenterOnThumb(Scrollbar*, const PlatformMouseEvent& event) +{ + return (event.shiftKey() && event.button() == LeftButton) || (event.button() == MiddleButton); +} + +int ScrollbarThemeGtk::scrollbarThickness(ScrollbarControlSize) +{ + return m_thumbFatness + (m_troughBorderWidth * 2); +} + +IntSize ScrollbarThemeGtk::buttonSize(Scrollbar* scrollbar) +{ + if (scrollbar->orientation() == VerticalScrollbar) + return IntSize(m_thumbFatness, m_stepperSize); + + // HorizontalScrollbar + return IntSize(m_stepperSize, m_thumbFatness); +} + +int ScrollbarThemeGtk::minimumThumbLength(Scrollbar* scrollbar) +{ + return m_minThumbLength; } } diff --git a/WebCore/platform/gtk/ScrollbarThemeGtk.h b/WebCore/platform/gtk/ScrollbarThemeGtk.h index 618da35..eff2fee 100644 --- a/WebCore/platform/gtk/ScrollbarThemeGtk.h +++ b/WebCore/platform/gtk/ScrollbarThemeGtk.h @@ -26,20 +26,48 @@ #ifndef ScrollbarThemeGtk_h #define ScrollbarThemeGtk_h -#include "ScrollbarTheme.h" - -typedef struct _GtkWidget GtkWidget; -typedef struct _GtkStyle GtkStyle; -typedef struct _GtkContainer GtkContainer; -typedef struct _GtkBorder GtkBorder; +#include "ScrollbarThemeComposite.h" namespace WebCore { -class ScrollbarThemeGtk : public ScrollbarTheme { +class Scrollbar; + +class ScrollbarThemeGtk : public ScrollbarThemeComposite { public: + ScrollbarThemeGtk(); virtual ~ScrollbarThemeGtk(); - virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar); + virtual bool hasButtons(Scrollbar*) { return true; } + virtual bool hasThumb(Scrollbar*); + virtual IntRect backButtonRect(Scrollbar*, ScrollbarPart, bool); + virtual IntRect forwardButtonRect(Scrollbar*, ScrollbarPart, bool); + virtual IntRect trackRect(Scrollbar*, bool); + IntRect thumbRect(Scrollbar*, const IntRect& unconstrainedTrackRect); + bool paint(Scrollbar*, GraphicsContext*, const IntRect& damageRect); + void paintScrollbarBackground(GraphicsContext*, Scrollbar*); + void paintTrackBackground(GraphicsContext*, Scrollbar*, const IntRect&); + void paintThumb(GraphicsContext*, Scrollbar*, const IntRect&); + virtual void paintButton(GraphicsContext*, Scrollbar*, const IntRect&, ScrollbarPart); + virtual void paintScrollCorner(ScrollView*, GraphicsContext*, const IntRect&); + virtual bool shouldCenterOnThumb(Scrollbar*, const PlatformMouseEvent&); + virtual int scrollbarThickness(ScrollbarControlSize); + virtual IntSize buttonSize(Scrollbar*); + virtual int minimumThumbLength(Scrollbar*); + + // TODO: These are the default GTK+ values. At some point we should pull these from the theme itself. + virtual double initialAutoscrollTimerDelay() { return 0.20; } + virtual double autoscrollTimerDelay() { return 0.02; } + void updateThemeProperties(); + void registerScrollbar(Scrollbar*); + void unregisterScrollbar(Scrollbar*); + +protected: + int m_thumbFatness; + int m_troughBorderWidth; + int m_stepperSize; + int m_stepperSpacing; + int m_minThumbLength; + bool m_troughUnderSteppers; }; } diff --git a/WebCore/platform/gtk/gtk2drawing.c b/WebCore/platform/gtk/gtk2drawing.c index 349bde0..b33fb1f 100644 --- a/WebCore/platform/gtk/gtk2drawing.c +++ b/WebCore/platform/gtk/gtk2drawing.c @@ -46,10 +46,7 @@ #include <gdk/gdkprivate.h> #include "gtkdrawing.h" - -#include "Assertions.h" #include "GtkVersioning.h" - #include <math.h> #include <string.h> diff --git a/WebCore/platform/mac/PopupMenuMac.h b/WebCore/platform/mac/PopupMenuMac.h index e969fff..8e21913 100644 --- a/WebCore/platform/mac/PopupMenuMac.h +++ b/WebCore/platform/mac/PopupMenuMac.h @@ -26,7 +26,11 @@ #include <wtf/RefCounted.h> #include <wtf/RetainPtr.h> +#ifdef __OBJC__ +@class NSPopUpButtonCell; +#else class NSPopUpButtonCell; +#endif namespace WebCore { diff --git a/WebCore/platform/mac/PurgeableBufferMac.cpp b/WebCore/platform/mac/PurgeableBufferMac.cpp index ce00494..54de4ed 100644 --- a/WebCore/platform/mac/PurgeableBufferMac.cpp +++ b/WebCore/platform/mac/PurgeableBufferMac.cpp @@ -25,7 +25,7 @@ #include "config.h" -#ifndef BUILDING_ON_TIGER +#if ENABLE(PURGEABLE_MEMORY) #include "PurgeableBuffer.h" diff --git a/WebCore/platform/mac/WebCoreSystemInterface.h b/WebCore/platform/mac/WebCoreSystemInterface.h index 1f14311..0cc7fd5 100644 --- a/WebCore/platform/mac/WebCoreSystemInterface.h +++ b/WebCore/platform/mac/WebCoreSystemInterface.h @@ -121,6 +121,7 @@ extern BOOL (*wkMediaControllerThemeAvailable)(int themeStyle); extern void (*wkPopupMenu)(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*); extern unsigned (*wkQTIncludeOnlyModernMediaFileTypes)(void); extern int (*wkQTMovieDataRate)(QTMovie*); +extern void (*wkQTMovieDisableComponent)(uint32_t[5]); extern float (*wkQTMovieMaxTimeLoaded)(QTMovie*); extern NSString *(*wkQTMovieMaxTimeLoadedChangeNotification)(void); extern float (*wkQTMovieMaxTimeSeekable)(QTMovie*); diff --git a/WebCore/platform/mac/WebCoreSystemInterface.mm b/WebCore/platform/mac/WebCoreSystemInterface.mm index 2a06f15..309a8fb 100644 --- a/WebCore/platform/mac/WebCoreSystemInterface.mm +++ b/WebCore/platform/mac/WebCoreSystemInterface.mm @@ -56,6 +56,7 @@ void (*wkGetWheelEventDeltas)(NSEvent*, float* deltaX, float* deltaY, BOOL* cont void (*wkPopupMenu)(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*); unsigned (*wkQTIncludeOnlyModernMediaFileTypes)(void); int (*wkQTMovieDataRate)(QTMovie*); +void (*wkQTMovieDisableComponent)(uint32_t[5]); float (*wkQTMovieMaxTimeLoaded)(QTMovie*); NSString *(*wkQTMovieMaxTimeLoadedChangeNotification)(void); float (*wkQTMovieMaxTimeSeekable)(QTMovie*); diff --git a/WebCore/platform/network/BlobRegistryImpl.cpp b/WebCore/platform/network/BlobRegistryImpl.cpp index ee872e6..c5beb64 100644 --- a/WebCore/platform/network/BlobRegistryImpl.cpp +++ b/WebCore/platform/network/BlobRegistryImpl.cpp @@ -30,8 +30,11 @@ #include "config.h" +#if ENABLE(BLOB) + #include "BlobRegistryImpl.h" +#include "BlobResourceHandle.h" #include "ResourceError.h" #include "ResourceHandle.h" #include "ResourceLoader.h" @@ -60,22 +63,21 @@ bool BlobRegistryImpl::shouldLoadResource(const ResourceRequest& request) const return true; } -PassRefPtr<ResourceHandle> BlobRegistryImpl::createResourceHandle(const ResourceRequest& request, ResourceHandleClient*) +PassRefPtr<ResourceHandle> BlobRegistryImpl::createResourceHandle(const ResourceRequest& request, ResourceHandleClient* client) { if (!shouldLoadResource(request)) return 0; - // FIXME: To be implemented. - return 0; + return BlobResourceHandle::create(m_blobs.get(request.url().string()), request, client); } -bool BlobRegistryImpl::loadResourceSynchronously(const ResourceRequest& request, ResourceError&, ResourceResponse&, Vector<char>&) +bool BlobRegistryImpl::loadResourceSynchronously(const ResourceRequest& request, ResourceError& error, ResourceResponse& response, Vector<char>& data) { if (!shouldLoadResource(request)) return false; - // FIXME: To be implemented. - return false; + BlobResourceHandle::loadResourceSynchronously(m_blobs.get(request.url().string()), request, error, response, data); + return true; } void BlobRegistryImpl::appendStorageItems(BlobStorageData* blobStorageData, const BlobDataItemList& items) @@ -175,3 +177,5 @@ PassRefPtr<BlobStorageData> BlobRegistryImpl::getBlobDataFromURL(const KURL& url } } // namespace WebCore + +#endif // ENABLE(BLOB) diff --git a/WebCore/platform/network/BlobResourceHandle.cpp b/WebCore/platform/network/BlobResourceHandle.cpp index 63335f6..8767b55 100644 --- a/WebCore/platform/network/BlobResourceHandle.cpp +++ b/WebCore/platform/network/BlobResourceHandle.cpp @@ -159,7 +159,8 @@ BlobResourceHandle::BlobResourceHandle(PassRefPtr<BlobStorageData> blobData, con , m_fileOpened(false) { if (m_async) { - m_asyncStream = adoptRef(client->createAsyncFileStream(this)); + // We need to take a ref. + m_asyncStream = client->createAsyncFileStream(this); callOnMainThread(delayedStart, this); } else m_stream = FileStream::create(); diff --git a/WebCore/platform/network/BlobResourceHandle.h b/WebCore/platform/network/BlobResourceHandle.h index b2a0854..63e8578 100644 --- a/WebCore/platform/network/BlobResourceHandle.h +++ b/WebCore/platform/network/BlobResourceHandle.h @@ -42,11 +42,11 @@ namespace WebCore { class AsyncFileStream; -class BlobDataItem; class BlobStorageData; class FileStream; class ResourceHandleClient; class ResourceRequest; +struct BlobDataItem; class BlobResourceHandle : public FileStreamClient, public ResourceHandle { public: diff --git a/WebCore/platform/network/FormData.cpp b/WebCore/platform/network/FormData.cpp index 4f2b365..786f1b6 100644 --- a/WebCore/platform/network/FormData.cpp +++ b/WebCore/platform/network/FormData.cpp @@ -22,23 +22,21 @@ #include "FormData.h" -#include "BlobItem.h" +#include "BlobData.h" +#include "BlobURL.h" #include "Chrome.h" #include "ChromeClient.h" #include "Document.h" +#include "File.h" #include "FileSystem.h" #include "FormDataBuilder.h" +#include "FormDataList.h" #include "MIMETypeRegistry.h" #include "Page.h" #include "TextEncoding.h" namespace WebCore { -#if ENABLE(BLOB) -const long long FormDataElement::toEndOfFile = -1; -const double FormDataElement::doNotCheckFileChange = 0; -#endif - inline FormData::FormData() : m_identifier(0) , m_hasGeneratedFiles(false) @@ -99,17 +97,17 @@ PassRefPtr<FormData> FormData::create(const Vector<char>& vector) return result.release(); } -PassRefPtr<FormData> FormData::create(const BlobItemList& items, const TextEncoding& encoding) +PassRefPtr<FormData> FormData::create(const FormDataList& list, const TextEncoding& encoding) { RefPtr<FormData> result = create(); - result->appendKeyValuePairItems(items, encoding, false, 0); + result->appendKeyValuePairItems(list, encoding, false, 0); return result.release(); } -PassRefPtr<FormData> FormData::createMultiPart(const BlobItemList& items, const TextEncoding& encoding, Document* document) +PassRefPtr<FormData> FormData::createMultiPart(const FormDataList& list, const TextEncoding& encoding, Document* document) { RefPtr<FormData> result = create(); - result->appendKeyValuePairItems(items, encoding, true, document); + result->appendKeyValuePairItems(list, encoding, true, document); return result.release(); } @@ -162,44 +160,12 @@ void FormData::appendData(const void* data, size_t size) void FormData::appendFile(const String& filename, bool shouldGenerateFile) { #if ENABLE(BLOB) - m_elements.append(FormDataElement(filename, 0, FormDataElement::toEndOfFile, FormDataElement::doNotCheckFileChange, shouldGenerateFile)); + m_elements.append(FormDataElement(filename, 0, BlobDataItem::toEndOfFile, BlobDataItem::doNotCheckFileChange, shouldGenerateFile)); #else m_elements.append(FormDataElement(filename, shouldGenerateFile)); #endif } -void FormData::appendItems(const BlobItemList& items) -{ - for (BlobItemList::const_iterator iter(items.begin()); iter != items.end(); ++iter) - appendItem(iter->get(), false); -} - -void FormData::appendItem(const BlobItem* item, bool shouldGenerateFile) -{ - const DataBlobItem* dataItem = item->toDataBlobItem(); - if (dataItem) { - appendData(dataItem->data(), static_cast<size_t>(dataItem->size())); - return; - } - - const FileBlobItem* fileItem = item->toFileBlobItem(); - ASSERT(fileItem); - if (fileItem->path().isEmpty()) { - // If the path is empty do not add the item. - return; - } - -#if ENABLE(BLOB) - const FileRangeBlobItem* fileRangeItem = item->toFileRangeBlobItem(); - if (fileRangeItem) { - appendFileRange(fileItem->path(), fileRangeItem->start(), fileRangeItem->size(), fileRangeItem->snapshotModificationTime(), shouldGenerateFile); - return; - } -#endif - - appendFile(fileItem->path(), shouldGenerateFile); -} - #if ENABLE(BLOB) void FormData::appendFileRange(const String& filename, long long start, long long length, double expectedModificationTime, bool shouldGenerateFile) { @@ -212,80 +178,82 @@ void FormData::appendBlob(const KURL& blobURL) } #endif -void FormData::appendKeyValuePairItems(const BlobItemList& items, const TextEncoding& encoding, bool isMultiPartForm, Document* document) +void FormData::appendKeyValuePairItems(const FormDataList& list, const TextEncoding& encoding, bool isMultiPartForm, Document* document) { if (isMultiPartForm) m_boundary = FormDataBuilder::generateUniqueBoundaryString(); Vector<char> encodedData; + const Vector<FormDataList::Item>& items = list.items(); size_t formDataListSize = items.size(); ASSERT(!(formDataListSize % 2)); for (size_t i = 0; i < formDataListSize; i += 2) { - const StringBlobItem* key = items[i]->toStringBlobItem(); - const BlobItem* value = items[i + 1].get(); - ASSERT(key); + const FormDataList::Item& key = items[i]; + const FormDataList::Item& value = items[i + 1]; if (isMultiPartForm) { Vector<char> header; - FormDataBuilder::beginMultiPartHeader(header, m_boundary.data(), key->cstr()); + FormDataBuilder::beginMultiPartHeader(header, m_boundary.data(), key.data()); bool shouldGenerateFile = false; - // If the current type is FILE, then we also need to include the filename - const FileBlobItem* fileItem = value->toFileBlobItem(); - if (fileItem) { - const String& path = fileItem->path(); -#if ENABLE(DIRECTORY_UPLOAD) - String fileName = !fileItem->relativePath().isEmpty() ? fileItem->relativePath() : fileItem->name(); + // If the current type is blob, then we also need to include the filename + if (value.blob()) { + String name; + if (value.blob()->isFile()) { + // For file blob, use the filename (or relative path if it is present) as the name. + File* file = static_cast<File*>(value.blob()); +#if ENABLE(DIRECTORY_UPLOAD) + name = file->webkitRelativePath().isEmpty() ? file->name() : file->webkitRelativePath(); #else - String fileName = fileItem->name(); -#endif + name = file->name(); +#endif - // Let the application specify a filename if it's going to generate a replacement file for the upload. - if (!path.isEmpty()) { + // Let the application specify a filename if it's going to generate a replacement file for the upload. if (Page* page = document->page()) { String generatedFileName; - shouldGenerateFile = page->chrome()->client()->shouldReplaceWithGeneratedFileForUpload(path, generatedFileName); + shouldGenerateFile = page->chrome()->client()->shouldReplaceWithGeneratedFileForUpload(file->path(), generatedFileName); if (shouldGenerateFile) - fileName = generatedFileName; + name = generatedFileName; } + } else { + // For non-file blob, use the identifier part of the URL as the name. + name = "Blob" + BlobURL::getIdentifier(value.blob()->url()); + name = name.replace("-", ""); // For safety, remove '-' from the filename since some servers may not like it. } // We have to include the filename=".." part in the header, even if the filename is empty - FormDataBuilder::addFilenameToMultiPartHeader(header, encoding, fileName); + FormDataBuilder::addFilenameToMultiPartHeader(header, encoding, name); - // If the item is sliced from a file, do not add the content type. -#if ENABLE(BLOB) - if (!fileName.isEmpty() && !value->toFileRangeBlobItem()) { -#else - if (!fileName.isEmpty()) { -#endif - // FIXME: The MIMETypeRegistry function's name makes it sound like it takes a path, - // not just a basename. But filename is not the path. But note that it's not safe to - // just use path instead since in the generated-file case it will not reflect the - // MIME type of the generated file. - String mimeType = MIMETypeRegistry::getMIMETypeForPath(fileName); - if (!mimeType.isEmpty()) - FormDataBuilder::addContentTypeToMultiPartHeader(header, mimeType.latin1()); - } + // Add the content type if it is available. + if (value.blob()->type().isEmpty()) + FormDataBuilder::addContentTypeToMultiPartHeader(header, value.blob()->type().latin1()); } FormDataBuilder::finishMultiPartHeader(header); // Append body appendData(header.data(), header.size()); - appendItem(value, shouldGenerateFile); + if (value.blob()) { + if (value.blob()->isFile()) { + // Do not add the file if the path is empty. + if (!static_cast<File*>(value.blob())->path().isEmpty()) + appendFile(static_cast<File*>(value.blob())->path(), shouldGenerateFile); + } +#if ENABLE(BLOB) + else + appendBlob(value.blob()->url()); +#endif + } else + appendData(value.data().data(), value.data().length()); appendData("\r\n", 2); } else { // Omit the name "isindex" if it's the first form data element. // FIXME: Why is this a good rule? Is this obsolete now? - const StringBlobItem* stringValue = value->toStringBlobItem(); - if (!stringValue) - continue; - if (encodedData.isEmpty() && key->cstr() == "isindex") - FormDataBuilder::encodeStringAsFormData(encodedData, stringValue->cstr()); + if (encodedData.isEmpty() && key.data() == "isindex") + FormDataBuilder::encodeStringAsFormData(encodedData, value.data()); else - FormDataBuilder::addKeyValuePairAsFormData(encodedData, key->cstr(), stringValue->cstr()); + FormDataBuilder::addKeyValuePairAsFormData(encodedData, key.data(), value.data()); } } diff --git a/WebCore/platform/network/FormData.h b/WebCore/platform/network/FormData.h index d7faa89..22ceb25 100644 --- a/WebCore/platform/network/FormData.h +++ b/WebCore/platform/network/FormData.h @@ -28,10 +28,9 @@ namespace WebCore { -class BlobItem; class Document; +class FormDataList; class TextEncoding; -typedef Vector<RefPtr<BlobItem> > BlobItemList; class FormDataElement { public: @@ -62,11 +61,6 @@ public: #endif String m_generatedFilename; bool m_shouldGenerateFile; - -#if ENABLE(BLOB) - static const long long toEndOfFile; - static const double doNotCheckFileChange; -#endif }; inline bool operator==(const FormDataElement& a, const FormDataElement& b) @@ -101,15 +95,14 @@ public: static PassRefPtr<FormData> create(const void*, size_t); static PassRefPtr<FormData> create(const CString&); static PassRefPtr<FormData> create(const Vector<char>&); - static PassRefPtr<FormData> create(const BlobItemList&, const TextEncoding&); - static PassRefPtr<FormData> createMultiPart(const BlobItemList&, const TextEncoding&, Document*); + static PassRefPtr<FormData> create(const FormDataList&, const TextEncoding&); + static PassRefPtr<FormData> createMultiPart(const FormDataList&, const TextEncoding&, Document*); PassRefPtr<FormData> copy() const; PassRefPtr<FormData> deepCopy() const; ~FormData(); void appendData(const void* data, size_t); - void appendItems(const BlobItemList&); - void appendFile(const String& filename, bool shouldGenerateFile = false); + void appendFile(const String& filePath, bool shouldGenerateFile = false); #if ENABLE(BLOB) void appendFileRange(const String& filename, long long start, long long length, double expectedModificationTime, bool shouldGenerateFile = false); void appendBlob(const KURL& blobURL); @@ -137,8 +130,7 @@ private: FormData(); FormData(const FormData&); - void appendItem(const BlobItem*, bool shouldGenerateFile); - void appendKeyValuePairItems(const BlobItemList&, const TextEncoding&, bool isMultiPartForm, Document*); + void appendKeyValuePairItems(const FormDataList&, const TextEncoding&, bool isMultiPartForm, Document*); Vector<FormDataElement> m_elements; diff --git a/WebCore/platform/network/mac/FormDataStreamMac.mm b/WebCore/platform/network/mac/FormDataStreamMac.mm index c7bd2e7..ed98356 100644 --- a/WebCore/platform/network/mac/FormDataStreamMac.mm +++ b/WebCore/platform/network/mac/FormDataStreamMac.mm @@ -31,6 +31,7 @@ #import "config.h" #import "FormDataStreamMac.h" +#import "BlobRegistryImpl.h" #import "FileSystem.h" #import "FormData.h" #import "ResourceHandle.h" @@ -141,7 +142,7 @@ static void closeCurrentStream(FormStreamFields *form) CFRelease(form->currentStream); form->currentStream = NULL; #if ENABLE(BLOB) - form->currentStreamRangeLength = FormDataElement::toEndOfFile; + form->currentStreamRangeLength = BlobDataItem::toEndOfFile; #endif } if (form->currentData) { @@ -169,7 +170,7 @@ static bool advanceCurrentStream(FormStreamFields* form) } else { #if ENABLE(BLOB) // Check if the file has been changed or not if required. - if (nextInput.m_expectedFileModificationTime != FormDataElement::doNotCheckFileChange) { + if (nextInput.m_expectedFileModificationTime != BlobDataItem::doNotCheckFileChange) { time_t fileModificationTime; if (!getFileModificationTime(nextInput.m_filename, fileModificationTime) || fileModificationTime != static_cast<time_t>(nextInput.m_expectedFileModificationTime)) return false; @@ -225,7 +226,7 @@ static void* formCreate(CFReadStreamRef stream, void* context) FormStreamFields* newInfo = new FormStreamFields; newInfo->currentStream = NULL; #if ENABLE(BLOB) - newInfo->currentStreamRangeLength = FormDataElement::toEndOfFile; + newInfo->currentStreamRangeLength = BlobDataItem::toEndOfFile; #endif newInfo->currentData = 0; newInfo->formStream = stream; // Don't retain. That would create a reference cycle. @@ -273,7 +274,7 @@ static CFIndex formRead(CFReadStreamRef stream, UInt8* buffer, CFIndex bufferLen while (form->currentStream) { CFIndex bytesToRead = bufferLength; #if ENABLE(BLOB) - if (form->currentStreamRangeLength != FormDataElement::toEndOfFile && form->currentStreamRangeLength < bytesToRead) + if (form->currentStreamRangeLength != BlobDataItem::toEndOfFile && form->currentStreamRangeLength < bytesToRead) bytesToRead = static_cast<CFIndex>(form->currentStreamRangeLength); #endif CFIndex bytesRead = CFReadStreamRead(form->currentStream, buffer, bytesToRead); @@ -286,7 +287,7 @@ static CFIndex formRead(CFReadStreamRef stream, UInt8* buffer, CFIndex bufferLen *atEOF = FALSE; form->bytesSent += bytesRead; #if ENABLE(BLOB) - if (form->currentStreamRangeLength != FormDataElement::toEndOfFile) + if (form->currentStreamRangeLength != BlobDataItem::toEndOfFile) form->currentStreamRangeLength -= bytesRead; #endif @@ -394,6 +395,49 @@ void setHTTPBody(NSMutableURLRequest *request, PassRefPtr<FormData> formData) } } +#if ENABLE(BLOB) + // Check if there is a blob in the form data. + bool hasBlob = false; + for (size_t i = 0; i < count; ++i) { + const FormDataElement& element = formData->elements()[i]; + if (element.m_type == FormDataElement::encodedBlob) { + hasBlob = true; + break; + } + } + + // If yes, we have to resolve all the blob references and regenerate the form data with only data and file types. + if (hasBlob) { + RefPtr<FormData> newFormData = FormData::create(); + newFormData->setAlwaysStream(formData->alwaysStream()); + newFormData->setIdentifier(formData->identifier()); + for (size_t i = 0; i < count; ++i) { + const FormDataElement& element = formData->elements()[i]; + if (element.m_type == FormDataElement::data) + newFormData->appendData(element.m_data.data(), element.m_data.size()); + else if (element.m_type == FormDataElement::encodedFile) + newFormData->appendFile(element.m_filename, element.m_shouldGenerateFile); + else { + ASSERT(element.m_type == FormDataElement::encodedBlob); + RefPtr<BlobStorageData> blobData = static_cast<BlobRegistryImpl&>(blobRegistry()).getBlobDataFromURL(KURL(ParsedURLString, element.m_blobURL)); + if (blobData) { + for (size_t j = 0; j < blobData->items().size(); ++j) { + const BlobDataItem& blobItem = blobData->items()[j]; + if (blobItem.type == BlobDataItem::Data) { + newFormData->appendData(blobItem.data.data() + static_cast<int>(blobItem.offset), static_cast<int>(blobItem.length)); + } else { + ASSERT(blobItem.type == BlobDataItem::File); + newFormData->appendFileRange(blobItem.path, blobItem.offset, blobItem.length, blobItem.expectedModificationTime); + } + } + } + } + } + formData = newFormData; + count = formData->elements().size(); + } +#endif + // Precompute the content length so NSURLConnection doesn't use chunked mode. long long length = 0; for (size_t i = 0; i < count; ++i) { @@ -403,7 +447,7 @@ void setHTTPBody(NSMutableURLRequest *request, PassRefPtr<FormData> formData) else { #if ENABLE(BLOB) // If we're sending the file range, use the existing range length for now. We will detect if the file has been changed right before we read the file and abort the operation if necessary. - if (element.m_fileLength != FormDataElement::toEndOfFile) { + if (element.m_fileLength != BlobDataItem::toEndOfFile) { length += element.m_fileLength; continue; } diff --git a/WebCore/platform/qt/FileSystemQt.cpp b/WebCore/platform/qt/FileSystemQt.cpp index 96c2093..b384091 100644 --- a/WebCore/platform/qt/FileSystemQt.cpp +++ b/WebCore/platform/qt/FileSystemQt.cpp @@ -128,6 +128,33 @@ CString openTemporaryFile(const char* prefix, PlatformFileHandle& handle) return CString(); } +#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE) +PlatformFileHandle openFile(const String& path, FileOpenMode mode) +{ + QIODevice::OpenMode platformMode; + + if (mode == OpenForRead) + platformMode = QIODevice::ReadOnly; + else if (mode == OpenForWrite) + platformMode = (QIODevice::WriteOnly | QIODevice::Truncate); + else + return invalidPlatformFileHandle; + + QFile* file = new QFile(path); + if (file->open(platformMode)) + return file; + + return invalidPlatformFileHandle; +} + +int readFromFile(PlatformFileHandle handle, char* data, int length) +{ + if (handle && handle->exists() && handle->isReadable()) + return handle->read(data, length); + return 0; +} +#endif + void closeFile(PlatformFileHandle& handle) { if (handle) { diff --git a/WebCore/platform/qt/ScrollbarQt.cpp b/WebCore/platform/qt/ScrollbarQt.cpp index 70aa5db..85dc107 100644 --- a/WebCore/platform/qt/ScrollbarQt.cpp +++ b/WebCore/platform/qt/ScrollbarQt.cpp @@ -72,9 +72,7 @@ bool Scrollbar::contextMenu(const PlatformMouseEvent& event) const QPoint globalPos = QPoint(event.globalX(), event.globalY()); QAction* actionSelected = menu.exec(globalPos); - if (!actionSelected) - { /* Do nothing */ } - else if (actionSelected == actScrollHere) { + if (actionSelected == actScrollHere) { const QPoint pos = convertFromContainingWindow(event.pos()); moveThumb(horizontal ? pos.x() : pos.y()); } else if (actionSelected == actScrollTop) @@ -82,13 +80,13 @@ bool Scrollbar::contextMenu(const PlatformMouseEvent& event) else if (actionSelected == actScrollBottom) setValue(maximum()); else if (actionSelected == actPageUp) - scroll(horizontal ? ScrollLeft: ScrollUp, ScrollByPage, 1); + scroll(horizontal ? ScrollLeft: ScrollUp, ScrollByPage); else if (actionSelected == actPageDown) - scroll(horizontal ? ScrollRight : ScrollDown, ScrollByPage, 1); + scroll(horizontal ? ScrollRight : ScrollDown, ScrollByPage); else if (actionSelected == actScrollUp) - scroll(horizontal ? ScrollLeft : ScrollUp, ScrollByLine, 1); + scroll(horizontal ? ScrollLeft : ScrollUp, ScrollByLine); else if (actionSelected == actScrollDown) - scroll(horizontal ? ScrollRight : ScrollDown, ScrollByLine, 1); + scroll(horizontal ? ScrollRight : ScrollDown, ScrollByLine); #endif // QT_NO_CONTEXTMENU return true; } diff --git a/WebCore/platform/win/PasteboardWin.cpp b/WebCore/platform/win/PasteboardWin.cpp index 03ecd36..c065f04 100644 --- a/WebCore/platform/win/PasteboardWin.cpp +++ b/WebCore/platform/win/PasteboardWin.cpp @@ -230,14 +230,7 @@ void Pasteboard::writeImage(Node* node, const KURL&, const String&) HGDIOBJ oldSource = SelectObject(sourceDC, coreBitmap); image->getHBITMAP(coreBitmap); -#if !defined(NO_ALPHABLEND) - BLENDFUNCTION bf = {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA}; - AlphaBlend(compatibleDC, 0, 0, image->width(), image->height(), - sourceDC, 0, 0, image->width(), image->height(), bf); -#else - StretchBlt(compatibleDC, 0, 0, image->width(), image->height(), - sourceDC, 0, 0, image->width(), image->height(), SRCCOPY); -#endif + BitBlt(compatibleDC, 0, 0, image->width(), image->height(), sourceDC, 0, 0, SRCCOPY); SelectObject(sourceDC, oldSource); DeleteObject(coreBitmap); diff --git a/WebCore/platform/win/ScrollbarThemeWin.cpp b/WebCore/platform/win/ScrollbarThemeWin.cpp index 2ee3512..a8d374a 100644 --- a/WebCore/platform/win/ScrollbarThemeWin.cpp +++ b/WebCore/platform/win/ScrollbarThemeWin.cpp @@ -288,7 +288,10 @@ void ScrollbarThemeWin::paintButton(GraphicsContext* context, Scrollbar* scrollb (scrollbar->hoveredPart() == ForwardButtonEndPart && !start)) { if (scrollbar->pressedPart() == scrollbar->hoveredPart()) { xpState += TS_ACTIVE; - classicState |= DFCS_PUSHED | DFCS_FLAT; + classicState |= DFCS_PUSHED; +#if !OS(WINCE) + classicState |= DFCS_FLAT; +#endif } else xpState += TS_HOVER; } else { diff --git a/WebCore/platform/win/SoftLinking.h b/WebCore/platform/win/SoftLinking.h index a82fe35..b67cc81 100644 --- a/WebCore/platform/win/SoftLinking.h +++ b/WebCore/platform/win/SoftLinking.h @@ -39,6 +39,12 @@ return library; \ } +#if OS(WINCE) +#define SOFT_LINK_GETPROCADDRESS GetProcAddressA +#else +#define SOFT_LINK_GETPROCADDRESS GetProcAddress +#endif + #define SOFT_LINK_LIBRARY(lib) SOFT_LINK_LIBRARY_HELPER(lib, L".dll") #define SOFT_LINK_DEBUG_LIBRARY(lib) SOFT_LINK_LIBRARY_HELPER(lib, L"_debug.dll") @@ -48,7 +54,7 @@ \ static resultType callingConvention init##functionName parameterDeclarations \ { \ - softLink##functionName = reinterpret_cast<resultType (callingConvention*) parameterDeclarations>(GetProcAddress(library##Library(), #functionName)); \ + softLink##functionName = reinterpret_cast<resultType (callingConvention*) parameterDeclarations>(SOFT_LINK_GETPROCADDRESS(library##Library(), #functionName)); \ ASSERT(softLink##functionName); \ return softLink##functionName parameterNames; \ }\ @@ -69,7 +75,7 @@ return ptr; \ initialized = true; \ \ - ptr = reinterpret_cast<functionName##PtrType>(GetProcAddress(library##Library(), #functionName)); \ + ptr = reinterpret_cast<functionName##PtrType>(SOFT_LINK_GETPROCADDRESS(library##Library(), #functionName)); \ return ptr; \ }\ diff --git a/WebCore/platform/win/SystemInfo.cpp b/WebCore/platform/win/SystemInfo.cpp index f010769..f2fe62b 100644 --- a/WebCore/platform/win/SystemInfo.cpp +++ b/WebCore/platform/win/SystemInfo.cpp @@ -32,6 +32,9 @@ namespace WebCore { bool isRunningOnVistaOrLater() { +#if OS(WINCE) + return false; +#else static bool isVistaOrLater; static bool initialized; @@ -47,6 +50,7 @@ bool isRunningOnVistaOrLater() isVistaOrLater = vi.dwMajorVersion >= 6; return isVistaOrLater; +#endif } } // namespace WebCore diff --git a/WebCore/plugins/PluginDatabase.cpp b/WebCore/plugins/PluginDatabase.cpp index 88297ac..77c84eb 100644 --- a/WebCore/plugins/PluginDatabase.cpp +++ b/WebCore/plugins/PluginDatabase.cpp @@ -30,6 +30,9 @@ #include "Frame.h" #include "KURL.h" #include "PluginPackage.h" +#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE) +#include "FileSystem.h" +#endif #include <stdlib.h> #if PLATFORM(ANDROID) @@ -41,7 +44,22 @@ namespace WebCore { typedef HashMap<String, RefPtr<PluginPackage> > PluginPackageByNameMap; +#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE) +static const size_t maximumPersistentPluginMetadataCacheSize = 32768; + +static bool gPersistentPluginMetadataCacheIsEnabled; + +String& persistentPluginMetadataCachePath() +{ + DEFINE_STATIC_LOCAL(String, cachePath, ()); + return cachePath; +} +#endif + PluginDatabase::PluginDatabase() +#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE) + : m_persistentMetadataCacheIsLoaded(false) +#endif { } @@ -79,6 +97,10 @@ void PluginDatabase::addExtraPluginDirectory(const String& directory) bool PluginDatabase::refresh() { +#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE) + if (!m_persistentMetadataCacheIsLoaded) + loadPersistentMetadataCache(); +#endif bool pluginSetChanged = false; if (!m_plugins.isEmpty()) { @@ -131,6 +153,10 @@ bool PluginDatabase::refresh() if (!pluginSetChanged) return false; +#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE) + updatePersistentMetadataCache(); +#endif + m_registeredMIMETypes.clear(); // Register plug-in MIME types @@ -187,8 +213,13 @@ PluginPackage* PluginDatabase::pluginForMIMEType(const String& mimeType) if (!plugin->isEnabled()) continue; - if (plugin->mimeToDescriptions().contains(key)) + if (plugin->mimeToDescriptions().contains(key)) { +#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE) + if (!plugin->ensurePluginLoaded()) + continue; +#endif pluginChoices.append(plugin); + } } if (pluginChoices.isEmpty()) @@ -227,6 +258,10 @@ String PluginDatabase::MIMETypeForExtension(const String& extension) const if (preferredPlugin && PluginPackage::equal(*plugin, *preferredPlugin)) return mimeType; +#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE) + if (!plugin->ensurePluginLoaded()) + continue; +#endif pluginChoices.append(plugin); mimeTypeForPlugin.add(plugin, mimeType); foundMapping = true; @@ -320,6 +355,9 @@ void PluginDatabase::clear() m_pluginPathsWithTimes.clear(); m_registeredMIMETypes.clear(); m_preferredPlugins.clear(); +#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE) + m_persistentMetadataCacheIsLoaded = false; +#endif } #if (!OS(WINCE)) && (!OS(SYMBIAN)) && (!OS(WINDOWS) || !ENABLE(NETSCAPE_PLUGIN_API)) @@ -437,4 +475,200 @@ void PluginDatabase::getPluginPathsInDirectories(HashSet<String>& paths) const #endif // !OS(SYMBIAN) && !OS(WINDOWS) +#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE) + +static void fillBufferWithContentsOfFile(PlatformFileHandle file, Vector<char>& buffer) +{ + size_t bufferSize = 0; + size_t bufferCapacity = 1024; + buffer.resize(bufferCapacity); + + do { + bufferSize += readFromFile(file, buffer.data() + bufferSize, bufferCapacity - bufferSize); + if (bufferSize == bufferCapacity) { + if (bufferCapacity < maximumPersistentPluginMetadataCacheSize) { + bufferCapacity *= 2; + buffer.resize(bufferCapacity); + } else { + buffer.clear(); + return; + } + } else + break; + } while (true); + + buffer.shrink(bufferSize); +} + +static bool readUTF8String(String& resultString, char*& start, const char* end) +{ + if (start >= end) + return false; + + int len = strlen(start); + resultString = String::fromUTF8(start, len); + start += len + 1; + + return true; +} + +static bool readTime(time_t& resultTime, char*& start, const char* end) +{ + if (start + sizeof(time_t) >= end) + return false; + + resultTime = *reinterpret_cast<time_t*>(start); + start += sizeof(time_t); + + return true; +} + +static const char schemaVersion = '1'; +static const char persistentPluginMetadataCacheFilename[] = "PluginMetadataCache.bin"; + +void PluginDatabase::loadPersistentMetadataCache() +{ + if (!isPersistentMetadataCacheEnabled() || persistentMetadataCachePath().isEmpty()) + return; + + PlatformFileHandle file; + String absoluteCachePath = pathByAppendingComponent(persistentMetadataCachePath(), persistentPluginMetadataCacheFilename); + file = openFile(absoluteCachePath, OpenForRead); + + if (!isHandleValid(file)) + return; + + // Mark cache as loaded regardless of success or failure. If + // there's error in the cache, we won't try to load it anymore. + m_persistentMetadataCacheIsLoaded = true; + + Vector<char> fileContents; + fillBufferWithContentsOfFile(file, fileContents); + closeFile(file); + + if (fileContents.size() < 2 || fileContents.first() != schemaVersion || fileContents.last() != '\0') { + LOG_ERROR("Unable to read plugin metadata cache: corrupt schema"); + deleteFile(absoluteCachePath); + return; + } + + char* bufferPos = fileContents.data() + 1; + char* end = fileContents.data() + fileContents.size(); + + PluginSet cachedPlugins; + HashMap<String, time_t> cachedPluginPathsWithTimes; + HashMap<String, RefPtr<PluginPackage> > cachedPluginsByPath; + + while (bufferPos < end) { + String path; + time_t lastModified; + String name; + String desc; + String mimeDesc; + if (!(readUTF8String(path, bufferPos, end) + && readTime(lastModified, bufferPos, end) + && readUTF8String(name, bufferPos, end) + && readUTF8String(desc, bufferPos, end) + && readUTF8String(mimeDesc, bufferPos, end))) { + LOG_ERROR("Unable to read plugin metadata cache: corrupt data"); + deleteFile(absoluteCachePath); + return; + } + + // Skip metadata that points to plugins from directories that + // are not part of plugin directory list anymore. + String pluginDirectoryName = directoryName(path); + if (m_pluginDirectories.find(pluginDirectoryName) == WTF::notFound) + continue; + + RefPtr<PluginPackage> package = PluginPackage::createPackageFromCache(path, lastModified, name, desc, mimeDesc); + + if (package && cachedPlugins.add(package).second) { + cachedPluginPathsWithTimes.add(package->path(), package->lastModified()); + cachedPluginsByPath.add(package->path(), package); + } + } + + m_plugins.swap(cachedPlugins); + m_pluginsByPath.swap(cachedPluginsByPath); + m_pluginPathsWithTimes.swap(cachedPluginPathsWithTimes); +} + +static bool writeUTF8String(PlatformFileHandle file, const String& string) +{ + CString utf8String = string.utf8(); + int length = utf8String.length() + 1; + return writeToFile(file, utf8String.data(), length) == length; +} + +static bool writeTime(PlatformFileHandle file, const time_t& time) +{ + return writeToFile(file, reinterpret_cast<const char*>(&time), sizeof(time_t)) == sizeof(time_t); +} + +void PluginDatabase::updatePersistentMetadataCache() +{ + if (!isPersistentMetadataCacheEnabled() || persistentMetadataCachePath().isEmpty()) + return; + + makeAllDirectories(persistentMetadataCachePath()); + String absoluteCachePath = pathByAppendingComponent(persistentMetadataCachePath(), persistentPluginMetadataCacheFilename); + deleteFile(absoluteCachePath); + + if (m_plugins.isEmpty()) + return; + + PlatformFileHandle file; + file = openFile(absoluteCachePath, OpenForWrite); + + if (!isHandleValid(file)) { + LOG_ERROR("Unable to open plugin metadata cache for saving"); + return; + } + + char localSchemaVersion = schemaVersion; + if (writeToFile(file, &localSchemaVersion, 1) != 1) { + LOG_ERROR("Unable to write plugin metadata cache schema"); + closeFile(file); + deleteFile(absoluteCachePath); + return; + } + + PluginSet::const_iterator end = m_plugins.end(); + for (PluginSet::const_iterator it = m_plugins.begin(); it != end; ++it) { + if (!(writeUTF8String(file, (*it)->path()) + && writeTime(file, (*it)->lastModified()) + && writeUTF8String(file, (*it)->name()) + && writeUTF8String(file, (*it)->description()) + && writeUTF8String(file, (*it)->fullMIMEDescription()))) { + LOG_ERROR("Unable to write plugin metadata to cache"); + closeFile(file); + deleteFile(absoluteCachePath); + return; + } + } + + closeFile(file); +} + +bool PluginDatabase::isPersistentMetadataCacheEnabled() +{ + return gPersistentPluginMetadataCacheIsEnabled; +} + +void PluginDatabase::setPersistentMetadataCacheEnabled(bool isEnabled) +{ + gPersistentPluginMetadataCacheIsEnabled = isEnabled; +} + +String PluginDatabase::persistentMetadataCachePath() +{ + return WebCore::persistentPluginMetadataCachePath(); +} + +void PluginDatabase::setPersistentMetadataCachePath(const String& persistentMetadataCachePath) +{ + WebCore::persistentPluginMetadataCachePath() = persistentMetadataCachePath; +} +#endif } diff --git a/WebCore/plugins/PluginDatabase.h b/WebCore/plugins/PluginDatabase.h index 287857e..b1e1525 100644 --- a/WebCore/plugins/PluginDatabase.h +++ b/WebCore/plugins/PluginDatabase.h @@ -84,6 +84,12 @@ namespace WebCore { Vector<String> pluginDirectories() const { return m_pluginDirectories; } String MIMETypeForExtension(const String& extension) const; +#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE) + static bool isPersistentMetadataCacheEnabled(); + static void setPersistentMetadataCacheEnabled(bool isEnabled); + static String persistentMetadataCachePath(); + static void setPersistentMetadataCachePath(const String& persistentMetadataCachePath); +#endif private: void getPluginPathsInDirectories(HashSet<String>&) const; @@ -92,6 +98,10 @@ namespace WebCore { // Returns whether the plugin was actually added or not (it won't be added if it's a duplicate of an existing plugin). bool add(PassRefPtr<PluginPackage>); void remove(PluginPackage*); +#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE) + void loadPersistentMetadataCache(); + void updatePersistentMetadataCache(); +#endif Vector<String> m_pluginDirectories; HashSet<String> m_registeredMIMETypes; @@ -105,6 +115,9 @@ namespace WebCore { friend class ::android::WebSettings; #endif HashMap<String, RefPtr<PluginPackage> > m_preferredPlugins; +#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE) + bool m_persistentMetadataCacheIsLoaded; +#endif }; } // namespace WebCore diff --git a/WebCore/plugins/PluginPackage.cpp b/WebCore/plugins/PluginPackage.cpp index 48c44f0..168d45a 100644 --- a/WebCore/plugins/PluginPackage.cpp +++ b/WebCore/plugins/PluginPackage.cpp @@ -114,6 +114,9 @@ PluginPackage::PluginPackage(const String& path, const time_t& lastModified) , m_module(0) , m_lastModified(lastModified) , m_freeLibraryTimer(this, &PluginPackage::freeLibraryTimerFired) +#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE) + , m_infoIsFromCache(true) +#endif { m_fileName = pathGetFileName(m_path); m_parentDirectory = m_path.left(m_path.length() - m_fileName.length() - 1); @@ -168,6 +171,19 @@ PassRefPtr<PluginPackage> PluginPackage::createPackage(const String& path, const return package.release(); } +#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE) +PassRefPtr<PluginPackage> PluginPackage::createPackageFromCache(const String& path, const time_t& lastModified, const String& name, const String& description, const String& mimeDescription) +{ + RefPtr<PluginPackage> package = adoptRef(new PluginPackage(path, lastModified)); + package->m_name = name; + package->m_description = description; + package->determineModuleVersionFromDescription(); + package->setMIMEDescription(mimeDescription); + package->m_infoIsFromCache = true; + return package.release(); +} +#endif + #if defined(XP_UNIX) void PluginPackage::determineQuirks(const String& mimeType) { @@ -349,4 +365,20 @@ int PluginPackage::compareFileVersion(const PlatformModuleVersion& compareVersio return 0; } +#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE) +bool PluginPackage::ensurePluginLoaded() +{ + if (!m_infoIsFromCache) + return m_isLoaded; + + m_quirks = PluginQuirkSet(); + m_name = String(); + m_description = String(); + m_fullMIMEDescription = String(); + m_moduleVersion = 0; + + return fetchInfo(); +} +#endif + } diff --git a/WebCore/plugins/PluginPackage.h b/WebCore/plugins/PluginPackage.h index 92a9c52..f4d1dac 100644 --- a/WebCore/plugins/PluginPackage.h +++ b/WebCore/plugins/PluginPackage.h @@ -49,6 +49,9 @@ namespace WebCore { public: ~PluginPackage(); static PassRefPtr<PluginPackage> createPackage(const String& path, const time_t& lastModified); +#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE) + static PassRefPtr<PluginPackage> createPackageFromCache(const String& path, const time_t& lastModified, const String& name, const String& description, const String& mimeDescription); +#endif const String& name() const { return m_name; } const String& description() const { return m_description; } @@ -80,6 +83,11 @@ namespace WebCore { NPInterface* npInterface() const { return m_npInterface; } #endif // OS(SYMBIAN) +#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE) + bool ensurePluginLoaded(); + void setMIMEDescription(const String& mimeDescription); + String fullMIMEDescription() const { return m_fullMIMEDescription;} +#endif private: PluginPackage(const String& path, const time_t& lastModified); @@ -121,6 +129,10 @@ namespace WebCore { Timer<PluginPackage> m_freeLibraryTimer; PluginQuirkSet m_quirks; +#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE) + String m_fullMIMEDescription; + bool m_infoIsFromCache; +#endif }; struct PluginPackageHash { diff --git a/WebCore/plugins/PluginViewNone.cpp b/WebCore/plugins/PluginViewNone.cpp index ab8f620..9aeaf3b 100644 --- a/WebCore/plugins/PluginViewNone.cpp +++ b/WebCore/plugins/PluginViewNone.cpp @@ -141,7 +141,7 @@ void PluginView::handleFocusOutEvent() // ports using PluginView, but until then, if new functions like this are // added, please make sure they have the proper platform #ifs so that changes // do not break ports who compile both this file and PluginView.cpp. -#if PLATFORM(MAC) || PLATFORM(CHROMIUM) || PLATFORM(EFL) || (OS(WINCE) && !PLATFORM(QT)) || (PLATFORM(QT) && !OS(WINCE)) +#if PLATFORM(MAC) || PLATFORM(CHROMIUM) || PLATFORM(EFL) || (OS(WINCE) && !PLATFORM(QT)) || (PLATFORM(QT) && !OS(WINCE)) || PLATFORM(BREWMP) #if ENABLE(NETSCAPE_PLUGIN_API) void PluginView::keepAlive(NPP) { diff --git a/WebCore/plugins/gtk/PluginPackageGtk.cpp b/WebCore/plugins/gtk/PluginPackageGtk.cpp index 97553a1..d0218fb 100644 --- a/WebCore/plugins/gtk/PluginPackageGtk.cpp +++ b/WebCore/plugins/gtk/PluginPackageGtk.cpp @@ -113,9 +113,9 @@ bool PluginPackage::load() GOwnPtr<gchar> finalPath(g_strdup(m_path.utf8().data())); while (g_file_test(finalPath.get(), G_FILE_TEST_IS_SYMLINK)) { GOwnPtr<GFile> file(g_file_new_for_path(finalPath.get())); + GOwnPtr<GFile> dir(g_file_get_parent(file.get())); GOwnPtr<gchar> linkPath(g_file_read_link(finalPath.get(), 0)); - - GOwnPtr<GFile> resolvedFile(g_file_resolve_relative_path(file.get(), linkPath.get())); + GOwnPtr<GFile> resolvedFile(g_file_resolve_relative_path(dir.get(), linkPath.get())); finalPath.set(g_file_get_path(resolvedFile.get())); } diff --git a/WebCore/plugins/qt/PluginPackageQt.cpp b/WebCore/plugins/qt/PluginPackageQt.cpp index d92fffe..e7058c7 100644 --- a/WebCore/plugins/qt/PluginPackageQt.cpp +++ b/WebCore/plugins/qt/PluginPackageQt.cpp @@ -60,9 +60,19 @@ bool PluginPackage::fetchInfo() m_description = buf; determineModuleVersionFromDescription(); - String s = gm(); + String mimeDescription = gm(); + setMIMEDescription(mimeDescription); + m_infoIsFromCache = false; + + return true; +} + +void PluginPackage::setMIMEDescription(const String& mimeDescription) +{ + m_fullMIMEDescription = mimeDescription; + Vector<String> types; - s.split(UChar(';'), false, types); + mimeDescription.split(UChar(';'), false, types); for (unsigned i = 0; i < types.size(); ++i) { Vector<String> mime; types[i].split(UChar(':'), true, mime); @@ -76,8 +86,6 @@ bool PluginPackage::fetchInfo() m_mimeToDescriptions.add(mime[0], mime[2]); } } - - return true; } static NPError staticPluginQuirkRequiresGtkToolKit_NPN_GetValue(NPP instance, NPNVariable variable, void* value) @@ -187,4 +195,5 @@ uint16_t PluginPackage::NPVersion() const { return NP_VERSION_MINOR; } + } diff --git a/WebCore/plugins/qt/PluginViewQt.cpp b/WebCore/plugins/qt/PluginViewQt.cpp index 5c681b8..f60885d 100644 --- a/WebCore/plugins/qt/PluginViewQt.cpp +++ b/WebCore/plugins/qt/PluginViewQt.cpp @@ -154,6 +154,13 @@ void PluginView::setFocus(bool focused) } else { Widget::setFocus(focused); } + if (!m_isWindowed) { + XEvent npEvent; + initXEvent(&npEvent); + npEvent.type = (focused) ? 9 : 10; // ints as Qt unsets FocusIn and FocusOut + if (!dispatchNPEvent(npEvent)) + LOG(Events, "PluginView::setFocus(%d): Focus event not accepted", focused); + } } void PluginView::show() @@ -374,6 +381,17 @@ void setXKeyEventSpecificFields(XEvent* xEvent, KeyboardEvent* event) xEvent->xkey.time = event->timeStamp(); xEvent->xkey.state = qKeyEvent->nativeModifiers(); xEvent->xkey.keycode = qKeyEvent->nativeScanCode(); + + // We may not have a nativeScanCode() if the key event is from DRT's eventsender. In that + // case just populate the XEvent's keycode with the Qt platform-independent keycode. The only + // place this keycode will be used is in webkit_test_plugin_handle_event(). + if (QWebPagePrivate::drtRun && !xEvent->xkey.keycode) { + if (!qKeyEvent->text().isEmpty()) + xEvent->xkey.keycode = int(qKeyEvent->text().at(0).unicode() + qKeyEvent->modifiers()); + else if (qKeyEvent->key() && (qKeyEvent->key() != Qt::Key_unknown)) + xEvent->xkey.keycode = int(qKeyEvent->key() + qKeyEvent->modifiers()); + } + xEvent->xkey.same_screen = true; // NOTE: As the XEvents sent to the plug-in are synthesized and there is not a native window @@ -578,19 +596,24 @@ void PluginView::setNPWindowIfNeeded() m_npWindow.x = m_windowRect.x(); m_npWindow.y = m_windowRect.y(); - - m_npWindow.clipRect.left = max(0, m_clipRect.x()); - m_npWindow.clipRect.top = max(0, m_clipRect.y()); - m_npWindow.clipRect.right = m_clipRect.x() + m_clipRect.width(); - m_npWindow.clipRect.bottom = m_clipRect.y() + m_clipRect.height(); } else { m_npWindow.x = 0; m_npWindow.y = 0; + } + // If the width or height are null, set the clipRect to null, indicating that + // the plugin is not visible/scrolled out. + if (!m_clipRect.width() || !m_clipRect.height()) { m_npWindow.clipRect.left = 0; - m_npWindow.clipRect.top = 0; m_npWindow.clipRect.right = 0; + m_npWindow.clipRect.top = 0; m_npWindow.clipRect.bottom = 0; + } else { + // Clipping rectangle of the plug-in; the origin is the top left corner of the drawable or window. + m_npWindow.clipRect.left = m_npWindow.x + m_clipRect.x(); + m_npWindow.clipRect.top = m_npWindow.y + m_clipRect.y(); + m_npWindow.clipRect.right = m_npWindow.x + m_clipRect.x() + m_clipRect.width(); + m_npWindow.clipRect.bottom = m_npWindow.y + m_clipRect.y() + m_clipRect.height(); } if (m_plugin->quirks().contains(PluginQuirkDontCallSetWindowMoreThanOnce)) { @@ -755,7 +778,7 @@ static Display *getPluginDisplay() // support gdk based plugins (like flash) that use a different X connection. // The code below has the same effect as this one: // Display *gdkDisplay = gdk_x11_display_get_xdisplay(gdk_display_get_default()); - QLibrary library("libgdk-x11-2.0.so.0"); + QLibrary library("libgdk-x11-2.0", 0); if (!library.load()) return 0; diff --git a/WebCore/plugins/win/PluginDatabaseWin.cpp b/WebCore/plugins/win/PluginDatabaseWin.cpp index 5d86117..6cbcdc8 100644 --- a/WebCore/plugins/win/PluginDatabaseWin.cpp +++ b/WebCore/plugins/win/PluginDatabaseWin.cpp @@ -332,6 +332,56 @@ static inline void addAdobeAcrobatPluginDirectory(Vector<String>& directories) RegCloseKey(key); } +static inline void addJavaPluginDirectory(Vector<String>& directories) +{ + HKEY key; + HRESULT result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("Software\\JavaSoft\\Java Plug-in"), 0, KEY_READ, &key); + if (result != ERROR_SUCCESS) + return; + + WCHAR name[128]; + FILETIME lastModified; + + Vector<int> latestJavaVersion; + String latestJavaVersionString; + + // Enumerate subkeys + for (int i = 0;; i++) { + DWORD nameLen = sizeof(name) / sizeof(WCHAR); + result = RegEnumKeyExW(key, i, name, &nameLen, 0, 0, 0, &lastModified); + + if (result != ERROR_SUCCESS) + break; + + Vector<int> javaVersion = parseVersionString(String(name, nameLen)); + if (compareVersions(javaVersion, latestJavaVersion)) { + latestJavaVersion = javaVersion; + latestJavaVersionString = String(name, nameLen); + } + } + + if (!latestJavaVersionString.isEmpty()) { + DWORD type; + WCHAR javaInstallPathStr[_MAX_PATH]; + DWORD javaInstallPathSize = sizeof(javaInstallPathStr); + DWORD useNewPluginValue; + DWORD useNewPluginSize; + + String javaPluginKeyPath = "Software\\JavaSoft\\Java Plug-in\\" + latestJavaVersionString; + result = SHGetValue(HKEY_LOCAL_MACHINE, javaPluginKeyPath.charactersWithNullTermination(), TEXT("UseNewJavaPlugin"), &type, (LPVOID)&useNewPluginValue, &useNewPluginSize); + + if (result == ERROR_SUCCESS && useNewPluginValue == 1) { + result = SHGetValue(HKEY_LOCAL_MACHINE, javaPluginKeyPath.charactersWithNullTermination(), TEXT("JavaHome"), &type, (LPBYTE)javaInstallPathStr, &javaInstallPathSize); + if (result == ERROR_SUCCESS) { + String javaPluginDirectory = String(javaInstallPathStr, javaInstallPathSize / sizeof(WCHAR) - 1) + "\\bin\\new_plugin"; + directories.append(javaPluginDirectory); + } + } + } + + RegCloseKey(key); +} + static inline String safariPluginsDirectory() { WCHAR moduleFileNameStr[_MAX_PATH]; @@ -385,6 +435,9 @@ Vector<String> PluginDatabase::defaultPluginDirectories() addMozillaPluginDirectories(directories); addWindowsMediaPlayerPluginDirectory(directories); addMacromediaPluginDirectories(directories); +#if PLATFORM(QT) + addJavaPluginDirectory(directories); +#endif return directories; } diff --git a/WebCore/rendering/AutoTableLayout.cpp b/WebCore/rendering/AutoTableLayout.cpp index ea8b416..d9233a2 100644 --- a/WebCore/rendering/AutoTableLayout.cpp +++ b/WebCore/rendering/AutoTableLayout.cpp @@ -140,7 +140,7 @@ void AutoTableLayout::recalcColumn(int effCol) // Nav/IE weirdness if (l.width.isFixed()) { - if (m_table->style()->htmlHacks() && l.maxWidth > l.width.value() && fixedContributor != maxContributor) { + if (m_table->document()->inQuirksMode() && l.maxWidth > l.width.value() && fixedContributor != maxContributor) { l.width = Length(); fixedContributor = 0; } diff --git a/WebCore/rendering/FixedTableLayout.cpp b/WebCore/rendering/FixedTableLayout.cpp index 4d6b88c..b5ff971 100644 --- a/WebCore/rendering/FixedTableLayout.cpp +++ b/WebCore/rendering/FixedTableLayout.cpp @@ -223,7 +223,7 @@ void FixedTableLayout::calcPrefWidths(int& minWidth, int& maxWidth) // In this example, the two inner tables should be as large as the outer table. // We can achieve this effect by making the maxwidth of fixed tables with percentage // widths be infinite. - if (m_table->style()->htmlHacks() && m_table->style()->width().isPercent() + if (m_table->document()->inQuirksMode() && m_table->style()->width().isPercent() && maxWidth < TABLE_MAX_WIDTH) maxWidth = TABLE_MAX_WIDTH; } diff --git a/WebCore/rendering/InlineFlowBox.cpp b/WebCore/rendering/InlineFlowBox.cpp index dfe7561..a71b796 100644 --- a/WebCore/rendering/InlineFlowBox.cpp +++ b/WebCore/rendering/InlineFlowBox.cpp @@ -761,8 +761,8 @@ void InlineFlowBox::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty) int h = height(); // Constrain our background/border painting to the line top and bottom if necessary. - bool strictMode = renderer()->document()->inStrictMode(); - if (!hasTextChildren() && !strictMode) { + bool noQuirksMode = renderer()->document()->inNoQuirksMode(); + if (!hasTextChildren() && !noQuirksMode) { RootInlineBox* rootBox = root(); int bottom = min(rootBox->lineBottom(), y + h); y = max(rootBox->lineTop(), y); @@ -837,8 +837,8 @@ void InlineFlowBox::paintMask(PaintInfo& paintInfo, int tx, int ty) int h = height(); // Constrain our background/border painting to the line top and bottom if necessary. - bool strictMode = renderer()->document()->inStrictMode(); - if (!hasTextChildren() && !strictMode) { + bool noQuirksMode = renderer()->document()->inNoQuirksMode(); + if (!hasTextChildren() && !noQuirksMode) { RootInlineBox* rootBox = root(); int bottom = min(rootBox->lineBottom(), y + h); y = max(rootBox->lineTop(), y); @@ -922,7 +922,7 @@ void InlineFlowBox::paintTextDecorations(PaintInfo& paintInfo, int tx, int ty, b { // Paint text decorations like underlines/overlines. We only do this if we aren't in quirks mode (i.e., in // almost-strict mode or strict mode). - if (renderer()->style()->htmlHacks() || !paintInfo.shouldPaintWithinRoot(renderer()) || + if (renderer()->document()->inQuirksMode() || !paintInfo.shouldPaintWithinRoot(renderer()) || renderer()->style()->visibility() != VISIBLE) return; diff --git a/WebCore/rendering/InlineTextBox.cpp b/WebCore/rendering/InlineTextBox.cpp index cb4fdb8..c74fe1e 100644 --- a/WebCore/rendering/InlineTextBox.cpp +++ b/WebCore/rendering/InlineTextBox.cpp @@ -547,7 +547,7 @@ void InlineTextBox::paint(PaintInfo& paintInfo, int tx, int ty) } // Paint decorations - if (d != TDNONE && paintInfo.phase != PaintPhaseSelection && styleToUse->htmlHacks()) { + if (d != TDNONE && paintInfo.phase != PaintPhaseSelection && renderer()->document()->inQuirksMode()) { context->setStrokeColor(styleToUse->visitedDependentColor(CSSPropertyColor), styleToUse->colorSpace()); paintDecoration(context, tx, ty, d, textShadow); } @@ -768,6 +768,21 @@ void InlineTextBox::paintDecoration(GraphicsContext* context, int tx, int ty, in context->clearShadow(); } +static GraphicsContext::TextCheckingLineStyle textCheckingLineStyleForMarkerType(DocumentMarker::MarkerType markerType) +{ + switch (markerType) { + case DocumentMarker::Spelling: + return GraphicsContext::TextCheckingSpellingLineStyle; + case DocumentMarker::Grammar: + return GraphicsContext::TextCheckingGrammarLineStyle; + case DocumentMarker::Replacement: + return GraphicsContext::TextCheckingReplacementLineStyle; + default: + ASSERT_NOT_REACHED(); + return GraphicsContext::TextCheckingSpellingLineStyle; + } +} + void InlineTextBox::paintSpellingOrGrammarMarker(GraphicsContext* pt, int tx, int ty, const DocumentMarker& marker, RenderStyle* style, const Font& font, bool grammar) { // Never print spelling/grammar markers (5327887) @@ -831,7 +846,7 @@ void InlineTextBox::paintSpellingOrGrammarMarker(GraphicsContext* pt, int tx, in // In larger fonts, though, place the underline up near the baseline to prevent a big gap. underlineOffset = baseline + 2; } - pt->drawLineForMisspellingOrBadGrammar(IntPoint(tx + m_x + start, ty + m_y + underlineOffset), width, grammar); + pt->drawLineForTextChecking(IntPoint(tx + m_x + start, ty + m_y + underlineOffset), width, textCheckingLineStyleForMarkerType(marker.type)); } void InlineTextBox::paintTextMatchMarker(GraphicsContext* pt, int tx, int ty, const DocumentMarker& marker, RenderStyle* style, const Font& font) @@ -898,10 +913,10 @@ void InlineTextBox::paintDocumentMarkers(GraphicsContext* pt, int tx, int ty, Re case DocumentMarker::Grammar: case DocumentMarker::Spelling: case DocumentMarker::Replacement: + case DocumentMarker::RejectedCorrection: if (background) continue; break; - case DocumentMarker::TextMatch: if (!background) continue; @@ -933,6 +948,9 @@ void InlineTextBox::paintDocumentMarkers(GraphicsContext* pt, int tx, int ty, Re break; case DocumentMarker::Replacement: computeRectForReplacementMarker(tx, ty, marker, style, font); + paintSpellingOrGrammarMarker(pt, tx, ty, marker, style, font, false); + break; + case DocumentMarker::RejectedCorrection: break; default: ASSERT_NOT_REACHED(); diff --git a/WebCore/rendering/MediaControlElements.cpp b/WebCore/rendering/MediaControlElements.cpp index 3fb712f..aaeb3e2 100644 --- a/WebCore/rendering/MediaControlElements.cpp +++ b/WebCore/rendering/MediaControlElements.cpp @@ -42,6 +42,7 @@ #include "RenderMedia.h" #include "RenderSlider.h" #include "RenderTheme.h" +#include "Settings.h" namespace WebCore { @@ -780,7 +781,20 @@ PassRefPtr<MediaControlFullscreenButtonElement> MediaControlFullscreenButtonElem void MediaControlFullscreenButtonElement::defaultEventHandler(Event* event) { if (event->type() == eventNames().clickEvent) { - mediaElement()->enterFullscreen(); +#if ENABLE(FULLSCREEN_API) + // Only use the new full screen API if the fullScreenEnabled setting has + // been explicitly enabled. Otherwise, use the old fullscreen API. This + // allows apps which embed a WebView to retain the existing full screen + // video implementation without requiring them to implement their own full + // screen behavior. + if (document()->settings() && document()->settings()->fullScreenEnabled()) { + if (document()->webkitFullScreen() && document()->webkitCurrentFullScreenElement() == mediaElement()) + document()->webkitCancelFullScreen(); + else + mediaElement()->webkitRequestFullScreen(0); + } else +#endif + mediaElement()->enterFullscreen(); event->setDefaultHandled(); } HTMLInputElement::defaultEventHandler(event); diff --git a/WebCore/rendering/RenderBlock.cpp b/WebCore/rendering/RenderBlock.cpp index 28d7914..d66336d 100644 --- a/WebCore/rendering/RenderBlock.cpp +++ b/WebCore/rendering/RenderBlock.cpp @@ -1042,7 +1042,7 @@ bool RenderBlock::isSelfCollapsingBlock() const return false; bool hasAutoHeight = style()->height().isAuto(); - if (style()->height().isPercent() && !style()->htmlHacks()) { + if (style()->height().isPercent() && !document()->inQuirksMode()) { hasAutoHeight = true; for (RenderBlock* cb = containingBlock(); !cb->isRenderView(); cb = cb->containingBlock()) { if (cb->style()->height().isFixed() || cb->isTableCell()) @@ -1478,7 +1478,7 @@ int RenderBlock::collapseMargins(RenderBox* child, MarginInfo& marginInfo) // This child is collapsing with the top of the // block. If it has larger margin values, then we need to update // our own maximal values. - if (!style()->htmlHacks() || !marginInfo.quirkContainer() || !topQuirk) + if (!document()->inQuirksMode() || !marginInfo.quirkContainer() || !topQuirk) setMaxTopMargins(max(posTop, maxTopPosMargin()), max(negTop, maxTopNegMargin())); // The minute any of the margins involved isn't a quirk, don't @@ -1530,7 +1530,7 @@ int RenderBlock::collapseMargins(RenderBox* child, MarginInfo& marginInfo) } else if (!marginInfo.atTopOfBlock() || (!marginInfo.canCollapseTopWithChildren() - && (!style()->htmlHacks() || !marginInfo.quirkContainer() || !marginInfo.topQuirk()))) { + && (!document()->inQuirksMode() || !marginInfo.quirkContainer() || !marginInfo.topQuirk()))) { // We're collapsing with a previous sibling's margins and not // with the top of the block. setHeight(height() + max(marginInfo.posMargin(), posTop) - max(marginInfo.negMargin(), negTop)); @@ -1683,7 +1683,7 @@ void RenderBlock::handleBottomOfBlock(int top, int bottom, MarginInfo& marginInf // If we can't collapse with children then go ahead and add in the bottom margin. if (!marginInfo.canCollapseWithBottom() && !marginInfo.canCollapseWithTop() - && (!style()->htmlHacks() || !marginInfo.quirkContainer() || !marginInfo.bottomQuirk())) + && (!document()->inQuirksMode() || !marginInfo.quirkContainer() || !marginInfo.bottomQuirk())) setHeight(height() + marginInfo.margin()); // Now add in our bottom border/padding. @@ -2120,8 +2120,12 @@ void RenderBlock::paintChildren(PaintInfo& paintInfo, int tx, int ty) PaintInfo info(paintInfo); info.phase = newPhase; info.updatePaintingRootForChildren(this); + + RenderView* renderView = view(); + bool usePrintRect = !renderView->printRect().isEmpty() && !document()->settings()->paginateDuringLayoutEnabled(); + bool checkPageBreaks = document()->paginated() && !document()->settings()->paginateDuringLayoutEnabled(); - bool checkColumnBreaks = !checkPageBreaks && !view()->printRect().isEmpty() && !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. @@ -2133,6 +2137,17 @@ void RenderBlock::paintChildren(PaintInfo& paintInfo, int tx, int ty) return; } + if (!child->isFloating() && child->isReplaced() && usePrintRect && child->height() <= renderView->printRect().height()) { + // Paginate block-level replaced elements. + if (ty + child->y() + child->height() > renderView->printRect().bottom()) { + if (ty + child->y() < renderView->truncatedAt()) + renderView->setBestTruncatedAt(ty + child->y(), child); + // If we were able to truncate, don't paint. + if (ty + child->y() >= renderView->truncatedAt()) + break; + } + } + if (!child->hasSelfPaintingLayer() && !child->isFloating()) child->paint(info, tx, ty); @@ -3529,7 +3544,7 @@ void RenderBlock::clearFloats() int RenderBlock::addOverhangingFloats(RenderBlock* child, int xoff, int yoff, bool makeChildPaintOtherFloats) { // Prevent floats from being added to the canvas by the root element, e.g., <html>. - if (child->hasOverflowClip() || !child->containsFloats() || child->isRoot()) + if (child->hasOverflowClip() || !child->containsFloats() || child->isRoot() || child->hasColumns()) return 0; int lowestFloatBottom = 0; @@ -4593,7 +4608,7 @@ void RenderBlock::calcInlinePrefWidths() // Firefox and Opera will allow a table cell to grow to fit an image inside it under // very specific cirucumstances (in order to match common WinIE renderings). // Not supporting the quirk has caused us to mis-render some real sites. (See Bugzilla 10517.) - bool allowImagesToBreak = !style()->htmlHacks() || !isTableCell() || !style()->width().isIntrinsicOrAuto(); + bool allowImagesToBreak = !document()->inQuirksMode() || !isTableCell() || !style()->width().isIntrinsicOrAuto(); bool autoWrap, oldAutoWrap; autoWrap = oldAutoWrap = style()->autoWrap(); @@ -4922,7 +4937,7 @@ void RenderBlock::calcBlockPrefWidths() // of 100px because of the table. // We can achieve this effect by making the maxwidth of blocks that contain tables // with percentage widths be infinite (as long as they are not inside a table cell). - if (style()->htmlHacks() && child->style()->width().isPercent() && + if (document()->inQuirksMode() && child->style()->width().isPercent() && !isTableCell() && child->isTable() && m_maxPrefWidth < BLOCK_MAX_WIDTH) { RenderBlock* cb = containingBlock(); while (!cb->isRenderView() && !cb->isTableCell()) diff --git a/WebCore/rendering/RenderBlockLineLayout.cpp b/WebCore/rendering/RenderBlockLineLayout.cpp index 7cb1597..d703fb2 100644 --- a/WebCore/rendering/RenderBlockLineLayout.cpp +++ b/WebCore/rendering/RenderBlockLineLayout.cpp @@ -194,7 +194,7 @@ static inline InlineBox* createInlineBoxForRenderer(RenderObject* obj, bool isRo // We only treat a box as text for a <br> if we are on a line by ourself or in strict mode // (Note the use of strict mode. In "almost strict" mode, we don't treat the box for <br> as text.) if (obj->isBR()) - textBox->setIsText(isOnlyRun || obj->document()->inStrictMode()); + textBox->setIsText(isOnlyRun || obj->document()->inNoQuirksMode()); return textBox; } @@ -1518,7 +1518,7 @@ InlineIterator RenderBlock::findNextLineBreak(InlineBidiResolver& resolver, bool // Firefox and Opera will allow a table cell to grow to fit an image inside it under // very specific circumstances (in order to match common WinIE renderings). // Not supporting the quirk has caused us to mis-render some real sites. (See Bugzilla 10517.) - bool allowImagesToBreak = !style()->htmlHacks() || !isTableCell() || !style()->width().isIntrinsicOrAuto(); + bool allowImagesToBreak = !document()->inQuirksMode() || !isTableCell() || !style()->width().isIntrinsicOrAuto(); EWhiteSpace currWS = style()->whiteSpace(); EWhiteSpace lastWS = currWS; diff --git a/WebCore/rendering/RenderBox.cpp b/WebCore/rendering/RenderBox.cpp index d614081..e107c4f 100644 --- a/WebCore/rendering/RenderBox.cpp +++ b/WebCore/rendering/RenderBox.cpp @@ -1619,7 +1619,7 @@ int RenderBox::calcPercentageHeight(const Length& height) int result = -1; bool skippedAutoHeightContainingBlock = false; RenderBlock* cb = containingBlock(); - if (style()->htmlHacks()) { + if (document()->inQuirksMode()) { // In quirks mode, blocks with auto height are skipped, and we keep looking for an enclosing // block that may have a specified height and then use it. In strict mode, this violates the // specification, which states that percentage heights just revert to auto if the containing @@ -1668,7 +1668,7 @@ int RenderBox::calcPercentageHeight(const Length& height) result = cb->calcPercentageHeight(cb->style()->height()); if (result != -1) result = cb->calcContentBoxHeight(result); - } else if (cb->isRenderView() || (cb->isBody() && style()->htmlHacks()) || isPositionedWithSpecifiedHeight) { + } else if (cb->isRenderView() || (cb->isBody() && document()->inQuirksMode()) || isPositionedWithSpecifiedHeight) { // Don't allow this to affect the block' height() member variable, since this // can get called while the block is still laying out its kids. int oldHeight = cb->height(); @@ -1901,7 +1901,7 @@ void RenderBox::calcAbsoluteHorizontal() // To match WinIE, in quirks mode use the parent's 'direction' property // instead of the the container block's. - TextDirection containerDirection = (style()->htmlHacks()) ? parent()->style()->direction() : containerBlock->style()->direction(); + TextDirection containerDirection = (document()->inQuirksMode()) ? parent()->style()->direction() : containerBlock->style()->direction(); const int bordersPlusPadding = borderAndPaddingWidth(); const Length marginLeft = style()->marginLeft(); @@ -2437,7 +2437,7 @@ void RenderBox::calcAbsoluteHorizontalReplaced() // To match WinIE, in quirks mode use the parent's 'direction' property // instead of the the container block's. - TextDirection containerDirection = (style()->htmlHacks()) ? parent()->style()->direction() : containerBlock->style()->direction(); + TextDirection containerDirection = (document()->inQuirksMode()) ? parent()->style()->direction() : containerBlock->style()->direction(); // Variables to solve. Length left = style()->left(); diff --git a/WebCore/rendering/RenderBox.h b/WebCore/rendering/RenderBox.h index e02f77a..8f1e9c3 100644 --- a/WebCore/rendering/RenderBox.h +++ b/WebCore/rendering/RenderBox.h @@ -217,7 +217,7 @@ public: bool stretchesToViewHeight() const { - return style()->htmlHacks() && style()->height().isAuto() && !isFloatingOrPositioned() && (isRoot() || isBody()); + return document()->inQuirksMode() && style()->height().isAuto() && !isFloatingOrPositioned() && (isRoot() || isBody()); } virtual IntSize intrinsicSize() const { return IntSize(); } @@ -246,7 +246,7 @@ public: virtual int verticalScrollbarWidth() const; int horizontalScrollbarHeight() const; - virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1.0f, Node** stopNode = 0); + virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1, Node** stopNode = 0); bool canBeScrolledAndHasScrollableArea() const; virtual bool canBeProgramaticallyScrolled(bool) const; virtual void autoscroll(); diff --git a/WebCore/rendering/RenderBoxModelObject.cpp b/WebCore/rendering/RenderBoxModelObject.cpp index 78618d1..0fbc9f2 100644 --- a/WebCore/rendering/RenderBoxModelObject.cpp +++ b/WebCore/rendering/RenderBoxModelObject.cpp @@ -337,10 +337,25 @@ int RenderBoxModelObject::relativePositionOffsetX() const int RenderBoxModelObject::relativePositionOffsetY() const { - if (!style()->top().isAuto()) - return style()->top().calcValue(containingBlock()->availableHeight()); - else if (!style()->bottom().isAuto()) - return -style()->bottom().calcValue(containingBlock()->availableHeight()); + RenderBlock* containingBlock = this->containingBlock(); + + // If the containing block of a relatively positioned element does not + // specify a height, a percentage top or bottom offset should be resolved as + // auto. An exception to this is if the containing block has the WinIE quirk + // where <html> and <body> assume the size of the viewport. In this case, + // calculate the percent offset based on this height. + // See <https://bugs.webkit.org/show_bug.cgi?id=26396>. + if (!style()->top().isAuto() + && (!containingBlock->style()->height().isAuto() + || !style()->top().isPercent() + || containingBlock->stretchesToViewHeight())) + return style()->top().calcValue(containingBlock->availableHeight()); + + if (!style()->bottom().isAuto() + && (!containingBlock->style()->height().isAuto() + || !style()->bottom().isPercent() + || containingBlock->stretchesToViewHeight())) + return -style()->bottom().calcValue(containingBlock->availableHeight()); return 0; } diff --git a/WebCore/rendering/RenderEmbeddedObject.cpp b/WebCore/rendering/RenderEmbeddedObject.cpp index 55b230b..b1b253a 100644 --- a/WebCore/rendering/RenderEmbeddedObject.cpp +++ b/WebCore/rendering/RenderEmbeddedObject.cpp @@ -102,6 +102,7 @@ bool RenderEmbeddedObject::allowsAcceleratedCompositing() const } #endif +// FIXME: This belongs in HTMLPluginElement.cpp to be shared by HTMLObjectElement and HTMLEmbedElement. static bool isURLAllowed(Document* doc, const String& url) { if (doc->frame()->page()->frameCount() >= Page::maxNumberOfFrames) @@ -123,6 +124,7 @@ static bool isURLAllowed(Document* doc, const String& url) typedef HashMap<String, String, CaseFoldingHash> ClassIdToTypeMap; +// FIXME: This belongs in HTMLObjectElement.cpp static ClassIdToTypeMap* createClassIdToTypeMap() { ClassIdToTypeMap* map = new ClassIdToTypeMap; @@ -135,6 +137,7 @@ static ClassIdToTypeMap* createClassIdToTypeMap() return map; } +// FIXME: This belongs in HTMLObjectElement.cpp static String serviceTypeForClassId(const String& classId) { // Return early if classId is empty (since we won't do anything below). @@ -146,6 +149,7 @@ static String serviceTypeForClassId(const String& classId) return map->get(classId); } +// FIXME: This belongs in HTMLObjectElement.cpp static void mapDataParamToSrc(Vector<String>* paramNames, Vector<String>* paramValues) { // Some plugins don't understand the "data" attribute of the OBJECT tag (i.e. Real and WMP @@ -164,190 +168,205 @@ static void mapDataParamToSrc(Vector<String>* paramNames, Vector<String>* paramV } } -void RenderEmbeddedObject::updateWidget(bool onlyCreateNonNetscapePlugins) +// FIXME: This belongs in some loader header? +static bool isNetscapePlugin(Frame* frame, const String& url, const String& serviceType) { - if (!m_replacementText.isNull() || !node()) // Check the node in case destroy() has been called. - return; - - String url; - String serviceType; - Vector<String> paramNames; - Vector<String> paramValues; - Frame* frame = frameView()->frame(); - - // The calls to SubframeLoader::requestObject within this function can result in a plug-in being initialized. - // This can run cause arbitrary JavaScript to run and may result in this RenderObject being detached from - // the render tree and destroyed, causing a crash like <rdar://problem/6954546>. By extending our lifetime - // artifically to ensure that we remain alive for the duration of plug-in initialization. - RenderWidgetProtector protector(this); + KURL completedURL; + if (!url.isEmpty()) + completedURL = frame->loader()->completeURL(url); - if (node()->hasTagName(objectTag)) { - HTMLObjectElement* objectElement = static_cast<HTMLObjectElement*>(node()); + if (frame->loader()->client()->objectContentType(completedURL, serviceType) == ObjectContentNetscapePlugin) + return true; + return false; +} - objectElement->setNeedWidgetUpdate(false); - if (!objectElement->isFinishedParsingChildren()) - return; +// FIXME: This belongs on HTMLObjectElement. +static bool hasFallbackContent(HTMLObjectElement* objectElement) +{ + for (Node* child = objectElement->firstChild(); child; child = child->nextSibling()) { + if ((!child->isTextNode() && !child->hasTagName(paramTag)) // Discount <param> + || (child->isTextNode() && !static_cast<Text*>(child)->containsOnlyWhitespace())) + return true; + } + return false; +} - // Check for a child EMBED tag. - HTMLEmbedElement* embed = 0; - for (Node* child = objectElement->firstChild(); child; ) { - if (child->hasTagName(embedTag)) { - embed = static_cast<HTMLEmbedElement*>(child); - break; +// FIXME: This belongs on HTMLObjectElement. +static void parametersFromObject(HTMLObjectElement* objectElement, Vector<String>& paramNames, Vector<String>& paramValues, String& url, String& serviceType) +{ + HashSet<StringImpl*, CaseFoldingHash> uniqueParamNames; + + // 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. + Node* child = objectElement->firstChild(); + while (child) { + if (child->hasTagName(paramTag)) { + HTMLParamElement* p = static_cast<HTMLParamElement*>(child); + String name = p->name(); + if (url.isEmpty() && (equalIgnoringCase(name, "src") || equalIgnoringCase(name, "movie") || equalIgnoringCase(name, "code") || equalIgnoringCase(name, "url"))) + url = deprecatedParseURL(p->value()); + // FIXME: serviceType calculation does not belong in this function. + if (serviceType.isEmpty() && equalIgnoringCase(name, "type")) { + serviceType = p->value(); + size_t pos = serviceType.find(";"); + if (pos != notFound) + serviceType = serviceType.left(pos); } - - if (child->hasTagName(objectTag)) - child = child->nextSibling(); // Don't descend into nested OBJECT tags - else - child = child->traverseNextNode(objectElement); // Otherwise descend (EMBEDs may be inside COMMENT tags) - } - - // Use the attributes from the EMBED tag instead of the OBJECT tag including WIDTH and HEIGHT. - HTMLElement* embedOrObject; - if (embed) { - embedOrObject = embed; - url = embed->url(); - serviceType = embed->serviceType(); - } else - embedOrObject = objectElement; - - // If there was no URL or type defined in EMBED, try the OBJECT tag. - if (url.isEmpty()) - url = objectElement->url(); - if (serviceType.isEmpty()) - serviceType = objectElement->serviceType(); - - HashSet<StringImpl*, CaseFoldingHash> uniqueParamNames; - - // Scan the PARAM children. - // Get the URL and type from the params if we don't already have them. - // Get the attributes from the params if there is no EMBED tag. - Node* child = objectElement->firstChild(); - while (child && (url.isEmpty() || serviceType.isEmpty() || !embed)) { - if (child->hasTagName(paramTag)) { - HTMLParamElement* p = static_cast<HTMLParamElement*>(child); - String name = p->name(); - if (url.isEmpty() && (equalIgnoringCase(name, "src") || equalIgnoringCase(name, "movie") || equalIgnoringCase(name, "code") || equalIgnoringCase(name, "url"))) - url = p->value(); - if (serviceType.isEmpty() && equalIgnoringCase(name, "type")) { - serviceType = p->value(); - size_t pos = serviceType.find(";"); - if (pos != notFound) - serviceType = serviceType.left(pos); - } - if (!embed && !name.isEmpty()) { - uniqueParamNames.add(name.impl()); - paramNames.append(p->name()); - paramValues.append(p->value()); - } + if (!name.isEmpty()) { + uniqueParamNames.add(name.impl()); + paramNames.append(p->name()); + paramValues.append(p->value()); } - child = child->nextSibling(); } + child = child->nextSibling(); + } - // When OBJECT is used for an applet via Sun's Java plugin, the CODEBASE attribute in the tag - // points to the Java plugin itself (an ActiveX component) while the actual applet CODEBASE is - // in a PARAM tag. See <http://java.sun.com/products/plugin/1.2/docs/tags.html>. This means - // we have to explicitly suppress the tag's CODEBASE attribute if there is none in a PARAM, - // else our Java plugin will misinterpret it. [4004531] - String codebase; - if (!embed && MIMETypeRegistry::isJavaAppletMIMEType(serviceType)) { - codebase = "codebase"; - uniqueParamNames.add(codebase.impl()); // pretend we found it in a PARAM already - } - - // Turn the attributes of either the EMBED tag or OBJECT tag into arrays, but don't override PARAM values. - NamedNodeMap* attributes = embedOrObject->attributes(); - if (attributes) { - for (unsigned i = 0; i < attributes->length(); ++i) { - Attribute* it = attributes->attributeItem(i); - const AtomicString& name = it->name().localName(); - if (embed || !uniqueParamNames.contains(name.impl())) { - paramNames.append(name.string()); - paramValues.append(it->value().string()); - } + // When OBJECT is used for an applet via Sun's Java plugin, the CODEBASE attribute in the tag + // points to the Java plugin itself (an ActiveX component) while the actual applet CODEBASE is + // in a PARAM tag. See <http://java.sun.com/products/plugin/1.2/docs/tags.html>. This means + // we have to explicitly suppress the tag's CODEBASE attribute if there is none in a PARAM, + // else our Java plugin will misinterpret it. [4004531] + String codebase; + if (MIMETypeRegistry::isJavaAppletMIMEType(serviceType)) { + codebase = "codebase"; + uniqueParamNames.add(codebase.impl()); // pretend we found it in a PARAM already + } + + // Turn the attributes of the <object> element into arrays, but don't override <param> values. + NamedNodeMap* attributes = objectElement->attributes(); + if (attributes) { + for (unsigned i = 0; i < attributes->length(); ++i) { + Attribute* it = attributes->attributeItem(i); + const AtomicString& name = it->name().localName(); + if (!uniqueParamNames.contains(name.impl())) { + paramNames.append(name.string()); + paramValues.append(it->value().string()); } } + } - mapDataParamToSrc(¶mNames, ¶mValues); + mapDataParamToSrc(¶mNames, ¶mValues); - // If we still don't have a type, try to map from a specific CLASSID to a type. - if (serviceType.isEmpty()) - serviceType = serviceTypeForClassId(objectElement->classId()); + // If we still don't have a type, try to map from a specific CLASSID to a type. + if (serviceType.isEmpty()) + serviceType = serviceTypeForClassId(objectElement->classId()); +} - if (!isURLAllowed(document(), url)) - return; +// FIXME: This belongs on HTMLObjectElement, HTMLPluginElement or HTMLFrameOwnerElement. +static void updateWidgetForObjectElement(HTMLObjectElement* objectElement, bool onlyCreateNonNetscapePlugins) +{ + objectElement->setNeedsWidgetUpdate(false); + if (!objectElement->isFinishedParsingChildren()) + return; - // Find out if we support fallback content. - m_hasFallbackContent = false; - for (Node* child = objectElement->firstChild(); child && !m_hasFallbackContent; child = child->nextSibling()) { - if ((!child->isTextNode() && !child->hasTagName(embedTag) && !child->hasTagName(paramTag)) // Discount <embed> and <param> - || (child->isTextNode() && !static_cast<Text*>(child)->containsOnlyWhitespace())) - m_hasFallbackContent = true; - } + Frame* frame = objectElement->document()->frame(); + String url = objectElement->url(); + String serviceType = objectElement->serviceType(); - if (onlyCreateNonNetscapePlugins) { - KURL completedURL; - if (!url.isEmpty()) - completedURL = frame->loader()->completeURL(url); + Vector<String> paramNames; + Vector<String> paramValues; + parametersFromObject(objectElement, paramNames, paramValues, url, serviceType); - if (frame->loader()->client()->objectContentType(completedURL, serviceType) == ObjectContentNetscapePlugin) - return; - } + if (!isURLAllowed(objectElement->document(), url)) + return; - bool beforeLoadAllowedLoad = objectElement->dispatchBeforeLoadEvent(url); - - // beforeload events can modify the DOM, potentially causing - // RenderWidget::destroy() to be called. Ensure we haven't been - // destroyed before continuing. - if (!node()) - return; - - bool success = beforeLoadAllowedLoad && frame->loader()->subframeLoader()->requestObject(this, url, objectElement->getAttribute(nameAttr), serviceType, paramNames, paramValues); - - if (!success && m_hasFallbackContent) - objectElement->renderFallbackContent(); + bool fallbackContent = hasFallbackContent(objectElement); + objectElement->renderEmbeddedObject()->setHasFallbackContent(fallbackContent); - } else if (node()->hasTagName(embedTag)) { - HTMLEmbedElement* embedElement = static_cast<HTMLEmbedElement*>(node()); - embedElement->setNeedWidgetUpdate(false); - url = embedElement->url(); - serviceType = embedElement->serviceType(); + if (onlyCreateNonNetscapePlugins && isNetscapePlugin(frame, url, serviceType)) + return; - if (url.isEmpty() && serviceType.isEmpty()) - return; - if (!isURLAllowed(document(), url)) - return; + bool beforeLoadAllowedLoad = objectElement->dispatchBeforeLoadEvent(url); - // add all attributes set on the embed object - NamedNodeMap* attributes = embedElement->attributes(); - if (attributes) { - for (unsigned i = 0; i < attributes->length(); ++i) { - Attribute* it = attributes->attributeItem(i); - paramNames.append(it->name().localName().string()); - paramValues.append(it->value().string()); - } - } + // beforeload events can modify the DOM, potentially causing + // RenderWidget::destroy() to be called. Ensure we haven't been + // destroyed before continuing. + // FIXME: Should this render fallback content? + if (!objectElement->renderer()) + return; + + bool success = beforeLoadAllowedLoad && frame->loader()->subframeLoader()->requestObject(objectElement, url, objectElement->getAttribute(nameAttr), serviceType, paramNames, paramValues); - if (onlyCreateNonNetscapePlugins) { - KURL completedURL; - if (!url.isEmpty()) - completedURL = frame->loader()->completeURL(url); + if (!success && fallbackContent) + objectElement->renderFallbackContent(); +} - if (frame->loader()->client()->objectContentType(completedURL, serviceType) == ObjectContentNetscapePlugin) - return; +// FIXME: This belongs on HTMLEmbedElement. +static void parametersFromEmbed(HTMLEmbedElement* embedElement, Vector<String>& paramNames, Vector<String>& paramValues) +{ + NamedNodeMap* attributes = embedElement->attributes(); + if (attributes) { + for (unsigned i = 0; i < attributes->length(); ++i) { + Attribute* it = attributes->attributeItem(i); + paramNames.append(it->name().localName().string()); + paramValues.append(it->value().string()); } + } +} + +// FIXME: This belongs on HTMLEmbedElement, HTMLPluginElement or HTMLFrameOwnerElement. +static void updateWidgetForEmbedElement(HTMLEmbedElement* embedElement, bool onlyCreateNonNetscapePlugins) +{ + Frame* frame = embedElement->document()->frame(); + String url = embedElement->url(); + String serviceType = embedElement->serviceType(); - if (embedElement->dispatchBeforeLoadEvent(url)) - frame->loader()->subframeLoader()->requestObject(this, url, embedElement->getAttribute(nameAttr), serviceType, paramNames, paramValues); + embedElement->setNeedsWidgetUpdate(false); + + if (url.isEmpty() && serviceType.isEmpty()) + return; + if (!isURLAllowed(embedElement->document(), url)) + return; + + Vector<String> paramNames; + Vector<String> paramValues; + parametersFromEmbed(embedElement, paramNames, paramValues); + + if (onlyCreateNonNetscapePlugins && isNetscapePlugin(frame, url, serviceType)) + return; + + if (embedElement->dispatchBeforeLoadEvent(url)) { + // FIXME: beforeLoad could have detached the renderer! Just like in the <object> case above. + frame->loader()->subframeLoader()->requestObject(embedElement, url, embedElement->getAttribute(nameAttr), serviceType, paramNames, paramValues); + } +} + +#if ENABLE(PLUGIN_PROXY_FOR_VIDEO) +// FIXME: This belongs on HTMLMediaElement. +static void updateWidgetForMediaElement(HTMLMediaElement* mediaElement, bool ignored) +{ + Vector<String> paramNames; + Vector<String> paramValues; + KURL kurl; + + mediaElement->getPluginProxyParams(kurl, paramNames, paramValues); + mediaElement->setNeedWidgetUpdate(false); + frame->loader()->subframeLoader()->loadMediaPlayerProxyPlugin(mediaElement, kurl, paramNames, paramValues); +} +#endif + +void RenderEmbeddedObject::updateWidget(bool onlyCreateNonNetscapePlugins) +{ + if (!m_replacementText.isNull() || !node()) // Check the node in case destroy() has been called. + return; + + // The calls to SubframeLoader::requestObject within this function can result in a plug-in being initialized. + // This can run cause arbitrary JavaScript to run and may result in this RenderObject being detached from + // the render tree and destroyed, causing a crash like <rdar://problem/6954546>. By extending our lifetime + // artifically to ensure that we remain alive for the duration of plug-in initialization. + RenderWidgetProtector protector(this); + + if (node()->hasTagName(objectTag)) { + HTMLObjectElement* objectElement = static_cast<HTMLObjectElement*>(node()); + updateWidgetForObjectElement(objectElement, onlyCreateNonNetscapePlugins); + } else if (node()->hasTagName(embedTag)) { + HTMLEmbedElement* embedElement = static_cast<HTMLEmbedElement*>(node()); + updateWidgetForEmbedElement(embedElement, onlyCreateNonNetscapePlugins); } #if ENABLE(PLUGIN_PROXY_FOR_VIDEO) else if (node()->hasTagName(videoTag) || node()->hasTagName(audioTag)) { HTMLMediaElement* mediaElement = static_cast<HTMLMediaElement*>(node()); - KURL kurl; - - mediaElement->getPluginProxyParams(kurl, paramNames, paramValues); - mediaElement->setNeedWidgetUpdate(false); - frame->loader()->subframeLoader()->loadMediaPlayerProxyPlugin(node(), kurl, paramNames, paramValues); + updateWidgetForMediaElement(mediaElement, onlyCreateNonNetscapePlugins); } #endif } diff --git a/WebCore/rendering/RenderEmbeddedObject.h b/WebCore/rendering/RenderEmbeddedObject.h index 0944094..6376f93 100644 --- a/WebCore/rendering/RenderEmbeddedObject.h +++ b/WebCore/rendering/RenderEmbeddedObject.h @@ -41,7 +41,9 @@ public: void setShowsCrashedPluginIndicator(); bool showsMissingPluginIndicator() const { return m_showsMissingPluginIndicator; } + // FIXME: This belongs on HTMLObjectElement. bool hasFallbackContent() const { return m_hasFallbackContent; } + void setHasFallbackContent(bool hasFallbackContent) { m_hasFallbackContent = hasFallbackContent; } void handleMissingPluginIndicatorEvent(Event*); @@ -68,7 +70,7 @@ private: bool getReplacementTextGeometry(int tx, int ty, FloatRect& contentRect, Path&, FloatRect& replacementTextRect, Font&, TextRun&, float& textWidth); String m_replacementText; - bool m_hasFallbackContent; + bool m_hasFallbackContent; // FIXME: This belongs on HTMLObjectElement. bool m_showsMissingPluginIndicator; bool m_missingPluginIndicatorIsPressed; bool m_mouseDownWasInMissingPluginIndicator; diff --git a/WebCore/rendering/RenderForeignObject.cpp b/WebCore/rendering/RenderForeignObject.cpp index 50c1a42..bfcb940 100644 --- a/WebCore/rendering/RenderForeignObject.cpp +++ b/WebCore/rendering/RenderForeignObject.cpp @@ -102,14 +102,20 @@ void RenderForeignObject::layout() LayoutRepainter repainter(*this, m_everHadLayout && checkForRepaintDuringLayout()); SVGForeignObjectElement* foreign = static_cast<SVGForeignObjectElement*>(node()); + bool updateCachedBoundariesInParents = false; if (m_needsTransformUpdate) { m_localTransform = foreign->animatedLocalTransform(); m_needsTransformUpdate = false; + updateCachedBoundariesInParents = true; } + FloatRect oldViewport = m_viewport; + // Cache viewport boundaries FloatPoint viewportLocation(foreign->x().value(foreign), foreign->y().value(foreign)); m_viewport = FloatRect(viewportLocation, FloatSize(foreign->width().value(foreign), foreign->height().value(foreign))); + if (!updateCachedBoundariesInParents) + updateCachedBoundariesInParents = oldViewport != m_viewport; // Set box origin to the foreignObject x/y translation, so positioned objects in XHTML content get correct // positions. A regular RenderBoxModelObject would pull this information from RenderStyle - in SVG those @@ -122,6 +128,10 @@ void RenderForeignObject::layout() RenderBlock::layout(); ASSERT(!needsLayout()); + // If our bounds changed, notify the parents. + if (updateCachedBoundariesInParents) + RenderSVGBlock::setNeedsBoundariesUpdate(); + // Invalidate all resources of this client if our layout changed. if (layoutChanged) SVGResourcesCache::clientLayoutChanged(this); diff --git a/WebCore/rendering/RenderImage.cpp b/WebCore/rendering/RenderImage.cpp index f34b691..316b1cf 100644 --- a/WebCore/rendering/RenderImage.cpp +++ b/WebCore/rendering/RenderImage.cpp @@ -61,7 +61,6 @@ using namespace HTMLNames; RenderImage::RenderImage(Node* node) : RenderReplaced(node, IntSize(0, 0)) - , m_cachedImage(0) { updateAltText(); @@ -70,22 +69,15 @@ RenderImage::RenderImage(Node* node) RenderImage::~RenderImage() { - if (m_cachedImage) - m_cachedImage->removeClient(this); + ASSERT(m_imageResource); + m_imageResource->shutdown(); } -void RenderImage::setCachedImage(CachedImage* newImage) +void RenderImage::setImageResource(PassOwnPtr<RenderImageResource> imageResource) { - if (m_cachedImage == newImage) - return; - if (m_cachedImage) - m_cachedImage->removeClient(this); - m_cachedImage = newImage; - if (m_cachedImage) { - m_cachedImage->addClient(this); - if (m_cachedImage->errorOccurred()) - imageChanged(m_cachedImage.get()); - } + ASSERT(!m_imageResource); + m_imageResource = imageResource; + m_imageResource->initialize(this); } // If we'll be displaying either alt text or an image, add some padding. @@ -139,22 +131,22 @@ void RenderImage::imageChanged(WrappedImagePtr newImage, const IntRect* rect) if (hasBoxDecorations() || hasMask()) RenderReplaced::imageChanged(newImage, rect); - - if (newImage != imagePtr() || !newImage) + + if (newImage != m_imageResource->imagePtr() || !newImage) return; bool imageSizeChanged = false; // Set image dimensions, taking into account the size of the alt text. - if (errorOccurred()) - imageSizeChanged = setImageSizeForAltText(m_cachedImage.get()); - + if (m_imageResource->errorOccurred()) + imageSizeChanged = setImageSizeForAltText(m_imageResource->cachedImage()); + bool shouldRepaint = true; // Image dimensions have been changed, see what needs to be done - if (imageSize(style()->effectiveZoom()) != intrinsicSize() || imageSizeChanged) { - if (!errorOccurred()) - setIntrinsicSize(imageSize(style()->effectiveZoom())); + if (m_imageResource->imageSize(style()->effectiveZoom()) != intrinsicSize() || imageSizeChanged) { + if (!m_imageResource->errorOccurred()) + setIntrinsicSize(m_imageResource->imageSize(style()->effectiveZoom())); // In the case of generated image content using :before/:after, we might not be in the // render tree yet. In that case, we don't need to worry about check for layout, since we'll get a @@ -184,7 +176,7 @@ void RenderImage::imageChanged(WrappedImagePtr newImage, const IntRect* rect) if (rect) { // The image changed rect is in source image coordinates (pre-zooming), // so map from the bounds of the image to the contentsBox. - repaintRect = enclosingIntRect(mapRect(*rect, FloatRect(FloatPoint(), imageSize(1.0f)), contentBoxRect())); + repaintRect = enclosingIntRect(mapRect(*rect, FloatRect(FloatPoint(), m_imageResource->imageSize(1.0f)), contentBoxRect())); // Guard against too-large changed rects. repaintRect.intersect(contentBoxRect()); } else @@ -207,7 +199,7 @@ void RenderImage::notifyFinished(CachedResource* newImage) return; #if USE(ACCELERATED_COMPOSITING) - if ((newImage == m_cachedImage) && hasLayer()) { + if (newImage == m_imageResource->cachedImage() && hasLayer()) { // tell any potential compositing layers // that the image is done and they can reference it directly. layer()->rendererContentChanged(); @@ -216,15 +208,6 @@ void RenderImage::notifyFinished(CachedResource* newImage) UNUSED_PARAM(newImage); #endif } - -void RenderImage::resetAnimation() -{ - if (m_cachedImage) { - image()->resetAnimation(); - if (!needsLayout()) - repaint(); - } -} void RenderImage::paintReplaced(PaintInfo& paintInfo, int tx, int ty) { @@ -240,7 +223,7 @@ void RenderImage::paintReplaced(PaintInfo& paintInfo, int tx, int ty) GraphicsContext* context = paintInfo.context; - if (!hasImage() || errorOccurred()) { + if (!m_imageResource->hasImage() || m_imageResource->errorOccurred()) { if (paintInfo.phase == PaintPhaseSelection) return; @@ -265,17 +248,19 @@ void RenderImage::paintReplaced(PaintInfo& paintInfo, int tx, int ty) int usableWidth = cWidth - 2; int usableHeight = cHeight - 2; - if (errorOccurred() && !image()->isNull() && (usableWidth >= image()->width()) && (usableHeight >= image()->height())) { + Image* image = m_imageResource->image(); + + if (m_imageResource->errorOccurred() && !image->isNull() && usableWidth >= image->width() && usableHeight >= image->height()) { // Center the error image, accounting for border and padding. - int centerX = (usableWidth - image()->width()) / 2; + int centerX = (usableWidth - image->width()) / 2; if (centerX < 0) centerX = 0; - int centerY = (usableHeight - image()->height()) / 2; + int centerY = (usableHeight - image->height()) / 2; if (centerY < 0) centerY = 0; imageX = leftBorder + leftPad + centerX + 1; imageY = topBorder + topPad + centerY + 1; - context->drawImage(image(), style()->colorSpace(), IntPoint(tx + imageX, ty + imageY)); + context->drawImage(image, style()->colorSpace(), IntPoint(tx + imageX, ty + imageY)); errorPictureDrawn = true; } @@ -298,8 +283,8 @@ void RenderImage::paintReplaced(PaintInfo& paintInfo, int tx, int ty) context->drawText(style()->font(), textRun, IntPoint(ax, ay + ascent)); } } - } else if (hasImage() && cWidth > 0 && cHeight > 0) { - Image* img = image(cWidth, cHeight); + } else if (m_imageResource->hasImage() && cWidth > 0 && cHeight > 0) { + Image* img = m_imageResource->image(cWidth, cHeight); if (!img || img->isNull()) return; @@ -361,22 +346,22 @@ void RenderImage::paintFocusRings(PaintInfo& paintInfo, const RenderStyle* style void RenderImage::paintIntoRect(GraphicsContext* context, const IntRect& rect) { - if (!hasImage() || errorOccurred() || rect.width() <= 0 || rect.height() <= 0) + if (!m_imageResource->hasImage() || m_imageResource->errorOccurred() || rect.width() <= 0 || rect.height() <= 0) return; - Image* img = image(rect.width(), rect.height()); + Image* img = m_imageResource->image(rect.width(), rect.height()); if (!img || img->isNull()) return; HTMLImageElement* imageElt = (node() && node()->hasTagName(imgTag)) ? static_cast<HTMLImageElement*>(node()) : 0; CompositeOperator compositeOperator = imageElt ? imageElt->compositeOperator() : CompositeSourceOver; - bool useLowQualityScaling = shouldPaintAtLowQuality(context, this->image(), rect.size()); - context->drawImage(image(rect.width(), rect.height()), style()->colorSpace(), rect, compositeOperator, useLowQualityScaling); + bool useLowQualityScaling = shouldPaintAtLowQuality(context, m_imageResource->image(), rect.size()); + context->drawImage(m_imageResource->image(rect.width(), rect.height()), style()->colorSpace(), rect, compositeOperator, useLowQualityScaling); } int RenderImage::minimumReplacedHeight() const { - return errorOccurred() ? intrinsicSize().height() : 0; + return m_imageResource->errorOccurred() ? intrinsicSize().height() : 0; } HTMLMapElement* RenderImage::imageMap() const @@ -459,18 +444,18 @@ bool RenderImage::isHeightSpecified() const int RenderImage::calcReplacedWidth(bool includeMaxWidth) const { - if (imageHasRelativeWidth()) + if (m_imageResource->imageHasRelativeWidth()) if (RenderObject* cb = isPositioned() ? container() : containingBlock()) { if (cb->isBox()) - setImageContainerSize(IntSize(toRenderBox(cb)->availableWidth(), toRenderBox(cb)->availableHeight())); + m_imageResource->setImageContainerSize(IntSize(toRenderBox(cb)->availableWidth(), toRenderBox(cb)->availableHeight())); } int width; if (isWidthSpecified()) width = calcReplacedWidthUsing(style()->width()); - else if (usesImageContainerSize()) - width = imageSize(style()->effectiveZoom()).width(); - else if (imageHasRelativeWidth()) + else if (m_imageResource->usesImageContainerSize()) + width = m_imageResource->imageSize(style()->effectiveZoom()).width(); + else if (m_imageResource->imageHasRelativeWidth()) width = 0; // If the image is relatively-sized, set the width to 0 until there is a set container size. else width = calcAspectRatioWidth(); @@ -497,9 +482,9 @@ int RenderImage::calcReplacedHeight() const int height; if (isHeightSpecified()) height = calcReplacedHeightUsing(style()->height()); - else if (usesImageContainerSize()) - height = imageSize(style()->effectiveZoom()).height(); - else if (imageHasRelativeHeight()) + else if (m_imageResource->usesImageContainerSize()) + height = m_imageResource->imageSize(style()->effectiveZoom()).height(); + else if (m_imageResource->imageHasRelativeHeight()) height = 0; // If the image is relatively-sized, set the height to 0 until there is a set container size. else height = calcAspectRatioHeight(); @@ -536,7 +521,7 @@ int RenderImage::calcAspectRatioWidth() const IntSize size = intrinsicSize(); if (!size.height()) return 0; - if (!hasImage() || errorOccurred()) + if (!m_imageResource->hasImage() || m_imageResource->errorOccurred()) return size.width(); // Don't bother scaling. return RenderReplaced::calcReplacedHeight() * size.width() / size.height(); } @@ -546,7 +531,7 @@ int RenderImage::calcAspectRatioHeight() const IntSize size = intrinsicSize(); if (!size.width()) return 0; - if (!hasImage() || errorOccurred()) + if (!m_imageResource->hasImage() || m_imageResource->errorOccurred()) return size.height(); // Don't bother scaling. return RenderReplaced::calcReplacedWidth() * size.height() / size.width(); } @@ -571,9 +556,4 @@ void RenderImage::calcPrefWidths() setPrefWidthsDirty(false); } -Image* RenderImage::nullImage() -{ - return Image::nullImage(); -} - } // namespace WebCore diff --git a/WebCore/rendering/RenderImage.h b/WebCore/rendering/RenderImage.h index b89a652..2b88c32 100644 --- a/WebCore/rendering/RenderImage.h +++ b/WebCore/rendering/RenderImage.h @@ -25,6 +25,7 @@ #ifndef RenderImage_h #define RenderImage_h +#include "RenderImageResource.h" #include "RenderReplaced.h" namespace WebCore { @@ -36,25 +37,21 @@ public: RenderImage(Node*); virtual ~RenderImage(); + void setImageResource(PassOwnPtr<RenderImageResource>); + + RenderImageResource* imageResource() { return m_imageResource.get(); } + const RenderImageResource* imageResource() const { return m_imageResource.get(); } + CachedImage* cachedImage() const { return m_imageResource->cachedImage(); } + bool setImageSizeForAltText(CachedImage* newImage = 0); void updateAltText(); - void setCachedImage(CachedImage*); - CachedImage* cachedImage() const { return m_cachedImage.get(); } - HTMLMapElement* imageMap() const; - void resetAnimation(); - - virtual bool hasImage() const { return m_cachedImage; } - void highQualityRepaintTimerFired(Timer<RenderImage>*); protected: - virtual Image* image(int /* width */ = 0, int /* height */ = 0) { return m_cachedImage ? m_cachedImage->image() : nullImage(); } - virtual bool errorOccurred() const { return m_cachedImage && m_cachedImage->errorOccurred(); } - virtual void imageChanged(WrappedImagePtr, const IntRect* = 0); virtual void paintIntoRect(GraphicsContext*, const IntRect&); @@ -64,14 +61,14 @@ protected: bool isWidthSpecified() const; bool isHeightSpecified() const; - virtual void intrinsicSizeChanged() { imageChanged(imagePtr()); } + virtual void intrinsicSizeChanged() { imageChanged(m_imageResource->imagePtr()); } private: virtual const char* renderName() const { return "RenderImage"; } virtual bool isImage() const { return true; } virtual bool isRenderImage() const { return true; } - + virtual void paintReplaced(PaintInfo&, int tx, int ty); virtual int minimumReplacedHeight() const; @@ -84,37 +81,25 @@ private: virtual void calcPrefWidths(); - virtual bool usesImageContainerSize() const { return m_cachedImage ? m_cachedImage->usesImageContainerSize() : false; } - virtual void setImageContainerSize(const IntSize& size) const { if (m_cachedImage) m_cachedImage->setImageContainerSize(size); } - virtual bool imageHasRelativeWidth() const { return m_cachedImage ? m_cachedImage->imageHasRelativeWidth() : false; } - virtual bool imageHasRelativeHeight() const { return m_cachedImage ? m_cachedImage->imageHasRelativeHeight() : false; } - virtual IntSize imageSize(float multiplier) const { return m_cachedImage ? m_cachedImage->imageSize(multiplier) : IntSize(); } - virtual WrappedImagePtr imagePtr() const { return m_cachedImage.get(); } - int calcAspectRatioWidth() const; int calcAspectRatioHeight() const; -protected: - // The image we are rendering. - CachedResourceHandle<CachedImage> m_cachedImage; - private: // Text to display as long as the image isn't available. String m_altText; + OwnPtr<RenderImageResource> m_imageResource; - static Image* nullImage(); - friend class RenderImageScaleObserver; }; inline RenderImage* toRenderImage(RenderObject* object) -{ +{ ASSERT(!object || object->isRenderImage()); return static_cast<RenderImage*>(object); } inline const RenderImage* toRenderImage(const RenderObject* object) -{ +{ ASSERT(!object || object->isRenderImage()); return static_cast<const RenderImage*>(object); } diff --git a/WebCore/rendering/RenderImageGeneratedContent.cpp b/WebCore/rendering/RenderImageGeneratedContent.cpp deleted file mode 100644 index 29d0508..0000000 --- a/WebCore/rendering/RenderImageGeneratedContent.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2008 Apple Computer, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 "RenderImageGeneratedContent.h" - -#include "RenderBlock.h" -#include "RenderStyle.h" -#include "StyleCachedImage.h" - -namespace WebCore { - -RenderImageGeneratedContent::RenderImageGeneratedContent(Node* n) -: RenderImage(n) -{} - -RenderImageGeneratedContent::~RenderImageGeneratedContent() -{ - m_cachedImage = 0; - m_styleImage->removeClient(this); -} - -void RenderImageGeneratedContent::setStyleImage(StyleImage* image) -{ - if (image->isCachedImage()) - m_cachedImage = static_cast<StyleCachedImage*>(image)->cachedImage(); - m_styleImage = image; - m_styleImage->addClient(this); -} - -} diff --git a/WebCore/rendering/RenderImageGeneratedContent.h b/WebCore/rendering/RenderImageGeneratedContent.h deleted file mode 100644 index 9f8330d..0000000 --- a/WebCore/rendering/RenderImageGeneratedContent.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2008 Apple Computer, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 RenderImageGeneratedContent_h -#define RenderImageGeneratedContent_h - -#include "RenderImage.h" -#include "StyleImage.h" -#include <wtf/RefPtr.h> - -namespace WebCore { - -class StyleImage; - -class RenderImageGeneratedContent : public RenderImage { -public: - RenderImageGeneratedContent(Node*); - virtual ~RenderImageGeneratedContent(); - - void setStyleImage(StyleImage*); - - virtual bool hasImage() const { return true; } - -protected: - virtual Image* image(int w = 0, int h = 0) { return m_styleImage->image(this, IntSize(w, h)); } - virtual bool errorOccurred() const { return m_styleImage->errorOccurred(); } - virtual bool usesImageContainerSize() const { return m_styleImage->usesImageContainerSize(); } - virtual void setImageContainerSize(const IntSize& size) const { m_styleImage->setImageContainerSize(size); } - virtual bool imageHasRelativeWidth() const { return m_styleImage->imageHasRelativeWidth(); } - virtual bool imageHasRelativeHeight() const { return m_styleImage->imageHasRelativeHeight(); } - virtual IntSize imageSize(float multiplier) const { return m_styleImage->imageSize(this, multiplier); } - - // |m_styleImage| can be 0 if we get a callback for a background image from RenderObject::setStyle. - virtual WrappedImagePtr imagePtr() const { return m_styleImage ? m_styleImage->data() : 0; } - -private: - RefPtr<StyleImage> m_styleImage; -}; - -} // namespace WebCore - -#endif // RenderImageGeneratedContent_h diff --git a/WebCore/rendering/RenderImageResource.cpp b/WebCore/rendering/RenderImageResource.cpp new file mode 100644 index 0000000..ea3ed2f --- /dev/null +++ b/WebCore/rendering/RenderImageResource.cpp @@ -0,0 +1,106 @@ +/* + * Copyright (C) 1999 Lars Knoll <knoll@kde.org> + * Copyright (C) 1999 Antti Koivisto <koivisto@kde.org> + * Copyright (C) 2000 Dirk Mueller <mueller@kde.org> + * Copyright (C) 2006 Allan Sandfeld Jensen <kde@carewolf.com> + * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> + * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. All rights reserved. + * Copyright (C) 2010 Google Inc. All rights reserved. + * 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 + * 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 "RenderImageResource.h" + +#include "RenderImageResourceStyleImage.h" +#include "RenderObject.h" + +namespace WebCore { + +RenderImageResource::RenderImageResource() + : m_renderer(0) + , m_cachedImage(0) +{ +} + +RenderImageResource::~RenderImageResource() +{ +} + +void RenderImageResource::initialize(RenderObject* renderer) +{ + ASSERT(!m_renderer); + ASSERT(renderer); + m_renderer = renderer; +} + +void RenderImageResource::shutdown() +{ + ASSERT(m_renderer); + + if (m_cachedImage) + m_cachedImage->removeClient(m_renderer); +} + +void RenderImageResource::setCachedImage(CachedImage* newImage) +{ + ASSERT(m_renderer); + + if (m_cachedImage == newImage) + return; + + if (m_cachedImage) + m_cachedImage->removeClient(m_renderer); + m_cachedImage = newImage; + if (m_cachedImage) { + m_cachedImage->addClient(m_renderer); + if (m_cachedImage->errorOccurred()) + m_renderer->imageChanged(m_cachedImage.get()); + } +} + +void RenderImageResource::resetAnimation() +{ + ASSERT(m_renderer); + + if (!m_cachedImage) + return; + + image()->resetAnimation(); + + if (!m_renderer->needsLayout()) + m_renderer->repaint(); +} + +void RenderImageResource::setImageContainerSize(const IntSize& size) const +{ + ASSERT(m_renderer); + + if (!m_cachedImage) + return; + + m_cachedImage->setImageContainerSize(size); +} + +Image* RenderImageResource::nullImage() +{ + return Image::nullImage(); +} + +} // namespace WebCore diff --git a/WebCore/rendering/RenderImageResource.h b/WebCore/rendering/RenderImageResource.h new file mode 100644 index 0000000..2346712 --- /dev/null +++ b/WebCore/rendering/RenderImageResource.h @@ -0,0 +1,79 @@ +/* + * Copyright (C) 1999 Lars Knoll <knoll@kde.org> + * Copyright (C) 1999 Antti Koivisto <koivisto@kde.org> + * Copyright (C) 2006 Allan Sandfeld Jensen <kde@carewolf.com> + * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> + * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Apple Inc. All rights reserved. + * 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 + * 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 RenderImageResource_h +#define RenderImageResource_h + +#include "CachedImage.h" +#include "CachedResourceHandle.h" +#include "StyleImage.h" +#include <wtf/Noncopyable.h> + +namespace WebCore { + +class RenderObject; + +class RenderImageResource : public Noncopyable { +public: + virtual ~RenderImageResource(); + + static PassOwnPtr<RenderImageResource> create() + { + return adoptPtr(new RenderImageResource); + } + + virtual void initialize(RenderObject*); + virtual void shutdown(); + + void setCachedImage(CachedImage*); + CachedImage* cachedImage() const { return m_cachedImage.get(); } + virtual bool hasImage() const { return m_cachedImage; } + + void resetAnimation(); + + virtual Image* image(int /* width */ = 0, int /* height */ = 0) { return m_cachedImage ? m_cachedImage->image() : nullImage(); } + virtual bool errorOccurred() const { return m_cachedImage && m_cachedImage->errorOccurred(); } + + virtual void setImageContainerSize(const IntSize& size) const; + virtual bool usesImageContainerSize() const { return m_cachedImage ? m_cachedImage->usesImageContainerSize() : false; } + virtual bool imageHasRelativeWidth() const { return m_cachedImage ? m_cachedImage->imageHasRelativeWidth() : false; } + virtual bool imageHasRelativeHeight() const { return m_cachedImage ? m_cachedImage->imageHasRelativeHeight() : false; } + + virtual IntSize imageSize(float multiplier) const { return m_cachedImage ? m_cachedImage->imageSize(multiplier) : IntSize(); } + + virtual WrappedImagePtr imagePtr() const { return m_cachedImage.get(); } + +protected: + RenderImageResource(); + RenderObject* m_renderer; + CachedResourceHandle<CachedImage> m_cachedImage; + +private: + static Image* nullImage(); +}; + +} // namespace WebCore + +#endif // RenderImage_h diff --git a/WebCore/rendering/RenderImageResourceStyleImage.cpp b/WebCore/rendering/RenderImageResourceStyleImage.cpp new file mode 100644 index 0000000..7f41984 --- /dev/null +++ b/WebCore/rendering/RenderImageResourceStyleImage.cpp @@ -0,0 +1,63 @@ +/* + * Copyright (C) 1999 Lars Knoll <knoll@kde.org> + * Copyright (C) 1999 Antti Koivisto <koivisto@kde.org> + * Copyright (C) 2000 Dirk Mueller <mueller@kde.org> + * Copyright (C) 2006 Allan Sandfeld Jensen <kde@carewolf.com> + * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> + * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. All rights reserved. + * Copyright (C) 2010 Google Inc. All rights reserved. + * 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 + * 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 "RenderImageResourceStyleImage.h" + +#include "RenderObject.h" +#include "StyleCachedImage.h" + +namespace WebCore { + +RenderImageResourceStyleImage::RenderImageResourceStyleImage(StyleImage* styleImage) + : m_styleImage(styleImage) +{ + ASSERT(m_styleImage); +} + +RenderImageResourceStyleImage::~RenderImageResourceStyleImage() +{ +} + +void RenderImageResourceStyleImage::initialize(RenderObject* renderer) +{ + RenderImageResource::initialize(renderer); + + if (m_styleImage->isCachedImage()) + m_cachedImage = static_cast<StyleCachedImage*>(m_styleImage.get())->cachedImage(); + + m_styleImage->addClient(m_renderer); +} + +void RenderImageResourceStyleImage::shutdown() +{ + ASSERT(m_renderer); + m_styleImage->removeClient(m_renderer); + m_cachedImage = 0; +} + +} // namespace WebCore diff --git a/WebCore/rendering/RenderImageResourceStyleImage.h b/WebCore/rendering/RenderImageResourceStyleImage.h new file mode 100644 index 0000000..d91aaa8 --- /dev/null +++ b/WebCore/rendering/RenderImageResourceStyleImage.h @@ -0,0 +1,68 @@ +/* + * Copyright (C) 1999 Lars Knoll <knoll@kde.org> + * Copyright (C) 1999 Antti Koivisto <koivisto@kde.org> + * Copyright (C) 2006 Allan Sandfeld Jensen <kde@carewolf.com> + * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> + * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Apple Inc. All rights reserved. + * 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 + * 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 RenderImageResourceStyleImage_h +#define RenderImageResourceStyleImage_h + +#include "RenderImageResource.h" +#include "StyleImage.h" +#include <wtf/RefPtr.h> + +namespace WebCore { + +class RenderObject; + +class RenderImageResourceStyleImage : public RenderImageResource { +public: + virtual ~RenderImageResourceStyleImage(); + + static PassOwnPtr<RenderImageResource> create(StyleImage* styleImage) + { + return adoptPtr(new RenderImageResourceStyleImage(styleImage)); + } + virtual void initialize(RenderObject*); + virtual void shutdown(); + + virtual bool hasImage() const { return true; } + virtual Image* image(int width = 0, int height = 0) { return m_styleImage->image(m_renderer, IntSize(width, height)); } + virtual bool errorOccurred() const { return m_styleImage->errorOccurred(); } + + virtual void setImageContainerSize(const IntSize& size) const { m_styleImage->setImageContainerSize(size); } + virtual bool usesImageContainerSize() const { return m_styleImage->usesImageContainerSize(); } + virtual bool imageHasRelativeWidth() const { return m_styleImage->imageHasRelativeWidth(); } + virtual bool imageHasRelativeHeight() const { return m_styleImage->imageHasRelativeHeight(); } + + virtual IntSize imageSize(float multiplier) const { return m_styleImage->imageSize(m_renderer, multiplier); } + + virtual WrappedImagePtr imagePtr() const { return m_styleImage->data(); } + +private: + RenderImageResourceStyleImage(StyleImage*); + RefPtr<StyleImage> m_styleImage; +}; + +} // namespace WebCore + +#endif // RenderImageStyleImage_h diff --git a/WebCore/rendering/RenderLayer.cpp b/WebCore/rendering/RenderLayer.cpp index 347fa32..331750c 100644 --- a/WebCore/rendering/RenderLayer.cpp +++ b/WebCore/rendering/RenderLayer.cpp @@ -2268,12 +2268,10 @@ bool RenderLayer::scroll(ScrollDirection direction, ScrollGranularity granularit bool didVerticalScroll = false; if (m_hBar) { - if (granularity == ScrollByDocument) { - // Special-case for the ScrollByDocument granularity. A document scroll can only be up - // or down and in both cases the horizontal bar goes all the way to the left. - didHorizontalScroll = m_hBar->scroll(ScrollLeft, ScrollByDocument, multiplier); - } else - didHorizontalScroll = m_hBar->scroll(direction, granularity, multiplier); + // Special-case for the ScrollByDocument granularity. A document scroll + // can only be up or down and in both cases the horizontal bar goes all + // the way to the left. + didHorizontalScroll = m_hBar->scroll((granularity == ScrollByDocument) ? ScrollLeft : direction, granularity, multiplier); } if (m_vBar) diff --git a/WebCore/rendering/RenderLayer.h b/WebCore/rendering/RenderLayer.h index 17521ad..3f0ac7c 100644 --- a/WebCore/rendering/RenderLayer.h +++ b/WebCore/rendering/RenderLayer.h @@ -277,7 +277,7 @@ public: void updateScrollInfoAfterLayout(); - bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1.0f); + bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1); void autoscroll(); void resize(const PlatformMouseEvent&, const IntSize&); diff --git a/WebCore/rendering/RenderLayerBacking.cpp b/WebCore/rendering/RenderLayerBacking.cpp index 23645d5..449466d 100644 --- a/WebCore/rendering/RenderLayerBacking.cpp +++ b/WebCore/rendering/RenderLayerBacking.cpp @@ -1163,9 +1163,11 @@ bool RenderLayerBacking::startAnimation(double timeOffset, const Animation* anim KeyframeValueList transformVector(AnimatedPropertyWebkitTransform); KeyframeValueList opacityVector(AnimatedPropertyOpacity); - for (Vector<KeyframeValue>::const_iterator it = keyframes.beginKeyframes(); it != keyframes.endKeyframes(); ++it) { - const RenderStyle* keyframeStyle = it->style(); - float key = it->key(); + size_t numKeyframes = keyframes.size(); + for (size_t i = 0; i < numKeyframes; ++i) { + const KeyframeValue& currentKeyframe = keyframes[i]; + const RenderStyle* keyframeStyle = currentKeyframe.style(); + float key = currentKeyframe.key(); if (!keyframeStyle) continue; @@ -1173,10 +1175,10 @@ bool RenderLayerBacking::startAnimation(double timeOffset, const Animation* anim // get timing function const TimingFunction* tf = keyframeStyle->hasAnimations() ? &((*keyframeStyle->animations()).animation(0)->timingFunction()) : 0; - if (hasTransform) + if (currentKeyframe.containsProperty(AnimatedPropertyWebkitTransform)) transformVector.insert(new TransformAnimationValue(key, &(keyframeStyle->transform()), tf)); - if (hasOpacity) + if (currentKeyframe.containsProperty(AnimatedPropertyOpacity)) opacityVector.insert(new FloatAnimationValue(key, keyframeStyle->opacity(), tf)); } diff --git a/WebCore/rendering/RenderLayerCompositor.h b/WebCore/rendering/RenderLayerCompositor.h index 917d610..86c061b 100644 --- a/WebCore/rendering/RenderLayerCompositor.h +++ b/WebCore/rendering/RenderLayerCompositor.h @@ -155,6 +155,7 @@ public: // their parent document. bool shouldPropagateCompositingToEnclosingIFrame() const; + // FIXME: This should be a RenderIFrame* HTMLFrameOwnerElement* enclosingIFrameElement() const; static RenderLayerCompositor* iframeContentsCompositor(RenderIFrame*); diff --git a/WebCore/rendering/RenderListBox.h b/WebCore/rendering/RenderListBox.h index aafb87e..36cb87a 100644 --- a/WebCore/rendering/RenderListBox.h +++ b/WebCore/rendering/RenderListBox.h @@ -68,7 +68,7 @@ private: virtual bool isPointInOverflowControl(HitTestResult&, int x, int y, int tx, int ty); - virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1.0f, Node** stopNode = 0); + virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1, Node** stopNode = 0); virtual void calcPrefWidths(); virtual int baselinePosition(bool firstLine, bool isRootLineBox) const; diff --git a/WebCore/rendering/RenderListItem.cpp b/WebCore/rendering/RenderListItem.cpp index f861467..2366a34 100644 --- a/WebCore/rendering/RenderListItem.cpp +++ b/WebCore/rendering/RenderListItem.cpp @@ -150,6 +150,7 @@ static RenderObject* getParentOfFirstLineBox(RenderBlock* curr, RenderObject* ma if (!firstChild) return 0; + bool inQuirksMode = curr->document()->inQuirksMode(); for (RenderObject* currChild = firstChild; currChild; currChild = currChild->nextSibling()) { if (currChild == marker) continue; @@ -163,7 +164,7 @@ static RenderObject* getParentOfFirstLineBox(RenderBlock* curr, RenderObject* ma if (currChild->isTable() || !currChild->isRenderBlock()) break; - if (curr->isListItem() && currChild->style()->htmlHacks() && currChild->node() && + if (curr->isListItem() && inQuirksMode && currChild->node() && (currChild->node()->hasTagName(ulTag)|| currChild->node()->hasTagName(olTag))) break; diff --git a/WebCore/rendering/RenderListMarker.cpp b/WebCore/rendering/RenderListMarker.cpp index 6ff1709..7b33c3d 100644 --- a/WebCore/rendering/RenderListMarker.cpp +++ b/WebCore/rendering/RenderListMarker.cpp @@ -79,7 +79,7 @@ static String toRoman(int number, bool upper) return String(&letters[lettersSize - length], length); } -static inline String toAlphabeticOrNumeric(int number, const UChar* sequence, int sequenceSize, SequenceType type) +static inline String toAlphabeticOrNumeric(int number, const UChar* sequence, unsigned sequenceSize, SequenceType type) { ASSERT(sequenceSize >= 2); @@ -115,12 +115,28 @@ static inline String toAlphabeticOrNumeric(int number, const UChar* sequence, in return String(&letters[lettersSize - length], length); } -static String toAlphabetic(int number, const UChar* alphabet, int alphabetSize) +static String toSymbolic(int number, const UChar* symbols, unsigned symbolsSize) +{ + ASSERT(number > 0); + ASSERT(symbolsSize >= 1); + unsigned numberShadow = number; + --numberShadow; + + // The asterisks list-style-type is the worst case; we show |numberShadow| asterisks. + Vector<UChar> letters; + letters.append(symbols[numberShadow % symbolsSize]); + unsigned numSymbols = numberShadow / symbolsSize; + while (numSymbols--) + letters.append(symbols[numberShadow % symbolsSize]); + return String::adopt(letters); +} + +static String toAlphabetic(int number, const UChar* alphabet, unsigned alphabetSize) { return toAlphabeticOrNumeric(number, alphabet, alphabetSize, AlphabeticSequence); } -static String toNumeric(int number, const UChar* numerals, int numeralsSize) +static String toNumeric(int number, const UChar* numerals, unsigned numeralsSize) { return toAlphabeticOrNumeric(number, numerals, numeralsSize, NumericSequence); } @@ -135,6 +151,11 @@ template <size_t size> static inline String toNumeric(int number, const UChar(&a return toNumeric(number, alphabet, size); } +template <size_t size> static inline String toSymbolic(int number, const UChar(&alphabet)[size]) +{ + return toSymbolic(number, alphabet, size); +} + static int toHebrewUnder1000(int number, UChar letters[5]) { // FIXME: CSS3 mentions various refinements not implemented here. @@ -419,6 +440,7 @@ static EListStyleType effectiveListMarkerType(EListStyleType type, int value) case Afar: case Amharic: case AmharicAbegede: + case Asterisks: case CjkEarthlyBranch: case CjkHeavenlyStem: case Ethiopic: @@ -437,6 +459,7 @@ static EListStyleType effectiveListMarkerType(EListStyleType type, int value) case EthiopicHalehameTiEr: case EthiopicHalehameTiEt: case EthiopicHalehameTig: + case Footnotes: case Hangul: case HangulConsonant: case Hiragana: @@ -475,9 +498,11 @@ static UChar listMarkerSuffix(EListStyleType type, int value) // Note, the following switch statement has been explicitly // grouped by list-style-type suffix. switch (effectiveType) { - case NoneListStyle: - case Disc: + case Asterisks: case Circle: + case Disc: + case Footnotes: + case NoneListStyle: case Square: ASSERT_NOT_REACHED(); return ' '; @@ -570,12 +595,24 @@ String listMarkerText(EListStyleType type, int value) case NoneListStyle: return ""; + case Asterisks: { + static const UChar asterisksSymbols[1] = { + 0x002A + }; + return toSymbolic(value, asterisksSymbols); + } // We use the same characters for text security. // See RenderText::setInternalString. case Circle: return String(&whiteBullet, 1); case Disc: return String(&bullet, 1); + case Footnotes: { + static const UChar footnotesSymbols[4] = { + 0x002A, 0x2051, 0x2020, 0x2021 + }; + return toSymbolic(value, footnotesSymbols); + } case Square: // The CSS 2.1 test suite uses U+25EE BLACK MEDIUM SMALL SQUARE // instead, but I think this looks better. @@ -1110,6 +1147,10 @@ void RenderListMarker::paint(PaintInfo& paintInfo, int tx, int ty) EListStyleType type = style()->listStyleType(); switch (type) { + case Asterisks: + case Footnotes: + context->drawText(style()->font(), TextRun(m_text), marker.location()); + return; case Disc: context->drawEllipse(marker); return; @@ -1291,6 +1332,11 @@ void RenderListMarker::calcPrefWidths() switch (type) { case NoneListStyle: break; + case Asterisks: + case Footnotes: + m_text = listMarkerText(type, m_listItem->value()); + width = font.width(m_text); // no suffix for these types + break; case Circle: case Disc: case Square: @@ -1489,6 +1535,11 @@ IntRect RenderListMarker::getRelativeMarkerRect() EListStyleType type = style()->listStyleType(); switch (type) { + case Asterisks: + case Footnotes: { + const Font& font = style()->font(); + return IntRect(x(), y() + font.ascent(), font.width(m_text), font.height()); + } case Disc: case Circle: case Square: { diff --git a/WebCore/rendering/RenderMedia.cpp b/WebCore/rendering/RenderMedia.cpp index d7b4a99..a589a2d 100644 --- a/WebCore/rendering/RenderMedia.cpp +++ b/WebCore/rendering/RenderMedia.cpp @@ -57,6 +57,7 @@ RenderMedia::RenderMedia(HTMLMediaElement* video) , m_opacityAnimationFrom(0) , m_opacityAnimationTo(1.0f) { + setImageResource(RenderImageResource::create()); } RenderMedia::RenderMedia(HTMLMediaElement* video, const IntSize& intrinsicSize) @@ -69,6 +70,7 @@ RenderMedia::RenderMedia(HTMLMediaElement* video, const IntSize& intrinsicSize) , m_opacityAnimationFrom(0) , m_opacityAnimationTo(1.0f) { + setImageResource(RenderImageResource::create()); setIntrinsicSize(intrinsicSize); } diff --git a/WebCore/rendering/RenderObject.cpp b/WebCore/rendering/RenderObject.cpp index 78da758..9ee97b4 100644 --- a/WebCore/rendering/RenderObject.cpp +++ b/WebCore/rendering/RenderObject.cpp @@ -41,7 +41,8 @@ #include "RenderArena.h" #include "RenderCounter.h" #include "RenderFlexibleBox.h" -#include "RenderImageGeneratedContent.h" +#include "RenderImage.h" +#include "RenderImageResourceStyleImage.h" #include "RenderInline.h" #include "RenderLayer.h" #include "RenderListItem.h" @@ -110,10 +111,12 @@ RenderObject* RenderObject::createObject(Node* node, RenderStyle* style) // Otherwise acts as if we didn't support this feature. const ContentData* contentData = style->contentData(); if (contentData && !contentData->next() && contentData->isImage() && doc != node) { - RenderImageGeneratedContent* image = new (arena) RenderImageGeneratedContent(node); + RenderImage* image = new (arena) RenderImage(node); image->setStyle(style); if (StyleImage* styleImage = contentData->image()) - image->setStyleImage(styleImage); + image->setImageResource(RenderImageResourceStyleImage::create(styleImage)); + else + image->setImageResource(RenderImageResource::create()); return image; } @@ -1425,7 +1428,8 @@ bool RenderObject::repaintAfterLayoutIfNeeded(RenderBoxModelObject* repaintConta style()->getBoxShadowHorizontalExtent(shadowLeft, shadowRight); int borderRight = isBox() ? toRenderBox(this)->borderRight() : 0; - int borderWidth = max(-outlineStyle->outlineOffset(), max(borderRight, max(style()->borderTopRightRadius().width(), style()->borderBottomRightRadius().width()))) + max(ow, shadowRight); + int boxWidth = isBox() ? toRenderBox(this)->width() : 0; + int borderWidth = max(-outlineStyle->outlineOffset(), max(borderRight, max(style()->borderTopRightRadius().width().calcValue(boxWidth), style()->borderBottomRightRadius().width().calcValue(boxWidth)))) + max(ow, shadowRight); IntRect rightRect(newOutlineBox.x() + min(newOutlineBox.width(), oldOutlineBox.width()) - borderWidth, newOutlineBox.y(), width + borderWidth, @@ -1443,7 +1447,8 @@ bool RenderObject::repaintAfterLayoutIfNeeded(RenderBoxModelObject* repaintConta style()->getBoxShadowVerticalExtent(shadowTop, shadowBottom); int borderBottom = isBox() ? toRenderBox(this)->borderBottom() : 0; - int borderHeight = max(-outlineStyle->outlineOffset(), max(borderBottom, max(style()->borderBottomLeftRadius().height(), style()->borderBottomRightRadius().height()))) + max(ow, shadowBottom); + int boxHeight = isBox() ? toRenderBox(this)->height() : 0; + int borderHeight = max(-outlineStyle->outlineOffset(), max(borderBottom, max(style()->borderBottomLeftRadius().height().calcValue(boxHeight), style()->borderBottomRightRadius().height().calcValue(boxHeight)))) + max(ow, shadowBottom); IntRect bottomRect(newOutlineBox.x(), min(newOutlineBox.bottom(), oldOutlineBox.bottom()) - borderHeight, max(newOutlineBox.width(), oldOutlineBox.width()), @@ -2556,27 +2561,11 @@ void RenderObject::adjustRectForOutlineAndShadow(IntRect& rect) const { int outlineSize = outlineStyleForRepaint()->outlineSize(); if (const ShadowData* boxShadow = style()->boxShadow()) { - int shadowLeft = 0; - int shadowRight = 0; - int shadowTop = 0; - int shadowBottom = 0; - - do { - if (boxShadow->style() == Normal) { - shadowLeft = min(boxShadow->x() - boxShadow->blur() - boxShadow->spread() - outlineSize, shadowLeft); - shadowRight = max(boxShadow->x() + boxShadow->blur() + boxShadow->spread() + outlineSize, shadowRight); - shadowTop = min(boxShadow->y() - boxShadow->blur() - boxShadow->spread() - outlineSize, shadowTop); - shadowBottom = max(boxShadow->y() + boxShadow->blur() + boxShadow->spread() + outlineSize, shadowBottom); - } - - boxShadow = boxShadow->next(); - } while (boxShadow); + boxShadow->adjustRectForShadow(rect, outlineSize); + return; + } - rect.move(shadowLeft, shadowTop); - rect.setWidth(rect.width() - shadowLeft + shadowRight); - rect.setHeight(rect.height() - shadowTop + shadowBottom); - } else - rect.inflate(outlineSize); + rect.inflate(outlineSize); } AnimationController* RenderObject::animation() const @@ -2708,6 +2697,12 @@ RenderSVGResourceContainer* RenderObject::toRenderSVGResourceContainer() return 0; } +void RenderObject::setNeedsBoundariesUpdate() +{ + if (RenderObject* renderer = parent()) + renderer->setNeedsBoundariesUpdate(); +} + FloatRect RenderObject::objectBoundingBox() const { ASSERT_NOT_REACHED(); diff --git a/WebCore/rendering/RenderObject.h b/WebCore/rendering/RenderObject.h index d2046cf..9fbaf91 100644 --- a/WebCore/rendering/RenderObject.h +++ b/WebCore/rendering/RenderObject.h @@ -327,7 +327,7 @@ public: // Unfortunately we don't have such a class yet, because it's not possible for all renderers // to inherit from RenderSVGObject -> RenderObject (some need RenderBlock inheritance for instance) virtual void setNeedsTransformUpdate() { } - virtual void setNeedsBoundariesUpdate() { } + virtual void setNeedsBoundariesUpdate(); // Per SVG 1.1 objectBoundingBox ignores clipping, masking, filter effects, opacity and stroke-width. // This is used for all computation of objectBoundingBox relative units and by SVGLocateable::getBBox(). @@ -383,14 +383,7 @@ public: bool hasBoxDecorations() const { return m_paintBackground; } bool mustRepaintBackgroundOrBorder() const; - bool hasBackground() const - { - Color color = style()->visitedDependentColor(CSSPropertyBackgroundColor); - if (color.isValid() && color.alpha() > 0) - return true; - return style()->hasBackgroundImage(); - } - + bool hasBackground() const { return style()->hasBackground(); } bool needsLayout() const { return m_needsLayout || m_normalChildNeedsLayout || m_posChildNeedsLayout || m_needsPositionedMovementLayout; } bool selfNeedsLayout() const { return m_needsLayout; } bool needsPositionedMovementLayout() const { return m_needsPositionedMovementLayout; } diff --git a/WebCore/rendering/RenderObjectChildList.cpp b/WebCore/rendering/RenderObjectChildList.cpp index 68e392c..96ec800 100644 --- a/WebCore/rendering/RenderObjectChildList.cpp +++ b/WebCore/rendering/RenderObjectChildList.cpp @@ -30,7 +30,8 @@ #include "AXObjectCache.h" #include "RenderBlock.h" #include "RenderCounter.h" -#include "RenderImageGeneratedContent.h" +#include "RenderImage.h" +#include "RenderImageResourceStyleImage.h" #include "RenderInline.h" #include "RenderLayer.h" #include "RenderListItem.h" @@ -97,6 +98,11 @@ RenderObject* RenderObjectChildList::removeChildNode(RenderObject* owner, Render if (oldChild->isPositioned() && owner->childrenInline()) owner->dirtyLinesFromChangedChild(oldChild); + +#if ENABLE(SVG) + // Update cached boundaries in SVG renderers, if a child is removed. + owner->setNeedsBoundariesUpdate(); +#endif } // If oldChild is the start or end of the selection, then clear the selection to @@ -430,12 +436,14 @@ void RenderObjectChildList::updateBeforeAfterContent(RenderObject* owner, Pseudo renderer->setStyle(pseudoElementStyle); break; case CONTENT_OBJECT: { - RenderImageGeneratedContent* image = new (owner->renderArena()) RenderImageGeneratedContent(owner->document()); // anonymous object + RenderImage* image = new (owner->renderArena()) RenderImage(owner->document()); // anonymous object RefPtr<RenderStyle> style = RenderStyle::create(); style->inheritFrom(pseudoElementStyle); image->setStyle(style.release()); if (StyleImage* styleImage = content->image()) - image->setStyleImage(styleImage); + image->setImageResource(RenderImageResourceStyleImage::create(styleImage)); + else + image->setImageResource(RenderImageResource::create()); renderer = image; break; } diff --git a/WebCore/rendering/RenderPath.cpp b/WebCore/rendering/RenderPath.cpp index 86a12c8..0f31df1 100644 --- a/WebCore/rendering/RenderPath.cpp +++ b/WebCore/rendering/RenderPath.cpp @@ -101,28 +101,39 @@ void RenderPath::layout() LayoutRepainter repainter(*this, m_everHadLayout && checkForRepaintDuringLayout()); SVGStyledTransformableElement* element = static_cast<SVGStyledTransformableElement*>(node()); + bool updateCachedBoundariesInParents = false; + bool needsPathUpdate = m_needsPathUpdate; if (needsPathUpdate) { m_path = element->toPathData(); m_needsPathUpdate = false; + updateCachedBoundariesInParents = true; } if (m_needsTransformUpdate) { m_localTransform = element->animatedLocalTransform(); m_needsTransformUpdate = false; + updateCachedBoundariesInParents = true; } + if (m_needsBoundariesUpdate) + updateCachedBoundariesInParents = true; + // Invalidate all resources of this client if our layout changed. if (m_everHadLayout && selfNeedsLayout()) SVGResourcesCache::clientLayoutChanged(this); // At this point LayoutRepainter already grabbed the old bounds, - // recalculate them now so repaintAfterLayout() uses the new bounds + // recalculate them now so repaintAfterLayout() uses the new bounds. if (needsPathUpdate || m_needsBoundariesUpdate) { updateCachedBoundaries(); m_needsBoundariesUpdate = false; } + // If our bounds changed, notify the parents. + if (updateCachedBoundariesInParents) + RenderSVGModelObject::setNeedsBoundariesUpdate(); + repainter.repaintAfterLayout(); setNeedsLayout(false); } @@ -172,8 +183,7 @@ void RenderPath::paint(PaintInfo& paintInfo, int, int) return; FloatRect boundingBox = repaintRectInLocalCoordinates(); - FloatRect nonLocalBoundingBox = m_localTransform.mapRect(boundingBox); - if (!nonLocalBoundingBox.intersects(paintInfo.rect)) + if (!SVGRenderSupport::paintInfoIntersectsRepaintRect(boundingBox, m_localTransform, paintInfo)) return; PaintInfo childPaintInfo(paintInfo); @@ -270,13 +280,6 @@ FloatRect RenderPath::calculateMarkerBoundsIfNeeded() return m_markerLayoutInfo.calculateBoundaries(markerStart, markerMid, markerEnd, svgStyle->strokeWidth().value(svgElement), m_path); } -void RenderPath::styleWillChange(StyleDifference diff, const RenderStyle* newStyle) -{ - if (diff == StyleDifferenceLayout) - setNeedsBoundariesUpdate(); - RenderSVGModelObject::styleWillChange(diff, newStyle); -} - void RenderPath::updateCachedBoundaries() { if (m_path.isEmpty()) { diff --git a/WebCore/rendering/RenderPath.h b/WebCore/rendering/RenderPath.h index 1bdac07..1d35a01 100644 --- a/WebCore/rendering/RenderPath.h +++ b/WebCore/rendering/RenderPath.h @@ -41,8 +41,8 @@ public: RenderPath(SVGStyledTransformableElement*); const Path& path() const { return m_path; } - void setNeedsBoundariesUpdate() { m_needsBoundariesUpdate = true; } void setNeedsPathUpdate() { m_needsPathUpdate = true; } + virtual void setNeedsBoundariesUpdate() { m_needsBoundariesUpdate = true; } virtual void setNeedsTransformUpdate() { m_needsTransformUpdate = true; } private: @@ -63,7 +63,6 @@ private: virtual void addFocusRingRects(Vector<IntRect>&, int tx, int ty); virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction); - virtual void styleWillChange(StyleDifference, const RenderStyle*); FloatRect calculateMarkerBoundsIfNeeded(); void updateCachedBoundaries(); diff --git a/WebCore/rendering/RenderRuby.cpp b/WebCore/rendering/RenderRuby.cpp index 4ab9d73..2f543d5 100644 --- a/WebCore/rendering/RenderRuby.cpp +++ b/WebCore/rendering/RenderRuby.cpp @@ -75,24 +75,19 @@ bool RenderRubyAsInline::isChildAllowed(RenderObject* child, RenderStyle*) const void RenderRubyAsInline::addChild(RenderObject* child, RenderObject* beforeChild) { - // Note: ':after' content is handled implicitely below + // Note: ':after' content is handled implicitly below - // if child is a ruby run, just add it normally if (child->isRubyRun()) { RenderInline::addChild(child, beforeChild); return; } - if (beforeChild && !isAfterContent(beforeChild)) { - // insert child into run - ASSERT(!beforeChild->isRubyRun()); - RenderRubyRun* run = findRubyRunParent(beforeChild); - ASSERT(run); // beforeChild should always have a run as parent - if (run) { + if (beforeChild && !isAfterContent(beforeChild) && !beforeChild->isRubyRun()) { + if (RenderRubyRun* run = findRubyRunParent(beforeChild)) { run->addChild(child, beforeChild); return; } - ASSERT(false); // beforeChild should always have a run as parent! + ASSERT_NOT_REACHED(); // beforeChild should always have a run as parent! // Emergency fallback: fall through and just append. } diff --git a/WebCore/rendering/RenderSVGBlock.cpp b/WebCore/rendering/RenderSVGBlock.cpp index d6022b5..b2d727a 100644 --- a/WebCore/rendering/RenderSVGBlock.cpp +++ b/WebCore/rendering/RenderSVGBlock.cpp @@ -81,6 +81,13 @@ void RenderSVGBlock::destroy() RenderBlock::destroy(); } +void RenderSVGBlock::styleWillChange(StyleDifference diff, const RenderStyle* newStyle) +{ + if (diff == StyleDifferenceLayout) + setNeedsBoundariesUpdate(); + RenderBlock::styleWillChange(diff, newStyle); +} + void RenderSVGBlock::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle) { RenderBlock::styleDidChange(diff, oldStyle); diff --git a/WebCore/rendering/RenderSVGBlock.h b/WebCore/rendering/RenderSVGBlock.h index c4337cc..c1379da 100644 --- a/WebCore/rendering/RenderSVGBlock.h +++ b/WebCore/rendering/RenderSVGBlock.h @@ -40,6 +40,7 @@ private: virtual void absoluteRects(Vector<IntRect>&, int tx, int ty); virtual void destroy(); + virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle); virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); virtual void updateFromElement(); }; diff --git a/WebCore/rendering/RenderSVGContainer.cpp b/WebCore/rendering/RenderSVGContainer.cpp index bab07a4..8c99270 100644 --- a/WebCore/rendering/RenderSVGContainer.cpp +++ b/WebCore/rendering/RenderSVGContainer.cpp @@ -39,6 +39,7 @@ namespace WebCore { RenderSVGContainer::RenderSVGContainer(SVGStyledElement* node) : RenderSVGModelObject(node) , m_drawsContents(true) + , m_needsBoundariesUpdate(true) { } @@ -55,7 +56,7 @@ void RenderSVGContainer::layout() LayoutRepainter repainter(*this, m_everHadLayout && checkForRepaintDuringLayout()); // Allow RenderSVGTransformableContainer to update its transform. - calculateLocalTransform(); + bool updatedTransform = calculateLocalTransform(); SVGRenderSupport::layoutChildren(this, selfNeedsLayout()); @@ -63,6 +64,16 @@ void RenderSVGContainer::layout() if (m_everHadLayout && selfNeedsLayout()) SVGResourcesCache::clientLayoutChanged(this); + // At this point LayoutRepainter already grabbed the old bounds, + // recalculate them now so repaintAfterLayout() uses the new bounds. + if (m_needsBoundariesUpdate || updatedTransform) { + updateCachedBoundaries(); + m_needsBoundariesUpdate = false; + + // If our bounds changed, notify the parents. + RenderSVGModelObject::setNeedsBoundariesUpdate(); + } + repainter.repaintAfterLayout(); setNeedsLayout(false); } @@ -86,6 +97,10 @@ void RenderSVGContainer::paint(PaintInfo& paintInfo, int, int) if (!firstChild() && !selfWillPaint()) return; + FloatRect repaintRect = repaintRectInLocalCoordinates(); + if (!SVGRenderSupport::paintInfoIntersectsRepaintRect(repaintRect, localToParentTransform(), paintInfo)) + return; + PaintInfo childPaintInfo(paintInfo); childPaintInfo.context->save(); @@ -115,7 +130,7 @@ void RenderSVGContainer::paint(PaintInfo& paintInfo, int, int) // FIXME: This means our focus ring won't share our rotation like it should. // We should instead disable our clip during PaintPhaseOutline if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) && style()->outlineWidth() && style()->visibility() == VISIBLE) { - IntRect paintRectInParent = enclosingIntRect(localToParentTransform().mapRect(repaintRectInLocalCoordinates())); + IntRect paintRectInParent = enclosingIntRect(localToParentTransform().mapRect(repaintRect)); paintOutline(paintInfo.context, paintRectInParent.x(), paintRectInParent.y(), paintRectInParent.width(), paintRectInParent.height()); } } @@ -128,21 +143,14 @@ void RenderSVGContainer::addFocusRingRects(Vector<IntRect>& rects, int, int) rects.append(paintRectInParent); } -FloatRect RenderSVGContainer::objectBoundingBox() const +void RenderSVGContainer::updateCachedBoundaries() { - return SVGRenderSupport::computeContainerBoundingBox(this, SVGRenderSupport::ObjectBoundingBox); -} + m_objectBoundingBox = FloatRect(); + m_strokeBoundingBox = FloatRect(); + m_repaintBoundingBox = FloatRect(); -FloatRect RenderSVGContainer::strokeBoundingBox() const -{ - return SVGRenderSupport::computeContainerBoundingBox(this, SVGRenderSupport::StrokeBoundingBox); -} - -FloatRect RenderSVGContainer::repaintRectInLocalCoordinates() const -{ - FloatRect repaintRect = SVGRenderSupport::computeContainerBoundingBox(this, SVGRenderSupport::RepaintBoundingBox); - SVGRenderSupport::intersectRepaintRectWithResources(this, repaintRect); - return repaintRect; + SVGRenderSupport::computeContainerBoundingBoxes(this, m_objectBoundingBox, m_strokeBoundingBox, m_repaintBoundingBox); + SVGRenderSupport::intersectRepaintRectWithResources(this, m_repaintBoundingBox); } bool RenderSVGContainer::nodeAtFloatPoint(const HitTestRequest& request, HitTestResult& result, const FloatPoint& pointInParent, HitTestAction hitTestAction) diff --git a/WebCore/rendering/RenderSVGContainer.h b/WebCore/rendering/RenderSVGContainer.h index 0a122cd..b0c952f 100644 --- a/WebCore/rendering/RenderSVGContainer.h +++ b/WebCore/rendering/RenderSVGContainer.h @@ -43,6 +43,7 @@ public: bool drawsContents() const { return m_drawsContents; } virtual void paint(PaintInfo&, int parentX, int parentY); + virtual void setNeedsBoundariesUpdate() { m_needsBoundariesUpdate = true; } protected: virtual RenderObjectChildList* virtualChildren() { return children(); } @@ -55,14 +56,14 @@ protected: virtual void addFocusRingRects(Vector<IntRect>&, int tx, int ty); - virtual FloatRect objectBoundingBox() const; - virtual FloatRect strokeBoundingBox() const; - virtual FloatRect repaintRectInLocalCoordinates() const; + virtual FloatRect objectBoundingBox() const { return m_objectBoundingBox; } + virtual FloatRect strokeBoundingBox() const { return m_strokeBoundingBox; } + virtual FloatRect repaintRectInLocalCoordinates() const { return m_repaintBoundingBox; } virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction); // Allow RenderSVGTransformableContainer to hook in at the right time in layout() - virtual void calculateLocalTransform() { } + virtual bool calculateLocalTransform() { return false; } // Allow RenderSVGViewportContainer to hook in at the right times in layout(), paint() and nodeAtFloatPoint() virtual void calcViewport() { } @@ -70,10 +71,15 @@ protected: virtual bool pointIsInsideViewportClip(const FloatPoint& /*pointInParent*/) { return true; } bool selfWillPaint(); + void updateCachedBoundaries(); private: RenderObjectChildList m_children; + FloatRect m_objectBoundingBox; + FloatRect m_strokeBoundingBox; + FloatRect m_repaintBoundingBox; bool m_drawsContents : 1; + bool m_needsBoundariesUpdate : 1; }; inline RenderSVGContainer* toRenderSVGContainer(RenderObject* object) diff --git a/WebCore/rendering/RenderSVGGradientStop.h b/WebCore/rendering/RenderSVGGradientStop.h index 45da7b4..f06a9a5 100644 --- a/WebCore/rendering/RenderSVGGradientStop.h +++ b/WebCore/rendering/RenderSVGGradientStop.h @@ -46,6 +46,7 @@ public: // https://bugs.webkit.org/show_bug.cgi?id=20400 virtual IntRect clippedOverflowRectForRepaint(RenderBoxModelObject*) { return IntRect(); } virtual FloatRect objectBoundingBox() const { return FloatRect(); } + virtual FloatRect strokeBoundingBox() const { return FloatRect(); } virtual FloatRect repaintRectInLocalCoordinates() const { return FloatRect(); } protected: diff --git a/WebCore/rendering/RenderSVGHiddenContainer.cpp b/WebCore/rendering/RenderSVGHiddenContainer.cpp index 0af4236..ee1d214 100644 --- a/WebCore/rendering/RenderSVGHiddenContainer.cpp +++ b/WebCore/rendering/RenderSVGHiddenContainer.cpp @@ -47,11 +47,6 @@ void RenderSVGHiddenContainer::paint(PaintInfo&, int, int) // This subtree does not paint. } -IntRect RenderSVGHiddenContainer::clippedOverflowRectForRepaint(RenderBoxModelObject* /*repaintContainer*/) -{ - return IntRect(); -} - void RenderSVGHiddenContainer::absoluteQuads(Vector<FloatQuad>&) { // This subtree does not take up space or paint @@ -62,16 +57,6 @@ bool RenderSVGHiddenContainer::nodeAtFloatPoint(const HitTestRequest&, HitTestRe return false; } -FloatRect RenderSVGHiddenContainer::objectBoundingBox() const -{ - return FloatRect(); -} - -FloatRect RenderSVGHiddenContainer::repaintRectInLocalCoordinates() const -{ - return FloatRect(); -} - } #endif // ENABLE(SVG) diff --git a/WebCore/rendering/RenderSVGHiddenContainer.h b/WebCore/rendering/RenderSVGHiddenContainer.h index e0daac1..97800d4 100644 --- a/WebCore/rendering/RenderSVGHiddenContainer.h +++ b/WebCore/rendering/RenderSVGHiddenContainer.h @@ -47,12 +47,9 @@ namespace WebCore { virtual void paint(PaintInfo&, int parentX, int parentY); - virtual IntRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer); + virtual IntRect clippedOverflowRectForRepaint(RenderBoxModelObject*) { return IntRect(); } virtual void absoluteQuads(Vector<FloatQuad>&); - virtual FloatRect objectBoundingBox() const; - virtual FloatRect repaintRectInLocalCoordinates() const; - virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction); }; } diff --git a/WebCore/rendering/RenderSVGImage.cpp b/WebCore/rendering/RenderSVGImage.cpp index 893a4ea..0056fa3 100644 --- a/WebCore/rendering/RenderSVGImage.cpp +++ b/WebCore/rendering/RenderSVGImage.cpp @@ -5,6 +5,7 @@ Copyright (C) 2007, 2008, 2009 Rob Buis <buis@kde.org> Copyright (C) 2009, Google, Inc. Copyright (C) 2009 Dirk Schulze <krit@webkit.org> + 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 @@ -32,6 +33,7 @@ #include "FloatQuad.h" #include "GraphicsContext.h" #include "PointerEventsHitRules.h" +#include "RenderImageResource.h" #include "RenderLayer.h" #include "RenderSVGResourceContainer.h" #include "RenderSVGResourceFilter.h" @@ -44,9 +46,16 @@ namespace WebCore { RenderSVGImage::RenderSVGImage(SVGImageElement* impl) - : RenderImage(impl) + : RenderSVGModelObject(impl) , m_needsTransformUpdate(true) + , m_imageResource(RenderImageResource::create()) { + m_imageResource->initialize(this); +} + +RenderSVGImage::~RenderSVGImage() +{ + m_imageResource->shutdown(); } void RenderSVGImage::layout() @@ -56,75 +65,72 @@ void RenderSVGImage::layout() LayoutRepainter repainter(*this, m_everHadLayout && checkForRepaintDuringLayout()); SVGImageElement* image = static_cast<SVGImageElement*>(node()); + bool updateCachedBoundariesInParents = false; if (m_needsTransformUpdate) { m_localTransform = image->animatedLocalTransform(); m_needsTransformUpdate = false; + updateCachedBoundariesInParents = true; } - // minimum height - setHeight(errorOccurred() ? intrinsicSize().height() : 0); - - calcWidth(); - calcHeight(); - // FIXME: Optimize caching the repaint rects. + FloatRect oldBoundaries = m_localBounds; m_localBounds = FloatRect(image->x().value(image), image->y().value(image), image->width().value(image), image->height().value(image)); m_cachedLocalRepaintRect = FloatRect(); + if (!updateCachedBoundariesInParents) + updateCachedBoundariesInParents = oldBoundaries != m_localBounds; + // Invalidate all resources of this client if our layout changed. if (m_everHadLayout && selfNeedsLayout()) SVGResourcesCache::clientLayoutChanged(this); + // If our bounds changed, notify the parents. + if (updateCachedBoundariesInParents) + RenderSVGModelObject::setNeedsBoundariesUpdate(); + repainter.repaintAfterLayout(); setNeedsLayout(false); } void RenderSVGImage::paint(PaintInfo& paintInfo, int, int) { - if (paintInfo.context->paintingDisabled() || style()->visibility() == HIDDEN) + if (paintInfo.context->paintingDisabled() || style()->visibility() == HIDDEN || !m_imageResource->hasImage()) return; - paintInfo.context->save(); - paintInfo.context->concatCTM(localToParentTransform()); - - if (paintInfo.phase == PaintPhaseForeground) { - PaintInfo savedInfo(paintInfo); + FloatRect boundingBox = repaintRectInLocalCoordinates(); + if (!SVGRenderSupport::paintInfoIntersectsRepaintRect(boundingBox, m_localTransform, paintInfo)) + return; - if (SVGRenderSupport::prepareToRenderSVGContent(this, paintInfo)) { - FloatRect destRect = m_localBounds; - FloatRect srcRect(0, 0, image()->width(), image()->height()); + PaintInfo childPaintInfo(paintInfo); + bool drawsOutline = style()->outlineWidth() && (childPaintInfo.phase == PaintPhaseOutline || childPaintInfo.phase == PaintPhaseSelfOutline); + if (drawsOutline || childPaintInfo.phase == PaintPhaseForeground) { + childPaintInfo.context->save(); + childPaintInfo.applyTransform(m_localTransform); - SVGImageElement* imageElt = static_cast<SVGImageElement*>(node()); - if (imageElt->preserveAspectRatio().align() != SVGPreserveAspectRatio::SVG_PRESERVEASPECTRATIO_NONE) - imageElt->preserveAspectRatio().transformRect(destRect, srcRect); + if (childPaintInfo.phase == PaintPhaseForeground) { + PaintInfo savedInfo(childPaintInfo); - paintInfo.context->drawImage(image(), DeviceColorSpace, destRect, srcRect); - } - SVGRenderSupport::finishRenderSVGContent(this, paintInfo, savedInfo.context); - } + if (SVGRenderSupport::prepareToRenderSVGContent(this, childPaintInfo)) { + Image* image = m_imageResource->image(); + FloatRect destRect = m_localBounds; + FloatRect srcRect(0, 0, image->width(), image->height()); - if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) && style()->outlineWidth()) - paintOutline(paintInfo.context, 0, 0, width(), height()); + SVGImageElement* imageElement = static_cast<SVGImageElement*>(node()); + if (imageElement->preserveAspectRatio().align() != SVGPreserveAspectRatio::SVG_PRESERVEASPECTRATIO_NONE) + imageElement->preserveAspectRatio().transformRect(destRect, srcRect); - paintInfo.context->restore(); -} - -void RenderSVGImage::destroy() -{ - SVGResourcesCache::clientDestroyed(this); - RenderImage::destroy(); -} + childPaintInfo.context->drawImage(image, DeviceColorSpace, destRect, srcRect); + } -void RenderSVGImage::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle) -{ - RenderImage::styleDidChange(diff, oldStyle); - SVGResourcesCache::clientStyleChanged(this, diff, style()); -} + SVGRenderSupport::finishRenderSVGContent(this, childPaintInfo, savedInfo.context); + } -void RenderSVGImage::updateFromElement() -{ - RenderImage::updateFromElement(); - SVGResourcesCache::clientUpdatedFromElement(this, style()); + if (drawsOutline) + paintOutline(childPaintInfo.context, static_cast<int>(boundingBox.x()), static_cast<int>(boundingBox.y()), + static_cast<int>(boundingBox.width()), static_cast<int>(boundingBox.height())); + + childPaintInfo.context->restore(); + } } bool RenderSVGImage::nodeAtFloatPoint(const HitTestRequest& request, HitTestResult& result, const FloatPoint& pointInParent, HitTestAction hitTestAction) @@ -152,12 +158,6 @@ bool RenderSVGImage::nodeAtFloatPoint(const HitTestRequest& request, HitTestResu return false; } -bool RenderSVGImage::nodeAtPoint(const HitTestRequest&, HitTestResult&, int, int, int, int, HitTestAction) -{ - ASSERT_NOT_REACHED(); - return false; -} - FloatRect RenderSVGImage::repaintRectInLocalCoordinates() const { // If we already have a cached repaint rect, return that @@ -170,10 +170,8 @@ FloatRect RenderSVGImage::repaintRectInLocalCoordinates() const return m_cachedLocalRepaintRect; } -void RenderSVGImage::imageChanged(WrappedImagePtr image, const IntRect* rect) +void RenderSVGImage::imageChanged(WrappedImagePtr, const IntRect*) { - RenderImage::imageChanged(image, rect); - // The image resource defaults to nullImage until the resource arrives. // This empty image may be cached by SVG resources which must be invalidated. if (SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(this)) @@ -185,21 +183,6 @@ void RenderSVGImage::imageChanged(WrappedImagePtr image, const IntRect* rect) repaint(); } -IntRect RenderSVGImage::clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer) -{ - return SVGRenderSupport::clippedOverflowRectForRepaint(this, repaintContainer); -} - -void RenderSVGImage::computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect& repaintRect, bool fixed) -{ - SVGRenderSupport::computeRectForRepaint(this, repaintContainer, repaintRect, fixed); -} - -void RenderSVGImage::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed , bool useTransforms, TransformState& transformState) const -{ - SVGRenderSupport::mapLocalToContainer(this, repaintContainer, fixed, useTransforms, transformState); -} - void RenderSVGImage::addFocusRingRects(Vector<IntRect>& rects, int, int) { // this is called from paint() after the localTransform has already been applied @@ -208,17 +191,6 @@ void RenderSVGImage::addFocusRingRects(Vector<IntRect>& rects, int, int) rects.append(contentRect); } -void RenderSVGImage::absoluteRects(Vector<IntRect>&, int, int) -{ - // This code path should never be taken for SVG, as we're assuming useTransforms=true everywhere, absoluteQuads should be used. - ASSERT_NOT_REACHED(); -} - -void RenderSVGImage::absoluteQuads(Vector<FloatQuad>& quads) -{ - quads.append(localToAbsoluteQuad(strokeBoundingBox())); -} - -} +} // namespace WebCore #endif // ENABLE(SVG) diff --git a/WebCore/rendering/RenderSVGImage.h b/WebCore/rendering/RenderSVGImage.h index 38e3a13..da94568 100644 --- a/WebCore/rendering/RenderSVGImage.h +++ b/WebCore/rendering/RenderSVGImage.h @@ -3,6 +3,7 @@ Copyright (C) 2006, 2009 Apple Inc. All rights reserved. Copyright (C) 2007 Rob Buis <buis@kde.org> Copyright (C) 2009 Google, Inc. + 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 @@ -26,20 +27,25 @@ #if ENABLE(SVG) #include "AffineTransform.h" #include "FloatRect.h" -#include "RenderImage.h" +#include "RenderSVGModelObject.h" #include "SVGPreserveAspectRatio.h" #include "SVGRenderSupport.h" namespace WebCore { +class RenderImageResource; class SVGImageElement; -class RenderSVGImage : public RenderImage { +class RenderSVGImage : public RenderSVGModelObject { public: RenderSVGImage(SVGImageElement*); + virtual ~RenderSVGImage(); virtual void setNeedsTransformUpdate() { m_needsTransformUpdate = true; } + RenderImageResource* imageResource() { return m_imageResource.get(); } + const RenderImageResource* imageResource() const { return m_imageResource.get(); } + private: virtual const char* renderName() const { return "RenderSVGImage"; } virtual bool isSVGImage() const { return true; } @@ -50,28 +56,16 @@ private: virtual FloatRect strokeBoundingBox() const { return m_localBounds; } virtual FloatRect repaintRectInLocalCoordinates() const; - virtual IntRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer); - virtual void computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect&, bool fixed = false); - - virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&) const; - - virtual void absoluteRects(Vector<IntRect>&, int tx, int ty); - virtual void absoluteQuads(Vector<FloatQuad>&); virtual void addFocusRingRects(Vector<IntRect>&, int tx, int ty); virtual void imageChanged(WrappedImagePtr, const IntRect* = 0); - + virtual void layout(); virtual void paint(PaintInfo&, int parentX, int parentY); - virtual void destroy(); - virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); - virtual void updateFromElement(); - virtual bool requiresLayer() const { return false; } virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction); - virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction); virtual AffineTransform localTransform() const { return m_localTransform; } @@ -79,6 +73,7 @@ private: AffineTransform m_localTransform; FloatRect m_localBounds; mutable FloatRect m_cachedLocalRepaintRect; + OwnPtr<RenderImageResource> m_imageResource; }; inline RenderSVGImage* toRenderSVGImage(RenderObject* object) diff --git a/WebCore/rendering/RenderSVGInline.cpp b/WebCore/rendering/RenderSVGInline.cpp index 93e6a06..bc6bc12 100644 --- a/WebCore/rendering/RenderSVGInline.cpp +++ b/WebCore/rendering/RenderSVGInline.cpp @@ -99,6 +99,13 @@ void RenderSVGInline::destroy() RenderInline::destroy(); } +void RenderSVGInline::styleWillChange(StyleDifference diff, const RenderStyle* newStyle) +{ + if (diff == StyleDifferenceLayout) + setNeedsBoundariesUpdate(); + RenderInline::styleWillChange(diff, newStyle); +} + void RenderSVGInline::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle) { RenderInline::styleDidChange(diff, oldStyle); diff --git a/WebCore/rendering/RenderSVGInline.h b/WebCore/rendering/RenderSVGInline.h index 56d911f..fb38f1b 100644 --- a/WebCore/rendering/RenderSVGInline.h +++ b/WebCore/rendering/RenderSVGInline.h @@ -56,6 +56,7 @@ private: virtual InlineFlowBox* createInlineFlowBox(); virtual void destroy(); + virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle); virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); virtual void updateFromElement(); }; diff --git a/WebCore/rendering/RenderSVGModelObject.cpp b/WebCore/rendering/RenderSVGModelObject.cpp index 5a19749..28760a0 100644 --- a/WebCore/rendering/RenderSVGModelObject.cpp +++ b/WebCore/rendering/RenderSVGModelObject.cpp @@ -87,6 +87,13 @@ void RenderSVGModelObject::destroy() RenderObject::destroy(); } +void RenderSVGModelObject::styleWillChange(StyleDifference diff, const RenderStyle* newStyle) +{ + if (diff == StyleDifferenceLayout) + setNeedsBoundariesUpdate(); + RenderObject::styleWillChange(diff, newStyle); +} + void RenderSVGModelObject::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle) { RenderObject::styleDidChange(diff, oldStyle); diff --git a/WebCore/rendering/RenderSVGModelObject.h b/WebCore/rendering/RenderSVGModelObject.h index 35c4dc3..9de217c 100644 --- a/WebCore/rendering/RenderSVGModelObject.h +++ b/WebCore/rendering/RenderSVGModelObject.h @@ -39,7 +39,7 @@ namespace WebCore { // Most renderers in the SVG rendering tree will inherit from this class -// but not all. (e.g. RenderSVGForeignObject, RenderSVGBlock, RenderSVGImage) thus methods +// but not all. (e.g. RenderSVGForeignObject, RenderSVGBlock) thus methods // required by SVG renders need to be declared on RenderObject, but shared // logic can go in this class or in SVGRenderSupport. @@ -61,6 +61,7 @@ public: virtual void destroy(); virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&) const; + virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle); virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); virtual void updateFromElement(); diff --git a/WebCore/rendering/RenderSVGResourceFilter.cpp b/WebCore/rendering/RenderSVGResourceFilter.cpp index 09e83f4..982375e 100644 --- a/WebCore/rendering/RenderSVGResourceFilter.cpp +++ b/WebCore/rendering/RenderSVGResourceFilter.cpp @@ -262,16 +262,17 @@ void RenderSVGResourceFilter::postApplyResource(RenderObject* object, GraphicsCo if (!filterData->builded) { filterData->filter->setSourceImage(filterData->sourceGraphicBuffer.release()); lastEffect->apply(filterData->filter.get()); +#if !PLATFORM(CG) + ImageBuffer* resultImage = lastEffect->resultImage(); + if (resultImage) + resultImage->transformColorSpace(LinearRGB, DeviceRGB); +#endif filterData->builded = true; } ImageBuffer* resultImage = lastEffect->resultImage(); - if (resultImage) { -#if !PLATFORM(CG) - resultImage->transformColorSpace(LinearRGB, DeviceRGB); -#endif + if (resultImage) context->drawImageBuffer(resultImage, object->style()->colorSpace(), lastEffect->subRegion()); - } } filterData->sourceGraphicBuffer.clear(); diff --git a/WebCore/rendering/RenderSVGRoot.cpp b/WebCore/rendering/RenderSVGRoot.cpp index b66a870..3fd439c 100644 --- a/WebCore/rendering/RenderSVGRoot.cpp +++ b/WebCore/rendering/RenderSVGRoot.cpp @@ -48,6 +48,7 @@ namespace WebCore { RenderSVGRoot::RenderSVGRoot(SVGStyledElement* node) : RenderBox(node) , m_isLayoutSizeChanged(false) + , m_needsBoundariesOrTransformUpdate(true) { setReplaced(true); } @@ -124,6 +125,13 @@ void RenderSVGRoot::layout() SVGRenderSupport::layoutChildren(this, needsLayout); m_isLayoutSizeChanged = false; + // At this point LayoutRepainter already grabbed the old bounds, + // recalculate them now so repaintAfterLayout() uses the new bounds. + if (m_needsBoundariesOrTransformUpdate) { + updateCachedBoundaries(); + m_needsBoundariesOrTransformUpdate = false; + } + repainter.repaintAfterLayout(); view()->enableLayoutState(); @@ -196,6 +204,13 @@ void RenderSVGRoot::destroy() RenderBox::destroy(); } +void RenderSVGRoot::styleWillChange(StyleDifference diff, const RenderStyle* newStyle) +{ + if (diff == StyleDifferenceLayout) + setNeedsBoundariesUpdate(); + RenderBox::styleWillChange(diff, newStyle); +} + void RenderSVGRoot::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle) { RenderBox::styleDidChange(diff, oldStyle); @@ -267,24 +282,6 @@ const AffineTransform& RenderSVGRoot::localToParentTransform() const return m_localToParentTransform; } -FloatRect RenderSVGRoot::objectBoundingBox() const -{ - return SVGRenderSupport::computeContainerBoundingBox(this, SVGRenderSupport::ObjectBoundingBox); -} - -FloatRect RenderSVGRoot::strokeBoundingBox() const -{ - return SVGRenderSupport::computeContainerBoundingBox(this, SVGRenderSupport::StrokeBoundingBox); -} - -FloatRect RenderSVGRoot::repaintRectInLocalCoordinates() const -{ - FloatRect repaintRect = SVGRenderSupport::computeContainerBoundingBox(this, SVGRenderSupport::RepaintBoundingBox); - style()->svgStyle()->inflateForShadow(repaintRect); - repaintRect.inflate(borderAndPaddingWidth()); - return repaintRect; -} - IntRect RenderSVGRoot::clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer) { return SVGRenderSupport::clippedOverflowRectForRepaint(this, repaintContainer); @@ -299,7 +296,10 @@ void RenderSVGRoot::computeRectForRepaint(RenderBoxModelObject* repaintContainer // Apply initial viewport clip - not affected by overflow settings repaintRect.intersect(enclosingIntRect(FloatRect(FloatPoint(), m_viewportSize))); - style()->svgStyle()->inflateForShadow(repaintRect); + const SVGRenderStyle* svgStyle = style()->svgStyle(); + if (const ShadowData* shadow = svgStyle->shadow()) + shadow->adjustRectForShadow(repaintRect); + RenderBox::computeRectForRepaint(repaintContainer, repaintRect, fixed); } @@ -313,6 +313,17 @@ void RenderSVGRoot::mapLocalToContainer(RenderBoxModelObject* repaintContainer, RenderBox::mapLocalToContainer(repaintContainer, fixed, useTransforms, transformState); } +void RenderSVGRoot::updateCachedBoundaries() +{ + m_objectBoundingBox = FloatRect(); + m_strokeBoundingBox = FloatRect(); + m_repaintBoundingBox = FloatRect(); + + SVGRenderSupport::computeContainerBoundingBoxes(this, m_objectBoundingBox, m_strokeBoundingBox, m_repaintBoundingBox); + SVGRenderSupport::intersectRepaintRectWithResources(this, m_repaintBoundingBox); + m_repaintBoundingBox.inflate(borderAndPaddingWidth()); +} + bool RenderSVGRoot::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction) { IntPoint pointInContainer(_x, _y); diff --git a/WebCore/rendering/RenderSVGRoot.h b/WebCore/rendering/RenderSVGRoot.h index b90113c..63a7b3f 100644 --- a/WebCore/rendering/RenderSVGRoot.h +++ b/WebCore/rendering/RenderSVGRoot.h @@ -41,6 +41,8 @@ public: RenderObjectChildList* children() { return &m_children; } bool isLayoutSizeChanged() const { return m_isLayoutSizeChanged; } + virtual void setNeedsBoundariesUpdate() { m_needsBoundariesOrTransformUpdate = true; } + virtual void setNeedsTransformUpdate() { m_needsBoundariesOrTransformUpdate = true; } private: virtual RenderObjectChildList* virtualChildren() { return children(); } @@ -58,6 +60,7 @@ private: virtual void paint(PaintInfo&, int parentX, int parentY); virtual void destroy(); + virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle); virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); virtual void updateFromElement(); @@ -66,9 +69,9 @@ private: bool fillContains(const FloatPoint&) const; bool strokeContains(const FloatPoint&) const; - virtual FloatRect objectBoundingBox() const; - virtual FloatRect strokeBoundingBox() const; - virtual FloatRect repaintRectInLocalCoordinates() const; + virtual FloatRect objectBoundingBox() const { return m_objectBoundingBox; } + virtual FloatRect strokeBoundingBox() const { return m_strokeBoundingBox; } + virtual FloatRect repaintRectInLocalCoordinates() const { return m_repaintBoundingBox; } virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction); @@ -80,6 +83,7 @@ private: void calcViewport(); bool selfWillPaint(); + void updateCachedBoundaries(); IntSize parentOriginToBorderBox() const; IntSize borderOriginToContentBox() const; @@ -88,8 +92,12 @@ private: RenderObjectChildList m_children; FloatSize m_viewportSize; + FloatRect m_objectBoundingBox; + FloatRect m_strokeBoundingBox; + FloatRect m_repaintBoundingBox; mutable AffineTransform m_localToParentTransform; bool m_isLayoutSizeChanged : 1; + bool m_needsBoundariesOrTransformUpdate : 1; }; inline RenderSVGRoot* toRenderSVGRoot(RenderObject* object) diff --git a/WebCore/rendering/RenderSVGShadowTreeRootContainer.cpp b/WebCore/rendering/RenderSVGShadowTreeRootContainer.cpp index 888dd57..d3064c6 100644 --- a/WebCore/rendering/RenderSVGShadowTreeRootContainer.cpp +++ b/WebCore/rendering/RenderSVGShadowTreeRootContainer.cpp @@ -53,7 +53,7 @@ void RenderSVGShadowTreeRootContainer::updateFromElement() SVGUseElement* useElement = static_cast<SVGUseElement*>(node()); if (!m_shadowRoot) { ASSERT(!m_recreateTree); - m_shadowRoot = new SVGShadowTreeRootElement(document(), useElement); + m_shadowRoot = SVGShadowTreeRootElement::create(document(), useElement); useElement->buildPendingResource(); } diff --git a/WebCore/rendering/RenderSVGText.cpp b/WebCore/rendering/RenderSVGText.cpp index 20c8a7c..80b8a91 100644 --- a/WebCore/rendering/RenderSVGText.cpp +++ b/WebCore/rendering/RenderSVGText.cpp @@ -75,10 +75,12 @@ void RenderSVGText::layout() ASSERT(needsLayout()); LayoutRepainter repainter(*this, m_everHadLayout && checkForRepaintDuringLayout()); + bool updateCachedBoundariesInParents = false; if (m_needsTransformUpdate) { SVGTextElement* text = static_cast<SVGTextElement*>(node()); m_localTransform = text->animatedLocalTransform(); m_needsTransformUpdate = false; + updateCachedBoundariesInParents = true; } // Reduced version of RenderBlock::layoutBlock(), which only takes care of SVG text. @@ -95,13 +97,22 @@ void RenderSVGText::layout() if (!firstChild()) setChildrenInline(true); + // FIXME: We need to find a way to only layout the child boxes, if needed. + FloatRect oldBoundaries = objectBoundingBox(); ASSERT(childrenInline()); forceLayoutInlineChildren(); + if (!updateCachedBoundariesInParents) + updateCachedBoundariesInParents = oldBoundaries != objectBoundingBox(); + // Invalidate all resources of this client if our layout changed. if (m_everHadLayout && selfNeedsLayout()) SVGResourcesCache::clientLayoutChanged(this); + // If our bounds changed, notify the parents. + if (updateCachedBoundariesInParents) + RenderSVGBlock::setNeedsBoundariesUpdate(); + repainter.repaintAfterLayout(); setNeedsLayout(false); } @@ -178,6 +189,9 @@ FloatRect RenderSVGText::repaintRectInLocalCoordinates() const FloatRect repaintRect = strokeBoundingBox(); SVGRenderSupport::intersectRepaintRectWithResources(this, repaintRect); + if (const ShadowData* textShadow = style()->textShadow()) + textShadow->adjustRectForShadow(repaintRect); + return repaintRect; } diff --git a/WebCore/rendering/RenderSVGTransformableContainer.cpp b/WebCore/rendering/RenderSVGTransformableContainer.cpp index 94b9eea..c7d2029 100644 --- a/WebCore/rendering/RenderSVGTransformableContainer.cpp +++ b/WebCore/rendering/RenderSVGTransformableContainer.cpp @@ -35,7 +35,7 @@ RenderSVGTransformableContainer::RenderSVGTransformableContainer(SVGStyledTransf { } -void RenderSVGTransformableContainer::calculateLocalTransform() +bool RenderSVGTransformableContainer::calculateLocalTransform() { SVGStyledTransformableElement* element = static_cast<SVGStyledTransformableElement*>(node()); @@ -46,17 +46,18 @@ void RenderSVGTransformableContainer::calculateLocalTransform() } if (!element->hasTagName(SVGNames::gTag) || !static_cast<SVGGElement*>(element)->isShadowTreeContainerElement()) - return; + return needsUpdate; FloatSize translation = static_cast<SVGShadowTreeContainerElement*>(element)->containerTranslation(); if (translation.width() == 0 && translation.height() == 0) - return; + return needsUpdate; // FIXME: Could optimize this case for use to avoid refetching the animatedLocalTransform() here, if only the containerTranslation() changed. if (!needsUpdate) m_localTransform = element->animatedLocalTransform(); m_localTransform.translate(translation.width(), translation.height()); + return true; } } diff --git a/WebCore/rendering/RenderSVGTransformableContainer.h b/WebCore/rendering/RenderSVGTransformableContainer.h index e6de054..b63b91c 100644 --- a/WebCore/rendering/RenderSVGTransformableContainer.h +++ b/WebCore/rendering/RenderSVGTransformableContainer.h @@ -35,7 +35,7 @@ namespace WebCore { virtual void setNeedsTransformUpdate() { m_needsTransformUpdate = true; } private: - virtual void calculateLocalTransform(); + virtual bool calculateLocalTransform(); virtual AffineTransform localTransform() const { return m_localTransform; } bool m_needsTransformUpdate : 1; diff --git a/WebCore/rendering/RenderSVGViewportContainer.cpp b/WebCore/rendering/RenderSVGViewportContainer.cpp index f314bde..ccf67fa 100644 --- a/WebCore/rendering/RenderSVGViewportContainer.cpp +++ b/WebCore/rendering/RenderSVGViewportContainer.cpp @@ -48,10 +48,15 @@ void RenderSVGViewportContainer::calcViewport() SVGElement* element = static_cast<SVGElement*>(node()); if (element->hasTagName(SVGNames::svgTag)) { SVGSVGElement* svg = static_cast<SVGSVGElement*>(element); + + FloatRect oldViewport = m_viewport; m_viewport = FloatRect(svg->x().value(svg) , svg->y().value(svg) , svg->width().value(svg) , svg->height().value(svg)); + + if (oldViewport != m_viewport) + setNeedsBoundariesUpdate(); } } diff --git a/WebCore/rendering/RenderScrollbar.cpp b/WebCore/rendering/RenderScrollbar.cpp index 7378056..e7a70a4 100644 --- a/WebCore/rendering/RenderScrollbar.cpp +++ b/WebCore/rendering/RenderScrollbar.cpp @@ -27,6 +27,7 @@ #include "RenderScrollbar.h" #include "Frame.h" +#include "FrameView.h" #include "RenderPart.h" #include "RenderScrollbarPart.h" #include "RenderScrollbarTheme.h" @@ -150,6 +151,14 @@ PassRefPtr<RenderStyle> RenderScrollbar::getScrollbarPseudoStyle(ScrollbarPart p RefPtr<RenderStyle> result = owningRenderer()->getUncachedPseudoStyle(pseudoId, owningRenderer()->style()); s_styleResolvePart = NoPart; s_styleResolveScrollbar = 0; + + // Scrollbars for root frames should always have background color + // unless explicitly specified as transparent. So we force it. + // This is because WebKit assumes scrollbar to be always painted and missing background + // causes visual artifact like non-repainted dirty region. + if (result && m_owningFrame && m_owningFrame->view() && !m_owningFrame->view()->isTransparent() && !result->hasBackground()) + result->setBackgroundColor(Color::white); + return result; } diff --git a/WebCore/rendering/RenderTable.cpp b/WebCore/rendering/RenderTable.cpp index f9f0f56..48f3920 100644 --- a/WebCore/rendering/RenderTable.cpp +++ b/WebCore/rendering/RenderTable.cpp @@ -392,7 +392,7 @@ void RenderTable::layout() toRenderTableSection(child)->layoutRows(child == m_firstBody ? max(0, th - calculatedHeight) : 0); } - if (!m_firstBody && th > calculatedHeight && !style()->htmlHacks()) { + if (!m_firstBody && th > calculatedHeight && !document()->inQuirksMode()) { // Completely empty tables (with no sections or anything) should at least honor specified height // in strict mode. setHeight(height() + th); diff --git a/WebCore/rendering/RenderTableSection.cpp b/WebCore/rendering/RenderTableSection.cpp index 8cb54c0..a9052ce 100644 --- a/WebCore/rendering/RenderTableSection.cpp +++ b/WebCore/rendering/RenderTableSection.cpp @@ -386,7 +386,7 @@ int RenderTableSection::calcRowHeight() // Explicit heights use the border box in quirks mode. In strict mode do the right // thing and actually add in the border and padding. ch = cell->style()->height().calcValue(0) + - (cell->style()->htmlHacks() ? 0 : (adjustedPaddingTop + adjustedPaddingBottom + + (document()->inQuirksMode() ? 0 : (adjustedPaddingTop + adjustedPaddingBottom + cell->borderTop() + cell->borderBottom())); ch = max(ch, adjustedHeight); diff --git a/WebCore/rendering/RenderTextControl.cpp b/WebCore/rendering/RenderTextControl.cpp index 9098bab..e66e4ed 100644 --- a/WebCore/rendering/RenderTextControl.cpp +++ b/WebCore/rendering/RenderTextControl.cpp @@ -355,26 +355,22 @@ String RenderTextControl::textWithHardLineBreaks() { if (!m_innerText) return ""; - Node* firstChild = m_innerText->firstChild(); - if (!firstChild) - return ""; - RenderObject* renderer = firstChild->renderer(); + RenderBlock* renderer = toRenderBlock(m_innerText->renderer()); if (!renderer) return ""; - InlineBox* box = renderer->isText() ? toRenderText(renderer)->firstTextBox() : toRenderBox(renderer)->inlineBoxWrapper(); - if (!box) - return ""; - Node* breakNode; unsigned breakOffset; - RootInlineBox* line = box->root(); + RootInlineBox* line = renderer->firstRootBox(); + if (!line) + return ""; + getNextSoftBreak(line, breakNode, breakOffset); Vector<UChar> result; - for (Node* n = firstChild; n; n = n->traverseNextNode(m_innerText.get())) { + for (Node* n = m_innerText->firstChild(); n; n = n->traverseNextNode(m_innerText.get())) { if (n->hasTagName(brTag)) result.append(&newlineCharacter, 1); else if (n->isTextNode()) { diff --git a/WebCore/rendering/RenderTextControlSingleLine.h b/WebCore/rendering/RenderTextControlSingleLine.h index e57e37e..0deb063 100644 --- a/WebCore/rendering/RenderTextControlSingleLine.h +++ b/WebCore/rendering/RenderTextControlSingleLine.h @@ -82,7 +82,7 @@ private: virtual int scrollHeight() const; virtual void setScrollLeft(int); virtual void setScrollTop(int); - virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1.0f, Node** stopNode = 0); + virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1, Node** stopNode = 0); int textBlockWidth() const; virtual float getAvgCharWidth(AtomicString family); diff --git a/WebCore/rendering/RenderTheme.cpp b/WebCore/rendering/RenderTheme.cpp index 5d00f5a..522bd4d 100644 --- a/WebCore/rendering/RenderTheme.cpp +++ b/WebCore/rendering/RenderTheme.cpp @@ -1043,7 +1043,7 @@ void RenderTheme::platformColorsDidChange() m_activeListBoxSelectionBackgroundColor = Color(); m_inactiveListBoxSelectionForegroundColor = Color(); - Page::setNeedsReapplyStyles(); + Page::scheduleForcedStyleRecalcForAllPages(); } Color RenderTheme::systemColor(int cssValueId) const diff --git a/WebCore/rendering/RenderVideo.cpp b/WebCore/rendering/RenderVideo.cpp index 0f444b2..3f4e2bf 100644 --- a/WebCore/rendering/RenderVideo.cpp +++ b/WebCore/rendering/RenderVideo.cpp @@ -110,7 +110,7 @@ IntSize RenderVideo::calculateIntrinsicSize() if (player() && video->readyState() >= HTMLVideoElement::HAVE_METADATA) return player()->naturalSize(); - if (video->shouldDisplayPosterImage() && !m_cachedImageSize.isEmpty() && !errorOccurred()) + if (video->shouldDisplayPosterImage() && !m_cachedImageSize.isEmpty() && !imageResource()->errorOccurred()) return m_cachedImageSize; // When the natural size of the video is unavailable, we use the provided diff --git a/WebCore/rendering/RootInlineBox.cpp b/WebCore/rendering/RootInlineBox.cpp index bec288c..e8f24b5 100644 --- a/WebCore/rendering/RootInlineBox.cpp +++ b/WebCore/rendering/RootInlineBox.cpp @@ -215,14 +215,10 @@ int RootInlineBox::verticallyAlignBoxes(int heightOfBlock, GlyphOverflowAndFallb int maxAscent = 0; int maxDescent = 0; - // Figure out if we're in strict mode. Note that we can't simply use !style()->htmlHacks(), - // because that would match almost strict mode as well. - RenderObject* curr = renderer(); - while (curr && !curr->node()) - curr = curr->container(); - bool strictMode = (curr && curr->document()->inStrictMode()); + // Figure out if we're in no-quirks mode. + bool noQuirksMode = renderer()->document()->inNoQuirksMode(); - computeLogicalBoxHeights(maxPositionTop, maxPositionBottom, maxAscent, maxDescent, strictMode, textBoxDataMap); + computeLogicalBoxHeights(maxPositionTop, maxPositionBottom, maxAscent, maxDescent, noQuirksMode, textBoxDataMap); if (maxAscent + maxDescent < max(maxPositionTop, maxPositionBottom)) adjustMaxAscentAndDescent(maxAscent, maxDescent, maxPositionTop, maxPositionBottom); @@ -230,8 +226,8 @@ int RootInlineBox::verticallyAlignBoxes(int heightOfBlock, GlyphOverflowAndFallb int maxHeight = maxAscent + maxDescent; int lineTop = heightOfBlock; int lineBottom = heightOfBlock; - placeBoxesVertically(heightOfBlock, maxHeight, maxAscent, strictMode, lineTop, lineBottom); - computeVerticalOverflow(lineTop, lineBottom, strictMode, textBoxDataMap); + placeBoxesVertically(heightOfBlock, maxHeight, maxAscent, noQuirksMode, lineTop, lineBottom); + computeVerticalOverflow(lineTop, lineBottom, noQuirksMode, textBoxDataMap); setLineTopBottomPositions(lineTop, lineBottom); heightOfBlock += maxHeight; diff --git a/WebCore/rendering/SVGRenderSupport.cpp b/WebCore/rendering/SVGRenderSupport.cpp index 12d6d77..644ff70 100644 --- a/WebCore/rendering/SVGRenderSupport.cpp +++ b/WebCore/rendering/SVGRenderSupport.cpp @@ -61,7 +61,9 @@ IntRect SVGRenderSupport::clippedOverflowRectForRepaint(RenderObject* object, Re void SVGRenderSupport::computeRectForRepaint(RenderObject* object, RenderBoxModelObject* repaintContainer, IntRect& repaintRect, bool fixed) { - object->style()->svgStyle()->inflateForShadow(repaintRect); + const SVGRenderStyle* svgStyle = object->style()->svgStyle(); + if (const ShadowData* shadow = svgStyle->shadow()) + shadow->adjustRectForShadow(repaintRect); // Translate to coords in our parent renderer, and then call computeRectForRepaint on our parent repaintRect = object->localToParentTransform().mapRect(repaintRect); @@ -86,24 +88,22 @@ bool SVGRenderSupport::prepareToRenderSVGContent(RenderObject* object, PaintInfo const SVGRenderStyle* svgStyle = style->svgStyle(); ASSERT(svgStyle); - FloatRect repaintRect; - // Setup transparency layers before setting up SVG resources! float opacity = style->opacity(); - if (opacity < 1) { - repaintRect = object->repaintRectInLocalCoordinates(); - paintInfo.context->clip(repaintRect); - paintInfo.context->beginTransparencyLayer(opacity); - } + const ShadowData* shadow = svgStyle->shadow(); + if (opacity < 1 || shadow) { + FloatRect repaintRect = object->repaintRectInLocalCoordinates(); - if (const ShadowData* shadow = svgStyle->shadow()) { - // Eventually compute repaint rect, if not done so far. - if (opacity >= 1) - repaintRect = object->repaintRectInLocalCoordinates(); + if (opacity < 1) { + paintInfo.context->clip(repaintRect); + paintInfo.context->beginTransparencyLayer(opacity); + } - paintInfo.context->clip(repaintRect); - paintInfo.context->setShadow(IntSize(shadow->x(), shadow->y()), shadow->blur(), shadow->color(), style->colorSpace()); - paintInfo.context->beginTransparencyLayer(1); + if (shadow) { + paintInfo.context->clip(repaintRect); + paintInfo.context->setShadow(IntSize(shadow->x(), shadow->y()), shadow->blur(), shadow->color(), style->colorSpace()); + paintInfo.context->beginTransparencyLayer(1); + } } SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(object); @@ -154,39 +154,38 @@ void SVGRenderSupport::finishRenderSVGContent(RenderObject* object, PaintInfo& p } #endif - float opacity = style->opacity(); - if (opacity < 1) + if (style->opacity() < 1) paintInfo.context->endTransparencyLayer(); - // This needs to be done separately from opacity, because if both properties are set, - // then the transparency layers are nested. if (svgStyle->shadow()) paintInfo.context->endTransparencyLayer(); } -FloatRect SVGRenderSupport::computeContainerBoundingBox(const RenderObject* container, ContainerBoundingBoxMode mode) +void SVGRenderSupport::computeContainerBoundingBoxes(const RenderObject* container, FloatRect& objectBoundingBox, FloatRect& strokeBoundingBox, FloatRect& repaintBoundingBox) { - FloatRect boundingBox; - for (RenderObject* current = container->firstChild(); current; current = current->nextSibling()) { - FloatRect childBoundingBox; - - switch (mode) { - case ObjectBoundingBox: - childBoundingBox = current->objectBoundingBox(); - break; - case StrokeBoundingBox: - childBoundingBox = current->strokeBoundingBox(); - break; - case RepaintBoundingBox: - childBoundingBox = current->repaintRectInLocalCoordinates(); - break; + if (current->isSVGHiddenContainer()) + continue; + + const AffineTransform& transform = current->localToParentTransform(); + if (transform.isIdentity()) { + objectBoundingBox.unite(current->objectBoundingBox()); + strokeBoundingBox.unite(current->strokeBoundingBox()); + repaintBoundingBox.unite(current->repaintRectInLocalCoordinates()); + } else { + objectBoundingBox.unite(transform.mapRect(current->objectBoundingBox())); + strokeBoundingBox.unite(transform.mapRect(current->strokeBoundingBox())); + repaintBoundingBox.unite(transform.mapRect(current->repaintRectInLocalCoordinates())); } - - boundingBox.unite(current->localToParentTransform().mapRect(childBoundingBox)); } +} + +bool SVGRenderSupport::paintInfoIntersectsRepaintRect(const FloatRect& localRepaintRect, const AffineTransform& localTransform, const PaintInfo& paintInfo) +{ + if (localTransform.isIdentity()) + return localRepaintRect.intersects(paintInfo.rect); - return boundingBox; + return localTransform.mapRect(localRepaintRect).intersects(paintInfo.rect); } const RenderSVGRoot* SVGRenderSupport::findTreeRootObject(const RenderObject* start) @@ -281,7 +280,8 @@ void SVGRenderSupport::intersectRepaintRectWithResources(const RenderObject* obj RenderObject* renderer = const_cast<RenderObject*>(object); SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(renderer); if (!resources) { - svgStyle->inflateForShadow(repaintRect); + if (const ShadowData* shadow = svgStyle->shadow()) + shadow->adjustRectForShadow(repaintRect); return; } @@ -296,7 +296,8 @@ void SVGRenderSupport::intersectRepaintRectWithResources(const RenderObject* obj if (RenderSVGResourceMasker* masker = resources->masker()) repaintRect.intersect(masker->resourceBoundingBox(renderer)); - svgStyle->inflateForShadow(repaintRect); + if (const ShadowData* shadow = svgStyle->shadow()) + shadow->adjustRectForShadow(repaintRect); } bool SVGRenderSupport::pointInClippingArea(RenderObject* object, const FloatPoint& point) diff --git a/WebCore/rendering/SVGRenderSupport.h b/WebCore/rendering/SVGRenderSupport.h index 2de1e99..54622d2 100644 --- a/WebCore/rendering/SVGRenderSupport.h +++ b/WebCore/rendering/SVGRenderSupport.h @@ -58,15 +58,8 @@ public: // Determines whether the passed point lies in a clipping area static bool pointInClippingArea(RenderObject*, const FloatPoint&); - enum ContainerBoundingBoxMode { - ObjectBoundingBox, - StrokeBoundingBox, - RepaintBoundingBox - }; - - // Used to share the "walk all the children" logic between objectBoundingBox - // and repaintRectInLocalCoordinates in RenderSVGRoot and RenderSVGContainer - static FloatRect computeContainerBoundingBox(const RenderObject* container, ContainerBoundingBoxMode); + static void computeContainerBoundingBoxes(const RenderObject* container, FloatRect& objectBoundingBox, FloatRect& strokeBoundingBox, FloatRect& repaintBoundingBox); + static bool paintInfoIntersectsRepaintRect(const FloatRect& localRepaintRect, const AffineTransform& localTransform, const PaintInfo& paintInfo); // Important functions used by nearly all SVG renderers centralizing coordinate transformations / repaint rect calculations static IntRect clippedOverflowRectForRepaint(RenderObject*, RenderBoxModelObject* repaintContainer); diff --git a/WebCore/rendering/SVGResources.h b/WebCore/rendering/SVGResources.h index 5f6e746..49591cf 100644 --- a/WebCore/rendering/SVGResources.h +++ b/WebCore/rendering/SVGResources.h @@ -38,7 +38,7 @@ class RenderSVGResourceMasker; class SVGRenderStyle; // Holds a set of resources associated with a RenderObject -class SVGResources { +class SVGResources : public Noncopyable { public: SVGResources(); diff --git a/WebCore/rendering/SVGResourcesCache.cpp b/WebCore/rendering/SVGResourcesCache.cpp index a4089d6..88cbb3a 100644 --- a/WebCore/rendering/SVGResourcesCache.cpp +++ b/WebCore/rendering/SVGResourcesCache.cpp @@ -34,11 +34,7 @@ SVGResourcesCache::SVGResourcesCache() SVGResourcesCache::~SVGResourcesCache() { - if (m_cache.isEmpty()) - return; - deleteAllValues(m_cache); - m_cache.clear(); } void SVGResourcesCache::addResourcesFromRenderObject(RenderObject* object, const RenderStyle* style) diff --git a/WebCore/rendering/SVGShadowTreeElements.cpp b/WebCore/rendering/SVGShadowTreeElements.cpp index 311874c..8a66991 100644 --- a/WebCore/rendering/SVGShadowTreeElements.cpp +++ b/WebCore/rendering/SVGShadowTreeElements.cpp @@ -26,17 +26,20 @@ #include "FloatSize.h" #include "RenderObject.h" #include "SVGNames.h" +#include "SVGUseElement.h" namespace WebCore { // SVGShadowTreeContainerElement + SVGShadowTreeContainerElement::SVGShadowTreeContainerElement(Document* document) : SVGGElement(SVGNames::gTag, document) { } - -SVGShadowTreeContainerElement::~SVGShadowTreeContainerElement() + +PassRefPtr<SVGShadowTreeContainerElement> SVGShadowTreeContainerElement::create(Document* document) { + return adoptRef(new SVGShadowTreeContainerElement(document)); } FloatSize SVGShadowTreeContainerElement::containerTranslation() const @@ -45,15 +48,17 @@ FloatSize SVGShadowTreeContainerElement::containerTranslation() const } // SVGShadowTreeRootElement -SVGShadowTreeRootElement::SVGShadowTreeRootElement(Document* document, Element* shadowParent) + +inline SVGShadowTreeRootElement::SVGShadowTreeRootElement(Document* document, SVGUseElement* shadowParent) : SVGShadowTreeContainerElement(document) , m_shadowParent(shadowParent) { setInDocument(); } -SVGShadowTreeRootElement::~SVGShadowTreeRootElement() +PassRefPtr<SVGShadowTreeRootElement> SVGShadowTreeRootElement::create(Document* document, SVGUseElement* shadowParent) { + return adoptRef(new SVGShadowTreeRootElement(document, shadowParent)); } void SVGShadowTreeRootElement::attachElement(PassRefPtr<RenderStyle> style, RenderArena* arena) diff --git a/WebCore/rendering/SVGShadowTreeElements.h b/WebCore/rendering/SVGShadowTreeElements.h index 7611b8a..d49fbaa 100644 --- a/WebCore/rendering/SVGShadowTreeElements.h +++ b/WebCore/rendering/SVGShadowTreeElements.h @@ -27,13 +27,11 @@ namespace WebCore { class FloatSize; +class SVGUseElement; class SVGShadowTreeContainerElement : public SVGGElement { public: - SVGShadowTreeContainerElement(Document*); - virtual ~SVGShadowTreeContainerElement(); - - virtual bool isShadowTreeContainerElement() const { return true; } + static PassRefPtr<SVGShadowTreeContainerElement> create(Document*); FloatSize containerTranslation() const; void setContainerOffset(const SVGLength& x, const SVGLength& y) @@ -42,22 +40,29 @@ public: m_yOffset = y; } +protected: + SVGShadowTreeContainerElement(Document*); + private: + virtual bool isShadowTreeContainerElement() const { return true; } + SVGLength m_xOffset; SVGLength m_yOffset; }; class SVGShadowTreeRootElement : public SVGShadowTreeContainerElement { public: - SVGShadowTreeRootElement(Document*, Element* shadowParent); - virtual ~SVGShadowTreeRootElement(); - - virtual bool isShadowNode() const { return m_shadowParent; } - virtual ContainerNode* shadowParentNode() { return m_shadowParent; } + static PassRefPtr<SVGShadowTreeRootElement> create(Document*, SVGUseElement* shadowParent); void attachElement(PassRefPtr<RenderStyle>, RenderArena*); + virtual ContainerNode* shadowParentNode() { return m_shadowParent; } + private: + SVGShadowTreeRootElement(Document*, SVGUseElement* shadowParent); + + virtual bool isShadowNode() const { return m_shadowParent; } + ContainerNode* m_shadowParent; }; diff --git a/WebCore/rendering/style/BorderData.h b/WebCore/rendering/style/BorderData.h index 96caf97..03635d9 100644 --- a/WebCore/rendering/style/BorderData.h +++ b/WebCore/rendering/style/BorderData.h @@ -26,7 +26,7 @@ #define BorderData_h #include "BorderValue.h" -#include "IntSize.h" +#include "LengthSize.h" #include "NinePieceImage.h" namespace WebCore { @@ -34,6 +34,12 @@ namespace WebCore { class BorderData { friend class RenderStyle; public: + BorderData() : m_topLeft(Length(0, Fixed), Length(0, Fixed)) + , m_topRight(Length(0, Fixed), Length(0, Fixed)) + , m_bottomLeft(Length(0, Fixed), Length(0, Fixed)) + , m_bottomRight(Length(0, Fixed), Length(0, Fixed)) + { + } bool hasBorder() const { bool haveImage = m_image.hasImage(); @@ -42,13 +48,13 @@ public: bool hasBorderRadius() const { - if (m_topLeft.width() > 0) + if (m_topLeft.width().rawValue() > 0) return true; - if (m_topRight.width() > 0) + if (m_topRight.width().rawValue() > 0) return true; - if (m_bottomLeft.width() > 0) + if (m_bottomLeft.width().rawValue() > 0) return true; - if (m_bottomRight.width() > 0) + if (m_bottomRight.width().rawValue() > 0) return true; return false; } @@ -99,10 +105,10 @@ public: const NinePieceImage& image() const { return m_image; } - const IntSize& topLeft() const { return m_topLeft; } - const IntSize& topRight() const { return m_topRight; } - const IntSize& bottomLeft() const { return m_bottomLeft; } - const IntSize& bottomRight() const { return m_bottomRight; } + const LengthSize& topLeft() const { return m_topLeft; } + const LengthSize& topRight() const { return m_topRight; } + const LengthSize& bottomLeft() const { return m_bottomLeft; } + const LengthSize& bottomRight() const { return m_bottomRight; } private: BorderValue m_left; @@ -112,10 +118,10 @@ private: NinePieceImage m_image; - IntSize m_topLeft; - IntSize m_topRight; - IntSize m_bottomLeft; - IntSize m_bottomRight; + LengthSize m_topLeft; + LengthSize m_topRight; + LengthSize m_bottomLeft; + LengthSize m_bottomRight; }; } // namespace WebCore diff --git a/WebCore/rendering/style/ContentData.cpp b/WebCore/rendering/style/ContentData.cpp index b0f9e81..d150f77 100644 --- a/WebCore/rendering/style/ContentData.cpp +++ b/WebCore/rendering/style/ContentData.cpp @@ -1,6 +1,6 @@ /* * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. + * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -22,7 +22,6 @@ #include "config.h" #include "ContentData.h" -#include "CounterContent.h" #include "StyleImage.h" #include <wtf/text/StringImpl.h> @@ -32,42 +31,26 @@ void ContentData::clear() { deleteContent(); - ContentData* n = m_next; - m_next = 0; - - // Reverse the list so we can delete without recursing. - ContentData* last = 0; - ContentData* c; - while ((c = n)) { - n = c->m_next; - c->m_next = last; - last = c; - } - for (c = last; c; c = n) { - n = c->m_next; - c->m_next = 0; - delete c; - } + // Delete the singly-linked list without recursing. + for (OwnPtr<ContentData> next = m_next.release(); next; next = next->m_next.release()) { } } +// FIXME: Why isn't this just operator==? +// FIXME: This is not a good name for a boolean-returning function. bool ContentData::dataEquivalent(const ContentData& other) const { if (type() != other.type()) return false; switch (type()) { - case CONTENT_NONE: - return true; - break; - case CONTENT_TEXT: - return equal(text(), other.text()); - break; - case CONTENT_OBJECT: - return StyleImage::imagesEquivalent(image(), other.image()); - break; - case CONTENT_COUNTER: - return *counter() == *other.counter(); - break; + case CONTENT_NONE: + return true; + case CONTENT_TEXT: + return equal(text(), other.text()); + case CONTENT_OBJECT: + return StyleImage::imagesEquivalent(image(), other.image()); + case CONTENT_COUNTER: + return *counter() == *other.counter(); } ASSERT_NOT_REACHED(); @@ -77,17 +60,17 @@ bool ContentData::dataEquivalent(const ContentData& other) const void ContentData::deleteContent() { switch (m_type) { - case CONTENT_NONE: - break; - case CONTENT_OBJECT: - m_content.m_image->deref(); - break; - case CONTENT_TEXT: - m_content.m_text->deref(); - break; - case CONTENT_COUNTER: - delete m_content.m_counter; - break; + case CONTENT_NONE: + break; + case CONTENT_OBJECT: + m_content.m_image->deref(); + break; + case CONTENT_TEXT: + m_content.m_text->deref(); + break; + case CONTENT_COUNTER: + delete m_content.m_counter; + break; } m_type = CONTENT_NONE; diff --git a/WebCore/rendering/style/ContentData.h b/WebCore/rendering/style/ContentData.h index 5c3565e..4f964a2 100644 --- a/WebCore/rendering/style/ContentData.h +++ b/WebCore/rendering/style/ContentData.h @@ -2,7 +2,7 @@ * Copyright (C) 2000 Lars Knoll (knoll@kde.org) * (C) 2000 Antti Koivisto (koivisto@kde.org) * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. + * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) * * This library is free software; you can redistribute it and/or @@ -25,21 +25,18 @@ #ifndef ContentData_h #define ContentData_h -#include "RenderStyleConstants.h" -#include <wtf/Forward.h> -#include <wtf/Noncopyable.h> -#include <wtf/PassRefPtr.h> +#include "CounterContent.h" +#include <wtf/OwnPtr.h> +#include <wtf/PassOwnPtr.h> namespace WebCore { -class CounterContent; class StyleImage; struct ContentData : Noncopyable { public: ContentData() : m_type(CONTENT_NONE) - , m_next(0) { } @@ -59,35 +56,44 @@ public: bool dataEquivalent(const ContentData&) const; - StyleImage* image() const { return m_content.m_image; } + StyleImage* image() const + { + ASSERT(isImage()); + return m_content.m_image; + } void setImage(PassRefPtr<StyleImage> image) { deleteContent(); m_type = CONTENT_OBJECT; - m_content.m_image = image.releaseRef(); + m_content.m_image = image.leakRef(); } - StringImpl* text() const { return m_content.m_text; } + StringImpl* text() const + { + ASSERT(isText()); + return m_content.m_text; + } void setText(PassRefPtr<StringImpl> text) { deleteContent(); m_type = CONTENT_TEXT; - m_content.m_text = text.releaseRef(); + m_content.m_text = text.leakRef(); } - CounterContent* counter() const { return m_content.m_counter; } - void setCounter(CounterContent* counter) + CounterContent* counter() const + { + ASSERT(isCounter()); + return m_content.m_counter; + } + void setCounter(PassOwnPtr<CounterContent> counter) { deleteContent(); m_type = CONTENT_COUNTER; - m_content.m_counter = counter; + m_content.m_counter = counter.leakPtr(); } - ContentData* next() const { return m_next; } - void setNext(ContentData* next) - { - m_next = next; - } + ContentData* next() const { return m_next.get(); } + void setNext(PassOwnPtr<ContentData> next) { m_next = next; } private: void deleteContent(); @@ -98,7 +104,7 @@ private: StringImpl* m_text; CounterContent* m_counter; } m_content; - ContentData* m_next; + OwnPtr<ContentData> m_next; }; } // namespace WebCore diff --git a/WebCore/rendering/style/CursorData.h b/WebCore/rendering/style/CursorData.h index 2341e71..6d0a273 100644 --- a/WebCore/rendering/style/CursorData.h +++ b/WebCore/rendering/style/CursorData.h @@ -25,15 +25,14 @@ #ifndef CursorData_h #define CursorData_h -#include "CachedImage.h" -#include "CachedResourceHandle.h" #include "IntPoint.h" +#include "StyleImage.h" namespace WebCore { class CursorData { public: - CursorData(CachedImage* image, const IntPoint& hotSpot) + CursorData(PassRefPtr<StyleImage> image, const IntPoint& hotSpot) : m_image(image) , m_hotSpot(hotSpot) { @@ -49,11 +48,13 @@ public: return !(*this == o); } - const CachedImage* image() const { return m_image.get(); } + StyleImage* image() const { return m_image.get(); } + void setImage(PassRefPtr<StyleImage> image) { m_image = image; } + const IntPoint& hotSpot() const { return m_hotSpot; } private: - CachedResourceHandle<CachedImage> m_image; + RefPtr<StyleImage> m_image; IntPoint m_hotSpot; // for CSS3 support }; diff --git a/WebCore/rendering/style/CursorList.h b/WebCore/rendering/style/CursorList.h index bdd65d4..1b82684 100644 --- a/WebCore/rendering/style/CursorList.h +++ b/WebCore/rendering/style/CursorList.h @@ -39,6 +39,7 @@ public: } const CursorData& operator[](int i) const { return m_vector[i]; } + CursorData& operator[](int i) { return m_vector[i]; } bool operator==(const CursorList& o) const { return m_vector == o.m_vector; } bool operator!=(const CursorList& o) const { return m_vector != o.m_vector; } diff --git a/WebCore/rendering/style/KeyframeList.cpp b/WebCore/rendering/style/KeyframeList.cpp index 41fbbe2..bafa426 100644 --- a/WebCore/rendering/style/KeyframeList.cpp +++ b/WebCore/rendering/style/KeyframeList.cpp @@ -43,10 +43,10 @@ bool KeyframeList::operator==(const KeyframeList& o) const Vector<KeyframeValue>::const_iterator it2 = o.m_keyframes.begin(); for (Vector<KeyframeValue>::const_iterator it1 = m_keyframes.begin(); it1 != m_keyframes.end(); ++it1) { - if (it1->m_key != it2->m_key) + if (it1->key() != it2->key()) return false; - const RenderStyle& style1 = *it1->m_style; - const RenderStyle& style2 = *it2->m_style; + const RenderStyle& style1 = *it1->style(); + const RenderStyle& style2 = *it2->style(); if (style1 != style2) return false; ++it2; @@ -55,34 +55,43 @@ bool KeyframeList::operator==(const KeyframeList& o) const return true; } -void KeyframeList::insert(float key, PassRefPtr<RenderStyle> style) +void KeyframeList::insert(const KeyframeValue& keyframe) { - if (key < 0 || key > 1) + if (keyframe.key() < 0 || keyframe.key() > 1) return; - int index = -1; - + bool inserted = false; + bool replaced = false; for (size_t i = 0; i < m_keyframes.size(); ++i) { - if (m_keyframes[i].m_key == key) { - index = (int) i; + if (m_keyframes[i].key() == keyframe.key()) { + m_keyframes[i] = keyframe; + replaced = true; break; } - if (m_keyframes[i].m_key > key) { + + if (m_keyframes[i].key() > keyframe.key()) { // insert before - m_keyframes.insert(i, KeyframeValue()); - index = (int) i; + m_keyframes.insert(i, keyframe); + inserted = true; break; } } - if (index < 0) { - // append - index = (int) m_keyframes.size(); - m_keyframes.append(KeyframeValue()); + if (!replaced && !inserted) + m_keyframes.append(keyframe); + + if (replaced) { + // We have to rebuild the properties list from scratch. + m_properties.clear(); + for (Vector<KeyframeValue>::const_iterator it = m_keyframes.begin(); it != m_keyframes.end(); ++it) { + const KeyframeValue& currKeyframe = *it; + for (HashSet<int>::const_iterator it = currKeyframe.properties().begin(); it != currKeyframe.properties().end(); ++it) + m_properties.add(*it); + } + } else { + for (HashSet<int>::const_iterator it = keyframe.properties().begin(); it != keyframe.properties().end(); ++it) + m_properties.add(*it); } - - m_keyframes[index].m_key = key; - m_keyframes[index].m_style = style; } } // namespace WebCore diff --git a/WebCore/rendering/style/KeyframeList.h b/WebCore/rendering/style/KeyframeList.h index bb5f180..64170ce 100644 --- a/WebCore/rendering/style/KeyframeList.h +++ b/WebCore/rendering/style/KeyframeList.h @@ -37,15 +37,25 @@ class RenderStyle; class KeyframeValue { public: - KeyframeValue() - : m_key(-1) + KeyframeValue(float key, PassRefPtr<RenderStyle> style) + : m_key(key) + , m_style(style) { } + void addProperty(int prop) { m_properties.add(prop); } + bool containsProperty(int prop) const { return m_properties.contains(prop); } + const HashSet<int>& properties() const { return m_properties; } + float key() const { return m_key; } + void setKey(float key) { m_key = key; } + const RenderStyle* style() const { return m_style.get(); } + void setStyle(PassRefPtr<RenderStyle> style) { m_style = style; } +private: float m_key; + HashSet<int> m_properties; // The properties specified in this keyframe. RefPtr<RenderStyle> m_style; }; @@ -55,8 +65,8 @@ public: : m_animationName(animationName) , m_renderer(renderer) { - insert(0, 0); - insert(1, 0); + insert(KeyframeValue(0, 0)); + insert(KeyframeValue(1, 0)); } ~KeyframeList(); @@ -65,7 +75,7 @@ public: const AtomicString& animationName() const { return m_animationName; } - void insert(float key, PassRefPtr<RenderStyle> style); + void insert(const KeyframeValue& keyframe); void addProperty(int prop) { m_properties.add(prop); } bool containsProperty(int prop) const { return m_properties.contains(prop); } @@ -75,13 +85,12 @@ public: void clear(); bool isEmpty() const { return m_keyframes.isEmpty(); } size_t size() const { return m_keyframes.size(); } - Vector<KeyframeValue>::const_iterator beginKeyframes() const { return m_keyframes.begin(); } - Vector<KeyframeValue>::const_iterator endKeyframes() const { return m_keyframes.end(); } + const KeyframeValue& operator[](size_t index) const { return m_keyframes[index]; } private: AtomicString m_animationName; - Vector<KeyframeValue> m_keyframes; - HashSet<int> m_properties; // the properties being animated + Vector<KeyframeValue> m_keyframes; // kept sorted by key + HashSet<int> m_properties; // the properties being animated RenderObject* m_renderer; }; diff --git a/WebCore/rendering/style/RenderStyle.cpp b/WebCore/rendering/style/RenderStyle.cpp index aaccbf7..93cd8de 100644 --- a/WebCore/rendering/style/RenderStyle.cpp +++ b/WebCore/rendering/style/RenderStyle.cpp @@ -24,8 +24,6 @@ #include "CSSPropertyNames.h" #include "CSSStyleSelector.h" -#include "CachedImage.h" -#include "CounterContent.h" #include "FontSelector.h" #include "RenderArena.h" #include "RenderObject.h" @@ -403,7 +401,6 @@ StyleDifference RenderStyle::diff(const RenderStyle* other, unsigned& changedCon inherited->vertical_border_spacing != other->inherited->vertical_border_spacing || inherited_flags._box_direction != other->inherited_flags._box_direction || inherited_flags._visuallyOrdered != other->inherited_flags._visuallyOrdered || - inherited_flags._htmlHacks != other->inherited_flags._htmlHacks || noninherited_flags._position != other->noninherited_flags._position || noninherited_flags._floating != other->noninherited_flags._floating || noninherited_flags._originalDisplay != other->noninherited_flags._originalDisplay) @@ -552,7 +549,7 @@ void RenderStyle::setClip(Length top, Length right, Length bottom, Length left) data->clip.m_left = left; } -void RenderStyle::addCursor(CachedImage* image, const IntPoint& hotSpot) +void RenderStyle::addCursor(PassRefPtr<StyleImage> image, const IntPoint& hotSpot) { if (!rareInheritedData.access()->cursorData) rareInheritedData.access()->cursorData = CursorList::create(); @@ -576,92 +573,59 @@ void RenderStyle::clearContent() rareNonInheritedData->m_content->clear(); } -void RenderStyle::setContent(PassRefPtr<StyleImage> image, bool add) +ContentData* RenderStyle::prepareToSetContent(StringImpl* string, bool add) { - if (!image) - return; // The object is null. Nothing to do. Just bail. - OwnPtr<ContentData>& content = rareNonInheritedData.access()->m_content; ContentData* lastContent = content.get(); while (lastContent && lastContent->next()) lastContent = lastContent->next(); + if (string && add && lastContent && lastContent->isText()) { + // Augment the existing string and share the existing ContentData node. + String newText = lastContent->text(); + newText.append(string); + lastContent->setText(newText.impl()); + return 0; + } + bool reuseContent = !add; - ContentData* newContentData; + OwnPtr<ContentData> newContentData; if (reuseContent && content) { content->clear(); - newContentData = content.leakPtr(); + newContentData = content.release(); } else - newContentData = new ContentData; + newContentData = adoptPtr(new ContentData); + + ContentData* result = newContentData.get(); if (lastContent && !reuseContent) - lastContent->setNext(newContentData); + lastContent->setNext(newContentData.release()); else - content.set(newContentData); + content = newContentData.release(); - newContentData->setImage(image); + return result; } -void RenderStyle::setContent(PassRefPtr<StringImpl> s, bool add) +void RenderStyle::setContent(PassRefPtr<StyleImage> image, bool add) { - if (!s) - return; // The string is null. Nothing to do. Just bail. - - OwnPtr<ContentData>& content = rareNonInheritedData.access()->m_content; - ContentData* lastContent = content.get(); - while (lastContent && lastContent->next()) - lastContent = lastContent->next(); - - bool reuseContent = !add; - if (add && lastContent) { - if (lastContent->isText()) { - // We can augment the existing string and share this ContentData node. - String newStr = lastContent->text(); - newStr.append(s.get()); - lastContent->setText(newStr.impl()); - return; - } - } - - ContentData* newContentData = 0; - if (reuseContent && content) { - content->clear(); - newContentData = content.leakPtr(); - } else - newContentData = new ContentData; - - if (lastContent && !reuseContent) - lastContent->setNext(newContentData); - else - content.set(newContentData); - - newContentData->setText(s); + if (!image) + return; + prepareToSetContent(0, add)->setImage(image); } -void RenderStyle::setContent(CounterContent* c, bool add) +void RenderStyle::setContent(PassRefPtr<StringImpl> string, bool add) { - if (!c) + if (!string) return; + if (ContentData* data = prepareToSetContent(string.get(), add)) + data->setText(string); +} - OwnPtr<ContentData>& content = rareNonInheritedData.access()->m_content; - ContentData* lastContent = content.get(); - while (lastContent && lastContent->next()) - lastContent = lastContent->next(); - - bool reuseContent = !add; - ContentData* newContentData = 0; - if (reuseContent && content) { - content->clear(); - newContentData = content.leakPtr(); - } else - newContentData = new ContentData; - - if (lastContent && !reuseContent) - lastContent->setNext(newContentData); - else - content.set(newContentData); - - newContentData->setCounter(c); +void RenderStyle::setContent(PassOwnPtr<CounterContent> counter, bool add) +{ + if (!counter) + return; + prepareToSetContent(0, add)->setCounter(counter); } void RenderStyle::applyTransform(TransformationMatrix& transform, const IntSize& borderBoxSize, ApplyTransformOrigin applyOrigin) const @@ -774,21 +738,22 @@ static void constrainCornerRadiiForRect(const IntRect& r, IntSize& topLeft, IntS void RenderStyle::getBorderRadiiForRect(const IntRect& r, IntSize& topLeft, IntSize& topRight, IntSize& bottomLeft, IntSize& bottomRight) const { - topLeft = surround->border.topLeft(); - topRight = surround->border.topRight(); + topLeft = IntSize(surround->border.topLeft().width().calcValue(r.width()), surround->border.topLeft().height().calcValue(r.height())); + topRight = IntSize(surround->border.topRight().width().calcValue(r.width()), surround->border.topRight().height().calcValue(r.height())); - bottomLeft = surround->border.bottomLeft(); - bottomRight = surround->border.bottomRight(); + bottomLeft = IntSize(surround->border.bottomLeft().width().calcValue(r.width()), surround->border.bottomLeft().height().calcValue(r.height())); + bottomRight = IntSize(surround->border.bottomRight().width().calcValue(r.width()), surround->border.bottomRight().height().calcValue(r.height())); constrainCornerRadiiForRect(r, topLeft, topRight, bottomLeft, bottomRight); } void RenderStyle::getInnerBorderRadiiForRectWithBorderWidths(const IntRect& innerRect, unsigned short topWidth, unsigned short bottomWidth, unsigned short leftWidth, unsigned short rightWidth, IntSize& innerTopLeft, IntSize& innerTopRight, IntSize& innerBottomLeft, IntSize& innerBottomRight) const { - innerTopLeft = surround->border.topLeft(); - innerTopRight = surround->border.topRight(); - innerBottomLeft = surround->border.bottomLeft(); - innerBottomRight = surround->border.bottomRight(); + innerTopLeft = IntSize(surround->border.topLeft().width().calcValue(innerRect.width()), surround->border.topLeft().height().calcValue(innerRect.height())); + innerTopRight = IntSize(surround->border.topRight().width().calcValue(innerRect.width()), surround->border.topRight().height().calcValue(innerRect.height())); + innerBottomLeft = IntSize(surround->border.bottomLeft().width().calcValue(innerRect.width()), surround->border.bottomLeft().height().calcValue(innerRect.height())); + innerBottomRight = IntSize(surround->border.bottomRight().width().calcValue(innerRect.width()), surround->border.bottomRight().height().calcValue(innerRect.height())); + innerTopLeft.setWidth(max(0, innerTopLeft.width() - leftWidth)); innerTopLeft.setHeight(max(0, innerTopLeft.height() - topWidth)); diff --git a/WebCore/rendering/style/RenderStyle.h b/WebCore/rendering/style/RenderStyle.h index 1681890..e696735 100644 --- a/WebCore/rendering/style/RenderStyle.h +++ b/WebCore/rendering/style/RenderStyle.h @@ -35,7 +35,6 @@ #include "CSSPropertyNames.h" #include "CSSReflectionDirection.h" #include "CSSValueList.h" -#include "CachedImage.h" #include "CollapsedBorderValue.h" #include "Color.h" #include "ColorSpace.h" @@ -103,7 +102,6 @@ using std::max; class CSSStyleSelector; class CSSValueList; -class CachedImage; class Pair; class StyleImage; @@ -178,7 +176,6 @@ protected: (_white_space == other._white_space) && (_box_direction == other._box_direction) && (_visuallyOrdered == other._visuallyOrdered) && - (_htmlHacks == other._htmlHacks) && (_force_backgrounds_to_white == other._force_backgrounds_to_white) && (_pointerEvents == other._pointerEvents) && (_insideLink == other._insideLink); @@ -203,7 +200,6 @@ protected: // non CSS2 inherited bool _visuallyOrdered : 1; - bool _htmlHacks : 1; bool _force_backgrounds_to_white : 1; unsigned _pointerEvents : 4; // EPointerEvents unsigned _insideLink : 2; // EInsideLink @@ -279,7 +275,6 @@ protected: inherited_flags._border_collapse = initialBorderCollapse(); inherited_flags._white_space = initialWhiteSpace(); inherited_flags._visuallyOrdered = initialVisuallyOrdered(); - inherited_flags._htmlHacks=false; inherited_flags._box_direction = initialBoxDirection(); inherited_flags._force_backgrounds_to_white = false; inherited_flags._pointerEvents = initialPointerEvents(); @@ -348,6 +343,14 @@ public: bool hasFixedBackgroundImage() const { return m_background->background().hasFixedImage(); } bool hasAppearance() const { return appearance() != NoControlPart; } + bool hasBackground() const + { + Color color = visitedDependentColor(CSSPropertyBackgroundColor); + if (color.isValid() && color.alpha() > 0) + return true; + return hasBackgroundImage(); + } + bool visuallyOrdered() const { return inherited_flags._visuallyOrdered; } void setVisuallyOrdered(bool b) { inherited_flags._visuallyOrdered = b; } @@ -390,10 +393,10 @@ public: const NinePieceImage& borderImage() const { return surround->border.image(); } - const IntSize& borderTopLeftRadius() const { return surround->border.topLeft(); } - const IntSize& borderTopRightRadius() const { return surround->border.topRight(); } - const IntSize& borderBottomLeftRadius() const { return surround->border.bottomLeft(); } - const IntSize& borderBottomRightRadius() const { return surround->border.bottomRight(); } + const LengthSize& borderTopLeftRadius() const { return surround->border.topLeft(); } + const LengthSize& borderTopRightRadius() const { return surround->border.topRight(); } + const LengthSize& borderBottomLeftRadius() const { return surround->border.bottomLeft(); } + const LengthSize& borderBottomRightRadius() const { return surround->border.bottomRight(); } bool hasBorderRadius() const { return surround->border.hasBorderRadius(); } unsigned short borderLeftWidth() const { return surround->border.borderLeftWidth(); } @@ -788,18 +791,23 @@ public: void setBorderImage(const NinePieceImage& b) { SET_VAR(surround, border.m_image, b) } - void setBorderTopLeftRadius(const IntSize& s) { SET_VAR(surround, border.m_topLeft, s) } - void setBorderTopRightRadius(const IntSize& s) { SET_VAR(surround, border.m_topRight, s) } - void setBorderBottomLeftRadius(const IntSize& s) { SET_VAR(surround, border.m_bottomLeft, s) } - void setBorderBottomRightRadius(const IntSize& s) { SET_VAR(surround, border.m_bottomRight, s) } + void setBorderTopLeftRadius(const LengthSize& s) { SET_VAR(surround, border.m_topLeft, s) } + void setBorderTopRightRadius(const LengthSize& s) { SET_VAR(surround, border.m_topRight, s) } + void setBorderBottomLeftRadius(const LengthSize& s) { SET_VAR(surround, border.m_bottomLeft, s) } + void setBorderBottomRightRadius(const LengthSize& s) { SET_VAR(surround, border.m_bottomRight, s) } - void setBorderRadius(const IntSize& s) + void setBorderRadius(const LengthSize& s) { setBorderTopLeftRadius(s); setBorderTopRightRadius(s); setBorderBottomLeftRadius(s); setBorderBottomRightRadius(s); } + void setBorderRadius(const IntSize& s) + { + setBorderRadius(LengthSize(Length(s.width(), Fixed), Length(s.height(), Fixed))); + } + void getBorderRadiiForRect(const IntRect&, IntSize& topLeft, IntSize& topRight, IntSize& bottomLeft, IntSize& bottomRight) const; void getInnerBorderRadiiForRectWithBorderWidths(const IntRect&, unsigned short topWidth, @@ -914,7 +922,7 @@ public: void setCounterReset(short v) { SET_VAR(rareNonInheritedData, m_counterReset, v) } void setListStyleType(EListStyleType v) { inherited_flags._list_style_type = v; } - void setListStyleImage(StyleImage* v) { if (inherited->list_style_image != v) inherited.access()->list_style_image = v; } + void setListStyleImage(PassRefPtr<StyleImage> v) { if (inherited->list_style_image != v) inherited.access()->list_style_image = v; } void setListStylePosition(EListStylePosition v) { inherited_flags._list_style_position = v; } void resetMargin() { SET_VAR(surround, margin, LengthBox(Fixed)) } @@ -931,7 +939,7 @@ public: void setPaddingRight(Length v) { SET_VAR(surround, padding.m_right, v) } void setCursor(ECursor c) { inherited_flags._cursor_style = c; } - void addCursor(CachedImage*, const IntPoint& = IntPoint()); + void addCursor(PassRefPtr<StyleImage>, const IntPoint& hotSpot = IntPoint()); void setCursorList(PassRefPtr<CursorList>); void clearCursorList(); @@ -941,9 +949,6 @@ public: bool forceBackgroundsToWhite() const { return inherited_flags._force_backgrounds_to_white; } void setForceBackgroundsToWhite(bool b=true) { inherited_flags._force_backgrounds_to_white = b; } - bool htmlHacks() const { return inherited_flags._htmlHacks; } - void setHtmlHacks(bool b=true) { inherited_flags._htmlHacks = b; } - bool hasAutoZIndex() const { return m_box->hasAutoZIndex(); } void setHasAutoZIndex() { SET_VAR(m_box, m_hasAutoZIndex, true); SET_VAR(m_box, m_zIndex, 0) } int zIndex() const { return m_box->zIndex(); } @@ -1091,7 +1096,7 @@ public: void clearContent(); void setContent(PassRefPtr<StringImpl>, bool add = false); void setContent(PassRefPtr<StyleImage>, bool add = false); - void setContent(CounterContent*, bool add = false); + void setContent(PassOwnPtr<CounterContent>, bool add = false); const CounterDirectiveMap* counterDirectives() const; CounterDirectiveMap& accessCounterDirectives(); @@ -1153,7 +1158,7 @@ public: static bool initialBorderCollapse() { return false; } static EBorderStyle initialBorderStyle() { return BNONE; } static NinePieceImage initialNinePieceImage() { return NinePieceImage(); } - static IntSize initialBorderRadius() { return IntSize(0, 0); } + static LengthSize initialBorderRadius() { return LengthSize(Length(0, Fixed), Length(0, Fixed)); } static ECaptionSide initialCaptionSide() { return CAPTOP; } static EClear initialClear() { return CNONE; } static TextDirection initialDirection() { return LTR; } @@ -1281,6 +1286,8 @@ private: const Color& textStrokeColor() const { return rareInheritedData->textStrokeColor; } const Color colorIncludingFallback(int colorProperty, EBorderStyle borderStyle) const; + + ContentData* prepareToSetContent(StringImpl*, bool add); }; } // namespace WebCore diff --git a/WebCore/rendering/style/RenderStyleConstants.h b/WebCore/rendering/style/RenderStyleConstants.h index 70b128b..68c8113 100644 --- a/WebCore/rendering/style/RenderStyleConstants.h +++ b/WebCore/rendering/style/RenderStyleConstants.h @@ -79,6 +79,7 @@ enum PseudoId { METER_HORIZONTAL_BAR, METER_HORIZONTAL_OPTIMUM, METER_HORIZONTAL_SUBOPTIMAL, METER_HORIZONTAL_EVEN_LESS_GOOD, METER_VERTICAL_BAR, METER_VERTICAL_OPTIMUM, METER_VERTICAL_SUBOPTIMAL, METER_VERTICAL_EVEN_LESS_GOOD, AFTER_LAST_INTERNAL_PSEUDOID, + FULL_SCREEN, FULL_SCREEN_DOCUMENT, FIRST_PUBLIC_PSEUDOID = FIRST_LINE, FIRST_INTERNAL_PSEUDOID = FILE_UPLOAD_BUTTON, PUBLIC_PSEUDOID_MASK = ((1 << FIRST_INTERNAL_PSEUDOID) - 1) & ~((1 << FIRST_PUBLIC_PSEUDOID) - 1) @@ -276,6 +277,8 @@ enum EListStyleType { EthiopicAbegedeTiEt, UpperGreek, UpperNorwegian, + Asterisks, + Footnotes, Hebrew, Armenian, Georgian, diff --git a/WebCore/rendering/style/SVGRenderStyle.cpp b/WebCore/rendering/style/SVGRenderStyle.cpp index dc8a5af..7d1ad3b 100644 --- a/WebCore/rendering/style/SVGRenderStyle.cpp +++ b/WebCore/rendering/style/SVGRenderStyle.cpp @@ -162,6 +162,10 @@ StyleDifference SVGRenderStyle::diff(const SVGRenderStyle* other) const || svg_inherited_flags._joinStyle != other->svg_inherited_flags._joinStyle) return StyleDifferenceLayout; + // Shadow changes require relayouts, as they affect the repaint rects. + if (shadowSVG != other->shadowSVG) + return StyleDifferenceLayout; + // Some stroke properties, requires relayouts, as the cached stroke boundaries need to be recalculated. if (stroke != other->stroke) { if (stroke->width != other->stroke->width @@ -178,10 +182,6 @@ StyleDifference SVGRenderStyle::diff(const SVGRenderStyle* other) const // NOTE: All comparisions below may only return StyleDifferenceRepaint - // Shadow changes need to cause repaints. - if (shadowSVG != other->shadowSVG) - return StyleDifferenceRepaint; - // Painting related properties only need repaints. if (miscNotEqual) { if (misc->floodColor != other->misc->floodColor @@ -215,48 +215,6 @@ StyleDifference SVGRenderStyle::diff(const SVGRenderStyle* other) const return StyleDifferenceEqual; } -static void getSVGShadowExtent(ShadowData* shadow, float& top, float& right, float& bottom, float& left) -{ - top = 0.0f; - right = 0.0f; - bottom = 0.0f; - left = 0.0f; - - float blurAndSpread = shadow->blur() + shadow->spread(); - - top = min(top, shadow->y() - blurAndSpread); - right = max(right, shadow->x() + blurAndSpread); - bottom = max(bottom, shadow->y() + blurAndSpread); - left = min(left, shadow->x() - blurAndSpread); -} - -void SVGRenderStyle::inflateForShadow(IntRect& repaintRect) const -{ - ShadowData* svgShadow = shadow(); - if (!svgShadow) - return; - - FloatRect repaintFloatRect = FloatRect(repaintRect); - inflateForShadow(repaintFloatRect); - repaintRect = enclosingIntRect(repaintFloatRect); -} - -void SVGRenderStyle::inflateForShadow(FloatRect& repaintRect) const -{ - ShadowData* svgShadow = shadow(); - if (!svgShadow) - return; - - float shadowTop; - float shadowRight; - float shadowBottom; - float shadowLeft; - getSVGShadowExtent(svgShadow, shadowTop, shadowRight, shadowBottom, shadowLeft); - - repaintRect.move(shadowLeft, shadowTop); - repaintRect.setSize(repaintRect.size() + FloatSize(shadowRight - shadowLeft, shadowBottom - shadowTop)); -} - } #endif // ENABLE(SVG) diff --git a/WebCore/rendering/style/SVGRenderStyle.h b/WebCore/rendering/style/SVGRenderStyle.h index f071755..d57e4cf 100644 --- a/WebCore/rendering/style/SVGRenderStyle.h +++ b/WebCore/rendering/style/SVGRenderStyle.h @@ -47,10 +47,6 @@ public: bool inheritedNotEqual(const SVGRenderStyle*) const; void inheritFrom(const SVGRenderStyle*); - // FIXME: These functions should move to ShadowData. - void inflateForShadow(IntRect&) const; - void inflateForShadow(FloatRect&) const; - StyleDifference diff(const SVGRenderStyle*) const; bool operator==(const SVGRenderStyle&) const; diff --git a/WebCore/rendering/style/ShadowData.cpp b/WebCore/rendering/style/ShadowData.cpp index d4569d0..3a8f81d 100644 --- a/WebCore/rendering/style/ShadowData.cpp +++ b/WebCore/rendering/style/ShadowData.cpp @@ -22,6 +22,11 @@ #include "config.h" #include "ShadowData.h" +#include "FloatRect.h" +#include "IntRect.h" + +using namespace std; + namespace WebCore { ShadowData::ShadowData(const ShadowData& o) @@ -44,4 +49,45 @@ bool ShadowData::operator==(const ShadowData& o) const return m_x == o.m_x && m_y == o.m_y && m_blur == o.m_blur && m_spread == o.m_spread && m_style == o.m_style && m_color == o.m_color; } +static inline void calculateShadowExtent(const ShadowData* shadow, int additionalOutlineSize, int& shadowLeft, int& shadowRight, int& shadowTop, int& shadowBottom) +{ + do { + int blurAndSpread = shadow->blur() + shadow->spread() + additionalOutlineSize; + if (shadow->style() == Normal) { + shadowLeft = min(shadow->x() - blurAndSpread, shadowLeft); + shadowRight = max(shadow->x() + blurAndSpread, shadowRight); + shadowTop = min(shadow->y() - blurAndSpread, shadowTop); + shadowBottom = max(shadow->y() + blurAndSpread, shadowBottom); + } + + shadow = shadow->next(); + } while (shadow); +} + +void ShadowData::adjustRectForShadow(IntRect& rect, int additionalOutlineSize) const +{ + int shadowLeft = 0; + int shadowRight = 0; + int shadowTop = 0; + int shadowBottom = 0; + calculateShadowExtent(this, additionalOutlineSize, shadowLeft, shadowRight, shadowTop, shadowBottom); + + rect.move(shadowLeft, shadowTop); + rect.setWidth(rect.width() - shadowLeft + shadowRight); + rect.setHeight(rect.height() - shadowTop + shadowBottom); +} + +void ShadowData::adjustRectForShadow(FloatRect& rect, int additionalOutlineSize) const +{ + int shadowLeft = 0; + int shadowRight = 0; + int shadowTop = 0; + int shadowBottom = 0; + calculateShadowExtent(this, additionalOutlineSize, shadowLeft, shadowRight, shadowTop, shadowBottom); + + rect.move(shadowLeft, shadowTop); + rect.setWidth(rect.width() - shadowLeft + shadowRight); + rect.setHeight(rect.height() - shadowTop + shadowBottom); +} + } // namespace WebCore diff --git a/WebCore/rendering/style/ShadowData.h b/WebCore/rendering/style/ShadowData.h index 9252e13..ca83af0 100644 --- a/WebCore/rendering/style/ShadowData.h +++ b/WebCore/rendering/style/ShadowData.h @@ -30,6 +30,9 @@ namespace WebCore { +class FloatRect; +class IntRect; + enum ShadowStyle { Normal, Inset }; // This struct holds information about shadows for the text-shadow and box-shadow properties. @@ -76,6 +79,9 @@ public: const ShadowData* next() const { return m_next; } void setNext(ShadowData* shadow) { m_next = shadow; } + void adjustRectForShadow(IntRect&, int additionalOutlineSize = 0) const; + void adjustRectForShadow(FloatRect&, int additionalOutlineSize = 0) const; + private: int m_x; int m_y; diff --git a/WebCore/rendering/style/StyleCachedImage.cpp b/WebCore/rendering/style/StyleCachedImage.cpp index b55c5b9..1d7aba8 100644 --- a/WebCore/rendering/style/StyleCachedImage.cpp +++ b/WebCore/rendering/style/StyleCachedImage.cpp @@ -29,7 +29,7 @@ namespace WebCore { -PassRefPtr<CSSValue> StyleCachedImage::cssValue() +PassRefPtr<CSSValue> StyleCachedImage::cssValue() const { return CSSPrimitiveValue::create(m_image->url(), CSSPrimitiveValue::CSS_URI); } diff --git a/WebCore/rendering/style/StyleCachedImage.h b/WebCore/rendering/style/StyleCachedImage.h index 3d22868..3d6e1a2 100644 --- a/WebCore/rendering/style/StyleCachedImage.h +++ b/WebCore/rendering/style/StyleCachedImage.h @@ -38,7 +38,7 @@ public: virtual bool isCachedImage() const { return true; } - virtual PassRefPtr<CSSValue> cssValue(); + virtual PassRefPtr<CSSValue> cssValue() const; CachedImage* cachedImage() const { return m_image.get(); } diff --git a/WebCore/rendering/style/StyleGeneratedImage.cpp b/WebCore/rendering/style/StyleGeneratedImage.cpp index 610e73d..2322f5f 100644 --- a/WebCore/rendering/style/StyleGeneratedImage.cpp +++ b/WebCore/rendering/style/StyleGeneratedImage.cpp @@ -29,7 +29,7 @@ namespace WebCore { -PassRefPtr<CSSValue> StyleGeneratedImage::cssValue() +PassRefPtr<CSSValue> StyleGeneratedImage::cssValue() const { return m_generator; } diff --git a/WebCore/rendering/style/StyleGeneratedImage.h b/WebCore/rendering/style/StyleGeneratedImage.h index 532e383..7be1f6a 100644 --- a/WebCore/rendering/style/StyleGeneratedImage.h +++ b/WebCore/rendering/style/StyleGeneratedImage.h @@ -42,7 +42,7 @@ public: virtual bool isGeneratedImage() const { return true; } - virtual PassRefPtr<CSSValue> cssValue(); + virtual PassRefPtr<CSSValue> cssValue() const; virtual IntSize imageSize(const RenderObject*, float multiplier) const; virtual bool imageHasRelativeWidth() const { return !m_fixedSize; } diff --git a/WebCore/rendering/style/StyleImage.h b/WebCore/rendering/style/StyleImage.h index cb90288..ead8d4a 100644 --- a/WebCore/rendering/style/StyleImage.h +++ b/WebCore/rendering/style/StyleImage.h @@ -24,6 +24,7 @@ #ifndef StyleImage_h #define StyleImage_h +#include "CSSValue.h" #include "IntSize.h" #include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> @@ -41,12 +42,12 @@ class StyleImage : public RefCounted<StyleImage> { public: virtual ~StyleImage() { } - bool operator==(const StyleImage& other) + bool operator==(const StyleImage& other) const { return data() == other.data(); } - - virtual PassRefPtr<CSSValue> cssValue() = 0; + + virtual PassRefPtr<CSSValue> cssValue() const = 0; virtual bool canRender(float /*multiplier*/) const { return true; } virtual bool isLoaded() const { return true; } @@ -60,7 +61,9 @@ public: virtual void removeClient(RenderObject*) = 0; virtual Image* image(RenderObject*, const IntSize&) const = 0; virtual WrappedImagePtr data() const = 0; + virtual bool isCachedImage() const { return false; } + virtual bool isPendingImage() const { return false; } virtual bool isGeneratedImage() const { return false; } static bool imagesEquivalent(StyleImage* image1, StyleImage* image2) diff --git a/WebCore/rendering/style/StylePendingImage.h b/WebCore/rendering/style/StylePendingImage.h new file mode 100644 index 0000000..b0c9b01 --- /dev/null +++ b/WebCore/rendering/style/StylePendingImage.h @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2010 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY + * EXPRESS OR 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 StylePendingImage_h +#define StylePendingImage_h + +#include "StyleImage.h" + +namespace WebCore { + +// StylePendingImage is a placeholder StyleImage that is entered into the RenderStyle during +// style resolution, in order to avoid loading images that are not referenced by the final style. +// They should never exist in a RenderStyle after it has been returned from the style selector. + +class StylePendingImage : public StyleImage { +public: + static PassRefPtr<StylePendingImage> create(CSSImageValue* value) { return adoptRef(new StylePendingImage(value)); } + + virtual WrappedImagePtr data() const { return m_value; } + + virtual bool isPendingImage() const { return true; } + + virtual PassRefPtr<CSSValue> cssValue() const { return m_value; } + CSSImageValue* cssImageValue() const { return m_value; } + + virtual IntSize imageSize(const RenderObject*, float /*multiplier*/) const { return IntSize(); } + virtual bool imageHasRelativeWidth() const { return false; } + virtual bool imageHasRelativeHeight() const { return false; } + virtual bool usesImageContainerSize() const { return false; } + virtual void setImageContainerSize(const IntSize&) { } + virtual void addClient(RenderObject*) { } + virtual void removeClient(RenderObject*) { } + virtual Image* image(RenderObject*, const IntSize&) const + { + ASSERT_NOT_REACHED(); + return 0; + } + +private: + StylePendingImage(CSSImageValue* value) + : m_value(value) + { + } + + CSSImageValue* m_value; // Not retained; it owns us. +}; + +} +#endif diff --git a/WebCore/storage/IDBCursor.cpp b/WebCore/storage/IDBCursor.cpp index de752f5..ae0d127 100644 --- a/WebCore/storage/IDBCursor.cpp +++ b/WebCore/storage/IDBCursor.cpp @@ -59,7 +59,7 @@ PassRefPtr<IDBKey> IDBCursor::key() const PassRefPtr<IDBAny> IDBCursor::value() const { - return m_backend->value(); + return IDBAny::create(m_backend->value().get()); } PassRefPtr<IDBRequest> IDBCursor::update(ScriptExecutionContext* context, PassRefPtr<SerializedScriptValue> value) diff --git a/WebCore/storage/IDBCursorBackendImpl.cpp b/WebCore/storage/IDBCursorBackendImpl.cpp index d3298b3..4cbac0e 100644 --- a/WebCore/storage/IDBCursorBackendImpl.cpp +++ b/WebCore/storage/IDBCursorBackendImpl.cpp @@ -28,23 +28,26 @@ #if ENABLE(INDEXED_DATABASE) -#include "IDBAny.h" #include "IDBCallbacks.h" +#include "IDBDatabaseBackendImpl.h" +#include "IDBDatabaseError.h" +#include "IDBDatabaseException.h" #include "IDBKeyRange.h" #include "IDBObjectStoreBackendImpl.h" #include "IDBRequest.h" #include "SQLiteDatabase.h" +#include "SQLiteStatement.h" #include "SerializedScriptValue.h" namespace WebCore { -IDBCursorBackendImpl::IDBCursorBackendImpl(PassRefPtr<IDBObjectStoreBackendImpl> idbObjectStore, PassRefPtr<IDBKeyRange> keyRange, IDBCursor::Direction direction, PassRefPtr<IDBKey> key, PassRefPtr<SerializedScriptValue> value) +IDBCursorBackendImpl::IDBCursorBackendImpl(PassRefPtr<IDBObjectStoreBackendImpl> idbObjectStore, PassRefPtr<IDBKeyRange> keyRange, IDBCursor::Direction direction, PassOwnPtr<SQLiteStatement> query) : m_idbObjectStore(idbObjectStore) , m_keyRange(keyRange) , m_direction(direction) - , m_key(key) - , m_value(IDBAny::create(value.get())) + , m_query(query) { + loadCurrentRow(); } IDBCursorBackendImpl::~IDBCursorBackendImpl() @@ -58,30 +61,106 @@ unsigned short IDBCursorBackendImpl::direction() const PassRefPtr<IDBKey> IDBCursorBackendImpl::key() const { - return m_key; + + return m_currentKey; } -PassRefPtr<IDBAny> IDBCursorBackendImpl::value() const +PassRefPtr<SerializedScriptValue> IDBCursorBackendImpl::value() const { - return m_value; + return m_currentValue; } -void IDBCursorBackendImpl::update(PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBCallbacks>) +void IDBCursorBackendImpl::update(PassRefPtr<SerializedScriptValue> prpValue, PassRefPtr<IDBCallbacks> callbacks) { - // FIXME: Implement this method. - ASSERT_NOT_REACHED(); + RefPtr<SerializedScriptValue> value = prpValue; + + 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.")); + return; + } + + String sql = "UPDATE ObjectStoreData SET value = ? WHERE id = ?"; + SQLiteStatement updateQuery(m_idbObjectStore->database()->sqliteDatabase(), sql); + + bool ok = updateQuery.prepare() == SQLResultOk; + ASSERT_UNUSED(ok, ok); // FIXME: Better error handling. + updateQuery.bindText(1, value->toWireString()); + updateQuery.bindInt64(2, m_currentId); + ok = updateQuery.step() == SQLResultDone; + ASSERT_UNUSED(ok, ok); // FIXME: Better error handling. + + m_currentValue = value.release(); + callbacks->onSuccess(); +} + +void IDBCursorBackendImpl::continueFunction(PassRefPtr<IDBKey> prpKey, PassRefPtr<IDBCallbacks> callbacks) +{ + RefPtr<IDBKey> key = prpKey; + while (true) { + if (!m_query || m_query->step() != SQLResultRow) { + m_query = 0; + m_currentId = InvalidId; + m_currentKey = 0; + m_currentValue = 0; + callbacks->onSuccess(); + return; + } + + RefPtr<IDBKey> oldKey = m_currentKey; + loadCurrentRow(); + + // If a key was supplied, we must loop until we find that key (or hit the end). + if (key && !key->isEqual(m_currentKey.get())) + continue; + + // If we don't have a uniqueness constraint, we can stop now. + if (m_direction == IDBCursor::NEXT || m_direction == IDBCursor::PREV) + break; + if (!m_currentKey->isEqual(oldKey.get())) + break; + } + + callbacks->onSuccess(this); } -void IDBCursorBackendImpl::continueFunction(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>) +void IDBCursorBackendImpl::remove(PassRefPtr<IDBCallbacks> callbacks) { - // FIXME: Implement this method. - ASSERT_NOT_REACHED(); + 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.")); + return; + } + + String sql = "DELETE FROM ObjectStoreData WHERE id = ?"; + SQLiteStatement deleteQuery(m_idbObjectStore->database()->sqliteDatabase(), sql); + + bool ok = deleteQuery.prepare() == SQLResultOk; + ASSERT_UNUSED(ok, ok); // FIXME: Better error handling. + deleteQuery.bindInt64(1, m_currentId); + ok = deleteQuery.step() == SQLResultDone; + ASSERT_UNUSED(ok, ok); // FIXME: Better error handling. + + m_currentId = InvalidId; + m_currentKey = 0; + m_currentValue = 0; + callbacks->onSuccess(); } -void IDBCursorBackendImpl::remove(PassRefPtr<IDBCallbacks>) +void IDBCursorBackendImpl::loadCurrentRow() { - // FIXME: Implement this method. - ASSERT_NOT_REACHED(); + // 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)); + else + m_currentKey = IDBKey::create(); + m_currentValue = SerializedScriptValue::createFromWire(m_query->getColumnText(4)); } } // namespace WebCore diff --git a/WebCore/storage/IDBCursorBackendImpl.h b/WebCore/storage/IDBCursorBackendImpl.h index 9ef62fe..3f7c4aa 100644 --- a/WebCore/storage/IDBCursorBackendImpl.h +++ b/WebCore/storage/IDBCursorBackendImpl.h @@ -31,37 +31,46 @@ #include "IDBCursor.h" #include "IDBCursorBackendInterface.h" +#include <wtf/OwnPtr.h> +#include <wtf/PassOwnPtr.h> #include <wtf/RefPtr.h> namespace WebCore { class IDBKeyRange; class IDBObjectStoreBackendImpl; +class SQLiteStatement; class SerializedScriptValue; class IDBCursorBackendImpl : public IDBCursorBackendInterface { public: - static PassRefPtr<IDBCursorBackendImpl> create(PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBKeyRange> keyRange, IDBCursor::Direction direction, PassRefPtr<IDBKey> key, PassRefPtr<SerializedScriptValue> value) + static PassRefPtr<IDBCursorBackendImpl> create(PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<IDBKeyRange> keyRange, IDBCursor::Direction direction, PassOwnPtr<SQLiteStatement> query) { - return adoptRef(new IDBCursorBackendImpl(objectStore, keyRange, direction, key, value)); + return adoptRef(new IDBCursorBackendImpl(objectStore, keyRange, direction, query)); } virtual ~IDBCursorBackendImpl(); virtual unsigned short direction() const; virtual PassRefPtr<IDBKey> key() const; - virtual PassRefPtr<IDBAny> value() const; + virtual PassRefPtr<SerializedScriptValue> 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, PassRefPtr<IDBKey>, PassRefPtr<SerializedScriptValue>); + IDBCursorBackendImpl(PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBKeyRange>, IDBCursor::Direction, PassOwnPtr<SQLiteStatement> query); + + void loadCurrentRow(); + + static const int64_t InvalidId = -1; RefPtr<IDBObjectStoreBackendImpl> m_idbObjectStore; RefPtr<IDBKeyRange> m_keyRange; IDBCursor::Direction m_direction; - RefPtr<IDBKey> m_key; - RefPtr<IDBAny> m_value; + OwnPtr<SQLiteStatement> m_query; + int64_t m_currentId; + RefPtr<IDBKey> m_currentKey; + RefPtr<SerializedScriptValue> m_currentValue; }; } // namespace WebCore diff --git a/WebCore/storage/IDBCursorBackendInterface.h b/WebCore/storage/IDBCursorBackendInterface.h index 4b209c4..acea955 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<IDBAny> value() const = 0; + virtual PassRefPtr<SerializedScriptValue> 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/IDBDatabase.cpp b/WebCore/storage/IDBDatabase.cpp index 78a6646..81950d6 100644 --- a/WebCore/storage/IDBDatabase.cpp +++ b/WebCore/storage/IDBDatabase.cpp @@ -69,6 +69,13 @@ PassRefPtr<IDBRequest> IDBDatabase::removeObjectStore(ScriptExecutionContext* co return request; } +PassRefPtr<IDBRequest> IDBDatabase::setVersion(ScriptExecutionContext* context, const String& version) +{ + RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this)); + m_backend->setVersion(version, request); + return request; +} + PassRefPtr<IDBTransaction> IDBDatabase::transaction(ScriptExecutionContext* context, DOMStringList* storeNames, unsigned short mode, unsigned long timeout) { // We need to create a new transaction synchronously. Locks are acquired asynchronously. Operations diff --git a/WebCore/storage/IDBDatabase.h b/WebCore/storage/IDBDatabase.h index 0e83288..dc70114 100644 --- a/WebCore/storage/IDBDatabase.h +++ b/WebCore/storage/IDBDatabase.h @@ -58,8 +58,10 @@ public: PassRefPtr<IDBRequest> createObjectStore(ScriptExecutionContext*, const String& name, const String& keyPath = String(), bool autoIncrement = false); PassRefPtr<IDBObjectStore> objectStore(const String& name, unsigned short mode = IDBTransaction::READ_ONLY); PassRefPtr<IDBRequest> removeObjectStore(ScriptExecutionContext*, const String& name); + PassRefPtr<IDBRequest> setVersion(ScriptExecutionContext*, const String& version); PassRefPtr<IDBTransaction> transaction(ScriptExecutionContext*, DOMStringList* storeNames = 0, unsigned short mode = IDBTransaction::READ_ONLY, unsigned long timeout = 0); // FIXME: what should the default timeout be? + private: IDBDatabase(PassRefPtr<IDBDatabaseBackendInterface>); diff --git a/WebCore/storage/IDBDatabase.idl b/WebCore/storage/IDBDatabase.idl index 51bbafb..347b3a7 100644 --- a/WebCore/storage/IDBDatabase.idl +++ b/WebCore/storage/IDBDatabase.idl @@ -32,13 +32,14 @@ module storage { readonly attribute DOMString version; readonly attribute DOMStringList objectStores; - // FIXME: Add setVersion. [CallWith=ScriptExecutionContext] IDBRequest createObjectStore(in DOMString name, in [Optional, ConvertNullToNullString] DOMString keyPath, in [Optional] boolean autoIncrement); // FIXME: objectStore needs to be able to raise an IDBDatabaseException. IDBObjectStore objectStore(in DOMString name, in [Optional] unsigned short mode); [CallWith=ScriptExecutionContext] IDBRequest removeObjectStore(in DOMString name); + [CallWith=ScriptExecutionContext] IDBRequest setVersion(in DOMString version); [CallWith=ScriptExecutionContext] IDBTransaction transaction (in [Optional] DOMStringList storeNames, in [Optional] unsigned short mode, in [Optional] unsigned long timeout); + // FIXME: Add close. }; } diff --git a/WebCore/storage/IDBDatabaseBackendImpl.cpp b/WebCore/storage/IDBDatabaseBackendImpl.cpp index 23bc44e..f4f2934 100644 --- a/WebCore/storage/IDBDatabaseBackendImpl.cpp +++ b/WebCore/storage/IDBDatabaseBackendImpl.cpp @@ -185,6 +185,13 @@ void IDBDatabaseBackendImpl::removeObjectStore(const String& name, PassRefPtr<ID callbacks->onSuccess(); } +void IDBDatabaseBackendImpl::setVersion(const String& version, PassRefPtr<IDBCallbacks> callbacks) +{ + m_version = version; + setMetaData(m_sqliteDatabase.get(), m_name, m_description, m_version); + callbacks->onSuccess(); +} + PassRefPtr<IDBTransactionBackendInterface> IDBDatabaseBackendImpl::transaction(DOMStringList* objectStores, unsigned short mode, unsigned long timeout) { return m_transactionCoordinator->createTransaction(objectStores, mode, timeout, this); diff --git a/WebCore/storage/IDBDatabaseBackendImpl.h b/WebCore/storage/IDBDatabaseBackendImpl.h index 3540b21..ab055f8 100644 --- a/WebCore/storage/IDBDatabaseBackendImpl.h +++ b/WebCore/storage/IDBDatabaseBackendImpl.h @@ -59,7 +59,9 @@ public: virtual void createObjectStore(const String& name, const String& keyPath, bool autoIncrement, PassRefPtr<IDBCallbacks>); virtual PassRefPtr<IDBObjectStoreBackendInterface> objectStore(const String& name, unsigned short mode); virtual void removeObjectStore(const String& name, PassRefPtr<IDBCallbacks>); + virtual void setVersion(const String& version, PassRefPtr<IDBCallbacks>); virtual PassRefPtr<IDBTransactionBackendInterface> transaction(DOMStringList* storeNames, unsigned short mode, unsigned long timeout); + private: IDBDatabaseBackendImpl(const String& name, const String& description, PassOwnPtr<SQLiteDatabase> database, IDBTransactionCoordinator*); diff --git a/WebCore/storage/IDBDatabaseBackendInterface.h b/WebCore/storage/IDBDatabaseBackendInterface.h index 9e35369..a2e042a 100644 --- a/WebCore/storage/IDBDatabaseBackendInterface.h +++ b/WebCore/storage/IDBDatabaseBackendInterface.h @@ -54,12 +54,12 @@ public: virtual String version() const = 0; virtual PassRefPtr<DOMStringList> objectStores() const = 0; - // FIXME: Add transaction and setVersion. - virtual void createObjectStore(const String& name, const String& keyPath, bool autoIncrement, PassRefPtr<IDBCallbacks>) = 0; virtual PassRefPtr<IDBObjectStoreBackendInterface> objectStore(const String& name, unsigned short mode) = 0; virtual void removeObjectStore(const String& name, PassRefPtr<IDBCallbacks>) = 0; + virtual void setVersion(const String& version, PassRefPtr<IDBCallbacks>) = 0; virtual PassRefPtr<IDBTransactionBackendInterface> transaction(DOMStringList* storeNames, unsigned short mode, unsigned long timeout) = 0; + // FIXME: Add close. }; } // namespace WebCore diff --git a/WebCore/storage/IDBKey.cpp b/WebCore/storage/IDBKey.cpp index 8ec5dfd..50c4c46 100644 --- a/WebCore/storage/IDBKey.cpp +++ b/WebCore/storage/IDBKey.cpp @@ -53,6 +53,25 @@ IDBKey::~IDBKey() { } +bool IDBKey::isEqual(IDBKey* other) +{ + if (!other || other->m_type != m_type) + return false; + + switch (m_type) { + case StringType: + return other->m_string == m_string; + // FIXME: Implement dates. + case NumberType: + return other->m_number == m_number; + case NullType: + return true; + } + + ASSERT_NOT_REACHED(); + return false; +} + } // namespace WebCore #endif diff --git a/WebCore/storage/IDBKey.h b/WebCore/storage/IDBKey.h index a84ea6a..228b4a4 100644 --- a/WebCore/storage/IDBKey.h +++ b/WebCore/storage/IDBKey.h @@ -71,6 +71,8 @@ public: return m_number; } + bool isEqual(IDBKey* other); + private: IDBKey(); explicit IDBKey(int32_t); diff --git a/WebCore/storage/IDBKeyPathBackendImpl.cpp b/WebCore/storage/IDBKeyPathBackendImpl.cpp index 6cc9be5..b7c45c3 100644 --- a/WebCore/storage/IDBKeyPathBackendImpl.cpp +++ b/WebCore/storage/IDBKeyPathBackendImpl.cpp @@ -30,7 +30,11 @@ #error "Chromium should not compile this file and instead define its own version of this factory that navigates the multi-process boundry." #endif +#if ENABLE(INDEXED_DATABASE) + void IDBKeyPathBackendImpl::createIDBKeysFromSerializedValuesAndKeyPath(const Vector<RefPtr<SerializedScriptValue>&, 0> values, const String& keyPath, Vector<RefPtr<IDBKey>, 0>& keys) { // FIXME: Implement this method once JSC supports WireFormat for SerializedScriptValue. } + +#endif // ENABLE(INDEXED_DATABASE) diff --git a/WebCore/storage/IDBKeyRange.cpp b/WebCore/storage/IDBKeyRange.cpp index dfcae19..4088b34 100644 --- a/WebCore/storage/IDBKeyRange.cpp +++ b/WebCore/storage/IDBKeyRange.cpp @@ -47,18 +47,27 @@ PassRefPtr<IDBKeyRange> IDBKeyRange::only(PassRefPtr<IDBKey> prpValue) PassRefPtr<IDBKeyRange> IDBKeyRange::leftBound(PassRefPtr<IDBKey> bound, bool open) { - return IDBKeyRange::create(bound, IDBKey::create(), open ? IDBKeyRange::LEFT_OPEN : IDBKeyRange::LEFT_BOUND); + unsigned short flags = IDBKeyRange::LEFT_BOUND; + if (open) + flags |= IDBKeyRange::LEFT_OPEN; + return IDBKeyRange::create(bound, IDBKey::create(), flags); } PassRefPtr<IDBKeyRange> IDBKeyRange::rightBound(PassRefPtr<IDBKey> bound, bool open) { - return IDBKeyRange::create(IDBKey::create(), bound, open ? IDBKeyRange::RIGHT_OPEN : IDBKeyRange::RIGHT_BOUND); + unsigned short flags = IDBKeyRange::RIGHT_BOUND; + if (open) + flags |= IDBKeyRange::RIGHT_OPEN; + return IDBKeyRange::create(IDBKey::create(), bound, flags); } PassRefPtr<IDBKeyRange> IDBKeyRange::bound(PassRefPtr<IDBKey> left, PassRefPtr<IDBKey> right, bool openLeft, bool openRight) { - unsigned short flags = openLeft ? IDBKeyRange::LEFT_OPEN : IDBKeyRange::LEFT_BOUND; - flags |= openRight ? IDBKeyRange::RIGHT_OPEN : IDBKeyRange::RIGHT_BOUND; + unsigned short flags = IDBKeyRange::LEFT_BOUND | IDBKeyRange::RIGHT_BOUND; + if (openLeft) + flags |= IDBKeyRange::LEFT_OPEN; + if (openRight) + flags |= IDBKeyRange::RIGHT_OPEN; return IDBKeyRange::create(left, right, flags); } diff --git a/WebCore/storage/IDBObjectStoreBackendImpl.cpp b/WebCore/storage/IDBObjectStoreBackendImpl.cpp index 1b9b76b..aeb3ced 100755 --- a/WebCore/storage/IDBObjectStoreBackendImpl.cpp +++ b/WebCore/storage/IDBObjectStoreBackendImpl.cpp @@ -265,23 +265,89 @@ void IDBObjectStoreBackendImpl::removeIndex(const String& name, PassRefPtr<IDBCa callbacks->onSuccess(); } -void IDBObjectStoreBackendImpl::openCursor(PassRefPtr<IDBKeyRange> range, unsigned short direction, PassRefPtr<IDBCallbacks> callbacks) +static String leftCursorWhereFragment(IDBKey::Type type, String comparisonOperator) { - // FIXME: Fully implement. + 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 ""; +} - RefPtr<IDBKey> key = range->left(); - SQLiteStatement query(sqliteDatabase(), "SELECT id, value FROM ObjectStoreData " + whereClause(key->type())); - bool ok = query.prepare() == SQLResultOk; +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. + 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); + if (range->flags() & IDBKeyRange::RIGHT_BOUND || range->flags() == IDBKeyRange::SINGLE) + sql += rightCursorWhereFragment(range->right()->type(), upperEquality); + sql += "objectStoreId = ? ORDER BY "; + + IDBCursor::Direction direction = static_cast<IDBCursor::Direction>(tmpDirection); + if (direction == IDBCursor::NEXT || direction == IDBCursor::NEXT_NO_DUPLICATE) + sql += "keyString, keyDate, keyNumber"; + else + sql += "keyString DESC, keyDate DESC, keyNumber DESC"; + + OwnPtr<SQLiteStatement> query = adoptPtr(new SQLiteStatement(sqliteDatabase(), sql)); + bool ok = query->prepare() == SQLResultOk; ASSERT_UNUSED(ok, ok); // FIXME: Better error handling? - bindWhereClause(query, m_id, key.get()); - if (query.step() != SQLResultRow) { + int currentColumn = 1; + if (range->flags() & IDBKeyRange::LEFT_BOUND || range->flags() == IDBKeyRange::SINGLE) + currentColumn += bindKey(*query, currentColumn, range->left().get()); + if (range->flags() & IDBKeyRange::RIGHT_BOUND || range->flags() == IDBKeyRange::SINGLE) + currentColumn += bindKey(*query, currentColumn, range->right().get()); + query->bindInt64(currentColumn, m_id); + + if (query->step() != SQLResultRow) { callbacks->onSuccess(); return; } - RefPtr<SerializedScriptValue> value = SerializedScriptValue::createFromWire(query.getColumnText(1)); - RefPtr<IDBCursorBackendInterface> cursor = IDBCursorBackendImpl::create(this, range, static_cast<IDBCursor::Direction>(direction), key.release(), value.release()); + RefPtr<IDBCursorBackendInterface> cursor = IDBCursorBackendImpl::create(this, range, direction, query.release()); callbacks->onSuccess(cursor.release()); } diff --git a/WebCore/svg/SVGAElement.cpp b/WebCore/svg/SVGAElement.cpp index a2a4e73..b0ffc74 100644 --- a/WebCore/svg/SVGAElement.cpp +++ b/WebCore/svg/SVGAElement.cpp @@ -45,17 +45,14 @@ namespace WebCore { -SVGAElement::SVGAElement(const QualifiedName& tagName, Document *doc) - : SVGStyledTransformableElement(tagName, doc) - , SVGURIReference() - , SVGTests() - , SVGLangSpace() - , SVGExternalResourcesRequired() +inline SVGAElement::SVGAElement(const QualifiedName& tagName, Document* document) + : SVGStyledTransformableElement(tagName, document) { } -SVGAElement::~SVGAElement() +PassRefPtr<SVGAElement> SVGAElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGAElement(tagName, document)); } String SVGAElement::title() const @@ -222,7 +219,7 @@ bool SVGAElement::childShouldCreateRenderer(Node* child) const if (child->hasTagName(SVGNames::aTag)) return false; if (parent() && parent()->isSVGElement()) - return static_cast<SVGElement*>(parent())->childShouldCreateRenderer(child); + return parent()->childShouldCreateRenderer(child); return SVGElement::childShouldCreateRenderer(child); } diff --git a/WebCore/svg/SVGAElement.h b/WebCore/svg/SVGAElement.h index 3debf8a..b43f192 100644 --- a/WebCore/svg/SVGAElement.h +++ b/WebCore/svg/SVGAElement.h @@ -23,6 +23,7 @@ #define SVGAElement_h #if ENABLE(SVG) + #include "SVGExternalResourcesRequired.h" #include "SVGLangSpace.h" #include "SVGStyledTransformableElement.h" @@ -37,8 +38,10 @@ namespace WebCore { public SVGLangSpace, public SVGExternalResourcesRequired { public: + static PassRefPtr<SVGAElement> create(const QualifiedName&, Document*); + + private: SVGAElement(const QualifiedName&, Document*); - virtual ~SVGAElement(); virtual bool isValid() const { return SVGTests::isValid(); } @@ -59,7 +62,6 @@ namespace WebCore { virtual bool childShouldCreateRenderer(Node*) const; - private: DECLARE_ANIMATED_PROPERTY(SVGAElement, SVGNames::targetAttr, String, Target, target) // SVGURIReference @@ -72,4 +74,5 @@ namespace WebCore { } // namespace WebCore #endif // ENABLE(SVG) + #endif // SVGAElement_h diff --git a/WebCore/svg/SVGAltGlyphElement.cpp b/WebCore/svg/SVGAltGlyphElement.cpp index 16808b9..2280d90 100644 --- a/WebCore/svg/SVGAltGlyphElement.cpp +++ b/WebCore/svg/SVGAltGlyphElement.cpp @@ -33,13 +33,14 @@ namespace WebCore { -SVGAltGlyphElement::SVGAltGlyphElement(const QualifiedName& tagName, Document* doc) - : SVGTextPositioningElement(tagName, doc) +inline SVGAltGlyphElement::SVGAltGlyphElement(const QualifiedName& tagName, Document* document) + : SVGTextPositioningElement(tagName, document) { } -SVGAltGlyphElement::~SVGAltGlyphElement() +PassRefPtr<SVGAltGlyphElement> SVGAltGlyphElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGAltGlyphElement(tagName, document)); } void SVGAltGlyphElement::synchronizeProperty(const QualifiedName& attrName) diff --git a/WebCore/svg/SVGAltGlyphElement.h b/WebCore/svg/SVGAltGlyphElement.h index cc5364b..ae0903a 100644 --- a/WebCore/svg/SVGAltGlyphElement.h +++ b/WebCore/svg/SVGAltGlyphElement.h @@ -34,13 +34,7 @@ namespace WebCore { class SVGAltGlyphElement : public SVGTextPositioningElement, public SVGURIReference { public: - SVGAltGlyphElement(const QualifiedName&, Document*); - virtual ~SVGAltGlyphElement(); - - virtual void synchronizeProperty(const QualifiedName&); - - virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); - bool childShouldCreateRenderer(Node*) const; + static PassRefPtr<SVGAltGlyphElement> create(const QualifiedName&, Document*); const AtomicString& glyphRef() const; void setGlyphRef(const AtomicString&, ExceptionCode&); @@ -49,7 +43,14 @@ namespace WebCore { SVGGlyphElement* glyphElement() const; - private: + private: + SVGAltGlyphElement(const QualifiedName&, Document*); + + virtual void synchronizeProperty(const QualifiedName&); + + virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); + virtual bool childShouldCreateRenderer(Node*) const; + // SVGURIReference DECLARE_ANIMATED_PROPERTY(SVGAltGlyphElement, XLinkNames::hrefAttr, String, Href, href) }; diff --git a/WebCore/svg/SVGAngle.cpp b/WebCore/svg/SVGAngle.cpp index 4d65ad0..6702904 100644 --- a/WebCore/svg/SVGAngle.cpp +++ b/WebCore/svg/SVGAngle.cpp @@ -34,25 +34,11 @@ SVGAngle::SVGAngle() { } -SVGAngle::~SVGAngle() -{ -} - -SVGAngle::SVGAngleType SVGAngle::unitType() const -{ - return m_unitType; -} - void SVGAngle::setValue(float value) { m_value = value; } -float SVGAngle::value() const -{ - return m_value; -} - // calc m_value void SVGAngle::calculate() { @@ -70,11 +56,6 @@ void SVGAngle::setValueInSpecifiedUnits(float valueInSpecifiedUnits) calculate(); } -float SVGAngle::valueInSpecifiedUnits() const -{ - return m_valueInSpecifiedUnits; -} - void SVGAngle::setValueAsString(const String& s) { m_valueAsString = s; diff --git a/WebCore/svg/SVGAngle.h b/WebCore/svg/SVGAngle.h index 289b8c6..de5c3ce 100644 --- a/WebCore/svg/SVGAngle.h +++ b/WebCore/svg/SVGAngle.h @@ -29,7 +29,6 @@ namespace WebCore { class SVGAngle { public: SVGAngle(); - virtual ~SVGAngle(); enum SVGAngleType { SVG_ANGLETYPE_UNKNOWN = 0, @@ -39,13 +38,13 @@ namespace WebCore { SVG_ANGLETYPE_GRAD = 4 }; - SVGAngleType unitType() const; + SVGAngleType unitType() const { return m_unitType; } void setValue(float); - float value() const; + float value() const { return m_value; } void setValueInSpecifiedUnits(float valueInSpecifiedUnits); - float valueInSpecifiedUnits() const; + float valueInSpecifiedUnits() const { return m_valueInSpecifiedUnits; } void setValueAsString(const String&); String valueAsString() const; diff --git a/WebCore/svg/SVGAnimateColorElement.cpp b/WebCore/svg/SVGAnimateColorElement.cpp index d5166cf..3960b3e 100644 --- a/WebCore/svg/SVGAnimateColorElement.cpp +++ b/WebCore/svg/SVGAnimateColorElement.cpp @@ -25,11 +25,16 @@ namespace WebCore { -SVGAnimateColorElement::SVGAnimateColorElement(const QualifiedName& tagName, Document* doc) - : SVGAnimateElement(tagName, doc) +inline SVGAnimateColorElement::SVGAnimateColorElement(const QualifiedName& tagName, Document* document) + : SVGAnimateElement(tagName, document) { } +PassRefPtr<SVGAnimateColorElement> SVGAnimateColorElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new SVGAnimateColorElement(tagName, document)); +} + } // vim:ts=4:noet diff --git a/WebCore/svg/SVGAnimateColorElement.h b/WebCore/svg/SVGAnimateColorElement.h index ad9a774..d36c8de 100644 --- a/WebCore/svg/SVGAnimateColorElement.h +++ b/WebCore/svg/SVGAnimateColorElement.h @@ -30,6 +30,9 @@ namespace WebCore { // SVGAnimateElement implements superset of the functionality. class SVGAnimateColorElement : public SVGAnimateElement { public: + static PassRefPtr<SVGAnimateColorElement> create(const QualifiedName&, Document*); + + private: SVGAnimateColorElement(const QualifiedName&, Document*); }; diff --git a/WebCore/svg/SVGAnimateElement.cpp b/WebCore/svg/SVGAnimateElement.cpp index df0c3bc..c47a378 100644 --- a/WebCore/svg/SVGAnimateElement.cpp +++ b/WebCore/svg/SVGAnimateElement.cpp @@ -36,8 +36,8 @@ using namespace std; namespace WebCore { -SVGAnimateElement::SVGAnimateElement(const QualifiedName& tagName, Document* doc) - : SVGAnimationElement(tagName, doc) +SVGAnimateElement::SVGAnimateElement(const QualifiedName& tagName, Document* document) + : SVGAnimationElement(tagName, document) , m_propertyType(StringProperty) , m_fromNumber(0) , m_toNumber(0) @@ -46,6 +46,11 @@ SVGAnimateElement::SVGAnimateElement(const QualifiedName& tagName, Document* doc { } +PassRefPtr<SVGAnimateElement> SVGAnimateElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new SVGAnimateElement(tagName, document)); +} + SVGAnimateElement::~SVGAnimateElement() { } diff --git a/WebCore/svg/SVGAnimateElement.h b/WebCore/svg/SVGAnimateElement.h index 43522a7..9993d84 100644 --- a/WebCore/svg/SVGAnimateElement.h +++ b/WebCore/svg/SVGAnimateElement.h @@ -30,15 +30,19 @@ #include <wtf/OwnPtr.h> namespace WebCore { + class SVGPathSegList; class SVGPointList; class SVGAnimateElement : public SVGAnimationElement { public: - SVGAnimateElement(const QualifiedName&, Document*); + static PassRefPtr<SVGAnimateElement> create(const QualifiedName&, Document*); + virtual ~SVGAnimateElement(); - + protected: + SVGAnimateElement(const QualifiedName&, Document*); + virtual void resetToBaseValue(const String&); virtual bool calculateFromAndToValues(const String& fromString, const String& toString); virtual bool calculateFromAndByValues(const String& fromString, const String& byString); diff --git a/WebCore/svg/SVGAnimateMotionElement.cpp b/WebCore/svg/SVGAnimateMotionElement.cpp index 4ddda73..ffa201b 100644 --- a/WebCore/svg/SVGAnimateMotionElement.cpp +++ b/WebCore/svg/SVGAnimateMotionElement.cpp @@ -40,15 +40,16 @@ namespace WebCore { using namespace SVGNames; -SVGAnimateMotionElement::SVGAnimateMotionElement(const QualifiedName& tagName, Document* doc) - : SVGAnimationElement(tagName, doc) +inline SVGAnimateMotionElement::SVGAnimateMotionElement(const QualifiedName& tagName, Document* document) + : SVGAnimationElement(tagName, document) , m_baseIndexInTransformList(0) , m_angle(0) { } -SVGAnimateMotionElement::~SVGAnimateMotionElement() +PassRefPtr<SVGAnimateMotionElement> SVGAnimateMotionElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGAnimateMotionElement(tagName, document)); } bool SVGAnimateMotionElement::hasValidTarget() const diff --git a/WebCore/svg/SVGAnimateMotionElement.h b/WebCore/svg/SVGAnimateMotionElement.h index ec189f9..225a076 100644 --- a/WebCore/svg/SVGAnimateMotionElement.h +++ b/WebCore/svg/SVGAnimateMotionElement.h @@ -29,14 +29,15 @@ namespace WebCore { class SVGAnimateMotionElement : public SVGAnimationElement { public: + static PassRefPtr<SVGAnimateMotionElement> create(const QualifiedName&, Document*); + + private: SVGAnimateMotionElement(const QualifiedName&, Document*); - virtual ~SVGAnimateMotionElement(); virtual bool hasValidTarget() const; virtual void parseMappedAttribute(Attribute*); - private: virtual void resetToBaseValue(const String&); virtual bool calculateFromAndToValues(const String& fromString, const String& toString); virtual bool calculateFromAndByValues(const String& fromString, const String& byString); diff --git a/WebCore/svg/SVGAnimateTransformElement.cpp b/WebCore/svg/SVGAnimateTransformElement.cpp index 0c27f0a..7471ea7 100644 --- a/WebCore/svg/SVGAnimateTransformElement.cpp +++ b/WebCore/svg/SVGAnimateTransformElement.cpp @@ -46,15 +46,16 @@ using namespace std; namespace WebCore { -SVGAnimateTransformElement::SVGAnimateTransformElement(const QualifiedName& tagName, Document* doc) - : SVGAnimationElement(tagName, doc) +inline SVGAnimateTransformElement::SVGAnimateTransformElement(const QualifiedName& tagName, Document* document) + : SVGAnimationElement(tagName, document) , m_type(SVGTransform::SVG_TRANSFORM_UNKNOWN) , m_baseIndexInTransformList(0) { } -SVGAnimateTransformElement::~SVGAnimateTransformElement() +PassRefPtr<SVGAnimateTransformElement> SVGAnimateTransformElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGAnimateTransformElement(tagName, document)); } bool SVGAnimateTransformElement::hasValidTarget() const diff --git a/WebCore/svg/SVGAnimateTransformElement.h b/WebCore/svg/SVGAnimateTransformElement.h index bf3de36..0f806d7 100644 --- a/WebCore/svg/SVGAnimateTransformElement.h +++ b/WebCore/svg/SVGAnimateTransformElement.h @@ -34,14 +34,15 @@ class AffineTransform; class SVGAnimateTransformElement : public SVGAnimationElement { public: + static PassRefPtr<SVGAnimateTransformElement> create(const QualifiedName&, Document*); + +private: SVGAnimateTransformElement(const QualifiedName&, Document*); - virtual ~SVGAnimateTransformElement(); virtual bool hasValidTarget() const; virtual void parseMappedAttribute(Attribute*); -private: virtual void resetToBaseValue(const String&); virtual bool calculateFromAndToValues(const String& fromString, const String& toString); virtual bool calculateFromAndByValues(const String& fromString, const String& byString); diff --git a/WebCore/svg/SVGAnimatedPathData.cpp b/WebCore/svg/SVGAnimatedPathData.cpp index 8ae4acd..6f54888 100644 --- a/WebCore/svg/SVGAnimatedPathData.cpp +++ b/WebCore/svg/SVGAnimatedPathData.cpp @@ -1,40 +1 @@ -/* - * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> - * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.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 - * 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 "SVGAnimatedPathData.h" - -namespace WebCore { - -SVGAnimatedPathData::SVGAnimatedPathData() -{ -} - -SVGAnimatedPathData::~SVGAnimatedPathData() -{ -} - -} - -#endif // ENABLE(SVG) - -// vim:ts=4:noet +// This file is now intentionally empty. Delete it after removing it from all the build systems and project files. diff --git a/WebCore/svg/SVGAnimatedPathData.h b/WebCore/svg/SVGAnimatedPathData.h index 399b61b..5ff66d3 100644 --- a/WebCore/svg/SVGAnimatedPathData.h +++ b/WebCore/svg/SVGAnimatedPathData.h @@ -24,14 +24,13 @@ #if ENABLE(SVG) namespace WebCore { + class SVGPathSegList; class SVGAnimatedPathData { public: - SVGAnimatedPathData(); - virtual ~SVGAnimatedPathData(); + virtual ~SVGAnimatedPathData() { } - // 'SVGAnimatedPathData' functions virtual SVGPathSegList* pathSegList() const = 0; virtual SVGPathSegList* normalizedPathSegList() const = 0; virtual SVGPathSegList* animatedPathSegList() const = 0; diff --git a/WebCore/svg/SVGAnimatedPoints.cpp b/WebCore/svg/SVGAnimatedPoints.cpp index 1b73309..6f54888 100644 --- a/WebCore/svg/SVGAnimatedPoints.cpp +++ b/WebCore/svg/SVGAnimatedPoints.cpp @@ -1,40 +1 @@ -/* - * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> - * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.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 - * 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 "SVGAnimatedPoints.h" - -namespace WebCore { - -SVGAnimatedPoints::SVGAnimatedPoints() -{ -} - -SVGAnimatedPoints::~SVGAnimatedPoints() -{ -} - -} - -#endif // ENABLE(SVG) - -// vim:ts=4:noet +// This file is now intentionally empty. Delete it after removing it from all the build systems and project files. diff --git a/WebCore/svg/SVGAnimatedPoints.h b/WebCore/svg/SVGAnimatedPoints.h index ec2f2ae..a62f60c 100644 --- a/WebCore/svg/SVGAnimatedPoints.h +++ b/WebCore/svg/SVGAnimatedPoints.h @@ -24,12 +24,12 @@ #if ENABLE(SVG) namespace WebCore { + class SVGPointList; class SVGAnimatedPoints { public: - SVGAnimatedPoints(); - virtual ~SVGAnimatedPoints(); + virtual ~SVGAnimatedPoints() { } // 'SVGAnimatedPoints' functions virtual SVGPointList* points() const = 0; diff --git a/WebCore/svg/SVGAnimationElement.cpp b/WebCore/svg/SVGAnimationElement.cpp index 513274e..b5eaafc 100644 --- a/WebCore/svg/SVGAnimationElement.cpp +++ b/WebCore/svg/SVGAnimationElement.cpp @@ -52,18 +52,12 @@ using namespace std; namespace WebCore { -SVGAnimationElement::SVGAnimationElement(const QualifiedName& tagName, Document* doc) - : SVGSMILElement(tagName, doc) - , SVGTests() - , SVGExternalResourcesRequired() +SVGAnimationElement::SVGAnimationElement(const QualifiedName& tagName, Document* document) + : SVGSMILElement(tagName, document) , m_animationValid(false) { } -SVGAnimationElement::~SVGAnimationElement() -{ -} - static void parseKeyTimes(const String& parse, Vector<float>& result, bool verifyOrder) { result.clear(); diff --git a/WebCore/svg/SVGAnimationElement.h b/WebCore/svg/SVGAnimationElement.h index 8e49460..da48dd6 100644 --- a/WebCore/svg/SVGAnimationElement.h +++ b/WebCore/svg/SVGAnimationElement.h @@ -44,13 +44,6 @@ namespace WebCore { public SVGExternalResourcesRequired, public ElementTimeControl { public: - SVGAnimationElement(const QualifiedName&, Document*); - virtual ~SVGAnimationElement(); - - virtual void parseMappedAttribute(Attribute*); - virtual void attributeChanged(Attribute*, bool preserveDecls); - virtual void synchronizeProperty(const QualifiedName&); - // SVGAnimationElement float getStartTime() const; float getCurrentTime() const; @@ -65,6 +58,10 @@ namespace WebCore { static bool attributeIsCSS(const String& attributeName); protected: + SVGAnimationElement(const QualifiedName&, Document*); + + virtual void parseMappedAttribute(Attribute*); + enum CalcMode { CalcModeDiscrete, CalcModeLinear, CalcModePaced, CalcModeSpline }; CalcMode calcMode() const; @@ -93,6 +90,9 @@ namespace WebCore { virtual void endedActiveInterval(); private: + virtual void attributeChanged(Attribute*, bool preserveDecls); + virtual void synchronizeProperty(const QualifiedName&); + virtual bool calculateFromAndToValues(const String& fromString, const String& toString) = 0; virtual bool calculateFromAndByValues(const String& fromString, const String& byString) = 0; virtual void calculateAnimatedValue(float percentage, unsigned repeat, SVGSMILElement* resultElement) = 0; @@ -105,7 +105,6 @@ namespace WebCore { void currentValuesFromKeyPoints(float percent, float& effectivePercent, String& from, String& to) const; float calculatePercentForSpline(float percent, unsigned splineIndex) const; - protected: // SVGExternalResourcesRequired DECLARE_ANIMATED_PROPERTY(SVGAnimationElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired) diff --git a/WebCore/svg/SVGCircleElement.cpp b/WebCore/svg/SVGCircleElement.cpp index ffbaa7b..b5a5184 100644 --- a/WebCore/svg/SVGCircleElement.cpp +++ b/WebCore/svg/SVGCircleElement.cpp @@ -32,19 +32,17 @@ namespace WebCore { -SVGCircleElement::SVGCircleElement(const QualifiedName& tagName, Document* doc) - : SVGStyledTransformableElement(tagName, doc) - , SVGTests() - , SVGLangSpace() - , SVGExternalResourcesRequired() +inline SVGCircleElement::SVGCircleElement(const QualifiedName& tagName, Document* document) + : SVGStyledTransformableElement(tagName, document) , m_cx(LengthModeWidth) , m_cy(LengthModeHeight) , m_r(LengthModeOther) { } -SVGCircleElement::~SVGCircleElement() +PassRefPtr<SVGCircleElement> SVGCircleElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGCircleElement(tagName, document)); } void SVGCircleElement::parseMappedAttribute(Attribute* attr) diff --git a/WebCore/svg/SVGCircleElement.h b/WebCore/svg/SVGCircleElement.h index f436b3c..dd11792 100644 --- a/WebCore/svg/SVGCircleElement.h +++ b/WebCore/svg/SVGCircleElement.h @@ -34,8 +34,10 @@ namespace WebCore { public SVGLangSpace, public SVGExternalResourcesRequired { public: + static PassRefPtr<SVGCircleElement> create(const QualifiedName&, Document*); + + private: SVGCircleElement(const QualifiedName&, Document*); - virtual ~SVGCircleElement(); virtual bool isValid() const { return SVGTests::isValid(); } @@ -45,7 +47,6 @@ namespace WebCore { virtual Path toPathData() const; - private: virtual bool selfHasRelativeLengths() const; DECLARE_ANIMATED_PROPERTY(SVGCircleElement, SVGNames::cxAttr, SVGLength, Cx, cx) diff --git a/WebCore/svg/SVGClipPathElement.cpp b/WebCore/svg/SVGClipPathElement.cpp index baaae96..715a34e 100644 --- a/WebCore/svg/SVGClipPathElement.cpp +++ b/WebCore/svg/SVGClipPathElement.cpp @@ -34,17 +34,15 @@ namespace WebCore { -SVGClipPathElement::SVGClipPathElement(const QualifiedName& tagName, Document* doc) - : SVGStyledTransformableElement(tagName, doc) - , SVGTests() - , SVGLangSpace() - , SVGExternalResourcesRequired() +inline SVGClipPathElement::SVGClipPathElement(const QualifiedName& tagName, Document* document) + : SVGStyledTransformableElement(tagName, document) , m_clipPathUnits(SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE) { } -SVGClipPathElement::~SVGClipPathElement() +PassRefPtr<SVGClipPathElement> SVGClipPathElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGClipPathElement(tagName, document)); } void SVGClipPathElement::parseMappedAttribute(Attribute* attr) diff --git a/WebCore/svg/SVGClipPathElement.h b/WebCore/svg/SVGClipPathElement.h index 85dd05e..7d8ada2 100644 --- a/WebCore/svg/SVGClipPathElement.h +++ b/WebCore/svg/SVGClipPathElement.h @@ -35,8 +35,10 @@ class SVGClipPathElement : public SVGStyledTransformableElement, public SVGLangSpace, public SVGExternalResourcesRequired { public: + static PassRefPtr<SVGClipPathElement> create(const QualifiedName&, Document*); + +private: SVGClipPathElement(const QualifiedName&, Document*); - virtual ~SVGClipPathElement(); virtual bool isValid() const { return SVGTests::isValid(); } virtual bool needsPendingResourceHandling() const { return false; } @@ -48,7 +50,6 @@ public: virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); -private: DECLARE_ANIMATED_PROPERTY(SVGClipPathElement, SVGNames::clipPathUnitsAttr, int, ClipPathUnits, clipPathUnits) // SVGExternalResourcesRequired diff --git a/WebCore/svg/SVGColor.cpp b/WebCore/svg/SVGColor.cpp index bacead9..75900ad 100644 --- a/WebCore/svg/SVGColor.cpp +++ b/WebCore/svg/SVGColor.cpp @@ -50,16 +50,6 @@ SVGColor::SVGColor(const Color& c) { } - -SVGColor::~SVGColor() -{ -} - -unsigned short SVGColor::colorType() const -{ - return m_colorType; -} - PassRefPtr<RGBColor> SVGColor::rgbColor() const { return RGBColor::create(m_color.rgb()); @@ -103,11 +93,6 @@ String SVGColor::cssText() const return String(); } -const Color& SVGColor::color() const -{ - return m_color; -} - } // vim:ts=4:noet diff --git a/WebCore/svg/SVGColor.h b/WebCore/svg/SVGColor.h index c181b6b..f8b55f0 100644 --- a/WebCore/svg/SVGColor.h +++ b/WebCore/svg/SVGColor.h @@ -45,8 +45,6 @@ namespace WebCore { return adoptRef(new SVGColor(SVG_COLORTYPE_CURRENTCOLOR)); } - virtual ~SVGColor(); - enum SVGColorType { SVG_COLORTYPE_UNKNOWN = 0, SVG_COLORTYPE_RGBCOLOR = 1, @@ -55,7 +53,7 @@ namespace WebCore { }; // 'SVGColor' functions - unsigned short colorType() const; + unsigned short colorType() const { return m_colorType; } PassRefPtr<RGBColor> rgbColor() const; @@ -66,16 +64,15 @@ namespace WebCore { void setRGBColorICCColor(const String& rgbColor, const String& iccColor, ExceptionCode&); void setColor(unsigned short colorType, const String& rgbColor, const String& iccColor, ExceptionCode&); - virtual String cssText() const; - - // Helpers - const Color& color() const; + const Color& color() const { return m_color; } protected: SVGColor(); SVGColor(const String& color); SVGColor(const Color&); + virtual String cssText() const; + private: SVGColor(SVGColorType); diff --git a/WebCore/svg/SVGComponentTransferFunctionElement.cpp b/WebCore/svg/SVGComponentTransferFunctionElement.cpp index 7c6cb85..c1750d7 100644 --- a/WebCore/svg/SVGComponentTransferFunctionElement.cpp +++ b/WebCore/svg/SVGComponentTransferFunctionElement.cpp @@ -30,17 +30,13 @@ namespace WebCore { -SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement(const QualifiedName& tagName, Document* doc) - : SVGElement(tagName, doc) +SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement(const QualifiedName& tagName, Document* document) + : SVGElement(tagName, document) , m_type(FECOMPONENTTRANSFER_TYPE_UNKNOWN) , m_tableValues(SVGNumberList::create(SVGNames::tableValuesAttr)) - , m_slope(1.0f) - , m_amplitude(1.0f) - , m_exponent(1.0f) -{ -} - -SVGComponentTransferFunctionElement::~SVGComponentTransferFunctionElement() + , m_slope(1) + , m_amplitude(1) + , m_exponent(1) { } diff --git a/WebCore/svg/SVGComponentTransferFunctionElement.h b/WebCore/svg/SVGComponentTransferFunctionElement.h index 91f0767..8b888af 100644 --- a/WebCore/svg/SVGComponentTransferFunctionElement.h +++ b/WebCore/svg/SVGComponentTransferFunctionElement.h @@ -31,14 +31,14 @@ namespace WebCore { class SVGComponentTransferFunctionElement : public SVGElement { public: + ComponentTransferFunction transferFunction() const; + + protected: SVGComponentTransferFunctionElement(const QualifiedName&, Document*); - virtual ~SVGComponentTransferFunctionElement(); virtual void parseMappedAttribute(Attribute*); virtual void synchronizeProperty(const QualifiedName&); - ComponentTransferFunction transferFunction() const; - private: DECLARE_ANIMATED_PROPERTY(SVGComponentTransferFunctionElement, SVGNames::typeAttr, int, Type, type) DECLARE_ANIMATED_PROPERTY(SVGComponentTransferFunctionElement, SVGNames::tableValuesAttr, SVGNumberList*, TableValues, tableValues) diff --git a/WebCore/svg/SVGCursorElement.cpp b/WebCore/svg/SVGCursorElement.cpp index cc3dfd1..9fb4140 100644 --- a/WebCore/svg/SVGCursorElement.cpp +++ b/WebCore/svg/SVGCursorElement.cpp @@ -30,16 +30,18 @@ namespace WebCore { -SVGCursorElement::SVGCursorElement(const QualifiedName& tagName, Document* doc) - : SVGElement(tagName, doc) - , SVGTests() - , SVGExternalResourcesRequired() - , SVGURIReference() +inline SVGCursorElement::SVGCursorElement(const QualifiedName& tagName, Document* document) + : SVGElement(tagName, document) , m_x(LengthModeWidth) , m_y(LengthModeHeight) { } +PassRefPtr<SVGCursorElement> SVGCursorElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new SVGCursorElement(tagName, document)); +} + SVGCursorElement::~SVGCursorElement() { HashSet<SVGElement*>::iterator end = m_clients.end(); diff --git a/WebCore/svg/SVGCursorElement.h b/WebCore/svg/SVGCursorElement.h index fe2d647..ce4d129 100644 --- a/WebCore/svg/SVGCursorElement.h +++ b/WebCore/svg/SVGCursorElement.h @@ -35,12 +35,16 @@ namespace WebCore { public SVGExternalResourcesRequired, public SVGURIReference { public: - SVGCursorElement(const QualifiedName&, Document*); + static PassRefPtr<SVGCursorElement> create(const QualifiedName&, Document*); + virtual ~SVGCursorElement(); void addClient(SVGElement*); void removeClient(SVGElement*); + private: + SVGCursorElement(const QualifiedName&, Document*); + virtual bool isValid() const { return SVGTests::isValid(); } virtual void parseMappedAttribute(Attribute*); @@ -49,7 +53,6 @@ namespace WebCore { virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const; - private: DECLARE_ANIMATED_PROPERTY(SVGCursorElement, SVGNames::xAttr, SVGLength, X, x) DECLARE_ANIMATED_PROPERTY(SVGCursorElement, SVGNames::yAttr, SVGLength, Y, y) diff --git a/WebCore/svg/SVGDefsElement.cpp b/WebCore/svg/SVGDefsElement.cpp index 660e0d1..4f5a582 100644 --- a/WebCore/svg/SVGDefsElement.cpp +++ b/WebCore/svg/SVGDefsElement.cpp @@ -27,16 +27,14 @@ namespace WebCore { -SVGDefsElement::SVGDefsElement(const QualifiedName& tagName, Document* doc) - : SVGStyledTransformableElement(tagName, doc) - , SVGTests() - , SVGLangSpace() - , SVGExternalResourcesRequired() +inline SVGDefsElement::SVGDefsElement(const QualifiedName& tagName, Document* document) + : SVGStyledTransformableElement(tagName, document) { } -SVGDefsElement::~SVGDefsElement() +PassRefPtr<SVGDefsElement> SVGDefsElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGDefsElement(tagName, document)); } bool SVGDefsElement::isValid() const diff --git a/WebCore/svg/SVGDefsElement.h b/WebCore/svg/SVGDefsElement.h index 1d84dd5..4a60bb5 100644 --- a/WebCore/svg/SVGDefsElement.h +++ b/WebCore/svg/SVGDefsElement.h @@ -34,15 +34,16 @@ namespace WebCore { public SVGLangSpace, public SVGExternalResourcesRequired { public: + static PassRefPtr<SVGDefsElement> create(const QualifiedName&, Document*); + + private: SVGDefsElement(const QualifiedName&, Document*); - virtual ~SVGDefsElement(); virtual bool isValid() const; virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); virtual void synchronizeProperty(const QualifiedName&); - private: // SVGExternalResourcesRequired DECLARE_ANIMATED_PROPERTY(SVGDefsElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired) }; diff --git a/WebCore/svg/SVGDescElement.cpp b/WebCore/svg/SVGDescElement.cpp index 58a7e01..720146c 100644 --- a/WebCore/svg/SVGDescElement.cpp +++ b/WebCore/svg/SVGDescElement.cpp @@ -24,14 +24,14 @@ namespace WebCore { -SVGDescElement::SVGDescElement(const QualifiedName& tagName, Document *doc) - : SVGStyledElement(tagName, doc) - , SVGLangSpace() +inline SVGDescElement::SVGDescElement(const QualifiedName& tagName, Document* document) + : SVGStyledElement(tagName, document) { } -SVGDescElement::~SVGDescElement() +PassRefPtr<SVGDescElement> SVGDescElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGDescElement(tagName, document)); } String SVGDescElement::description() const diff --git a/WebCore/svg/SVGDescElement.h b/WebCore/svg/SVGDescElement.h index 23374ef..994007c 100644 --- a/WebCore/svg/SVGDescElement.h +++ b/WebCore/svg/SVGDescElement.h @@ -30,11 +30,13 @@ namespace WebCore { class SVGDescElement : public SVGStyledElement, public SVGLangSpace { public: - SVGDescElement(const QualifiedName&, Document*); - virtual ~SVGDescElement(); + static PassRefPtr<SVGDescElement> create(const QualifiedName&, Document*); String description() const; + private: + SVGDescElement(const QualifiedName&, Document*); + virtual bool rendererIsNeeded(RenderStyle*) { return false; } }; diff --git a/WebCore/svg/SVGDocument.cpp b/WebCore/svg/SVGDocument.cpp index c31ca9e..e6d53a4 100644 --- a/WebCore/svg/SVGDocument.cpp +++ b/WebCore/svg/SVGDocument.cpp @@ -40,10 +40,6 @@ SVGDocument::SVGDocument(Frame* frame, const KURL& url) { } -SVGDocument::~SVGDocument() -{ -} - SVGSVGElement* SVGDocument::rootElement() const { Element* elem = documentElement(); diff --git a/WebCore/svg/SVGDocument.h b/WebCore/svg/SVGDocument.h index b5d4076..58e3518 100644 --- a/WebCore/svg/SVGDocument.h +++ b/WebCore/svg/SVGDocument.h @@ -38,8 +38,6 @@ namespace WebCore { return adoptRef(new SVGDocument(frame, url)); } - virtual ~SVGDocument(); - SVGSVGElement* rootElement() const; void dispatchZoomEvent(float prevScale, float newScale); diff --git a/WebCore/svg/SVGDocumentExtensions.cpp b/WebCore/svg/SVGDocumentExtensions.cpp index 819d12b..011859a 100644 --- a/WebCore/svg/SVGDocumentExtensions.cpp +++ b/WebCore/svg/SVGDocumentExtensions.cpp @@ -40,9 +40,9 @@ namespace WebCore { -SVGDocumentExtensions::SVGDocumentExtensions(Document* doc) - : m_doc(doc) - , m_resourcesCache(new SVGResourcesCache) +SVGDocumentExtensions::SVGDocumentExtensions(Document* document) + : m_document(document) + , m_resourcesCache(adoptPtr(new SVGResourcesCache)) { } @@ -148,12 +148,12 @@ static void reportMessage(Document* document, MessageLevel level, const String& void SVGDocumentExtensions::reportWarning(const String& message) { - reportMessage(m_doc, WarningMessageLevel, "Warning: " + message); + reportMessage(m_document, WarningMessageLevel, "Warning: " + message); } void SVGDocumentExtensions::reportError(const String& message) { - reportMessage(m_doc, ErrorMessageLevel, "Error: " + message); + reportMessage(m_document, ErrorMessageLevel, "Error: " + message); } void SVGDocumentExtensions::addPendingResource(const AtomicString& id, SVGStyledElement* obj) diff --git a/WebCore/svg/SVGDocumentExtensions.h b/WebCore/svg/SVGDocumentExtensions.h index da23cd0..e716e10 100644 --- a/WebCore/svg/SVGDocumentExtensions.h +++ b/WebCore/svg/SVGDocumentExtensions.h @@ -61,7 +61,7 @@ public: SVGResourcesCache* resourcesCache() const { return m_resourcesCache.get(); } private: - Document* m_doc; // weak reference + Document* m_document; // weak reference HashSet<SVGSVGElement*> m_timeContainers; // For SVG 1.2 support this will need to be made more general. HashMap<AtomicString, RenderSVGResourceContainer*> m_resources; HashMap<AtomicString, HashSet<SVGStyledElement*>*> m_pendingResources; diff --git a/WebCore/svg/SVGElement.cpp b/WebCore/svg/SVGElement.cpp index 37e4930..ee16e8f 100644 --- a/WebCore/svg/SVGElement.cpp +++ b/WebCore/svg/SVGElement.cpp @@ -52,13 +52,13 @@ namespace WebCore { using namespace HTMLNames; SVGElement::SVGElement(const QualifiedName& tagName, Document* document) - : StyledElement(tagName, document, CreateSVGElementZeroRefCount) + : StyledElement(tagName, document, CreateSVGElement) { } PassRefPtr<SVGElement> SVGElement::create(const QualifiedName& tagName, Document* document) { - return new SVGElement(tagName, document); + return adoptRef(new SVGElement(tagName, document)); } SVGElement::~SVGElement() diff --git a/WebCore/svg/SVGElement.h b/WebCore/svg/SVGElement.h index 255c7be..fb28279 100644 --- a/WebCore/svg/SVGElement.h +++ b/WebCore/svg/SVGElement.h @@ -49,8 +49,6 @@ namespace WebCore { SVGDocumentExtensions* accessDocumentSVGExtensions() const; - virtual void parseMappedAttribute(Attribute*); - virtual bool isStyled() const { return false; } virtual bool isStyledTransformable() const { return false; } virtual bool isStyledLocatable() const { return false; } @@ -62,9 +60,6 @@ namespace WebCore { // For SVGTests virtual bool isValid() const { return true; } - virtual bool rendererIsNeeded(RenderStyle*) { return false; } - virtual bool childShouldCreateRenderer(Node*) const; - virtual void svgAttributeChanged(const QualifiedName&) { } virtual void synchronizeProperty(const QualifiedName&) { } @@ -84,9 +79,12 @@ namespace WebCore { protected: SVGElement(const QualifiedName&, Document*); + virtual void parseMappedAttribute(Attribute*); + virtual void finishParsingChildren(); virtual void insertedIntoDocument(); virtual void attributeChanged(Attribute*, bool preserveDecls = false); + virtual bool childShouldCreateRenderer(Node*) const; SVGElementRareData* rareSVGData() const; SVGElementRareData* ensureRareSVGData(); @@ -94,6 +92,8 @@ namespace WebCore { private: friend class SVGElementInstance; + virtual bool rendererIsNeeded(RenderStyle*) { return false; } + virtual bool isSupported(StringImpl* feature, StringImpl* version) const; virtual ContainerNode* eventParentNode(); diff --git a/WebCore/svg/SVGElementInstanceList.h b/WebCore/svg/SVGElementInstanceList.h index 4a4bbcb..87dffe1 100644 --- a/WebCore/svg/SVGElementInstanceList.h +++ b/WebCore/svg/SVGElementInstanceList.h @@ -29,14 +29,15 @@ namespace WebCore { class SVGElementInstanceList : public RefCounted<SVGElementInstanceList> { public: - static PassRefPtr<SVGElementInstanceList> create(PassRefPtr<SVGElementInstance> rootInstance) { return adoptRef(new SVGElementInstanceList(rootInstance)); } + static PassRefPtr<SVGElementInstanceList> create(PassRefPtr<SVGElementInstance> root) { return adoptRef(new SVGElementInstanceList(root)); } virtual ~SVGElementInstanceList(); unsigned length() const; SVGElementInstance* item(unsigned index); private: - SVGElementInstanceList(PassRefPtr<SVGElementInstance> rootInstance); + SVGElementInstanceList(PassRefPtr<SVGElementInstance>); + RefPtr<SVGElementInstance> m_rootInstance; }; diff --git a/WebCore/svg/SVGEllipseElement.cpp b/WebCore/svg/SVGEllipseElement.cpp index 128b5e0..5e18910 100644 --- a/WebCore/svg/SVGEllipseElement.cpp +++ b/WebCore/svg/SVGEllipseElement.cpp @@ -32,11 +32,8 @@ namespace WebCore { -SVGEllipseElement::SVGEllipseElement(const QualifiedName& tagName, Document* doc) - : SVGStyledTransformableElement(tagName, doc) - , SVGTests() - , SVGLangSpace() - , SVGExternalResourcesRequired() +inline SVGEllipseElement::SVGEllipseElement(const QualifiedName& tagName, Document* document) + : SVGStyledTransformableElement(tagName, document) , m_cx(LengthModeWidth) , m_cy(LengthModeHeight) , m_rx(LengthModeWidth) @@ -44,8 +41,9 @@ SVGEllipseElement::SVGEllipseElement(const QualifiedName& tagName, Document* doc { } -SVGEllipseElement::~SVGEllipseElement() +PassRefPtr<SVGEllipseElement> SVGEllipseElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGEllipseElement(tagName, document)); } void SVGEllipseElement::parseMappedAttribute(Attribute* attr) diff --git a/WebCore/svg/SVGEllipseElement.h b/WebCore/svg/SVGEllipseElement.h index 85ec4c8..bee815c 100644 --- a/WebCore/svg/SVGEllipseElement.h +++ b/WebCore/svg/SVGEllipseElement.h @@ -34,8 +34,10 @@ namespace WebCore { public SVGLangSpace, public SVGExternalResourcesRequired { public: + static PassRefPtr<SVGEllipseElement> create(const QualifiedName&, Document*); + + private: SVGEllipseElement(const QualifiedName&, Document*); - virtual ~SVGEllipseElement(); virtual bool isValid() const { return SVGTests::isValid(); } @@ -45,7 +47,6 @@ namespace WebCore { virtual Path toPathData() const; - private: virtual bool selfHasRelativeLengths() const; DECLARE_ANIMATED_PROPERTY(SVGEllipseElement, SVGNames::cxAttr, SVGLength, Cx, cx) diff --git a/WebCore/svg/SVGExternalResourcesRequired.cpp b/WebCore/svg/SVGExternalResourcesRequired.cpp index 981b056..c976b0f 100644 --- a/WebCore/svg/SVGExternalResourcesRequired.cpp +++ b/WebCore/svg/SVGExternalResourcesRequired.cpp @@ -24,19 +24,9 @@ #include "SVGExternalResourcesRequired.h" #include "Attr.h" -#include "SVGElement.h" -#include "SVGNames.h" namespace WebCore { -SVGExternalResourcesRequired::SVGExternalResourcesRequired() -{ -} - -SVGExternalResourcesRequired::~SVGExternalResourcesRequired() -{ -} - bool SVGExternalResourcesRequired::parseMappedAttribute(Attribute* attr) { if (attr->name() == SVGNames::externalResourcesRequiredAttr) { diff --git a/WebCore/svg/SVGExternalResourcesRequired.h b/WebCore/svg/SVGExternalResourcesRequired.h index 44b6ae7..6322538 100644 --- a/WebCore/svg/SVGExternalResourcesRequired.h +++ b/WebCore/svg/SVGExternalResourcesRequired.h @@ -36,8 +36,7 @@ namespace WebCore { // FIXME: When implementing animVal support, make sure that animVal==baseVal for externalResourcesRequired class SVGExternalResourcesRequired { public: - SVGExternalResourcesRequired(); - virtual ~SVGExternalResourcesRequired(); + virtual ~SVGExternalResourcesRequired() { } bool parseMappedAttribute(Attribute*); bool isKnownAttribute(const QualifiedName&); diff --git a/WebCore/svg/SVGFEBlendElement.cpp b/WebCore/svg/SVGFEBlendElement.cpp index e944d61..451b7d1 100644 --- a/WebCore/svg/SVGFEBlendElement.cpp +++ b/WebCore/svg/SVGFEBlendElement.cpp @@ -27,14 +27,15 @@ namespace WebCore { -SVGFEBlendElement::SVGFEBlendElement(const QualifiedName& tagName, Document* doc) - : SVGFilterPrimitiveStandardAttributes(tagName, doc) +inline SVGFEBlendElement::SVGFEBlendElement(const QualifiedName& tagName, Document* document) + : SVGFilterPrimitiveStandardAttributes(tagName, document) , m_mode(FEBLEND_MODE_NORMAL) { } -SVGFEBlendElement::~SVGFEBlendElement() +PassRefPtr<SVGFEBlendElement> SVGFEBlendElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGFEBlendElement(tagName, document)); } void SVGFEBlendElement::parseMappedAttribute(Attribute* attr) diff --git a/WebCore/svg/SVGFEBlendElement.h b/WebCore/svg/SVGFEBlendElement.h index 2ffa93e..41c8307 100644 --- a/WebCore/svg/SVGFEBlendElement.h +++ b/WebCore/svg/SVGFEBlendElement.h @@ -28,14 +28,15 @@ namespace WebCore { class SVGFEBlendElement : public SVGFilterPrimitiveStandardAttributes { public: + static PassRefPtr<SVGFEBlendElement> create(const QualifiedName&, Document*); + +private: SVGFEBlendElement(const QualifiedName&, Document*); - virtual ~SVGFEBlendElement(); virtual void parseMappedAttribute(Attribute*); virtual void synchronizeProperty(const QualifiedName&); virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*); -private: DECLARE_ANIMATED_PROPERTY(SVGFEBlendElement, SVGNames::inAttr, String, In1, in1) DECLARE_ANIMATED_PROPERTY(SVGFEBlendElement, SVGNames::in2Attr, String, In2, in2) DECLARE_ANIMATED_PROPERTY(SVGFEBlendElement, SVGNames::modeAttr, int, Mode, mode) diff --git a/WebCore/svg/SVGFEColorMatrixElement.cpp b/WebCore/svg/SVGFEColorMatrixElement.cpp index d7c10d1..7f496bc 100644 --- a/WebCore/svg/SVGFEColorMatrixElement.cpp +++ b/WebCore/svg/SVGFEColorMatrixElement.cpp @@ -29,15 +29,16 @@ namespace WebCore { -SVGFEColorMatrixElement::SVGFEColorMatrixElement(const QualifiedName& tagName, Document* doc) - : SVGFilterPrimitiveStandardAttributes(tagName, doc) +inline SVGFEColorMatrixElement::SVGFEColorMatrixElement(const QualifiedName& tagName, Document* document) + : SVGFilterPrimitiveStandardAttributes(tagName, document) , m_type(FECOLORMATRIX_TYPE_UNKNOWN) , m_values(SVGNumberList::create(SVGNames::valuesAttr)) { } -SVGFEColorMatrixElement::~SVGFEColorMatrixElement() +PassRefPtr<SVGFEColorMatrixElement> SVGFEColorMatrixElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGFEColorMatrixElement(tagName, document)); } void SVGFEColorMatrixElement::parseMappedAttribute(Attribute* attr) diff --git a/WebCore/svg/SVGFEColorMatrixElement.h b/WebCore/svg/SVGFEColorMatrixElement.h index 6701eea..873d530 100644 --- a/WebCore/svg/SVGFEColorMatrixElement.h +++ b/WebCore/svg/SVGFEColorMatrixElement.h @@ -30,14 +30,15 @@ namespace WebCore { class SVGFEColorMatrixElement : public SVGFilterPrimitiveStandardAttributes { public: + static PassRefPtr<SVGFEColorMatrixElement> create(const QualifiedName&, Document*); + +private: SVGFEColorMatrixElement(const QualifiedName&, Document*); - virtual ~SVGFEColorMatrixElement(); virtual void parseMappedAttribute(Attribute*); virtual void synchronizeProperty(const QualifiedName&); virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*); -private: DECLARE_ANIMATED_PROPERTY(SVGFEColorMatrixElement, SVGNames::inAttr, String, In1, in1) DECLARE_ANIMATED_PROPERTY(SVGFEColorMatrixElement, SVGNames::typeAttr, int, Type, type) DECLARE_ANIMATED_PROPERTY(SVGFEColorMatrixElement, SVGNames::valuesAttr, SVGNumberList*, Values, values) diff --git a/WebCore/svg/SVGFEComponentTransferElement.cpp b/WebCore/svg/SVGFEComponentTransferElement.cpp index 9f85a0b..a99e74c 100644 --- a/WebCore/svg/SVGFEComponentTransferElement.cpp +++ b/WebCore/svg/SVGFEComponentTransferElement.cpp @@ -33,13 +33,14 @@ namespace WebCore { -SVGFEComponentTransferElement::SVGFEComponentTransferElement(const QualifiedName& tagName, Document* doc) - : SVGFilterPrimitiveStandardAttributes(tagName, doc) +inline SVGFEComponentTransferElement::SVGFEComponentTransferElement(const QualifiedName& tagName, Document* document) + : SVGFilterPrimitiveStandardAttributes(tagName, document) { } -SVGFEComponentTransferElement::~SVGFEComponentTransferElement() +PassRefPtr<SVGFEComponentTransferElement> SVGFEComponentTransferElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGFEComponentTransferElement(tagName, document)); } void SVGFEComponentTransferElement::parseMappedAttribute(Attribute* attr) diff --git a/WebCore/svg/SVGFEComponentTransferElement.h b/WebCore/svg/SVGFEComponentTransferElement.h index 785dc68..957661e 100644 --- a/WebCore/svg/SVGFEComponentTransferElement.h +++ b/WebCore/svg/SVGFEComponentTransferElement.h @@ -29,14 +29,15 @@ namespace WebCore { class SVGFEComponentTransferElement : public SVGFilterPrimitiveStandardAttributes { public: + static PassRefPtr<SVGFEComponentTransferElement> create(const QualifiedName&, Document*); + +private: SVGFEComponentTransferElement(const QualifiedName&, Document*); - virtual ~SVGFEComponentTransferElement(); virtual void parseMappedAttribute(Attribute*); virtual void synchronizeProperty(const QualifiedName&); virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*); -private: DECLARE_ANIMATED_PROPERTY(SVGFEComponentTransferElement, SVGNames::inAttr, String, In1, in1) }; diff --git a/WebCore/svg/SVGFECompositeElement.cpp b/WebCore/svg/SVGFECompositeElement.cpp index dfa335d..f658632 100644 --- a/WebCore/svg/SVGFECompositeElement.cpp +++ b/WebCore/svg/SVGFECompositeElement.cpp @@ -28,14 +28,15 @@ namespace WebCore { -SVGFECompositeElement::SVGFECompositeElement(const QualifiedName& tagName, Document* doc) - : SVGFilterPrimitiveStandardAttributes(tagName, doc) +inline SVGFECompositeElement::SVGFECompositeElement(const QualifiedName& tagName, Document* document) + : SVGFilterPrimitiveStandardAttributes(tagName, document) , m__operator(FECOMPOSITE_OPERATOR_OVER) { } -SVGFECompositeElement::~SVGFECompositeElement() +PassRefPtr<SVGFECompositeElement> SVGFECompositeElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGFECompositeElement(tagName, document)); } void SVGFECompositeElement::parseMappedAttribute(Attribute* attr) diff --git a/WebCore/svg/SVGFECompositeElement.h b/WebCore/svg/SVGFECompositeElement.h index b229cc5..19683de 100644 --- a/WebCore/svg/SVGFECompositeElement.h +++ b/WebCore/svg/SVGFECompositeElement.h @@ -29,14 +29,15 @@ namespace WebCore { class SVGFECompositeElement : public SVGFilterPrimitiveStandardAttributes { public: + static PassRefPtr<SVGFECompositeElement> create(const QualifiedName&, Document*); + +private: SVGFECompositeElement(const QualifiedName&, Document*); - virtual ~SVGFECompositeElement(); virtual void parseMappedAttribute(Attribute*); virtual void synchronizeProperty(const QualifiedName&); virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*); -private: DECLARE_ANIMATED_PROPERTY(SVGFECompositeElement, SVGNames::inAttr, String, In1, in1) DECLARE_ANIMATED_PROPERTY(SVGFECompositeElement, SVGNames::in2Attr, String, In2, in2) DECLARE_ANIMATED_PROPERTY(SVGFECompositeElement, SVGNames::operatorAttr, int, _operator, _operator) diff --git a/WebCore/svg/SVGFEConvolveMatrixElement.cpp b/WebCore/svg/SVGFEConvolveMatrixElement.cpp index ed6910e..9432a00 100644 --- a/WebCore/svg/SVGFEConvolveMatrixElement.cpp +++ b/WebCore/svg/SVGFEConvolveMatrixElement.cpp @@ -38,15 +38,16 @@ namespace WebCore { char SVGKernelUnitLengthXAttrIdentifier[] = "SVGKernelUnitLengthXAttr"; char SVGKernelUnitLengthYAttrIdentifier[] = "SVGKernelUnitLengthYAttr"; -SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement(const QualifiedName& tagName, Document* doc) - : SVGFilterPrimitiveStandardAttributes(tagName, doc) +inline SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement(const QualifiedName& tagName, Document* document) + : SVGFilterPrimitiveStandardAttributes(tagName, document) , m_kernelMatrix(SVGNumberList::create(SVGNames::kernelMatrixAttr)) , m_edgeMode(EDGEMODE_DUPLICATE) { } -SVGFEConvolveMatrixElement::~SVGFEConvolveMatrixElement() +PassRefPtr<SVGFEConvolveMatrixElement> SVGFEConvolveMatrixElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGFEConvolveMatrixElement(tagName, document)); } void SVGFEConvolveMatrixElement::parseMappedAttribute(Attribute* attr) diff --git a/WebCore/svg/SVGFEConvolveMatrixElement.h b/WebCore/svg/SVGFEConvolveMatrixElement.h index 5f505d7..e70b768 100644 --- a/WebCore/svg/SVGFEConvolveMatrixElement.h +++ b/WebCore/svg/SVGFEConvolveMatrixElement.h @@ -29,16 +29,17 @@ namespace WebCore { class SVGFEConvolveMatrixElement : public SVGFilterPrimitiveStandardAttributes { public: - SVGFEConvolveMatrixElement(const QualifiedName&, Document*); - virtual ~SVGFEConvolveMatrixElement(); + static PassRefPtr<SVGFEConvolveMatrixElement> create(const QualifiedName&, Document*); void setOrder(float orderX, float orderY); void setKernelUnitLength(float kernelUnitLengthX, float kernelUnitLengthY); +private: + SVGFEConvolveMatrixElement(const QualifiedName&, Document*); + virtual void parseMappedAttribute(Attribute*); virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*); -private: DECLARE_ANIMATED_PROPERTY(SVGFEConvolveMatrixElement, SVGNames::inAttr, String, In1, in1) DECLARE_ANIMATED_PROPERTY(SVGFEConvolveMatrixElement, SVGNames::orderXAttr, long, OrderX, orderX) DECLARE_ANIMATED_PROPERTY(SVGFEConvolveMatrixElement, SVGNames::orderYAttr, long, OrderY, orderY) diff --git a/WebCore/svg/SVGFEDiffuseLightingElement.cpp b/WebCore/svg/SVGFEDiffuseLightingElement.cpp index 81144c6..8c7e7ed 100644 --- a/WebCore/svg/SVGFEDiffuseLightingElement.cpp +++ b/WebCore/svg/SVGFEDiffuseLightingElement.cpp @@ -35,15 +35,16 @@ namespace WebCore { char SVGKernelUnitLengthXIdentifier[] = "SVGKernelUnitLengthX"; char SVGKernelUnitLengthYIdentifier[] = "SVGKernelUnitLengthY"; -SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement(const QualifiedName& tagName, Document* doc) - : SVGFilterPrimitiveStandardAttributes(tagName, doc) - , m_diffuseConstant(1.0f) - , m_surfaceScale(1.0f) +inline SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement(const QualifiedName& tagName, Document* document) + : SVGFilterPrimitiveStandardAttributes(tagName, document) + , m_diffuseConstant(1) + , m_surfaceScale(1) { } -SVGFEDiffuseLightingElement::~SVGFEDiffuseLightingElement() +PassRefPtr<SVGFEDiffuseLightingElement> SVGFEDiffuseLightingElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGFEDiffuseLightingElement(tagName, document)); } void SVGFEDiffuseLightingElement::parseMappedAttribute(Attribute* attr) diff --git a/WebCore/svg/SVGFEDiffuseLightingElement.h b/WebCore/svg/SVGFEDiffuseLightingElement.h index c5bedf1..e0dbfc4 100644 --- a/WebCore/svg/SVGFEDiffuseLightingElement.h +++ b/WebCore/svg/SVGFEDiffuseLightingElement.h @@ -36,15 +36,16 @@ class SVGColor; class SVGFEDiffuseLightingElement : public SVGFilterPrimitiveStandardAttributes { public: + static PassRefPtr<SVGFEDiffuseLightingElement> create(const QualifiedName&, Document*); + +private: SVGFEDiffuseLightingElement(const QualifiedName&, Document*); - virtual ~SVGFEDiffuseLightingElement(); virtual void parseMappedAttribute(Attribute*); virtual void svgAttributeChanged(const QualifiedName&); virtual void synchronizeProperty(const QualifiedName&); virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*); -private: DECLARE_ANIMATED_PROPERTY(SVGFEDiffuseLightingElement, SVGNames::inAttr, String, In1, in1) DECLARE_ANIMATED_PROPERTY(SVGFEDiffuseLightingElement, SVGNames::diffuseConstantAttr, float, DiffuseConstant, diffuseConstant) DECLARE_ANIMATED_PROPERTY(SVGFEDiffuseLightingElement, SVGNames::surfaceScaleAttr, float, SurfaceScale, surfaceScale) diff --git a/WebCore/svg/SVGFEDisplacementMapElement.cpp b/WebCore/svg/SVGFEDisplacementMapElement.cpp index 2706c78..013eca5 100644 --- a/WebCore/svg/SVGFEDisplacementMapElement.cpp +++ b/WebCore/svg/SVGFEDisplacementMapElement.cpp @@ -26,15 +26,16 @@ namespace WebCore { -SVGFEDisplacementMapElement::SVGFEDisplacementMapElement(const QualifiedName& tagName, Document* doc) - : SVGFilterPrimitiveStandardAttributes(tagName, doc) +inline SVGFEDisplacementMapElement::SVGFEDisplacementMapElement(const QualifiedName& tagName, Document* document) + : SVGFilterPrimitiveStandardAttributes(tagName, document) , m_xChannelSelector(CHANNEL_A) , m_yChannelSelector(CHANNEL_A) { } -SVGFEDisplacementMapElement::~SVGFEDisplacementMapElement() +PassRefPtr<SVGFEDisplacementMapElement> SVGFEDisplacementMapElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGFEDisplacementMapElement(tagName, document)); } ChannelSelectorType SVGFEDisplacementMapElement::stringToChannel(const String& key) diff --git a/WebCore/svg/SVGFEDisplacementMapElement.h b/WebCore/svg/SVGFEDisplacementMapElement.h index 445c631..239c2c7 100644 --- a/WebCore/svg/SVGFEDisplacementMapElement.h +++ b/WebCore/svg/SVGFEDisplacementMapElement.h @@ -28,16 +28,17 @@ namespace WebCore { class SVGFEDisplacementMapElement : public SVGFilterPrimitiveStandardAttributes { public: - SVGFEDisplacementMapElement(const QualifiedName& tagName, Document*); - virtual ~SVGFEDisplacementMapElement(); - + static PassRefPtr<SVGFEDisplacementMapElement> create(const QualifiedName&, Document*); + static ChannelSelectorType stringToChannel(const String&); +private: + SVGFEDisplacementMapElement(const QualifiedName& tagName, Document*); + virtual void parseMappedAttribute(Attribute*); virtual void synchronizeProperty(const QualifiedName&); virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*); -private: DECLARE_ANIMATED_PROPERTY(SVGFEDisplacementMapElement, SVGNames::inAttr, String, In1, in1) DECLARE_ANIMATED_PROPERTY(SVGFEDisplacementMapElement, SVGNames::in2Attr, String, In2, in2) DECLARE_ANIMATED_PROPERTY(SVGFEDisplacementMapElement, SVGNames::xChannelSelectorAttr, int, XChannelSelector, xChannelSelector) diff --git a/WebCore/svg/SVGFEDistantLightElement.cpp b/WebCore/svg/SVGFEDistantLightElement.cpp index 3a056af..59394d8 100644 --- a/WebCore/svg/SVGFEDistantLightElement.cpp +++ b/WebCore/svg/SVGFEDistantLightElement.cpp @@ -25,13 +25,14 @@ namespace WebCore { -SVGFEDistantLightElement::SVGFEDistantLightElement(const QualifiedName& tagName, Document* doc) - : SVGFELightElement(tagName, doc) +inline SVGFEDistantLightElement::SVGFEDistantLightElement(const QualifiedName& tagName, Document* document) + : SVGFELightElement(tagName, document) { } -SVGFEDistantLightElement::~SVGFEDistantLightElement() +PassRefPtr<SVGFEDistantLightElement> SVGFEDistantLightElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGFEDistantLightElement(tagName, document)); } PassRefPtr<LightSource> SVGFEDistantLightElement::lightSource() const diff --git a/WebCore/svg/SVGFEDistantLightElement.h b/WebCore/svg/SVGFEDistantLightElement.h index a625c04..9024cce 100644 --- a/WebCore/svg/SVGFEDistantLightElement.h +++ b/WebCore/svg/SVGFEDistantLightElement.h @@ -24,10 +24,13 @@ #include "SVGFELightElement.h" namespace WebCore { + class SVGFEDistantLightElement : public SVGFELightElement { public: + static PassRefPtr<SVGFEDistantLightElement> create(const QualifiedName&, Document*); + + private: SVGFEDistantLightElement(const QualifiedName&, Document*); - virtual ~SVGFEDistantLightElement(); virtual PassRefPtr<LightSource> lightSource() const; }; diff --git a/WebCore/svg/SVGFEFloodElement.cpp b/WebCore/svg/SVGFEFloodElement.cpp index 050f2d4..321eb8f 100644 --- a/WebCore/svg/SVGFEFloodElement.cpp +++ b/WebCore/svg/SVGFEFloodElement.cpp @@ -29,13 +29,14 @@ namespace WebCore { -SVGFEFloodElement::SVGFEFloodElement(const QualifiedName& tagName, Document* doc) - : SVGFilterPrimitiveStandardAttributes(tagName, doc) +inline SVGFEFloodElement::SVGFEFloodElement(const QualifiedName& tagName, Document* document) + : SVGFilterPrimitiveStandardAttributes(tagName, document) { } -SVGFEFloodElement::~SVGFEFloodElement() +PassRefPtr<SVGFEFloodElement> SVGFEFloodElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGFEFloodElement(tagName, document)); } PassRefPtr<FilterEffect> SVGFEFloodElement::build(SVGFilterBuilder*) diff --git a/WebCore/svg/SVGFEFloodElement.h b/WebCore/svg/SVGFEFloodElement.h index 73aa0ee..2f7d94d 100644 --- a/WebCore/svg/SVGFEFloodElement.h +++ b/WebCore/svg/SVGFEFloodElement.h @@ -26,10 +26,13 @@ #include "SVGFilterPrimitiveStandardAttributes.h" namespace WebCore { + class SVGFEFloodElement : public SVGFilterPrimitiveStandardAttributes { public: + static PassRefPtr<SVGFEFloodElement> create(const QualifiedName&, Document*); + +private: SVGFEFloodElement(const QualifiedName&, Document*); - virtual ~SVGFEFloodElement(); virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*); }; diff --git a/WebCore/svg/SVGFEFuncAElement.cpp b/WebCore/svg/SVGFEFuncAElement.cpp index 3722826..8967efe 100644 --- a/WebCore/svg/SVGFEFuncAElement.cpp +++ b/WebCore/svg/SVGFEFuncAElement.cpp @@ -25,13 +25,14 @@ namespace WebCore { -SVGFEFuncAElement::SVGFEFuncAElement(const QualifiedName& tagName, Document* doc) - : SVGComponentTransferFunctionElement(tagName, doc) +inline SVGFEFuncAElement::SVGFEFuncAElement(const QualifiedName& tagName, Document* document) + : SVGComponentTransferFunctionElement(tagName, document) { } -SVGFEFuncAElement::~SVGFEFuncAElement() +PassRefPtr<SVGFEFuncAElement> SVGFEFuncAElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGFEFuncAElement(tagName, document)); } } diff --git a/WebCore/svg/SVGFEFuncAElement.h b/WebCore/svg/SVGFEFuncAElement.h index 500d630..f92ad5b 100644 --- a/WebCore/svg/SVGFEFuncAElement.h +++ b/WebCore/svg/SVGFEFuncAElement.h @@ -25,10 +25,13 @@ #include "SVGComponentTransferFunctionElement.h" namespace WebCore { + class SVGFEFuncAElement : public SVGComponentTransferFunctionElement { public: + static PassRefPtr<SVGFEFuncAElement> create(const QualifiedName&, Document*); + + private: SVGFEFuncAElement(const QualifiedName&, Document*); - virtual ~SVGFEFuncAElement(); }; } // namespace WebCore diff --git a/WebCore/svg/SVGFEFuncBElement.cpp b/WebCore/svg/SVGFEFuncBElement.cpp index 3ea448f..2b4287a 100644 --- a/WebCore/svg/SVGFEFuncBElement.cpp +++ b/WebCore/svg/SVGFEFuncBElement.cpp @@ -25,13 +25,14 @@ namespace WebCore { -SVGFEFuncBElement::SVGFEFuncBElement(const QualifiedName& tagName, Document *doc) - : SVGComponentTransferFunctionElement(tagName, doc) +inline SVGFEFuncBElement::SVGFEFuncBElement(const QualifiedName& tagName, Document* document) + : SVGComponentTransferFunctionElement(tagName, document) { } -SVGFEFuncBElement::~SVGFEFuncBElement() +PassRefPtr<SVGFEFuncBElement> SVGFEFuncBElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGFEFuncBElement(tagName, document)); } } diff --git a/WebCore/svg/SVGFEFuncBElement.h b/WebCore/svg/SVGFEFuncBElement.h index 85f9500..ea664f5 100644 --- a/WebCore/svg/SVGFEFuncBElement.h +++ b/WebCore/svg/SVGFEFuncBElement.h @@ -25,10 +25,13 @@ #include "SVGComponentTransferFunctionElement.h" namespace WebCore { + class SVGFEFuncBElement : public SVGComponentTransferFunctionElement { public: + static PassRefPtr<SVGFEFuncBElement> create(const QualifiedName&, Document*); + + private: SVGFEFuncBElement(const QualifiedName&, Document*); - virtual ~SVGFEFuncBElement(); }; } // namespace WebCore diff --git a/WebCore/svg/SVGFEFuncGElement.cpp b/WebCore/svg/SVGFEFuncGElement.cpp index c74a9ce..32cbdf3 100644 --- a/WebCore/svg/SVGFEFuncGElement.cpp +++ b/WebCore/svg/SVGFEFuncGElement.cpp @@ -25,13 +25,14 @@ namespace WebCore { -SVGFEFuncGElement::SVGFEFuncGElement(const QualifiedName& tagName, Document* doc) - : SVGComponentTransferFunctionElement(tagName, doc) +inline SVGFEFuncGElement::SVGFEFuncGElement(const QualifiedName& tagName, Document* document) + : SVGComponentTransferFunctionElement(tagName, document) { } -SVGFEFuncGElement::~SVGFEFuncGElement() +PassRefPtr<SVGFEFuncGElement> SVGFEFuncGElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGFEFuncGElement(tagName, document)); } } diff --git a/WebCore/svg/SVGFEFuncGElement.h b/WebCore/svg/SVGFEFuncGElement.h index 9950a53..df32106 100644 --- a/WebCore/svg/SVGFEFuncGElement.h +++ b/WebCore/svg/SVGFEFuncGElement.h @@ -25,10 +25,13 @@ #include "SVGComponentTransferFunctionElement.h" namespace WebCore { + class SVGFEFuncGElement : public SVGComponentTransferFunctionElement { public: + static PassRefPtr<SVGFEFuncGElement> create(const QualifiedName&, Document*); + + private: SVGFEFuncGElement(const QualifiedName&, Document*); - virtual ~SVGFEFuncGElement(); }; } // namespace WebCore diff --git a/WebCore/svg/SVGFEFuncRElement.cpp b/WebCore/svg/SVGFEFuncRElement.cpp index ce3355d..9c17909 100644 --- a/WebCore/svg/SVGFEFuncRElement.cpp +++ b/WebCore/svg/SVGFEFuncRElement.cpp @@ -25,13 +25,14 @@ namespace WebCore { -SVGFEFuncRElement::SVGFEFuncRElement(const QualifiedName& tagName, Document* doc) - : SVGComponentTransferFunctionElement(tagName, doc) +inline SVGFEFuncRElement::SVGFEFuncRElement(const QualifiedName& tagName, Document* document) + : SVGComponentTransferFunctionElement(tagName, document) { } -SVGFEFuncRElement::~SVGFEFuncRElement() +PassRefPtr<SVGFEFuncRElement> SVGFEFuncRElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGFEFuncRElement(tagName, document)); } } diff --git a/WebCore/svg/SVGFEFuncRElement.h b/WebCore/svg/SVGFEFuncRElement.h index 8e78091..601095f 100644 --- a/WebCore/svg/SVGFEFuncRElement.h +++ b/WebCore/svg/SVGFEFuncRElement.h @@ -25,10 +25,13 @@ #include "SVGComponentTransferFunctionElement.h" namespace WebCore { + class SVGFEFuncRElement : public SVGComponentTransferFunctionElement { public: + static PassRefPtr<SVGFEFuncRElement> create(const QualifiedName&, Document*); + + private: SVGFEFuncRElement(const QualifiedName&, Document*); - virtual ~SVGFEFuncRElement(); }; } // namespace WebCore diff --git a/WebCore/svg/SVGFEGaussianBlurElement.cpp b/WebCore/svg/SVGFEGaussianBlurElement.cpp index 2e5578a..f66fa90 100644 --- a/WebCore/svg/SVGFEGaussianBlurElement.cpp +++ b/WebCore/svg/SVGFEGaussianBlurElement.cpp @@ -32,13 +32,14 @@ namespace WebCore { char SVGStdDeviationXAttrIdentifier[] = "SVGStdDeviationXAttr"; char SVGStdDeviationYAttrIdentifier[] = "SVGStdDeviationYAttr"; -SVGFEGaussianBlurElement::SVGFEGaussianBlurElement(const QualifiedName& tagName, Document* doc) - : SVGFilterPrimitiveStandardAttributes(tagName, doc) +inline SVGFEGaussianBlurElement::SVGFEGaussianBlurElement(const QualifiedName& tagName, Document* document) + : SVGFilterPrimitiveStandardAttributes(tagName, document) { } -SVGFEGaussianBlurElement::~SVGFEGaussianBlurElement() +PassRefPtr<SVGFEGaussianBlurElement> SVGFEGaussianBlurElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGFEGaussianBlurElement(tagName, document)); } void SVGFEGaussianBlurElement::setStdDeviation(float, float) diff --git a/WebCore/svg/SVGFEGaussianBlurElement.h b/WebCore/svg/SVGFEGaussianBlurElement.h index 10c0f5a..36b7383 100644 --- a/WebCore/svg/SVGFEGaussianBlurElement.h +++ b/WebCore/svg/SVGFEGaussianBlurElement.h @@ -32,16 +32,17 @@ extern char SVGStdDeviationYAttrIdentifier[]; class SVGFEGaussianBlurElement : public SVGFilterPrimitiveStandardAttributes { public: - SVGFEGaussianBlurElement(const QualifiedName&, Document*); - virtual ~SVGFEGaussianBlurElement(); + static PassRefPtr<SVGFEGaussianBlurElement> create(const QualifiedName&, Document*); void setStdDeviation(float stdDeviationX, float stdDeviationY); +private: + SVGFEGaussianBlurElement(const QualifiedName&, Document*); + virtual void parseMappedAttribute(Attribute*); virtual void synchronizeProperty(const QualifiedName&); virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*); -private: DECLARE_ANIMATED_PROPERTY(SVGFEGaussianBlurElement, SVGNames::inAttr, String, In1, in1) DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEGaussianBlurElement, SVGNames::stdDeviationAttr, SVGStdDeviationXAttrIdentifier, float, StdDeviationX, stdDeviationX) DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEGaussianBlurElement, SVGNames::stdDeviationAttr, SVGStdDeviationYAttrIdentifier, float, StdDeviationY, stdDeviationY) diff --git a/WebCore/svg/SVGFEImageElement.cpp b/WebCore/svg/SVGFEImageElement.cpp index eb024f6..0808ad7 100644 --- a/WebCore/svg/SVGFEImageElement.cpp +++ b/WebCore/svg/SVGFEImageElement.cpp @@ -37,14 +37,16 @@ namespace WebCore { -SVGFEImageElement::SVGFEImageElement(const QualifiedName& tagName, Document* doc) - : SVGFilterPrimitiveStandardAttributes(tagName, doc) - , SVGURIReference() - , SVGLangSpace() - , SVGExternalResourcesRequired() +inline SVGFEImageElement::SVGFEImageElement(const QualifiedName& tagName, Document* document) + : SVGFilterPrimitiveStandardAttributes(tagName, document) { } +PassRefPtr<SVGFEImageElement> SVGFEImageElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new SVGFEImageElement(tagName, document)); +} + SVGFEImageElement::~SVGFEImageElement() { if (m_cachedImage) diff --git a/WebCore/svg/SVGFEImageElement.h b/WebCore/svg/SVGFEImageElement.h index 2128c6d..b5fad48 100644 --- a/WebCore/svg/SVGFEImageElement.h +++ b/WebCore/svg/SVGFEImageElement.h @@ -40,9 +40,13 @@ class SVGFEImageElement : public SVGFilterPrimitiveStandardAttributes, public SVGExternalResourcesRequired, public CachedResourceClient { public: - SVGFEImageElement(const QualifiedName&, Document*); + static PassRefPtr<SVGFEImageElement> create(const QualifiedName&, Document*); + virtual ~SVGFEImageElement(); +private: + SVGFEImageElement(const QualifiedName&, Document*); + virtual void parseMappedAttribute(Attribute*); virtual void synchronizeProperty(const QualifiedName&); virtual void notifyFinished(CachedResource*); @@ -50,7 +54,6 @@ public: virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const; virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*); -private: void requestImageResource(); DECLARE_ANIMATED_PROPERTY(SVGFEImageElement, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio) diff --git a/WebCore/svg/SVGFELightElement.cpp b/WebCore/svg/SVGFELightElement.cpp index 5975033..dc10cf9 100644 --- a/WebCore/svg/SVGFELightElement.cpp +++ b/WebCore/svg/SVGFELightElement.cpp @@ -30,13 +30,9 @@ namespace WebCore { -SVGFELightElement::SVGFELightElement(const QualifiedName& tagName, Document* doc) - : SVGElement(tagName, doc) - , m_specularExponent(1.0f) -{ -} - -SVGFELightElement::~SVGFELightElement() +SVGFELightElement::SVGFELightElement(const QualifiedName& tagName, Document* document) + : SVGElement(tagName, document) + , m_specularExponent(1) { } diff --git a/WebCore/svg/SVGFELightElement.h b/WebCore/svg/SVGFELightElement.h index d0874cb..b86204d 100644 --- a/WebCore/svg/SVGFELightElement.h +++ b/WebCore/svg/SVGFELightElement.h @@ -31,16 +31,17 @@ namespace WebCore { class SVGFELightElement : public SVGElement { public: - SVGFELightElement(const QualifiedName&, Document*); - virtual ~SVGFELightElement(); - virtual PassRefPtr<LightSource> lightSource() const = 0; + +protected: + SVGFELightElement(const QualifiedName&, Document*); + +private: virtual void parseMappedAttribute(Attribute*); virtual void svgAttributeChanged(const QualifiedName&); virtual void synchronizeProperty(const QualifiedName&); virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); -private: DECLARE_ANIMATED_PROPERTY(SVGFELightElement, SVGNames::azimuthAttr, float, Azimuth, azimuth) DECLARE_ANIMATED_PROPERTY(SVGFELightElement, SVGNames::elevationAttr, float, Elevation, elevation) DECLARE_ANIMATED_PROPERTY(SVGFELightElement, SVGNames::xAttr, float, X, x) diff --git a/WebCore/svg/SVGFEMergeElement.cpp b/WebCore/svg/SVGFEMergeElement.cpp index bbdfd52..6254b24 100644 --- a/WebCore/svg/SVGFEMergeElement.cpp +++ b/WebCore/svg/SVGFEMergeElement.cpp @@ -27,13 +27,14 @@ namespace WebCore { -SVGFEMergeElement::SVGFEMergeElement(const QualifiedName& tagName, Document* doc) - : SVGFilterPrimitiveStandardAttributes(tagName, doc) +inline SVGFEMergeElement::SVGFEMergeElement(const QualifiedName& tagName, Document* document) + : SVGFilterPrimitiveStandardAttributes(tagName, document) { } -SVGFEMergeElement::~SVGFEMergeElement() +PassRefPtr<SVGFEMergeElement> SVGFEMergeElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGFEMergeElement(tagName, document)); } PassRefPtr<FilterEffect> SVGFEMergeElement::build(SVGFilterBuilder* filterBuilder) diff --git a/WebCore/svg/SVGFEMergeElement.h b/WebCore/svg/SVGFEMergeElement.h index 1ae6eb4..c07be4c 100644 --- a/WebCore/svg/SVGFEMergeElement.h +++ b/WebCore/svg/SVGFEMergeElement.h @@ -29,8 +29,10 @@ namespace WebCore { class SVGFEMergeElement : public SVGFilterPrimitiveStandardAttributes { public: + static PassRefPtr<SVGFEMergeElement> create(const QualifiedName&, Document*); + +private: SVGFEMergeElement(const QualifiedName&, Document*); - virtual ~SVGFEMergeElement(); virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*); }; diff --git a/WebCore/svg/SVGFEMergeNodeElement.cpp b/WebCore/svg/SVGFEMergeNodeElement.cpp index 65f7a1d..4bd5ac5 100644 --- a/WebCore/svg/SVGFEMergeNodeElement.cpp +++ b/WebCore/svg/SVGFEMergeNodeElement.cpp @@ -27,13 +27,14 @@ namespace WebCore { -SVGFEMergeNodeElement::SVGFEMergeNodeElement(const QualifiedName& tagName, Document* doc) - : SVGElement(tagName, doc) +inline SVGFEMergeNodeElement::SVGFEMergeNodeElement(const QualifiedName& tagName, Document* document) + : SVGElement(tagName, document) { } -SVGFEMergeNodeElement::~SVGFEMergeNodeElement() +PassRefPtr<SVGFEMergeNodeElement> SVGFEMergeNodeElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGFEMergeNodeElement(tagName, document)); } void SVGFEMergeNodeElement::parseMappedAttribute(Attribute* attr) diff --git a/WebCore/svg/SVGFEMergeNodeElement.h b/WebCore/svg/SVGFEMergeNodeElement.h index 944081f..65c5d3d 100644 --- a/WebCore/svg/SVGFEMergeNodeElement.h +++ b/WebCore/svg/SVGFEMergeNodeElement.h @@ -29,13 +29,14 @@ namespace WebCore { class SVGFEMergeNodeElement : public SVGElement { public: + static PassRefPtr<SVGFEMergeNodeElement> create(const QualifiedName&, Document*); + + private: SVGFEMergeNodeElement(const QualifiedName&, Document*); - virtual ~SVGFEMergeNodeElement(); virtual void parseMappedAttribute(Attribute*); virtual void synchronizeProperty(const QualifiedName&); - private: DECLARE_ANIMATED_PROPERTY(SVGFEMergeNodeElement, SVGNames::inAttr, String, In1, in1) }; diff --git a/WebCore/svg/SVGFEMorphologyElement.cpp b/WebCore/svg/SVGFEMorphologyElement.cpp index 739517f..c3db844 100644 --- a/WebCore/svg/SVGFEMorphologyElement.cpp +++ b/WebCore/svg/SVGFEMorphologyElement.cpp @@ -31,14 +31,15 @@ namespace WebCore { char SVGRadiusXAttrIdentifier[] = "SVGRadiusXAttr"; char SVGRadiusYAttrIdentifier[] = "SVGRadiusYAttr"; -SVGFEMorphologyElement::SVGFEMorphologyElement(const QualifiedName& tagName, Document* document) +inline SVGFEMorphologyElement::SVGFEMorphologyElement(const QualifiedName& tagName, Document* document) : SVGFilterPrimitiveStandardAttributes(tagName, document) , m__operator(FEMORPHOLOGY_OPERATOR_ERODE) { } -SVGFEMorphologyElement::~SVGFEMorphologyElement() +PassRefPtr<SVGFEMorphologyElement> SVGFEMorphologyElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGFEMorphologyElement(tagName, document)); } void SVGFEMorphologyElement::setRadius(float, float) diff --git a/WebCore/svg/SVGFEMorphologyElement.h b/WebCore/svg/SVGFEMorphologyElement.h index d976b92..9bf26ee 100644 --- a/WebCore/svg/SVGFEMorphologyElement.h +++ b/WebCore/svg/SVGFEMorphologyElement.h @@ -31,16 +31,17 @@ extern char SVGRadiusYAttrIdentifier[]; class SVGFEMorphologyElement : public SVGFilterPrimitiveStandardAttributes { public: - SVGFEMorphologyElement(const QualifiedName&, Document*); - virtual ~SVGFEMorphologyElement(); + static PassRefPtr<SVGFEMorphologyElement> create(const QualifiedName&, Document*); void setRadius(float radiusX, float radiusY); +private: + SVGFEMorphologyElement(const QualifiedName&, Document*); + virtual void parseMappedAttribute(Attribute*); virtual void synchronizeProperty(const QualifiedName&); virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*); -private: DECLARE_ANIMATED_PROPERTY(SVGFEMorphologyElement, SVGNames::inAttr, String, In1, in1) DECLARE_ANIMATED_PROPERTY(SVGFEMorphologyElement, SVGNames::operatorAttr, int, _operator, _operator) DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEMorphologyElement, SVGNames::radiusAttr, SVGRadiusXAttrIdentifier, float, RadiusX, radiusX) diff --git a/WebCore/svg/SVGFEOffsetElement.cpp b/WebCore/svg/SVGFEOffsetElement.cpp index 006bb3b..b27db31 100644 --- a/WebCore/svg/SVGFEOffsetElement.cpp +++ b/WebCore/svg/SVGFEOffsetElement.cpp @@ -27,13 +27,14 @@ namespace WebCore { -SVGFEOffsetElement::SVGFEOffsetElement(const QualifiedName& tagName, Document* doc) - : SVGFilterPrimitiveStandardAttributes(tagName, doc) +inline SVGFEOffsetElement::SVGFEOffsetElement(const QualifiedName& tagName, Document* document) + : SVGFilterPrimitiveStandardAttributes(tagName, document) { } -SVGFEOffsetElement::~SVGFEOffsetElement() +PassRefPtr<SVGFEOffsetElement> SVGFEOffsetElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGFEOffsetElement(tagName, document)); } void SVGFEOffsetElement::parseMappedAttribute(Attribute* attr) diff --git a/WebCore/svg/SVGFEOffsetElement.h b/WebCore/svg/SVGFEOffsetElement.h index 8f93526..e522ce2 100644 --- a/WebCore/svg/SVGFEOffsetElement.h +++ b/WebCore/svg/SVGFEOffsetElement.h @@ -29,15 +29,16 @@ namespace WebCore { class SVGFEOffsetElement : public SVGFilterPrimitiveStandardAttributes { public: + static PassRefPtr<SVGFEOffsetElement> create(const QualifiedName&, Document*); + +private: SVGFEOffsetElement(const QualifiedName&, Document*); - virtual ~SVGFEOffsetElement(); virtual void parseMappedAttribute(Attribute*); virtual void svgAttributeChanged(const QualifiedName&); virtual void synchronizeProperty(const QualifiedName&); virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*); -private: DECLARE_ANIMATED_PROPERTY(SVGFEOffsetElement, SVGNames::inAttr, String, In1, in1) DECLARE_ANIMATED_PROPERTY(SVGFEOffsetElement, SVGNames::dxAttr, float, Dx, dx) DECLARE_ANIMATED_PROPERTY(SVGFEOffsetElement, SVGNames::dyAttr, float, Dy, dy) diff --git a/WebCore/svg/SVGFEPointLightElement.cpp b/WebCore/svg/SVGFEPointLightElement.cpp index 46568ff..4436ab9 100644 --- a/WebCore/svg/SVGFEPointLightElement.cpp +++ b/WebCore/svg/SVGFEPointLightElement.cpp @@ -25,19 +25,19 @@ namespace WebCore { -SVGFEPointLightElement::SVGFEPointLightElement(const QualifiedName& tagName, Document* doc) - : SVGFELightElement(tagName, doc) +inline SVGFEPointLightElement::SVGFEPointLightElement(const QualifiedName& tagName, Document* document) + : SVGFELightElement(tagName, document) { } -SVGFEPointLightElement::~SVGFEPointLightElement() +PassRefPtr<SVGFEPointLightElement> SVGFEPointLightElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGFEPointLightElement(tagName, document)); } PassRefPtr<LightSource> SVGFEPointLightElement::lightSource() const { - FloatPoint3D pos(x(), y(), z()); - return PointLightSource::create(pos); + return PointLightSource::create(FloatPoint3D(x(), y(), z())); } } diff --git a/WebCore/svg/SVGFEPointLightElement.h b/WebCore/svg/SVGFEPointLightElement.h index d734f9e..270d36d 100644 --- a/WebCore/svg/SVGFEPointLightElement.h +++ b/WebCore/svg/SVGFEPointLightElement.h @@ -24,10 +24,13 @@ #include "SVGFELightElement.h" namespace WebCore { + class SVGFEPointLightElement : public SVGFELightElement { - public: + public: + static PassRefPtr<SVGFEPointLightElement> create(const QualifiedName&, Document*); + + private: SVGFEPointLightElement(const QualifiedName&, Document*); - virtual ~SVGFEPointLightElement(); virtual PassRefPtr<LightSource> lightSource() const; }; diff --git a/WebCore/svg/SVGFESpecularLightingElement.cpp b/WebCore/svg/SVGFESpecularLightingElement.cpp index afbdefe..d07c6ce 100644 --- a/WebCore/svg/SVGFESpecularLightingElement.cpp +++ b/WebCore/svg/SVGFESpecularLightingElement.cpp @@ -32,16 +32,17 @@ namespace WebCore { -SVGFESpecularLightingElement::SVGFESpecularLightingElement(const QualifiedName& tagName, Document* doc) - : SVGFilterPrimitiveStandardAttributes(tagName, doc) - , m_specularConstant(1.0f) - , m_specularExponent(1.0f) - , m_surfaceScale(1.0f) +inline SVGFESpecularLightingElement::SVGFESpecularLightingElement(const QualifiedName& tagName, Document* document) + : SVGFilterPrimitiveStandardAttributes(tagName, document) + , m_specularConstant(1) + , m_specularExponent(1) + , m_surfaceScale(1) { } -SVGFESpecularLightingElement::~SVGFESpecularLightingElement() +PassRefPtr<SVGFESpecularLightingElement> SVGFESpecularLightingElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGFESpecularLightingElement(tagName, document)); } void SVGFESpecularLightingElement::parseMappedAttribute(Attribute* attr) diff --git a/WebCore/svg/SVGFESpecularLightingElement.h b/WebCore/svg/SVGFESpecularLightingElement.h index a506cf7..1fed36f 100644 --- a/WebCore/svg/SVGFESpecularLightingElement.h +++ b/WebCore/svg/SVGFESpecularLightingElement.h @@ -33,14 +33,15 @@ extern char SVGKernelUnitLengthYIdentifier[]; class SVGFESpecularLightingElement : public SVGFilterPrimitiveStandardAttributes { public: + static PassRefPtr<SVGFESpecularLightingElement> create(const QualifiedName&, Document*); + +private: SVGFESpecularLightingElement(const QualifiedName&, Document*); - virtual ~SVGFESpecularLightingElement(); virtual void parseMappedAttribute(Attribute*); virtual void synchronizeProperty(const QualifiedName&); virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*); -private: DECLARE_ANIMATED_PROPERTY(SVGFESpecularLightingElement, SVGNames::inAttr, String, In1, in1) DECLARE_ANIMATED_PROPERTY(SVGFESpecularLightingElement, SVGNames::specularConstantAttr, float, SpecularConstant, specularConstant) DECLARE_ANIMATED_PROPERTY(SVGFESpecularLightingElement, SVGNames::specularExponentAttr, float, SpecularExponent, specularExponent) diff --git a/WebCore/svg/SVGFESpotLightElement.cpp b/WebCore/svg/SVGFESpotLightElement.cpp index 26d0e16..04731f0 100644 --- a/WebCore/svg/SVGFESpotLightElement.cpp +++ b/WebCore/svg/SVGFESpotLightElement.cpp @@ -25,13 +25,14 @@ namespace WebCore { -SVGFESpotLightElement::SVGFESpotLightElement(const QualifiedName& tagName, Document* doc) - : SVGFELightElement(tagName, doc) +inline SVGFESpotLightElement::SVGFESpotLightElement(const QualifiedName& tagName, Document* document) + : SVGFELightElement(tagName, document) { } -SVGFESpotLightElement::~SVGFESpotLightElement() +PassRefPtr<SVGFESpotLightElement> SVGFESpotLightElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGFESpotLightElement(tagName, document)); } PassRefPtr<LightSource> SVGFESpotLightElement::lightSource() const diff --git a/WebCore/svg/SVGFESpotLightElement.h b/WebCore/svg/SVGFESpotLightElement.h index 6903c0b..79fc5fc 100644 --- a/WebCore/svg/SVGFESpotLightElement.h +++ b/WebCore/svg/SVGFESpotLightElement.h @@ -24,10 +24,13 @@ #include "SVGFELightElement.h" namespace WebCore { + class SVGFESpotLightElement : public SVGFELightElement { public: + static PassRefPtr<SVGFESpotLightElement> create(const QualifiedName&, Document*); + + private: SVGFESpotLightElement(const QualifiedName&, Document*); - virtual ~SVGFESpotLightElement(); virtual PassRefPtr<LightSource> lightSource() const; }; diff --git a/WebCore/svg/SVGFETileElement.cpp b/WebCore/svg/SVGFETileElement.cpp index f3f5eaf..4379b96 100644 --- a/WebCore/svg/SVGFETileElement.cpp +++ b/WebCore/svg/SVGFETileElement.cpp @@ -28,13 +28,14 @@ namespace WebCore { -SVGFETileElement::SVGFETileElement(const QualifiedName& tagName, Document* doc) - : SVGFilterPrimitiveStandardAttributes(tagName, doc) +inline SVGFETileElement::SVGFETileElement(const QualifiedName& tagName, Document* document) + : SVGFilterPrimitiveStandardAttributes(tagName, document) { } -SVGFETileElement::~SVGFETileElement() +PassRefPtr<SVGFETileElement> SVGFETileElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGFETileElement(tagName, document)); } void SVGFETileElement::parseMappedAttribute(Attribute* attr) diff --git a/WebCore/svg/SVGFETileElement.h b/WebCore/svg/SVGFETileElement.h index 41355e2..03dc08d 100644 --- a/WebCore/svg/SVGFETileElement.h +++ b/WebCore/svg/SVGFETileElement.h @@ -29,14 +29,15 @@ namespace WebCore { class SVGFETileElement : public SVGFilterPrimitiveStandardAttributes { public: + static PassRefPtr<SVGFETileElement> create(const QualifiedName&, Document*); + +private: SVGFETileElement(const QualifiedName&, Document*); - virtual ~SVGFETileElement(); virtual void parseMappedAttribute(Attribute*); virtual void synchronizeProperty(const QualifiedName&); virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*); -private: DECLARE_ANIMATED_PROPERTY(SVGFETileElement, SVGNames::inAttr, String, In1, in1) }; diff --git a/WebCore/svg/SVGFETurbulenceElement.cpp b/WebCore/svg/SVGFETurbulenceElement.cpp index 0415e89..5c1d32f 100644 --- a/WebCore/svg/SVGFETurbulenceElement.cpp +++ b/WebCore/svg/SVGFETurbulenceElement.cpp @@ -31,16 +31,17 @@ namespace WebCore { char SVGBaseFrequencyXIdentifier[] = "SVGBaseFrequencyX"; char SVGBaseFrequencyYIdentifier[] = "SVGBaseFrequencyY"; -SVGFETurbulenceElement::SVGFETurbulenceElement(const QualifiedName& tagName, Document* doc) - : SVGFilterPrimitiveStandardAttributes(tagName, doc) +inline SVGFETurbulenceElement::SVGFETurbulenceElement(const QualifiedName& tagName, Document* document) + : SVGFilterPrimitiveStandardAttributes(tagName, document) , m_numOctaves(1) , m_stitchTiles(SVG_STITCHTYPE_NOSTITCH) , m_type(FETURBULENCE_TYPE_TURBULENCE) { } -SVGFETurbulenceElement::~SVGFETurbulenceElement() +PassRefPtr<SVGFETurbulenceElement> SVGFETurbulenceElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGFETurbulenceElement(tagName, document)); } void SVGFETurbulenceElement::parseMappedAttribute(Attribute* attr) diff --git a/WebCore/svg/SVGFETurbulenceElement.h b/WebCore/svg/SVGFETurbulenceElement.h index c5820c8..78d47f9 100644 --- a/WebCore/svg/SVGFETurbulenceElement.h +++ b/WebCore/svg/SVGFETurbulenceElement.h @@ -38,14 +38,15 @@ enum SVGStitchOptions { class SVGFETurbulenceElement : public SVGFilterPrimitiveStandardAttributes { public: + static PassRefPtr<SVGFETurbulenceElement> create(const QualifiedName&, Document*); + +private: SVGFETurbulenceElement(const QualifiedName&, Document*); - virtual ~SVGFETurbulenceElement(); virtual void parseMappedAttribute(Attribute*); virtual void synchronizeProperty(const QualifiedName&); virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*); -private: DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFETurbulenceElement, SVGNames::baseFrequencyAttr, SVGBaseFrequencyXIdentifier, float, BaseFrequencyX, baseFrequencyX) DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFETurbulenceElement, SVGNames::baseFrequencyAttr, SVGBaseFrequencyYIdentifier, float, BaseFrequencyY, baseFrequencyY) DECLARE_ANIMATED_PROPERTY(SVGFETurbulenceElement, SVGNames::numOctavesAttr, long, NumOctaves, numOctaves) diff --git a/WebCore/svg/SVGFilterElement.cpp b/WebCore/svg/SVGFilterElement.cpp index eb633c0..3418b9d 100644 --- a/WebCore/svg/SVGFilterElement.cpp +++ b/WebCore/svg/SVGFilterElement.cpp @@ -42,8 +42,8 @@ namespace WebCore { char SVGFilterResXIdentifier[] = "SVGFilterResX"; char SVGFilterResYIdentifier[] = "SVGFilterResY"; -SVGFilterElement::SVGFilterElement(const QualifiedName& tagName, Document* doc) - : SVGStyledElement(tagName, doc) +inline SVGFilterElement::SVGFilterElement(const QualifiedName& tagName, Document* document) + : SVGStyledElement(tagName, document) , SVGURIReference() , SVGLangSpace() , SVGExternalResourcesRequired() @@ -58,8 +58,9 @@ SVGFilterElement::SVGFilterElement(const QualifiedName& tagName, Document* doc) // Spec: If the width/height attribute is not specified, the effect is as if a value of "120%" were specified. } -SVGFilterElement::~SVGFilterElement() +PassRefPtr<SVGFilterElement> SVGFilterElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGFilterElement(tagName, document)); } void SVGFilterElement::setFilterRes(unsigned long filterResX, unsigned long filterResY) diff --git a/WebCore/svg/SVGFilterElement.h b/WebCore/svg/SVGFilterElement.h index ddcd953..67d0a47 100644 --- a/WebCore/svg/SVGFilterElement.h +++ b/WebCore/svg/SVGFilterElement.h @@ -40,21 +40,11 @@ class SVGFilterElement : public SVGStyledElement, public SVGLangSpace, public SVGExternalResourcesRequired { public: - SVGFilterElement(const QualifiedName&, Document*); - virtual ~SVGFilterElement(); - - virtual bool needsPendingResourceHandling() const { return false; } + static PassRefPtr<SVGFilterElement> create(const QualifiedName&, Document*); void setFilterRes(unsigned long filterResX, unsigned long filterResY); FloatRect filterBoundingBox(const FloatRect&) const; - virtual void parseMappedAttribute(Attribute*); - virtual void svgAttributeChanged(const QualifiedName&); - virtual void synchronizeProperty(const QualifiedName&); - virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); - - virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); - static void invalidateFilter(SVGElement* element) { ASSERT(element); @@ -72,6 +62,17 @@ public: } private: + SVGFilterElement(const QualifiedName&, Document*); + + virtual bool needsPendingResourceHandling() const { return false; } + + virtual void parseMappedAttribute(Attribute*); + virtual void svgAttributeChanged(const QualifiedName&); + virtual void synchronizeProperty(const QualifiedName&); + virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); + + virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); + virtual bool selfHasRelativeLengths() const; DECLARE_ANIMATED_PROPERTY(SVGFilterElement, SVGNames::filterUnitsAttr, int, FilterUnits, filterUnits) diff --git a/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp b/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp index e91c0a1..07d9241 100644 --- a/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp +++ b/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp @@ -33,8 +33,8 @@ namespace WebCore { -SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes(const QualifiedName& tagName, Document* doc) - : SVGStyledElement(tagName, doc) +SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes(const QualifiedName& tagName, Document* document) + : SVGStyledElement(tagName, document) , m_x(LengthModeWidth, "0%") , m_y(LengthModeHeight, "0%") , m_width(LengthModeWidth, "100%") @@ -44,10 +44,6 @@ SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes(const // Spec: If the width/height attribute is not specified, the effect is as if a value of "100%" were specified. } -SVGFilterPrimitiveStandardAttributes::~SVGFilterPrimitiveStandardAttributes() -{ -} - void SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(Attribute* attr) { const AtomicString& value = attr->value(); diff --git a/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h b/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h index 8754c6a..2fb41ea 100644 --- a/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h +++ b/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h @@ -35,22 +35,23 @@ namespace WebCore { class SVGFilterPrimitiveStandardAttributes : public SVGStyledElement { public: + void setStandardAttributes(bool, FilterEffect*) const; + + virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*) = 0; + +protected: SVGFilterPrimitiveStandardAttributes(const QualifiedName&, Document*); - virtual ~SVGFilterPrimitiveStandardAttributes(); - - virtual bool isFilterEffect() const { return true; } virtual void parseMappedAttribute(Attribute*); virtual void svgAttributeChanged(const QualifiedName&); virtual void synchronizeProperty(const QualifiedName&); virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); - virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*) = 0; - virtual bool rendererIsNeeded(RenderStyle*) { return false; } +private: + virtual bool isFilterEffect() const { return true; } - void setStandardAttributes(bool, FilterEffect*) const; + virtual bool rendererIsNeeded(RenderStyle*) { return false; } -private: DECLARE_ANIMATED_PROPERTY(SVGFilterPrimitiveStandardAttributes, SVGNames::xAttr, SVGLength, X, x) DECLARE_ANIMATED_PROPERTY(SVGFilterPrimitiveStandardAttributes, SVGNames::yAttr, SVGLength, Y, y) DECLARE_ANIMATED_PROPERTY(SVGFilterPrimitiveStandardAttributes, SVGNames::widthAttr, SVGLength, Width, width) diff --git a/WebCore/svg/SVGFitToViewBox.cpp b/WebCore/svg/SVGFitToViewBox.cpp index c78a619..5297e8f 100644 --- a/WebCore/svg/SVGFitToViewBox.cpp +++ b/WebCore/svg/SVGFitToViewBox.cpp @@ -34,14 +34,6 @@ namespace WebCore { -SVGFitToViewBox::SVGFitToViewBox() -{ -} - -SVGFitToViewBox::~SVGFitToViewBox() -{ -} - bool SVGFitToViewBox::parseViewBox(Document* doc, const String& s, FloatRect& viewBox) { const UChar* c = s.characters(); diff --git a/WebCore/svg/SVGFitToViewBox.h b/WebCore/svg/SVGFitToViewBox.h index ca0fec8..d6551f5 100644 --- a/WebCore/svg/SVGFitToViewBox.h +++ b/WebCore/svg/SVGFitToViewBox.h @@ -31,8 +31,7 @@ class AffineTransform; class SVGFitToViewBox { public: - SVGFitToViewBox(); - virtual ~SVGFitToViewBox(); + virtual ~SVGFitToViewBox() { } bool parseViewBox(Document*, const UChar*& start, const UChar* end, FloatRect& viewBox, bool validate = true); static AffineTransform viewBoxToViewTransform(const FloatRect& viewBoxRect, const SVGPreserveAspectRatio&, float viewWidth, float viewHeight); diff --git a/WebCore/svg/SVGFontData.cpp b/WebCore/svg/SVGFontData.cpp index a88de66..63433ee 100644 --- a/WebCore/svg/SVGFontData.cpp +++ b/WebCore/svg/SVGFontData.cpp @@ -36,10 +36,6 @@ SVGFontData::SVGFontData(SVGFontFaceElement* fontFaceElement) ASSERT_ARG(fontFaceElement, fontFaceElement); } -SVGFontData::~SVGFontData() -{ -} - } // namespace WebCore #endif diff --git a/WebCore/svg/SVGFontData.h b/WebCore/svg/SVGFontData.h index c66aa23..e897a59 100644 --- a/WebCore/svg/SVGFontData.h +++ b/WebCore/svg/SVGFontData.h @@ -28,7 +28,7 @@ namespace WebCore { class SVGFontData : public Noncopyable { public: SVGFontData(SVGFontFaceElement*); - virtual ~SVGFontData(); + virtual ~SVGFontData() { } SVGFontFaceElement* svgFontFaceElement() const { return m_svgFontFaceElement; } diff --git a/WebCore/svg/SVGFontElement.cpp b/WebCore/svg/SVGFontElement.cpp index 2d29042..ae0cb6e 100644 --- a/WebCore/svg/SVGFontElement.cpp +++ b/WebCore/svg/SVGFontElement.cpp @@ -40,14 +40,15 @@ namespace WebCore { using namespace SVGNames; -SVGFontElement::SVGFontElement(const QualifiedName& tagName, Document* doc) - : SVGStyledElement(tagName, doc) +inline SVGFontElement::SVGFontElement(const QualifiedName& tagName, Document* document) + : SVGStyledElement(tagName, document) , m_isGlyphCacheValid(false) { } -SVGFontElement::~SVGFontElement() +PassRefPtr<SVGFontElement> SVGFontElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGFontElement(tagName, document)); } void SVGFontElement::synchronizeProperty(const QualifiedName& attrName) diff --git a/WebCore/svg/SVGFontElement.h b/WebCore/svg/SVGFontElement.h index 24c2fc5..98bf766 100644 --- a/WebCore/svg/SVGFontElement.h +++ b/WebCore/svg/SVGFontElement.h @@ -50,14 +50,11 @@ struct SVGKerningPair { typedef Vector<SVGKerningPair> KerningPairVector; class SVGMissingGlyphElement; + class SVGFontElement : public SVGStyledElement , public SVGExternalResourcesRequired { public: - SVGFontElement(const QualifiedName&, Document*); - virtual ~SVGFontElement(); - - virtual void synchronizeProperty(const QualifiedName&); - virtual bool rendererIsNeeded(RenderStyle*) { return false; } + static PassRefPtr<SVGFontElement> create(const QualifiedName&, Document*); void invalidateGlyphCache(); @@ -69,11 +66,16 @@ public: SVGMissingGlyphElement* firstMissingGlyphElement() const; private: - // SVGExternalResourcesRequired - DECLARE_ANIMATED_PROPERTY(SVGFontElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired) + SVGFontElement(const QualifiedName&, Document*); + + virtual void synchronizeProperty(const QualifiedName&); + virtual bool rendererIsNeeded(RenderStyle*) { return false; } void ensureGlyphCache() const; + // SVGExternalResourcesRequired + DECLARE_ANIMATED_PROPERTY(SVGFontElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired) + mutable KerningPairVector m_horizontalKerningPairs; mutable KerningPairVector m_verticalKerningPairs; mutable SVGGlyphMap m_glyphMap; diff --git a/WebCore/svg/SVGFontFaceElement.cpp b/WebCore/svg/SVGFontFaceElement.cpp index 42c1c75..4884074 100644 --- a/WebCore/svg/SVGFontFaceElement.cpp +++ b/WebCore/svg/SVGFontFaceElement.cpp @@ -46,18 +46,19 @@ namespace WebCore { using namespace SVGNames; -SVGFontFaceElement::SVGFontFaceElement(const QualifiedName& tagName, Document* doc) - : SVGElement(tagName, doc) +inline SVGFontFaceElement::SVGFontFaceElement(const QualifiedName& tagName, Document* document) + : SVGElement(tagName, document) , m_fontFaceRule(CSSFontFaceRule::create()) , m_styleDeclaration(CSSMutableStyleDeclaration::create()) { - m_styleDeclaration->setParent(document()->mappedElementSheet()); + m_styleDeclaration->setParent(document->mappedElementSheet()); m_styleDeclaration->setStrictParsing(true); m_fontFaceRule->setDeclaration(m_styleDeclaration.get()); } -SVGFontFaceElement::~SVGFontFaceElement() +PassRefPtr<SVGFontFaceElement> SVGFontFaceElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGFontFaceElement(tagName, document)); } static int cssPropertyIdForSVGAttributeName(const QualifiedName& attrName) @@ -307,7 +308,7 @@ void SVGFontFaceElement::rebuildFontFace() } } - document()->updateStyleSelector(); + document()->styleSelectorChanged(DeferRecalcStyle); } void SVGFontFaceElement::insertedIntoDocument() @@ -342,7 +343,7 @@ void SVGFontFaceElement::removeFromMappedElementSheet() break; } } - document()->updateStyleSelector(); + document()->styleSelectorChanged(DeferRecalcStyle); } } // namespace WebCore diff --git a/WebCore/svg/SVGFontFaceElement.h b/WebCore/svg/SVGFontFaceElement.h index 7d1f457..3ee71d8 100644 --- a/WebCore/svg/SVGFontFaceElement.h +++ b/WebCore/svg/SVGFontFaceElement.h @@ -33,14 +33,7 @@ namespace WebCore { class SVGFontFaceElement : public SVGElement { public: - SVGFontFaceElement(const QualifiedName&, Document*); - virtual ~SVGFontFaceElement(); - - virtual void parseMappedAttribute(Attribute*); - - virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); - virtual void insertedIntoDocument(); - virtual void removedFromDocument(); + static PassRefPtr<SVGFontFaceElement> create(const QualifiedName&, Document*); unsigned unitsPerEm() const; int xHeight() const; @@ -59,6 +52,14 @@ namespace WebCore { void removeFromMappedElementSheet(); private: + SVGFontFaceElement(const QualifiedName&, Document*); + + virtual void parseMappedAttribute(Attribute*); + + virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); + virtual void insertedIntoDocument(); + virtual void removedFromDocument(); + RefPtr<CSSFontFaceRule> m_fontFaceRule; RefPtr<CSSMutableStyleDeclaration> m_styleDeclaration; diff --git a/WebCore/svg/SVGFontFaceFormatElement.cpp b/WebCore/svg/SVGFontFaceFormatElement.cpp index d6e3a3d..e3182c4 100644 --- a/WebCore/svg/SVGFontFaceFormatElement.cpp +++ b/WebCore/svg/SVGFontFaceFormatElement.cpp @@ -29,11 +29,16 @@ namespace WebCore { using namespace SVGNames; -SVGFontFaceFormatElement::SVGFontFaceFormatElement(const QualifiedName& tagName, Document* doc) - : SVGElement(tagName, doc) +inline SVGFontFaceFormatElement::SVGFontFaceFormatElement(const QualifiedName& tagName, Document* document) + : SVGElement(tagName, document) { } +PassRefPtr<SVGFontFaceFormatElement> SVGFontFaceFormatElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new SVGFontFaceFormatElement(tagName, document)); +} + void SVGFontFaceFormatElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) { SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta); diff --git a/WebCore/svg/SVGFontFaceFormatElement.h b/WebCore/svg/SVGFontFaceFormatElement.h index eae22bf..6ca6c1f 100644 --- a/WebCore/svg/SVGFontFaceFormatElement.h +++ b/WebCore/svg/SVGFontFaceFormatElement.h @@ -27,6 +27,9 @@ namespace WebCore { class SVGFontFaceFormatElement : public SVGElement { public: + static PassRefPtr<SVGFontFaceFormatElement> create(const QualifiedName&, Document*); + +private: SVGFontFaceFormatElement(const QualifiedName&, Document*); virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); diff --git a/WebCore/svg/SVGFontFaceNameElement.cpp b/WebCore/svg/SVGFontFaceNameElement.cpp index b9657b3..39ac2b3 100644 --- a/WebCore/svg/SVGFontFaceNameElement.cpp +++ b/WebCore/svg/SVGFontFaceNameElement.cpp @@ -27,11 +27,16 @@ namespace WebCore { -SVGFontFaceNameElement::SVGFontFaceNameElement(const QualifiedName& tagName, Document* doc) - : SVGElement(tagName, doc) +inline SVGFontFaceNameElement::SVGFontFaceNameElement(const QualifiedName& tagName, Document* document) + : SVGElement(tagName, document) { } +PassRefPtr<SVGFontFaceNameElement> SVGFontFaceNameElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new SVGFontFaceNameElement(tagName, document)); +} + PassRefPtr<CSSFontFaceSrcValue> SVGFontFaceNameElement::srcValue() const { return CSSFontFaceSrcValue::createLocal(getAttribute(SVGNames::nameAttr)); diff --git a/WebCore/svg/SVGFontFaceNameElement.h b/WebCore/svg/SVGFontFaceNameElement.h index ab71b7d..462d7a8 100644 --- a/WebCore/svg/SVGFontFaceNameElement.h +++ b/WebCore/svg/SVGFontFaceNameElement.h @@ -24,12 +24,17 @@ #include "SVGElement.h" namespace WebCore { + class CSSFontFaceSrcValue; + class SVGFontFaceNameElement : public SVGElement { public: - SVGFontFaceNameElement(const QualifiedName&, Document*); + static PassRefPtr<SVGFontFaceNameElement> create(const QualifiedName&, Document*); PassRefPtr<CSSFontFaceSrcValue> srcValue() const; + + private: + SVGFontFaceNameElement(const QualifiedName&, Document*); }; } // namespace WebCore diff --git a/WebCore/svg/SVGFontFaceSrcElement.cpp b/WebCore/svg/SVGFontFaceSrcElement.cpp index 77b2e5e..891ddcd 100644 --- a/WebCore/svg/SVGFontFaceSrcElement.cpp +++ b/WebCore/svg/SVGFontFaceSrcElement.cpp @@ -33,11 +33,16 @@ namespace WebCore { using namespace SVGNames; -SVGFontFaceSrcElement::SVGFontFaceSrcElement(const QualifiedName& tagName, Document* doc) - : SVGElement(tagName, doc) +inline SVGFontFaceSrcElement::SVGFontFaceSrcElement(const QualifiedName& tagName, Document* document) + : SVGElement(tagName, document) { } +PassRefPtr<SVGFontFaceSrcElement> SVGFontFaceSrcElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new SVGFontFaceSrcElement(tagName, document)); +} + PassRefPtr<CSSValueList> SVGFontFaceSrcElement::srcValue() const { RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); diff --git a/WebCore/svg/SVGFontFaceSrcElement.h b/WebCore/svg/SVGFontFaceSrcElement.h index 0277e9a..e6f8d30 100644 --- a/WebCore/svg/SVGFontFaceSrcElement.h +++ b/WebCore/svg/SVGFontFaceSrcElement.h @@ -24,13 +24,18 @@ #include "SVGElement.h" namespace WebCore { + class CSSValueList; + class SVGFontFaceSrcElement : public SVGElement { public: - SVGFontFaceSrcElement(const QualifiedName&, Document*); - + static PassRefPtr<SVGFontFaceSrcElement> create(const QualifiedName&, Document*); + PassRefPtr<CSSValueList> srcValue() const; + private: + SVGFontFaceSrcElement(const QualifiedName&, Document*); + virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); }; diff --git a/WebCore/svg/SVGFontFaceUriElement.cpp b/WebCore/svg/SVGFontFaceUriElement.cpp index a7ad370..4d03b2b 100644 --- a/WebCore/svg/SVGFontFaceUriElement.cpp +++ b/WebCore/svg/SVGFontFaceUriElement.cpp @@ -36,11 +36,16 @@ namespace WebCore { using namespace SVGNames; -SVGFontFaceUriElement::SVGFontFaceUriElement(const QualifiedName& tagName, Document* doc) - : SVGElement(tagName, doc) +inline SVGFontFaceUriElement::SVGFontFaceUriElement(const QualifiedName& tagName, Document* document) + : SVGElement(tagName, document) { } +PassRefPtr<SVGFontFaceUriElement> SVGFontFaceUriElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new SVGFontFaceUriElement(tagName, document)); +} + SVGFontFaceUriElement::~SVGFontFaceUriElement() { if (m_cachedFont) diff --git a/WebCore/svg/SVGFontFaceUriElement.h b/WebCore/svg/SVGFontFaceUriElement.h index b026160..74999ac 100644 --- a/WebCore/svg/SVGFontFaceUriElement.h +++ b/WebCore/svg/SVGFontFaceUriElement.h @@ -32,15 +32,20 @@ namespace WebCore { class SVGFontFaceUriElement : public SVGElement, public CachedResourceClient { public: - SVGFontFaceUriElement(const QualifiedName&, Document*); - ~SVGFontFaceUriElement(); - + static PassRefPtr<SVGFontFaceUriElement> create(const QualifiedName&, Document*); + + virtual ~SVGFontFaceUriElement(); + PassRefPtr<CSSFontFaceSrcValue> srcValue() const; + private: + SVGFontFaceUriElement(const QualifiedName&, Document*); + virtual void parseMappedAttribute(Attribute*); virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); virtual void insertedIntoDocument(); +<<<<<<< HEAD #ifdef ANDROID_INSTRUMENT void* operator new(size_t size) { return SVGElement::operator new(size); @@ -58,6 +63,8 @@ namespace WebCore { #endif private: +======= +>>>>>>> webkit.org at r66666 void loadFont(); CachedResourceHandle<CachedFont> m_cachedFont; diff --git a/WebCore/svg/SVGForeignObjectElement.cpp b/WebCore/svg/SVGForeignObjectElement.cpp index 3e9e90e..e4f7096 100644 --- a/WebCore/svg/SVGForeignObjectElement.cpp +++ b/WebCore/svg/SVGForeignObjectElement.cpp @@ -33,11 +33,8 @@ namespace WebCore { -SVGForeignObjectElement::SVGForeignObjectElement(const QualifiedName& tagName, Document *doc) - : SVGStyledTransformableElement(tagName, doc) - , SVGTests() - , SVGLangSpace() - , SVGExternalResourcesRequired() +SVGForeignObjectElement::SVGForeignObjectElement(const QualifiedName& tagName, Document* document) + : SVGStyledTransformableElement(tagName, document) , m_x(LengthModeWidth) , m_y(LengthModeHeight) , m_width(LengthModeWidth) @@ -45,8 +42,9 @@ SVGForeignObjectElement::SVGForeignObjectElement(const QualifiedName& tagName, D { } -SVGForeignObjectElement::~SVGForeignObjectElement() +PassRefPtr<SVGForeignObjectElement> SVGForeignObjectElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGForeignObjectElement(tagName, document)); } void SVGForeignObjectElement::parseMappedAttribute(Attribute* attr) diff --git a/WebCore/svg/SVGForeignObjectElement.h b/WebCore/svg/SVGForeignObjectElement.h index 5ce16fd..a587134 100644 --- a/WebCore/svg/SVGForeignObjectElement.h +++ b/WebCore/svg/SVGForeignObjectElement.h @@ -35,18 +35,19 @@ namespace WebCore { public SVGLangSpace, public SVGExternalResourcesRequired { public: + static PassRefPtr<SVGForeignObjectElement> create(const QualifiedName&, Document*); + + private: SVGForeignObjectElement(const QualifiedName&, Document*); - virtual ~SVGForeignObjectElement(); virtual bool isValid() const { return SVGTests::isValid(); } virtual void parseMappedAttribute(Attribute*); virtual void svgAttributeChanged(const QualifiedName&); virtual void synchronizeProperty(const QualifiedName&); - bool childShouldCreateRenderer(Node*) const; + virtual bool childShouldCreateRenderer(Node*) const; virtual RenderObject* createRenderer(RenderArena* arena, RenderStyle* style); - private: virtual bool selfHasRelativeLengths() const; DECLARE_ANIMATED_PROPERTY(SVGForeignObjectElement, SVGNames::xAttr, SVGLength, X, x) diff --git a/WebCore/svg/SVGGElement.cpp b/WebCore/svg/SVGGElement.cpp index 0c85a03..8174eac 100644 --- a/WebCore/svg/SVGGElement.cpp +++ b/WebCore/svg/SVGGElement.cpp @@ -29,16 +29,14 @@ namespace WebCore { -SVGGElement::SVGGElement(const QualifiedName& tagName, Document* doc) - : SVGStyledTransformableElement(tagName, doc) - , SVGTests() - , SVGLangSpace() - , SVGExternalResourcesRequired() +SVGGElement::SVGGElement(const QualifiedName& tagName, Document* document) + : SVGStyledTransformableElement(tagName, document) { } -SVGGElement::~SVGGElement() +PassRefPtr<SVGGElement> SVGGElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGGElement(tagName, document)); } void SVGGElement::parseMappedAttribute(Attribute* attr) diff --git a/WebCore/svg/SVGGElement.h b/WebCore/svg/SVGGElement.h index 107fa3c..a149351 100644 --- a/WebCore/svg/SVGGElement.h +++ b/WebCore/svg/SVGGElement.h @@ -34,10 +34,16 @@ namespace WebCore { public SVGLangSpace, public SVGExternalResourcesRequired { public: - SVGGElement(const QualifiedName&, Document*); - virtual ~SVGGElement(); + static PassRefPtr<SVGGElement> create(const QualifiedName&, Document*); virtual bool isShadowTreeContainerElement() const { return false; } + + protected: + SVGGElement(const QualifiedName&, Document*); + + virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); + + private: virtual bool isValid() const { return SVGTests::isValid(); } virtual void parseMappedAttribute(Attribute*); @@ -45,9 +51,7 @@ namespace WebCore { virtual void synchronizeProperty(const QualifiedName&); virtual bool rendererIsNeeded(RenderStyle*) { return true; } - virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); - private: // SVGExternalResourcesRequired DECLARE_ANIMATED_PROPERTY(SVGGElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired) }; diff --git a/WebCore/svg/SVGGlyphElement.cpp b/WebCore/svg/SVGGlyphElement.cpp index 2c84841..8ded0fc 100644 --- a/WebCore/svg/SVGGlyphElement.cpp +++ b/WebCore/svg/SVGGlyphElement.cpp @@ -37,13 +37,14 @@ namespace WebCore { using namespace SVGNames; -SVGGlyphElement::SVGGlyphElement(const QualifiedName& tagName, Document* doc) - : SVGStyledElement(tagName, doc) +inline SVGGlyphElement::SVGGlyphElement(const QualifiedName& tagName, Document* document) + : SVGStyledElement(tagName, document) { } -SVGGlyphElement::~SVGGlyphElement() +PassRefPtr<SVGGlyphElement> SVGGlyphElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGGlyphElement(tagName, document)); } void SVGGlyphElement::invalidateGlyphCache() diff --git a/WebCore/svg/SVGGlyphElement.h b/WebCore/svg/SVGGlyphElement.h index 5b5408d..a7dd570 100644 --- a/WebCore/svg/SVGGlyphElement.h +++ b/WebCore/svg/SVGGlyphElement.h @@ -103,15 +103,7 @@ namespace WebCore { class SVGGlyphElement : public SVGStyledElement { public: - SVGGlyphElement(const QualifiedName&, Document*); - virtual ~SVGGlyphElement(); - - virtual void parseMappedAttribute(Attribute*); - - virtual void insertedIntoDocument(); - virtual void removedFromDocument(); - - virtual bool rendererIsNeeded(RenderStyle*) { return false; } + static PassRefPtr<SVGGlyphElement> create(const QualifiedName&, Document*); SVGGlyphIdentifier buildGlyphIdentifier() const; @@ -121,7 +113,17 @@ namespace WebCore { // Helper function shared between SVGGlyphElement & SVGMissingGlyphElement static SVGGlyphIdentifier buildGenericGlyphIdentifier(const SVGElement*); + private: + SVGGlyphElement(const QualifiedName&, Document*); + + virtual void parseMappedAttribute(Attribute*); + + virtual void insertedIntoDocument(); + virtual void removedFromDocument(); + + virtual bool rendererIsNeeded(RenderStyle*) { return false; } + void invalidateGlyphCache(); }; diff --git a/WebCore/svg/SVGGradientElement.cpp b/WebCore/svg/SVGGradientElement.cpp index f2d9712..523e4df 100644 --- a/WebCore/svg/SVGGradientElement.cpp +++ b/WebCore/svg/SVGGradientElement.cpp @@ -38,19 +38,13 @@ namespace WebCore { -SVGGradientElement::SVGGradientElement(const QualifiedName& tagName, Document* doc) - : SVGStyledElement(tagName, doc) - , SVGURIReference() - , SVGExternalResourcesRequired() +SVGGradientElement::SVGGradientElement(const QualifiedName& tagName, Document* document) + : SVGStyledElement(tagName, document) , m_gradientUnits(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) , m_gradientTransform(SVGTransformList::create(SVGNames::gradientTransformAttr)) { } -SVGGradientElement::~SVGGradientElement() -{ -} - void SVGGradientElement::parseMappedAttribute(Attribute* attr) { if (attr->name() == SVGNames::gradientUnitsAttr) { diff --git a/WebCore/svg/SVGGradientElement.h b/WebCore/svg/SVGGradientElement.h index 9976d7d..d1e7914 100644 --- a/WebCore/svg/SVGGradientElement.h +++ b/WebCore/svg/SVGGradientElement.h @@ -34,20 +34,20 @@ namespace WebCore { public SVGURIReference, public SVGExternalResourcesRequired { public: + Vector<Gradient::ColorStop> buildStops(); + + protected: SVGGradientElement(const QualifiedName&, Document*); - virtual ~SVGGradientElement(); - - virtual bool needsPendingResourceHandling() const { return false; } virtual void parseMappedAttribute(Attribute*); virtual void svgAttributeChanged(const QualifiedName&); virtual void synchronizeProperty(const QualifiedName&); + private: + virtual bool needsPendingResourceHandling() const { return false; } + virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); - Vector<Gradient::ColorStop> buildStops(); - - protected: DECLARE_ANIMATED_PROPERTY(SVGGradientElement, SVGNames::spreadMethodAttr, int, SpreadMethod, spreadMethod) DECLARE_ANIMATED_PROPERTY(SVGGradientElement, SVGNames::gradientUnitsAttr, int, GradientUnits, gradientUnits) DECLARE_ANIMATED_PROPERTY(SVGGradientElement, SVGNames::gradientTransformAttr, SVGTransformList*, GradientTransform, gradientTransform) diff --git a/WebCore/svg/SVGHKernElement.cpp b/WebCore/svg/SVGHKernElement.cpp index eb8a4b5..a432daa 100644 --- a/WebCore/svg/SVGHKernElement.cpp +++ b/WebCore/svg/SVGHKernElement.cpp @@ -35,13 +35,14 @@ namespace WebCore { using namespace SVGNames; -SVGHKernElement::SVGHKernElement(const QualifiedName& tagName, Document* doc) - : SVGElement(tagName, doc) +inline SVGHKernElement::SVGHKernElement(const QualifiedName& tagName, Document* document) + : SVGElement(tagName, document) { } -SVGHKernElement::~SVGHKernElement() +PassRefPtr<SVGHKernElement> SVGHKernElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGHKernElement(tagName, document)); } void SVGHKernElement::insertedIntoDocument() diff --git a/WebCore/svg/SVGHKernElement.h b/WebCore/svg/SVGHKernElement.h index bd893d8..7249fac 100644 --- a/WebCore/svg/SVGHKernElement.h +++ b/WebCore/svg/SVGHKernElement.h @@ -24,27 +24,22 @@ #if ENABLE(SVG_FONTS) #include "SVGFontElement.h" -#include "SVGParserUtilities.h" -#include "SVGStyledElement.h" -#include <wtf/Forward.h> - -#include <limits> namespace WebCore { - class SVGFontData; - class SVGHKernElement : public SVGElement { public: + static PassRefPtr<SVGHKernElement> create(const QualifiedName&, Document*); + + void buildHorizontalKerningPair(KerningPairVector&); + + private: SVGHKernElement(const QualifiedName&, Document*); - virtual ~SVGHKernElement(); virtual void insertedIntoDocument(); virtual void removedFromDocument(); virtual bool rendererIsNeeded(RenderStyle*) { return false; } - - void buildHorizontalKerningPair(KerningPairVector&); }; } // namespace WebCore diff --git a/WebCore/svg/SVGImageElement.cpp b/WebCore/svg/SVGImageElement.cpp index c5e4802..f6fa013 100644 --- a/WebCore/svg/SVGImageElement.cpp +++ b/WebCore/svg/SVGImageElement.cpp @@ -26,6 +26,7 @@ #include "Attribute.h" #include "CSSPropertyNames.h" +#include "RenderImageResource.h" #include "RenderSVGImage.h" #include "RenderSVGResource.h" #include "SVGDocument.h" @@ -36,12 +37,8 @@ namespace WebCore { -SVGImageElement::SVGImageElement(const QualifiedName& tagName, Document* doc) - : SVGStyledTransformableElement(tagName, doc) - , SVGTests() - , SVGLangSpace() - , SVGExternalResourcesRequired() - , SVGURIReference() +inline SVGImageElement::SVGImageElement(const QualifiedName& tagName, Document* document) + : SVGStyledTransformableElement(tagName, document) , m_x(LengthModeWidth) , m_y(LengthModeHeight) , m_width(LengthModeWidth) @@ -50,8 +47,9 @@ SVGImageElement::SVGImageElement(const QualifiedName& tagName, Document* doc) { } -SVGImageElement::~SVGImageElement() +PassRefPtr<SVGImageElement> SVGImageElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGImageElement(tagName, document)); } void SVGImageElement::parseMappedAttribute(Attribute* attr) @@ -172,10 +170,10 @@ void SVGImageElement::attach() SVGStyledTransformableElement::attach(); if (RenderSVGImage* imageObj = toRenderSVGImage(renderer())) { - if (imageObj->hasImage()) + if (imageObj->imageResource()->hasImage()) return; - imageObj->setCachedImage(m_imageLoader.image()); + imageObj->imageResource()->setCachedImage(m_imageLoader.image()); } } diff --git a/WebCore/svg/SVGImageElement.h b/WebCore/svg/SVGImageElement.h index cf4cf88..9024415 100644 --- a/WebCore/svg/SVGImageElement.h +++ b/WebCore/svg/SVGImageElement.h @@ -40,8 +40,10 @@ namespace WebCore { public SVGExternalResourcesRequired, public SVGURIReference { public: + static PassRefPtr<SVGImageElement> create(const QualifiedName&, Document*); + + private: SVGImageElement(const QualifiedName&, Document*); - virtual ~SVGImageElement(); virtual bool isValid() const { return SVGTests::isValid(); } @@ -57,10 +59,8 @@ namespace WebCore { virtual const QualifiedName& imageSourceAttributeName() const; virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const; - protected: virtual bool haveLoadedRequiredResources(); - private: virtual bool selfHasRelativeLengths() const; virtual void willMoveToNewOwnerDocument(); diff --git a/WebCore/svg/SVGImageLoader.cpp b/WebCore/svg/SVGImageLoader.cpp index 3d04863..5ba9c81 100644 --- a/WebCore/svg/SVGImageLoader.cpp +++ b/WebCore/svg/SVGImageLoader.cpp @@ -35,10 +35,6 @@ SVGImageLoader::SVGImageLoader(SVGImageElement* node) { } -SVGImageLoader::~SVGImageLoader() -{ -} - void SVGImageLoader::dispatchLoadEvent() { if (image()->errorOccurred()) diff --git a/WebCore/svg/SVGImageLoader.h b/WebCore/svg/SVGImageLoader.h index 807a9bc..98dcffc 100644 --- a/WebCore/svg/SVGImageLoader.h +++ b/WebCore/svg/SVGImageLoader.h @@ -30,8 +30,8 @@ namespace WebCore { class SVGImageLoader : public ImageLoader { public: SVGImageLoader(SVGImageElement*); - virtual ~SVGImageLoader(); + private: virtual void dispatchLoadEvent(); virtual String sourceURI(const AtomicString&) const; }; diff --git a/WebCore/svg/SVGLangSpace.cpp b/WebCore/svg/SVGLangSpace.cpp index 4ac7c00..ad6458c 100644 --- a/WebCore/svg/SVGLangSpace.cpp +++ b/WebCore/svg/SVGLangSpace.cpp @@ -30,19 +30,6 @@ namespace WebCore { -SVGLangSpace::SVGLangSpace() -{ -} - -SVGLangSpace::~SVGLangSpace() -{ -} - -const AtomicString& SVGLangSpace::xmllang() const -{ - return m_lang; -} - void SVGLangSpace::setXmllang(const AtomicString& xmlLang) { m_lang = xmlLang; diff --git a/WebCore/svg/SVGLangSpace.h b/WebCore/svg/SVGLangSpace.h index 64e435d..723fa7a 100644 --- a/WebCore/svg/SVGLangSpace.h +++ b/WebCore/svg/SVGLangSpace.h @@ -31,10 +31,7 @@ namespace WebCore { class SVGLangSpace { public: - SVGLangSpace(); - virtual ~SVGLangSpace(); - - const AtomicString& xmllang() const; + const AtomicString& xmllang() const { return m_lang; } void setXmllang(const AtomicString& xmlLang); const AtomicString& xmlspace() const; diff --git a/WebCore/svg/SVGLengthList.cpp b/WebCore/svg/SVGLengthList.cpp index d144ca0..2149e04 100644 --- a/WebCore/svg/SVGLengthList.cpp +++ b/WebCore/svg/SVGLengthList.cpp @@ -32,10 +32,6 @@ SVGLengthList::SVGLengthList(const QualifiedName& attributeName) { } -SVGLengthList::~SVGLengthList() -{ -} - void SVGLengthList::parse(const String& value, SVGLengthMode mode) { ExceptionCode ec = 0; diff --git a/WebCore/svg/SVGLengthList.h b/WebCore/svg/SVGLengthList.h index bbabf62..27b958f 100644 --- a/WebCore/svg/SVGLengthList.h +++ b/WebCore/svg/SVGLengthList.h @@ -30,9 +30,8 @@ namespace WebCore { class SVGLengthList : public SVGPODList<SVGLength> { public: static PassRefPtr<SVGLengthList> create(const QualifiedName& attributeName) { return adoptRef(new SVGLengthList(attributeName)); } - virtual ~SVGLengthList(); - void parse(const String& value, SVGLengthMode mode); + void parse(const String& value, SVGLengthMode); String valueAsString() const; diff --git a/WebCore/svg/SVGLineElement.cpp b/WebCore/svg/SVGLineElement.cpp index ebbcdf6..bd15890 100644 --- a/WebCore/svg/SVGLineElement.cpp +++ b/WebCore/svg/SVGLineElement.cpp @@ -32,11 +32,8 @@ namespace WebCore { -SVGLineElement::SVGLineElement(const QualifiedName& tagName, Document* doc) - : SVGStyledTransformableElement(tagName, doc) - , SVGTests() - , SVGLangSpace() - , SVGExternalResourcesRequired() +inline SVGLineElement::SVGLineElement(const QualifiedName& tagName, Document* document) + : SVGStyledTransformableElement(tagName, document) , m_x1(LengthModeWidth) , m_y1(LengthModeHeight) , m_x2(LengthModeWidth) @@ -44,8 +41,9 @@ SVGLineElement::SVGLineElement(const QualifiedName& tagName, Document* doc) { } -SVGLineElement::~SVGLineElement() +PassRefPtr<SVGLineElement> SVGLineElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGLineElement(tagName, document)); } void SVGLineElement::parseMappedAttribute(Attribute* attr) diff --git a/WebCore/svg/SVGLineElement.h b/WebCore/svg/SVGLineElement.h index cdfa2aa..21007f0 100644 --- a/WebCore/svg/SVGLineElement.h +++ b/WebCore/svg/SVGLineElement.h @@ -36,8 +36,10 @@ namespace WebCore { public SVGLangSpace, public SVGExternalResourcesRequired { public: + static PassRefPtr<SVGLineElement> create(const QualifiedName&, Document*); + + private: SVGLineElement(const QualifiedName&, Document*); - virtual ~SVGLineElement(); virtual bool isValid() const { return SVGTests::isValid(); } @@ -49,7 +51,6 @@ namespace WebCore { virtual bool supportsMarkers() const { return true; } - private: virtual bool selfHasRelativeLengths() const; DECLARE_ANIMATED_PROPERTY(SVGLineElement, SVGNames::x1Attr, SVGLength, X1, x1) diff --git a/WebCore/svg/SVGLinearGradientElement.cpp b/WebCore/svg/SVGLinearGradientElement.cpp index d3c81b0..ec351d7 100644 --- a/WebCore/svg/SVGLinearGradientElement.cpp +++ b/WebCore/svg/SVGLinearGradientElement.cpp @@ -39,8 +39,8 @@ namespace WebCore { -SVGLinearGradientElement::SVGLinearGradientElement(const QualifiedName& tagName, Document* doc) - : SVGGradientElement(tagName, doc) +inline SVGLinearGradientElement::SVGLinearGradientElement(const QualifiedName& tagName, Document* document) + : SVGGradientElement(tagName, document) , m_x1(LengthModeWidth) , m_y1(LengthModeHeight) , m_x2(LengthModeWidth, "100%") @@ -49,8 +49,9 @@ SVGLinearGradientElement::SVGLinearGradientElement(const QualifiedName& tagName, // Spec: If the x2 attribute is not specified, the effect is as if a value of "100%" were specified. } -SVGLinearGradientElement::~SVGLinearGradientElement() +PassRefPtr<SVGLinearGradientElement> SVGLinearGradientElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGLinearGradientElement(tagName, document)); } void SVGLinearGradientElement::parseMappedAttribute(Attribute* attr) diff --git a/WebCore/svg/SVGLinearGradientElement.h b/WebCore/svg/SVGLinearGradientElement.h index b329d8b..dec912f 100644 --- a/WebCore/svg/SVGLinearGradientElement.h +++ b/WebCore/svg/SVGLinearGradientElement.h @@ -31,8 +31,13 @@ namespace WebCore { class SVGLinearGradientElement : public SVGGradientElement { public: + static PassRefPtr<SVGLinearGradientElement> create(const QualifiedName&, Document*); + + LinearGradientAttributes collectGradientProperties(); + void calculateStartEndPoints(const LinearGradientAttributes&, FloatPoint& startPoint, FloatPoint& endPoint); + + private: SVGLinearGradientElement(const QualifiedName&, Document*); - virtual ~SVGLinearGradientElement(); virtual void parseMappedAttribute(Attribute*); virtual void svgAttributeChanged(const QualifiedName&); @@ -40,10 +45,6 @@ namespace WebCore { virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); - LinearGradientAttributes collectGradientProperties(); - void calculateStartEndPoints(const LinearGradientAttributes&, FloatPoint& startPoint, FloatPoint& endPoint); - - private: virtual bool selfHasRelativeLengths() const; DECLARE_ANIMATED_PROPERTY(SVGLinearGradientElement, SVGNames::x1Attr, SVGLength, X1, x1) diff --git a/WebCore/svg/SVGLocatable.cpp b/WebCore/svg/SVGLocatable.cpp index b7b4440..3311a5a 100644 --- a/WebCore/svg/SVGLocatable.cpp +++ b/WebCore/svg/SVGLocatable.cpp @@ -31,14 +31,6 @@ namespace WebCore { -SVGLocatable::SVGLocatable() -{ -} - -SVGLocatable::~SVGLocatable() -{ -} - static bool isViewportElement(Node* node) { return (node->hasTagName(SVGNames::svgTag) diff --git a/WebCore/svg/SVGLocatable.h b/WebCore/svg/SVGLocatable.h index 2e51dc5..b19f5cd 100644 --- a/WebCore/svg/SVGLocatable.h +++ b/WebCore/svg/SVGLocatable.h @@ -33,8 +33,7 @@ class SVGElement; class SVGLocatable { public: - SVGLocatable(); - virtual ~SVGLocatable(); + virtual ~SVGLocatable() { } // 'SVGLocatable' functions virtual SVGElement* nearestViewportElement() const = 0; diff --git a/WebCore/svg/SVGMPathElement.cpp b/WebCore/svg/SVGMPathElement.cpp index 7165c11..c6da308 100644 --- a/WebCore/svg/SVGMPathElement.cpp +++ b/WebCore/svg/SVGMPathElement.cpp @@ -27,13 +27,14 @@ namespace WebCore { -SVGMPathElement::SVGMPathElement(const QualifiedName& qname, Document* doc) - : SVGElement(qname, doc) +inline SVGMPathElement::SVGMPathElement(const QualifiedName& tagName, Document* document) + : SVGElement(tagName, document) { } -SVGMPathElement::~SVGMPathElement() +PassRefPtr<SVGMPathElement> SVGMPathElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGMPathElement(tagName, document)); } void SVGMPathElement::parseMappedAttribute(Attribute* attr) diff --git a/WebCore/svg/SVGMPathElement.h b/WebCore/svg/SVGMPathElement.h index 7543b6e..1bbe7d3 100644 --- a/WebCore/svg/SVGMPathElement.h +++ b/WebCore/svg/SVGMPathElement.h @@ -32,15 +32,16 @@ namespace WebCore { public SVGURIReference, public SVGExternalResourcesRequired { public: + static PassRefPtr<SVGMPathElement> create(const QualifiedName&, Document*); + + SVGPathElement* pathElement(); + + private: SVGMPathElement(const QualifiedName&, Document*); - virtual ~SVGMPathElement(); virtual void parseMappedAttribute(Attribute*); virtual void synchronizeProperty(const QualifiedName&); - SVGPathElement* pathElement(); - - private: // SVGURIReference DECLARE_ANIMATED_PROPERTY(SVGMPathElement, XLinkNames::hrefAttr, String, Href, href) diff --git a/WebCore/svg/SVGMarkerElement.cpp b/WebCore/svg/SVGMarkerElement.cpp index 8e6296d..4ff420d 100644 --- a/WebCore/svg/SVGMarkerElement.cpp +++ b/WebCore/svg/SVGMarkerElement.cpp @@ -38,11 +38,8 @@ namespace WebCore { char SVGOrientTypeAttrIdentifier[] = "SVGOrientTypeAttr"; char SVGOrientAngleAttrIdentifier[] = "SVGOrientAngleAttr"; -SVGMarkerElement::SVGMarkerElement(const QualifiedName& tagName, Document* doc) - : SVGStyledElement(tagName, doc) - , SVGLangSpace() - , SVGExternalResourcesRequired() - , SVGFitToViewBox() +SVGMarkerElement::SVGMarkerElement(const QualifiedName& tagName, Document* document) + : SVGStyledElement(tagName, document) , m_refX(LengthModeWidth) , m_refY(LengthModeHeight) , m_markerWidth(LengthModeWidth, "3") @@ -53,8 +50,9 @@ SVGMarkerElement::SVGMarkerElement(const QualifiedName& tagName, Document* doc) // Spec: If the markerWidth/markerHeight attribute is not specified, the effect is as if a value of "3" were specified. } -SVGMarkerElement::~SVGMarkerElement() +PassRefPtr<SVGMarkerElement> SVGMarkerElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGMarkerElement(tagName, document)); } AffineTransform SVGMarkerElement::viewBoxToViewTransform(float viewWidth, float viewHeight) const diff --git a/WebCore/svg/SVGMarkerElement.h b/WebCore/svg/SVGMarkerElement.h index 436aaa7..7782739 100644 --- a/WebCore/svg/SVGMarkerElement.h +++ b/WebCore/svg/SVGMarkerElement.h @@ -53,16 +53,18 @@ public: SVG_MARKER_ORIENT_ANGLE = 2 }; - SVGMarkerElement(const QualifiedName&, Document*); - virtual ~SVGMarkerElement(); - - virtual bool needsPendingResourceHandling() const { return false; } + static PassRefPtr<SVGMarkerElement> create(const QualifiedName&, Document*); AffineTransform viewBoxToViewTransform(float viewWidth, float viewHeight) const; void setOrientToAuto(); void setOrientToAngle(const SVGAngle&); +private: + SVGMarkerElement(const QualifiedName&, Document*); + + virtual bool needsPendingResourceHandling() const { return false; } + virtual void parseMappedAttribute(Attribute*); virtual void svgAttributeChanged(const QualifiedName&); virtual void synchronizeProperty(const QualifiedName&); @@ -70,7 +72,6 @@ public: virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); -private: virtual bool selfHasRelativeLengths() const; DECLARE_ANIMATED_PROPERTY(SVGMarkerElement, SVGNames::refXAttr, SVGLength, RefX, refX) diff --git a/WebCore/svg/SVGMaskElement.cpp b/WebCore/svg/SVGMaskElement.cpp index 4f245ce..78c3732 100644 --- a/WebCore/svg/SVGMaskElement.cpp +++ b/WebCore/svg/SVGMaskElement.cpp @@ -38,11 +38,8 @@ using namespace std; namespace WebCore { -SVGMaskElement::SVGMaskElement(const QualifiedName& tagName, Document* doc) - : SVGStyledLocatableElement(tagName, doc) - , SVGTests() - , SVGLangSpace() - , SVGExternalResourcesRequired() +inline SVGMaskElement::SVGMaskElement(const QualifiedName& tagName, Document* document) + : SVGStyledLocatableElement(tagName, document) , m_maskUnits(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) , m_maskContentUnits(SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE) , m_x(LengthModeWidth, "-10%") @@ -54,8 +51,9 @@ SVGMaskElement::SVGMaskElement(const QualifiedName& tagName, Document* doc) // Spec: If the width/height attribute is not specified, the effect is as if a value of "120%" were specified. } -SVGMaskElement::~SVGMaskElement() +PassRefPtr<SVGMaskElement> SVGMaskElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGMaskElement(tagName, document)); } void SVGMaskElement::parseMappedAttribute(Attribute* attr) diff --git a/WebCore/svg/SVGMaskElement.h b/WebCore/svg/SVGMaskElement.h index 91d9bc9..c951beb 100644 --- a/WebCore/svg/SVGMaskElement.h +++ b/WebCore/svg/SVGMaskElement.h @@ -36,13 +36,16 @@ namespace WebCore { public SVGLangSpace, public SVGExternalResourcesRequired { public: + static PassRefPtr<SVGMaskElement> create(const QualifiedName&, Document*); + + FloatRect maskBoundingBox(const FloatRect&) const; + + private: SVGMaskElement(const QualifiedName&, Document*); - virtual ~SVGMaskElement(); virtual bool isValid() const { return SVGTests::isValid(); } virtual bool needsPendingResourceHandling() const { return false; } - FloatRect maskBoundingBox(const FloatRect&) const; virtual void parseMappedAttribute(Attribute*); virtual void svgAttributeChanged(const QualifiedName&); virtual void synchronizeProperty(const QualifiedName&); @@ -50,7 +53,6 @@ namespace WebCore { virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); - private: virtual bool selfHasRelativeLengths() const; DECLARE_ANIMATED_PROPERTY(SVGMaskElement, SVGNames::maskUnitsAttr, int, MaskUnits, maskUnits) diff --git a/WebCore/svg/SVGMetadataElement.cpp b/WebCore/svg/SVGMetadataElement.cpp index 28a34d6..6db3806 100644 --- a/WebCore/svg/SVGMetadataElement.cpp +++ b/WebCore/svg/SVGMetadataElement.cpp @@ -22,15 +22,18 @@ #if ENABLE(SVG) #include "SVGMetadataElement.h" -using namespace WebCore; +namespace WebCore { -SVGMetadataElement::SVGMetadataElement(const QualifiedName& tagName, Document *doc) -: SVGElement(tagName, doc) +inline SVGMetadataElement::SVGMetadataElement(const QualifiedName& tagName, Document* document) + : SVGElement(tagName, document) { } -SVGMetadataElement::~SVGMetadataElement() +PassRefPtr<SVGMetadataElement> SVGMetadataElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGMetadataElement(tagName, document)); +} + } #endif // ENABLE(SVG) diff --git a/WebCore/svg/SVGMetadataElement.h b/WebCore/svg/SVGMetadataElement.h index 6323f12..4cac5bc 100644 --- a/WebCore/svg/SVGMetadataElement.h +++ b/WebCore/svg/SVGMetadataElement.h @@ -25,10 +25,13 @@ #include "SVGElement.h" namespace WebCore { + class SVGMetadataElement : public SVGElement { public: + static PassRefPtr<SVGMetadataElement> create(const QualifiedName&, Document*); + + private: SVGMetadataElement(const QualifiedName&, Document*); - virtual ~SVGMetadataElement(); }; } // namespace WebCore diff --git a/WebCore/svg/SVGMissingGlyphElement.cpp b/WebCore/svg/SVGMissingGlyphElement.cpp index 3fe531c..4c80494 100644 --- a/WebCore/svg/SVGMissingGlyphElement.cpp +++ b/WebCore/svg/SVGMissingGlyphElement.cpp @@ -24,11 +24,16 @@ namespace WebCore { -SVGMissingGlyphElement::SVGMissingGlyphElement(const QualifiedName& tagName, Document* doc) - : SVGStyledElement(tagName, doc) +inline SVGMissingGlyphElement::SVGMissingGlyphElement(const QualifiedName& tagName, Document* document) + : SVGStyledElement(tagName, document) { } +PassRefPtr<SVGMissingGlyphElement> SVGMissingGlyphElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new SVGMissingGlyphElement(tagName, document)); +} + } #endif // ENABLE(SVG_FONTS) diff --git a/WebCore/svg/SVGMissingGlyphElement.h b/WebCore/svg/SVGMissingGlyphElement.h index 9dde843..ecae295 100644 --- a/WebCore/svg/SVGMissingGlyphElement.h +++ b/WebCore/svg/SVGMissingGlyphElement.h @@ -24,8 +24,12 @@ #include "SVGStyledElement.h" namespace WebCore { + class SVGMissingGlyphElement : public SVGStyledElement { public: + static PassRefPtr<SVGMissingGlyphElement> create(const QualifiedName&, Document*); + + private: SVGMissingGlyphElement(const QualifiedName&, Document*); virtual bool rendererIsNeeded(RenderStyle*) { return false; } diff --git a/WebCore/svg/SVGNumberList.cpp b/WebCore/svg/SVGNumberList.cpp index 0603af7..96fe55f 100644 --- a/WebCore/svg/SVGNumberList.cpp +++ b/WebCore/svg/SVGNumberList.cpp @@ -32,10 +32,6 @@ SVGNumberList::SVGNumberList(const QualifiedName& attributeName) { } -SVGNumberList::~SVGNumberList() -{ -} - void SVGNumberList::parse(const String& value) { ExceptionCode ec = 0; diff --git a/WebCore/svg/SVGNumberList.h b/WebCore/svg/SVGNumberList.h index fa29356..e64b0b7 100644 --- a/WebCore/svg/SVGNumberList.h +++ b/WebCore/svg/SVGNumberList.h @@ -31,7 +31,6 @@ namespace WebCore { class SVGNumberList : public SVGPODList<float> { public: static PassRefPtr<SVGNumberList> create(const QualifiedName& attributeName) { return adoptRef(new SVGNumberList(attributeName)); } - virtual ~SVGNumberList(); void parse(const String& value); diff --git a/WebCore/svg/SVGPaint.cpp b/WebCore/svg/SVGPaint.cpp index a2100aa..b36e97d 100644 --- a/WebCore/svg/SVGPaint.cpp +++ b/WebCore/svg/SVGPaint.cpp @@ -63,10 +63,6 @@ SVGPaint::SVGPaint(const String& uri, const Color& c) setUri(uri); } -SVGPaint::~SVGPaint() -{ -} - SVGPaint* SVGPaint::defaultFill() { static SVGPaint* staticDefaultFill = create(Color::black).releaseRef(); diff --git a/WebCore/svg/SVGPaint.h b/WebCore/svg/SVGPaint.h index e86c315..f0ceb4c 100644 --- a/WebCore/svg/SVGPaint.h +++ b/WebCore/svg/SVGPaint.h @@ -64,16 +64,12 @@ namespace WebCore { return adoptRef(new SVGPaint(uri, color)); } - virtual ~SVGPaint(); - // 'SVGPaint' functions SVGPaintType paintType() const { return m_paintType; } String uri() const; void setUri(const String&); void setPaint(SVGPaintType, const String& uri, const String& rgbPaint, const String& iccPaint, ExceptionCode&); - - virtual String cssText() const; static SVGPaint* defaultFill(); static SVGPaint* defaultStroke(); @@ -90,6 +86,8 @@ namespace WebCore { virtual bool isSVGPaint() const { return true; } + virtual String cssText() const; + SVGPaintType m_paintType; String m_uri; }; diff --git a/WebCore/svg/SVGParserUtilities.cpp b/WebCore/svg/SVGParserUtilities.cpp index 5bf2fbc..b8b6d85 100644 --- a/WebCore/svg/SVGParserUtilities.cpp +++ b/WebCore/svg/SVGParserUtilities.cpp @@ -34,11 +34,10 @@ namespace WebCore { -/* We use this generic _parseNumber function to allow the Path parsing code to work - * at a higher precision internally, without any unnecessary runtime cost or code - * complexity - */ -template <typename FloatType> static bool _parseNumber(const UChar*& ptr, const UChar* end, FloatType& number, bool skip) +// We use this generic parseNumber function to allow the Path parsing code to work +// at a higher precision internally, without any unnecessary runtime cost or code +// complexity. +template <typename FloatType> static bool genericParseNumber(const UChar*& ptr, const UChar* end, FloatType& number, bool skip) { int exponent; FloatType integer, decimal, frac; @@ -127,7 +126,7 @@ template <typename FloatType> static bool _parseNumber(const UChar*& ptr, const bool parseNumber(const UChar*& ptr, const UChar* end, float& number, bool skip) { - return _parseNumber(ptr, end, number, skip); + return genericParseNumber(ptr, end, number, skip); } // only used to parse largeArcFlag and sweepFlag which must be a "0" or "1" diff --git a/WebCore/svg/SVGPathBlender.cpp b/WebCore/svg/SVGPathBlender.cpp index 8320890..d46e24a 100644 --- a/WebCore/svg/SVGPathBlender.cpp +++ b/WebCore/svg/SVGPathBlender.cpp @@ -34,10 +34,6 @@ SVGPathBlender::SVGPathBlender() { } -SVGPathBlender::~SVGPathBlender() -{ -} - float SVGPathBlender::blendAnimatedFloat(float from, float to) { return (to - from) * m_progress + from; diff --git a/WebCore/svg/SVGPathBlender.h b/WebCore/svg/SVGPathBlender.h index a15c0ad..c0ae7f3 100644 --- a/WebCore/svg/SVGPathBlender.h +++ b/WebCore/svg/SVGPathBlender.h @@ -30,7 +30,6 @@ namespace WebCore { class SVGPathBlender : public Noncopyable { public: SVGPathBlender(); - ~SVGPathBlender(); bool blendAnimatedPath(float, SVGPathSource*, SVGPathSource*, SVGPathConsumer*); void cleanup(); diff --git a/WebCore/svg/SVGPathBuilder.h b/WebCore/svg/SVGPathBuilder.h index 38eabd4..f3c2632 100644 --- a/WebCore/svg/SVGPathBuilder.h +++ b/WebCore/svg/SVGPathBuilder.h @@ -36,18 +36,18 @@ public: SVGPathBuilder(); void setCurrentPath(Path* path) { m_path = path; } + +private: virtual void incrementPathSegmentCount() { } virtual bool continueConsuming() { return true; } virtual void cleanup() { m_path = 0; } -private: // Used in UnalteredParisng/NormalizedParsing modes. virtual void moveTo(const FloatPoint&, bool closed, PathCoordinateMode); virtual void lineTo(const FloatPoint&, PathCoordinateMode); virtual void curveToCubic(const FloatPoint&, const FloatPoint&, const FloatPoint&, PathCoordinateMode); virtual void closePath(); -private: // Only used in UnalteredParsing mode. virtual void lineToHorizontal(float, PathCoordinateMode) { ASSERT_NOT_REACHED(); } virtual void lineToVertical(float, PathCoordinateMode) { ASSERT_NOT_REACHED(); } diff --git a/WebCore/svg/SVGPathByteStreamBuilder.h b/WebCore/svg/SVGPathByteStreamBuilder.h index c89856f..55803aa 100644 --- a/WebCore/svg/SVGPathByteStreamBuilder.h +++ b/WebCore/svg/SVGPathByteStreamBuilder.h @@ -34,18 +34,18 @@ public: SVGPathByteStreamBuilder(); void setCurrentByteStream(SVGPathByteStream* byteStream) { m_byteStream = byteStream; } + +private: virtual void incrementPathSegmentCount() { } virtual bool continueConsuming() { return true; } virtual void cleanup() { m_byteStream = 0; } -private: // Used in UnalteredParsing/NormalizedParsing modes. virtual void moveTo(const FloatPoint&, bool closed, PathCoordinateMode); virtual void lineTo(const FloatPoint&, PathCoordinateMode); virtual void curveToCubic(const FloatPoint&, const FloatPoint&, const FloatPoint&, PathCoordinateMode); virtual void closePath(); -private: // Only used in UnalteredParsing mode. virtual void lineToHorizontal(float, PathCoordinateMode); virtual void lineToVertical(float, PathCoordinateMode); @@ -54,7 +54,6 @@ private: virtual void curveToQuadraticSmooth(const FloatPoint&, PathCoordinateMode); virtual void arcTo(float, float, float, bool largeArcFlag, bool sweepFlag, const FloatPoint&, PathCoordinateMode); -private: template<typename ByteType> void writeType(const ByteType& type) { diff --git a/WebCore/svg/SVGPathByteStreamSource.cpp b/WebCore/svg/SVGPathByteStreamSource.cpp index e6a60e3..d0475f3 100644 --- a/WebCore/svg/SVGPathByteStreamSource.cpp +++ b/WebCore/svg/SVGPathByteStreamSource.cpp @@ -32,10 +32,6 @@ SVGPathByteStreamSource::SVGPathByteStreamSource(SVGPathByteStream* stream) m_streamEnd = stream->end(); } -SVGPathByteStreamSource::~SVGPathByteStreamSource() -{ -} - bool SVGPathByteStreamSource::hasMoreData() const { return m_streamCurrent < m_streamEnd; diff --git a/WebCore/svg/SVGPathByteStreamSource.h b/WebCore/svg/SVGPathByteStreamSource.h index 2537ad2..6895c73 100644 --- a/WebCore/svg/SVGPathByteStreamSource.h +++ b/WebCore/svg/SVGPathByteStreamSource.h @@ -35,7 +35,8 @@ public: return adoptPtr(new SVGPathByteStreamSource(stream)); } - virtual ~SVGPathByteStreamSource(); +private: + SVGPathByteStreamSource(SVGPathByteStream*); virtual bool hasMoreData() const; virtual bool moveToNextToken() { return true; } @@ -52,9 +53,6 @@ public: virtual bool parseCurveToQuadraticSmoothSegment(FloatPoint&); virtual bool parseArcToSegment(float&, float&, float&, bool&, bool&, FloatPoint&); -private: - SVGPathByteStreamSource(SVGPathByteStream*); - #if COMPILER(MSVC) #pragma warning(disable: 4701) #endif diff --git a/WebCore/svg/SVGPathConsumer.h b/WebCore/svg/SVGPathConsumer.h index 629c1bf..b7c5e73 100644 --- a/WebCore/svg/SVGPathConsumer.h +++ b/WebCore/svg/SVGPathConsumer.h @@ -46,14 +46,12 @@ public: virtual bool continueConsuming() = 0; virtual void cleanup() = 0; -public: // Used in UnalteredParisng/NormalizedParsing modes. virtual void moveTo(const FloatPoint&, bool closed, PathCoordinateMode) = 0; virtual void lineTo(const FloatPoint&, PathCoordinateMode) = 0; virtual void curveToCubic(const FloatPoint&, const FloatPoint&, const FloatPoint&, PathCoordinateMode) = 0; virtual void closePath() = 0; -public: // Only used in UnalteredParsing mode. virtual void lineToHorizontal(float, PathCoordinateMode) = 0; virtual void lineToVertical(float, PathCoordinateMode) = 0; @@ -63,7 +61,6 @@ public: virtual void arcTo(float, float, float, bool largeArcFlag, bool sweepFlag, const FloatPoint&, PathCoordinateMode) = 0; protected: - SVGPathConsumer() { } virtual ~SVGPathConsumer() { } }; diff --git a/WebCore/svg/SVGPathElement.cpp b/WebCore/svg/SVGPathElement.cpp index 6d801fb..3ed85a3 100644 --- a/WebCore/svg/SVGPathElement.cpp +++ b/WebCore/svg/SVGPathElement.cpp @@ -44,16 +44,14 @@ namespace WebCore { -SVGPathElement::SVGPathElement(const QualifiedName& tagName, Document* doc) - : SVGStyledTransformableElement(tagName, doc) - , SVGTests() - , SVGLangSpace() - , SVGExternalResourcesRequired() +inline SVGPathElement::SVGPathElement(const QualifiedName& tagName, Document* document) + : SVGStyledTransformableElement(tagName, document) { } -SVGPathElement::~SVGPathElement() +PassRefPtr<SVGPathElement> SVGPathElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGPathElement(tagName, document)); } float SVGPathElement::getTotalLength() diff --git a/WebCore/svg/SVGPathElement.h b/WebCore/svg/SVGPathElement.h index 07612c6..cc4e7bd 100644 --- a/WebCore/svg/SVGPathElement.h +++ b/WebCore/svg/SVGPathElement.h @@ -50,16 +50,15 @@ namespace WebCore { class SVGPathSegCurvetoCubicSmoothRel; class SVGPathSegCurvetoQuadraticSmoothAbs; class SVGPathSegCurvetoQuadraticSmoothRel; + class SVGPathElement : public SVGStyledTransformableElement, public SVGTests, public SVGLangSpace, public SVGExternalResourcesRequired, public SVGAnimatedPathData { public: - SVGPathElement(const QualifiedName&, Document*); - virtual ~SVGPathElement(); + static PassRefPtr<SVGPathElement> create(const QualifiedName&, Document*); - virtual bool isValid() const { return SVGTests::isValid(); } float getTotalLength(); FloatPoint getPointAtLength(float distance); unsigned long getPathSegAtLength(float distance); @@ -90,15 +89,19 @@ namespace WebCore { virtual SVGPathSegList* animatedPathSegList() const; virtual SVGPathSegList* animatedNormalizedPathSegList() const; + virtual Path toPathData() const; + + private: + SVGPathElement(const QualifiedName&, Document*); + + virtual bool isValid() const { return SVGTests::isValid(); } + virtual void parseMappedAttribute(Attribute*); virtual void svgAttributeChanged(const QualifiedName&); virtual void synchronizeProperty(const QualifiedName&); - virtual Path toPathData() const; - virtual bool supportsMarkers() const { return true; } - private: mutable RefPtr<SVGPathSegList> m_pathSegList; DECLARE_ANIMATED_PROPERTY(SVGPathElement, SVGNames::pathLengthAttr, float, PathLength, pathLength) diff --git a/WebCore/svg/SVGPathParser.cpp b/WebCore/svg/SVGPathParser.cpp index 66bd00f..a0d6847 100644 --- a/WebCore/svg/SVGPathParser.cpp +++ b/WebCore/svg/SVGPathParser.cpp @@ -38,10 +38,6 @@ SVGPathParser::SVGPathParser() { } -SVGPathParser::~SVGPathParser() -{ -} - void SVGPathParser::parseClosePathSegment() { // Reset m_currentPoint for the next path. diff --git a/WebCore/svg/SVGPathParser.h b/WebCore/svg/SVGPathParser.h index 5393fc2..7679a95 100644 --- a/WebCore/svg/SVGPathParser.h +++ b/WebCore/svg/SVGPathParser.h @@ -37,7 +37,6 @@ namespace WebCore { class SVGPathParser : public Noncopyable { public: SVGPathParser(); - ~SVGPathParser(); bool parsePathDataFromSource(PathParsingMode pathParsingMode); void setCurrentConsumer(SVGPathConsumer* consumer) { m_consumer = consumer; } diff --git a/WebCore/svg/SVGPathSeg.cpp b/WebCore/svg/SVGPathSeg.cpp index 56ee56c..5939976 100644 --- a/WebCore/svg/SVGPathSeg.cpp +++ b/WebCore/svg/SVGPathSeg.cpp @@ -31,20 +31,6 @@ namespace WebCore { -SVGPathSeg::~SVGPathSeg() -{ -} - -unsigned short SVGPathSeg::pathSegType() const -{ - return PATHSEG_UNKNOWN; -} - -String SVGPathSeg::pathSegTypeAsLetter() const -{ - return ""; -} - const QualifiedName& SVGPathSeg::associatedAttributeName() const { return SVGNames::dAttr; diff --git a/WebCore/svg/SVGPathSeg.h b/WebCore/svg/SVGPathSeg.h index 6c4db89..a2cf261 100644 --- a/WebCore/svg/SVGPathSeg.h +++ b/WebCore/svg/SVGPathSeg.h @@ -50,13 +50,11 @@ enum SVGPathSegType { PathSegCurveToQuadraticSmoothRel = 19 }; -class SVGPathElement; -class SVGStyledElement; class QualifiedName; class SVGPathSeg : public RefCounted<SVGPathSeg> { public: - virtual ~SVGPathSeg(); + virtual ~SVGPathSeg() { } // Forward declare these enums in the w3c naming scheme, for IDL generation enum { @@ -83,29 +81,27 @@ public: }; - virtual unsigned short pathSegType() const; - virtual String pathSegTypeAsLetter() const; + virtual unsigned short pathSegType() const = 0; + virtual String pathSegTypeAsLetter() const = 0; const QualifiedName& associatedAttributeName() const; - -protected: - SVGPathSeg() { } }; class SVGPathSegSingleCoord : public SVGPathSeg { public: - SVGPathSegSingleCoord(float x, float y) - : m_x(x) - , m_y(y) - { - } - void setX(float x) { m_x = x; } float x() const { return m_x; } void setY(float y) { m_y = y; } float y() const { return m_y; } +protected: + SVGPathSegSingleCoord(float x, float y) + : m_x(x) + , m_y(y) + { + } + private: float m_x; float m_y; diff --git a/WebCore/svg/SVGPathSegArc.h b/WebCore/svg/SVGPathSegArc.h index c7bbbb0..5d5c332 100644 --- a/WebCore/svg/SVGPathSegArc.h +++ b/WebCore/svg/SVGPathSegArc.h @@ -80,11 +80,11 @@ namespace WebCore { return adoptRef(new SVGPathSegArcAbs(x, y, r1, r2, angle, largeArcFlag, sweepFlag)); } - virtual unsigned short pathSegType() const { return PATHSEG_ARC_ABS; } - virtual String pathSegTypeAsLetter() const { return "A"; } - private: SVGPathSegArcAbs(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag); + + virtual unsigned short pathSegType() const { return PATHSEG_ARC_ABS; } + virtual String pathSegTypeAsLetter() const { return "A"; } }; class SVGPathSegArcRel : public SVGPathSegArc { @@ -94,11 +94,11 @@ namespace WebCore { return adoptRef(new SVGPathSegArcRel(x, y, r1, r2, angle, largeArcFlag, sweepFlag)); } - virtual unsigned short pathSegType() const { return PATHSEG_ARC_REL; } - virtual String pathSegTypeAsLetter() const { return "a"; } - private: SVGPathSegArcRel(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag); + + virtual unsigned short pathSegType() const { return PATHSEG_ARC_REL; } + virtual String pathSegTypeAsLetter() const { return "a"; } }; } // namespace WebCore diff --git a/WebCore/svg/SVGPathSegClosePath.cpp b/WebCore/svg/SVGPathSegClosePath.cpp index d3c8c3b..6f54888 100644 --- a/WebCore/svg/SVGPathSegClosePath.cpp +++ b/WebCore/svg/SVGPathSegClosePath.cpp @@ -1,41 +1 @@ -/* - * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> - * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.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 - * 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 "SVGPathSegClosePath.h" - -namespace WebCore { - -SVGPathSegClosePath::SVGPathSegClosePath() - : SVGPathSeg() -{ -} - -SVGPathSegClosePath::~SVGPathSegClosePath() -{ -} - -} - -#endif // ENABLE(SVG) - -// vim:ts=4:noet +// This file is now intentionally empty. Delete it after removing it from all the build systems and project files. diff --git a/WebCore/svg/SVGPathSegClosePath.h b/WebCore/svg/SVGPathSegClosePath.h index 635c970..8f074ed 100644 --- a/WebCore/svg/SVGPathSegClosePath.h +++ b/WebCore/svg/SVGPathSegClosePath.h @@ -31,13 +31,12 @@ namespace WebCore { class SVGPathSegClosePath : public SVGPathSeg { public: static PassRefPtr<SVGPathSegClosePath> create() { return adoptRef(new SVGPathSegClosePath); } - virtual ~SVGPathSegClosePath(); + +private: + SVGPathSegClosePath() { } virtual unsigned short pathSegType() const { return PATHSEG_CLOSEPATH; } virtual String pathSegTypeAsLetter() const { return "Z"; } - -private: - SVGPathSegClosePath(); }; } // namespace WebCore diff --git a/WebCore/svg/SVGPathSegCurvetoCubic.h b/WebCore/svg/SVGPathSegCurvetoCubic.h index 7e2735e..ae4a21d 100644 --- a/WebCore/svg/SVGPathSegCurvetoCubic.h +++ b/WebCore/svg/SVGPathSegCurvetoCubic.h @@ -30,7 +30,7 @@ namespace WebCore { class SVGPathSegCurvetoCubic : public SVGPathSeg { public: - SVGPathSegCurvetoCubic(float x, float y, float x1, float y1, float x2, float y2) : SVGPathSeg() , m_x(x) , m_y(y) , m_x1(x1) , m_y1(y1) , m_x2(x2) , m_y2(y2) {} + SVGPathSegCurvetoCubic(float x, float y, float x1, float y1, float x2, float y2) : m_x(x), m_y(y), m_x1(x1), m_y1(y1), m_x2(x2), m_y2(y2) { } void setX(float x) { m_x = x; } float x() const { return m_x; } @@ -66,11 +66,11 @@ namespace WebCore { return adoptRef(new SVGPathSegCurvetoCubicAbs(x, y, x1, y1, x2, y2)); } - virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_CUBIC_ABS; } - virtual String pathSegTypeAsLetter() const { return "C"; } - private: SVGPathSegCurvetoCubicAbs(float x, float y, float x1, float y1, float x2, float y2); + + virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_CUBIC_ABS; } + virtual String pathSegTypeAsLetter() const { return "C"; } }; class SVGPathSegCurvetoCubicRel : public SVGPathSegCurvetoCubic { @@ -80,11 +80,11 @@ namespace WebCore { return adoptRef(new SVGPathSegCurvetoCubicRel(x, y, x1, y1, x2, y2)); } - virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_CUBIC_REL; } - virtual String pathSegTypeAsLetter() const { return "c"; } - private: SVGPathSegCurvetoCubicRel(float x, float y, float x1, float y1, float x2, float y2); + + virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_CUBIC_REL; } + virtual String pathSegTypeAsLetter() const { return "c"; } }; } // namespace WebCore diff --git a/WebCore/svg/SVGPathSegCurvetoCubicSmooth.h b/WebCore/svg/SVGPathSegCurvetoCubicSmooth.h index bc8895c..2227951 100644 --- a/WebCore/svg/SVGPathSegCurvetoCubicSmooth.h +++ b/WebCore/svg/SVGPathSegCurvetoCubicSmooth.h @@ -31,7 +31,12 @@ namespace WebCore { class SVGPathSegCurvetoCubicSmooth : public SVGPathSeg { public: SVGPathSegCurvetoCubicSmooth(float x, float y, float x2, float y2) - : m_x(x), m_y(y), m_x2(x2), m_y2(y2) { } + : m_x(x) + , m_y(y) + , m_x2(x2) + , m_y2(y2) + { + } void setX(float x) { m_x = x; } float x() const { return m_x; } @@ -56,22 +61,22 @@ namespace WebCore { public: static PassRefPtr<SVGPathSegCurvetoCubicSmoothAbs> create(float x, float y, float x2, float y2) { return adoptRef(new SVGPathSegCurvetoCubicSmoothAbs(x, y, x2, y2)); } - virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_CUBIC_SMOOTH_ABS; } - virtual String pathSegTypeAsLetter() const { return "S"; } - private: SVGPathSegCurvetoCubicSmoothAbs(float x, float y, float x2, float y2); + + virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_CUBIC_SMOOTH_ABS; } + virtual String pathSegTypeAsLetter() const { return "S"; } }; class SVGPathSegCurvetoCubicSmoothRel : public SVGPathSegCurvetoCubicSmooth { public: static PassRefPtr<SVGPathSegCurvetoCubicSmoothRel> create(float x, float y, float x2, float y2) { return adoptRef(new SVGPathSegCurvetoCubicSmoothRel(x, y, x2, y2)); } - virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_CUBIC_SMOOTH_REL; } - virtual String pathSegTypeAsLetter() const { return "s"; } - private: SVGPathSegCurvetoCubicSmoothRel(float x, float y, float x2, float y2); + + virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_CUBIC_SMOOTH_REL; } + virtual String pathSegTypeAsLetter() const { return "s"; } }; } // namespace WebCore diff --git a/WebCore/svg/SVGPathSegCurvetoQuadratic.h b/WebCore/svg/SVGPathSegCurvetoQuadratic.h index 967442f..f84cfaa 100644 --- a/WebCore/svg/SVGPathSegCurvetoQuadratic.h +++ b/WebCore/svg/SVGPathSegCurvetoQuadratic.h @@ -31,7 +31,12 @@ namespace WebCore { class SVGPathSegCurvetoQuadratic : public SVGPathSeg { public: SVGPathSegCurvetoQuadratic(float x, float y, float x1, float y1) - : SVGPathSeg(), m_x(x), m_y(y), m_x1(x1), m_y1(y1) {} + : m_x(x) + , m_y(y) + , m_x1(x1) + , m_y1(y1) + { + } void setX(float x) { m_x = x; } float x() const { return m_x; } @@ -56,22 +61,22 @@ namespace WebCore { public: static PassRefPtr<SVGPathSegCurvetoQuadraticAbs> create(float x, float y, float x1, float y1) { return adoptRef(new SVGPathSegCurvetoQuadraticAbs(x, y, x1, y1)); } - virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_QUADRATIC_ABS; } - virtual String pathSegTypeAsLetter() const { return "Q"; } - private: SVGPathSegCurvetoQuadraticAbs(float x, float y, float x1, float y1); + + virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_QUADRATIC_ABS; } + virtual String pathSegTypeAsLetter() const { return "Q"; } }; class SVGPathSegCurvetoQuadraticRel : public SVGPathSegCurvetoQuadratic { public: static PassRefPtr<SVGPathSegCurvetoQuadraticRel> create(float x, float y, float x1, float y1) { return adoptRef(new SVGPathSegCurvetoQuadraticRel(x, y, x1, y1)); } - virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_QUADRATIC_REL; } - virtual String pathSegTypeAsLetter() const { return "q"; } - private: SVGPathSegCurvetoQuadraticRel(float x, float y, float x1, float y1); + + virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_QUADRATIC_REL; } + virtual String pathSegTypeAsLetter() const { return "q"; } }; } // namespace WebCore diff --git a/WebCore/svg/SVGPathSegCurvetoQuadraticSmooth.h b/WebCore/svg/SVGPathSegCurvetoQuadraticSmooth.h index fb3d51f..109799e 100644 --- a/WebCore/svg/SVGPathSegCurvetoQuadraticSmooth.h +++ b/WebCore/svg/SVGPathSegCurvetoQuadraticSmooth.h @@ -32,22 +32,22 @@ namespace WebCore { public: static PassRefPtr<SVGPathSegCurvetoQuadraticSmoothAbs> create(float x, float y) { return adoptRef(new SVGPathSegCurvetoQuadraticSmoothAbs(x, y)); } - virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS; } - virtual String pathSegTypeAsLetter() const { return "T"; } - private: SVGPathSegCurvetoQuadraticSmoothAbs(float x, float y); + + virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS; } + virtual String pathSegTypeAsLetter() const { return "T"; } }; class SVGPathSegCurvetoQuadraticSmoothRel : public SVGPathSegSingleCoord { public: static PassRefPtr<SVGPathSegCurvetoQuadraticSmoothRel> create(float x, float y) { return adoptRef(new SVGPathSegCurvetoQuadraticSmoothRel(x, y)); } - virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL; } - virtual String pathSegTypeAsLetter() const { return "t"; } - private: SVGPathSegCurvetoQuadraticSmoothRel(float x, float y); + + virtual unsigned short pathSegType() const { return PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL; } + virtual String pathSegTypeAsLetter() const { return "t"; } }; } // namespace WebCore diff --git a/WebCore/svg/SVGPathSegLineto.h b/WebCore/svg/SVGPathSegLineto.h index 9b69bf0..3cd3b7f 100644 --- a/WebCore/svg/SVGPathSegLineto.h +++ b/WebCore/svg/SVGPathSegLineto.h @@ -27,27 +27,27 @@ #include "SVGPathSeg.h" namespace WebCore { + class SVGPathSegLinetoAbs : public SVGPathSegSingleCoord { public: static PassRefPtr<SVGPathSegLinetoAbs> create(float x, float y) { return adoptRef(new SVGPathSegLinetoAbs(x, y)); } - virtual unsigned short pathSegType() const { return PATHSEG_LINETO_ABS; } - virtual String pathSegTypeAsLetter() const { return "L"; } - private: SVGPathSegLinetoAbs(float x, float y); + + virtual unsigned short pathSegType() const { return PATHSEG_LINETO_ABS; } + virtual String pathSegTypeAsLetter() const { return "L"; } }; class SVGPathSegLinetoRel : public SVGPathSegSingleCoord { public: static PassRefPtr<SVGPathSegLinetoRel> create(float x, float y) { return adoptRef(new SVGPathSegLinetoRel(x, y)); } + private: + SVGPathSegLinetoRel(float x, float y); virtual unsigned short pathSegType() const { return PATHSEG_LINETO_REL; } virtual String pathSegTypeAsLetter() const { return "l"; } - - private: - SVGPathSegLinetoRel(float x, float y); }; } // namespace WebCore diff --git a/WebCore/svg/SVGPathSegLinetoHorizontal.h b/WebCore/svg/SVGPathSegLinetoHorizontal.h index 3a16ad1..da59f05 100644 --- a/WebCore/svg/SVGPathSegLinetoHorizontal.h +++ b/WebCore/svg/SVGPathSegLinetoHorizontal.h @@ -43,22 +43,22 @@ namespace WebCore { public: static PassRefPtr<SVGPathSegLinetoHorizontalAbs> create(float x) { return adoptRef(new SVGPathSegLinetoHorizontalAbs(x)); } - virtual unsigned short pathSegType() const { return PATHSEG_LINETO_HORIZONTAL_ABS; } - virtual String pathSegTypeAsLetter() const { return "H"; } - private: SVGPathSegLinetoHorizontalAbs(float x); + + virtual unsigned short pathSegType() const { return PATHSEG_LINETO_HORIZONTAL_ABS; } + virtual String pathSegTypeAsLetter() const { return "H"; } }; class SVGPathSegLinetoHorizontalRel : public SVGPathSegLinetoHorizontal { public: static PassRefPtr<SVGPathSegLinetoHorizontalRel> create(float x) { return adoptRef(new SVGPathSegLinetoHorizontalRel(x)); } - virtual unsigned short pathSegType() const { return PATHSEG_LINETO_HORIZONTAL_REL; } - virtual String pathSegTypeAsLetter() const { return "h"; } - private: SVGPathSegLinetoHorizontalRel(float x); + + virtual unsigned short pathSegType() const { return PATHSEG_LINETO_HORIZONTAL_REL; } + virtual String pathSegTypeAsLetter() const { return "h"; } }; } // namespace WebCore diff --git a/WebCore/svg/SVGPathSegLinetoVertical.h b/WebCore/svg/SVGPathSegLinetoVertical.h index d4d9f85..b13b9f4 100644 --- a/WebCore/svg/SVGPathSegLinetoVertical.h +++ b/WebCore/svg/SVGPathSegLinetoVertical.h @@ -43,22 +43,22 @@ namespace WebCore { public: static PassRefPtr<SVGPathSegLinetoVerticalAbs> create(float y) { return adoptRef(new SVGPathSegLinetoVerticalAbs(y)); } - virtual unsigned short pathSegType() const { return PATHSEG_LINETO_VERTICAL_ABS; } - virtual String pathSegTypeAsLetter() const { return "V"; } - private: SVGPathSegLinetoVerticalAbs(float y); + + virtual unsigned short pathSegType() const { return PATHSEG_LINETO_VERTICAL_ABS; } + virtual String pathSegTypeAsLetter() const { return "V"; } }; class SVGPathSegLinetoVerticalRel : public SVGPathSegLinetoVertical { public: static PassRefPtr<SVGPathSegLinetoVerticalRel> create(float y) { return adoptRef(new SVGPathSegLinetoVerticalRel(y)); } - virtual unsigned short pathSegType() const { return PATHSEG_LINETO_VERTICAL_REL; } - virtual String pathSegTypeAsLetter() const { return "v"; } - private: SVGPathSegLinetoVerticalRel(float y); + + virtual unsigned short pathSegType() const { return PATHSEG_LINETO_VERTICAL_REL; } + virtual String pathSegTypeAsLetter() const { return "v"; } }; } // namespace WebCore diff --git a/WebCore/svg/SVGPathSegList.cpp b/WebCore/svg/SVGPathSegList.cpp index 3b86f55..5a40c64 100644 --- a/WebCore/svg/SVGPathSegList.cpp +++ b/WebCore/svg/SVGPathSegList.cpp @@ -32,10 +32,6 @@ SVGPathSegList::SVGPathSegList(const QualifiedName& attributeName) { } -SVGPathSegList::~SVGPathSegList() -{ -} - } #endif // ENABLE(SVG) diff --git a/WebCore/svg/SVGPathSegList.h b/WebCore/svg/SVGPathSegList.h index f27c653..6e61c06 100644 --- a/WebCore/svg/SVGPathSegList.h +++ b/WebCore/svg/SVGPathSegList.h @@ -31,7 +31,6 @@ class SVGElement; class SVGPathSegList : public SVGList<RefPtr<SVGPathSeg> > { public: static PassRefPtr<SVGPathSegList> create(const QualifiedName& attributeName) { return adoptRef(new SVGPathSegList(attributeName)); } - virtual ~SVGPathSegList(); private: SVGPathSegList(const QualifiedName&); diff --git a/WebCore/svg/SVGPathSegListBuilder.h b/WebCore/svg/SVGPathSegListBuilder.h index 2fd2667..f376706 100644 --- a/WebCore/svg/SVGPathSegListBuilder.h +++ b/WebCore/svg/SVGPathSegListBuilder.h @@ -36,18 +36,18 @@ public: SVGPathSegListBuilder(); void setCurrentSVGPathSegList(SVGPathSegList* pathSegList) { m_pathSegList = pathSegList; } + +private: virtual void incrementPathSegmentCount() { } virtual bool continueConsuming() { return true; } virtual void cleanup() { m_pathSegList = 0; } -private: // Used in UnalteredParisng/NormalizedParsing modes. virtual void moveTo(const FloatPoint&, bool closed, PathCoordinateMode); virtual void lineTo(const FloatPoint&, PathCoordinateMode); virtual void curveToCubic(const FloatPoint&, const FloatPoint&, const FloatPoint&, PathCoordinateMode); virtual void closePath(); -private: // Only used in UnalteredParsing mode. virtual void lineToHorizontal(float, PathCoordinateMode); virtual void lineToVertical(float, PathCoordinateMode); diff --git a/WebCore/svg/SVGPathSegListSource.cpp b/WebCore/svg/SVGPathSegListSource.cpp index 48fa094..2378743 100644 --- a/WebCore/svg/SVGPathSegListSource.cpp +++ b/WebCore/svg/SVGPathSegListSource.cpp @@ -39,10 +39,6 @@ SVGPathSegListSource::SVGPathSegListSource(SVGPathSegList* pathSegList) m_itemEnd = m_pathSegList->numberOfItems(); } -SVGPathSegListSource::~SVGPathSegListSource() -{ -} - bool SVGPathSegListSource::hasMoreData() const { return m_itemCurrent < m_itemEnd; diff --git a/WebCore/svg/SVGPathSegListSource.h b/WebCore/svg/SVGPathSegListSource.h index fd89e3e..4f93be1 100644 --- a/WebCore/svg/SVGPathSegListSource.h +++ b/WebCore/svg/SVGPathSegListSource.h @@ -37,7 +37,8 @@ public: return adoptPtr(new SVGPathSegListSource(pathSegList)); } - virtual ~SVGPathSegListSource(); +private: + SVGPathSegListSource(SVGPathSegList*); virtual bool hasMoreData() const; virtual bool moveToNextToken() { return true; } @@ -54,9 +55,6 @@ public: virtual bool parseCurveToQuadraticSmoothSegment(FloatPoint&); virtual bool parseArcToSegment(float&, float&, float&, bool&, bool&, FloatPoint&); -private: - SVGPathSegListSource(SVGPathSegList*); - SVGPathSegList* m_pathSegList; RefPtr<SVGPathSeg> m_segment; int m_itemCurrent; diff --git a/WebCore/svg/SVGPathSegMoveto.h b/WebCore/svg/SVGPathSegMoveto.h index 194b1a6..edaff4b 100644 --- a/WebCore/svg/SVGPathSegMoveto.h +++ b/WebCore/svg/SVGPathSegMoveto.h @@ -31,22 +31,22 @@ namespace WebCore { public: static PassRefPtr<SVGPathSegMovetoAbs> create(float x, float y) { return adoptRef(new SVGPathSegMovetoAbs(x, y)); } - virtual unsigned short pathSegType() const { return PATHSEG_MOVETO_ABS; } - virtual String pathSegTypeAsLetter() const { return "M"; } - private: SVGPathSegMovetoAbs(float x, float y); + + virtual unsigned short pathSegType() const { return PATHSEG_MOVETO_ABS; } + virtual String pathSegTypeAsLetter() const { return "M"; } }; class SVGPathSegMovetoRel : public SVGPathSegSingleCoord { public: static PassRefPtr<SVGPathSegMovetoRel> create(float x, float y) { return adoptRef(new SVGPathSegMovetoRel(x, y)); } - virtual unsigned short pathSegType() const { return PATHSEG_MOVETO_REL; } - virtual String pathSegTypeAsLetter() const { return "m"; } - private: SVGPathSegMovetoRel(float x, float y); + + virtual unsigned short pathSegType() const { return PATHSEG_MOVETO_REL; } + virtual String pathSegTypeAsLetter() const { return "m"; } }; } // namespace WebCore diff --git a/WebCore/svg/SVGPathSource.h b/WebCore/svg/SVGPathSource.h index 6d7ec5f..d1a6149 100644 --- a/WebCore/svg/SVGPathSource.h +++ b/WebCore/svg/SVGPathSource.h @@ -43,9 +43,6 @@ public: virtual bool parseCurveToQuadraticSegment(FloatPoint&, FloatPoint&) = 0; virtual bool parseCurveToQuadraticSmoothSegment(FloatPoint&) = 0; virtual bool parseArcToSegment(float&, float&, float&, bool&, bool&, FloatPoint&) = 0; - -public: - SVGPathSource() { } }; } // namespace WebCore diff --git a/WebCore/svg/SVGPathStringBuilder.cpp b/WebCore/svg/SVGPathStringBuilder.cpp index 0a166ad..951956d 100644 --- a/WebCore/svg/SVGPathStringBuilder.cpp +++ b/WebCore/svg/SVGPathStringBuilder.cpp @@ -24,10 +24,6 @@ namespace WebCore { -SVGPathStringBuilder::SVGPathStringBuilder() -{ -} - void SVGPathStringBuilder::moveTo(const FloatPoint& targetPoint, bool, PathCoordinateMode mode) { if (mode == AbsoluteCoordinates) diff --git a/WebCore/svg/SVGPathStringBuilder.h b/WebCore/svg/SVGPathStringBuilder.h index ebb8596..a51c40c 100644 --- a/WebCore/svg/SVGPathStringBuilder.h +++ b/WebCore/svg/SVGPathStringBuilder.h @@ -29,21 +29,19 @@ namespace WebCore { class SVGPathStringBuilder : public SVGPathConsumer { public: - SVGPathStringBuilder(); + String result() { return m_stringBuilder.toString(ConcatAddingSpacesBetweenIndividualStrings); } +private: virtual void cleanup() { m_stringBuilder.clear(); } virtual void incrementPathSegmentCount() { } virtual bool continueConsuming() { return true; } - String result() { return m_stringBuilder.toString(ConcatAddingSpacesBetweenIndividualStrings); } -private: // Used in UnalteredParsing/NormalizedParsing modes. virtual void moveTo(const FloatPoint&, bool closed, PathCoordinateMode); virtual void lineTo(const FloatPoint&, PathCoordinateMode); virtual void curveToCubic(const FloatPoint&, const FloatPoint&, const FloatPoint&, PathCoordinateMode); virtual void closePath(); -private: // Only used in UnalteredParsing mode. virtual void lineToHorizontal(float, PathCoordinateMode); virtual void lineToVertical(float, PathCoordinateMode); diff --git a/WebCore/svg/SVGPathStringSource.cpp b/WebCore/svg/SVGPathStringSource.cpp index 0efbfd0..5154ee6 100644 --- a/WebCore/svg/SVGPathStringSource.cpp +++ b/WebCore/svg/SVGPathStringSource.cpp @@ -34,10 +34,6 @@ SVGPathStringSource::SVGPathStringSource(const String& string) ASSERT(!string.isEmpty()); } -SVGPathStringSource::~SVGPathStringSource() -{ -} - bool SVGPathStringSource::hasMoreData() const { return m_current < m_end; diff --git a/WebCore/svg/SVGPathStringSource.h b/WebCore/svg/SVGPathStringSource.h index d0266f4..a3c8a95 100644 --- a/WebCore/svg/SVGPathStringSource.h +++ b/WebCore/svg/SVGPathStringSource.h @@ -35,7 +35,8 @@ public: return adoptPtr(new SVGPathStringSource(string)); } - virtual ~SVGPathStringSource(); +private: + SVGPathStringSource(const String&); virtual bool hasMoreData() const; virtual bool moveToNextToken(); @@ -52,8 +53,6 @@ public: virtual bool parseCurveToQuadraticSmoothSegment(FloatPoint&); virtual bool parseArcToSegment(float&, float&, float&, bool&, bool&, FloatPoint&); -private: - SVGPathStringSource(const String&); String m_string; const UChar* m_current; diff --git a/WebCore/svg/SVGPatternElement.cpp b/WebCore/svg/SVGPatternElement.cpp index 94d3572..6a8a108 100644 --- a/WebCore/svg/SVGPatternElement.cpp +++ b/WebCore/svg/SVGPatternElement.cpp @@ -49,13 +49,8 @@ using namespace std; namespace WebCore { -SVGPatternElement::SVGPatternElement(const QualifiedName& tagName, Document* doc) - : SVGStyledElement(tagName, doc) - , SVGURIReference() - , SVGTests() - , SVGLangSpace() - , SVGExternalResourcesRequired() - , SVGFitToViewBox() +inline SVGPatternElement::SVGPatternElement(const QualifiedName& tagName, Document* document) + : SVGStyledElement(tagName, document) , m_x(LengthModeWidth) , m_y(LengthModeHeight) , m_width(LengthModeWidth) @@ -66,8 +61,9 @@ SVGPatternElement::SVGPatternElement(const QualifiedName& tagName, Document* doc { } -SVGPatternElement::~SVGPatternElement() +PassRefPtr<SVGPatternElement> SVGPatternElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGPatternElement(tagName, document)); } void SVGPatternElement::parseMappedAttribute(Attribute* attr) diff --git a/WebCore/svg/SVGPatternElement.h b/WebCore/svg/SVGPatternElement.h index 32ec808..497660a 100644 --- a/WebCore/svg/SVGPatternElement.h +++ b/WebCore/svg/SVGPatternElement.h @@ -43,8 +43,12 @@ namespace WebCore { public SVGExternalResourcesRequired, public SVGFitToViewBox { public: + static PassRefPtr<SVGPatternElement> create(const QualifiedName&, Document*); + + PatternAttributes collectPatternProperties() const; + + private: SVGPatternElement(const QualifiedName&, Document*); - virtual ~SVGPatternElement(); virtual bool isValid() const { return SVGTests::isValid(); } virtual bool needsPendingResourceHandling() const { return false; } @@ -56,9 +60,6 @@ namespace WebCore { virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); - PatternAttributes collectPatternProperties() const; - - private: virtual bool selfHasRelativeLengths() const; DECLARE_ANIMATED_PROPERTY(SVGPatternElement, SVGNames::xAttr, SVGLength, X, x) diff --git a/WebCore/svg/SVGPointList.cpp b/WebCore/svg/SVGPointList.cpp index 8a3d870..0d8e10c 100644 --- a/WebCore/svg/SVGPointList.cpp +++ b/WebCore/svg/SVGPointList.cpp @@ -32,10 +32,6 @@ SVGPointList::SVGPointList(const QualifiedName& attributeName) { } -SVGPointList::~SVGPointList() -{ -} - String SVGPointList::valueAsString() const { String result; diff --git a/WebCore/svg/SVGPointList.h b/WebCore/svg/SVGPointList.h index 853c7b1..43edbbb 100644 --- a/WebCore/svg/SVGPointList.h +++ b/WebCore/svg/SVGPointList.h @@ -32,7 +32,6 @@ namespace WebCore { class SVGPointList : public SVGPODList<FloatPoint> { public: static PassRefPtr<SVGPointList> create(const QualifiedName& attributeName) { return adoptRef(new SVGPointList(attributeName)); } - virtual ~SVGPointList(); String valueAsString() const; diff --git a/WebCore/svg/SVGPolyElement.cpp b/WebCore/svg/SVGPolyElement.cpp index 8475309..da8aba4 100644 --- a/WebCore/svg/SVGPolyElement.cpp +++ b/WebCore/svg/SVGPolyElement.cpp @@ -34,16 +34,8 @@ namespace WebCore { -SVGPolyElement::SVGPolyElement(const QualifiedName& tagName, Document* doc) - : SVGStyledTransformableElement(tagName, doc) - , SVGTests() - , SVGLangSpace() - , SVGExternalResourcesRequired() - , SVGAnimatedPoints() -{ -} - -SVGPolyElement::~SVGPolyElement() +SVGPolyElement::SVGPolyElement(const QualifiedName& tagName, Document* document) + : SVGStyledTransformableElement(tagName, document) { } diff --git a/WebCore/svg/SVGPolyElement.h b/WebCore/svg/SVGPolyElement.h index bbcdb67..6d36f4b 100644 --- a/WebCore/svg/SVGPolyElement.h +++ b/WebCore/svg/SVGPolyElement.h @@ -36,21 +36,21 @@ namespace WebCore { public SVGExternalResourcesRequired, public SVGAnimatedPoints { public: - SVGPolyElement(const QualifiedName&, Document*); - virtual ~SVGPolyElement(); - - virtual bool isValid() const { return SVGTests::isValid(); } - virtual SVGPointList* points() const; virtual SVGPointList* animatedPoints() const; + protected: + SVGPolyElement(const QualifiedName&, Document*); + + private: + virtual bool isValid() const { return SVGTests::isValid(); } + virtual void parseMappedAttribute(Attribute*); virtual void svgAttributeChanged(const QualifiedName&); virtual void synchronizeProperty(const QualifiedName&); virtual bool supportsMarkers() const { return true; } - private: // SVGExternalResourcesRequired DECLARE_ANIMATED_PROPERTY(SVGPolyElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired) diff --git a/WebCore/svg/SVGPolygonElement.cpp b/WebCore/svg/SVGPolygonElement.cpp index c7ab09b..57e2d53 100644 --- a/WebCore/svg/SVGPolygonElement.cpp +++ b/WebCore/svg/SVGPolygonElement.cpp @@ -27,13 +27,14 @@ namespace WebCore { -SVGPolygonElement::SVGPolygonElement(const QualifiedName& tagName, Document* doc) - : SVGPolyElement(tagName, doc) +inline SVGPolygonElement::SVGPolygonElement(const QualifiedName& tagName, Document* document) + : SVGPolyElement(tagName, document) { } -SVGPolygonElement::~SVGPolygonElement() +PassRefPtr<SVGPolygonElement> SVGPolygonElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGPolygonElement(tagName, document)); } Path SVGPolygonElement::toPathData() const diff --git a/WebCore/svg/SVGPolygonElement.h b/WebCore/svg/SVGPolygonElement.h index 76b11a2..7a5bda8 100644 --- a/WebCore/svg/SVGPolygonElement.h +++ b/WebCore/svg/SVGPolygonElement.h @@ -28,8 +28,10 @@ namespace WebCore { class SVGPolygonElement : public SVGPolyElement { public: + static PassRefPtr<SVGPolygonElement> create(const QualifiedName&, Document*); + + private: SVGPolygonElement(const QualifiedName&, Document*); - virtual ~SVGPolygonElement(); virtual Path toPathData() const; }; diff --git a/WebCore/svg/SVGPolylineElement.cpp b/WebCore/svg/SVGPolylineElement.cpp index a1dfcd6..7ec8431 100644 --- a/WebCore/svg/SVGPolylineElement.cpp +++ b/WebCore/svg/SVGPolylineElement.cpp @@ -27,13 +27,14 @@ namespace WebCore { -SVGPolylineElement::SVGPolylineElement(const QualifiedName& tagName, Document* doc) - : SVGPolyElement(tagName, doc) +inline SVGPolylineElement::SVGPolylineElement(const QualifiedName& tagName, Document* document) + : SVGPolyElement(tagName, document) { } -SVGPolylineElement::~SVGPolylineElement() +PassRefPtr<SVGPolylineElement> SVGPolylineElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGPolylineElement(tagName, document)); } Path SVGPolylineElement::toPathData() const diff --git a/WebCore/svg/SVGPolylineElement.h b/WebCore/svg/SVGPolylineElement.h index fbdaa81..d3fe555 100644 --- a/WebCore/svg/SVGPolylineElement.h +++ b/WebCore/svg/SVGPolylineElement.h @@ -28,8 +28,10 @@ namespace WebCore { class SVGPolylineElement : public SVGPolyElement { public: + static PassRefPtr<SVGPolylineElement> create(const QualifiedName&, Document*); + + private: SVGPolylineElement(const QualifiedName&, Document*); - virtual ~SVGPolylineElement(); virtual Path toPathData() const; }; diff --git a/WebCore/svg/SVGPreserveAspectRatio.cpp b/WebCore/svg/SVGPreserveAspectRatio.cpp index 00a7a65..a129fe6 100644 --- a/WebCore/svg/SVGPreserveAspectRatio.cpp +++ b/WebCore/svg/SVGPreserveAspectRatio.cpp @@ -37,10 +37,6 @@ SVGPreserveAspectRatio::SVGPreserveAspectRatio() // FIXME: Should the two values default to UNKNOWN instead? } -SVGPreserveAspectRatio::~SVGPreserveAspectRatio() -{ -} - void SVGPreserveAspectRatio::setAlign(unsigned short align) { m_align = align; diff --git a/WebCore/svg/SVGPreserveAspectRatio.h b/WebCore/svg/SVGPreserveAspectRatio.h index 9ed27fe..f29b7d3 100644 --- a/WebCore/svg/SVGPreserveAspectRatio.h +++ b/WebCore/svg/SVGPreserveAspectRatio.h @@ -54,7 +54,6 @@ namespace WebCore { }; SVGPreserveAspectRatio(); - virtual ~SVGPreserveAspectRatio(); void setAlign(unsigned short); unsigned short align() const; diff --git a/WebCore/svg/SVGRadialGradientElement.cpp b/WebCore/svg/SVGRadialGradientElement.cpp index 4448c67..80aba78 100644 --- a/WebCore/svg/SVGRadialGradientElement.cpp +++ b/WebCore/svg/SVGRadialGradientElement.cpp @@ -40,8 +40,8 @@ namespace WebCore { -SVGRadialGradientElement::SVGRadialGradientElement(const QualifiedName& tagName, Document* doc) - : SVGGradientElement(tagName, doc) +inline SVGRadialGradientElement::SVGRadialGradientElement(const QualifiedName& tagName, Document* document) + : SVGGradientElement(tagName, document) , m_cx(LengthModeWidth, "50%") , m_cy(LengthModeHeight, "50%") , m_r(LengthModeOther, "50%") @@ -51,8 +51,9 @@ SVGRadialGradientElement::SVGRadialGradientElement(const QualifiedName& tagName, // Spec: If the cx/cy/r attribute is not specified, the effect is as if a value of "50%" were specified. } -SVGRadialGradientElement::~SVGRadialGradientElement() +PassRefPtr<SVGRadialGradientElement> SVGRadialGradientElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGRadialGradientElement(tagName, document)); } void SVGRadialGradientElement::parseMappedAttribute(Attribute* attr) diff --git a/WebCore/svg/SVGRadialGradientElement.h b/WebCore/svg/SVGRadialGradientElement.h index 2c3db56..e528a13 100644 --- a/WebCore/svg/SVGRadialGradientElement.h +++ b/WebCore/svg/SVGRadialGradientElement.h @@ -31,8 +31,13 @@ namespace WebCore { class SVGRadialGradientElement : public SVGGradientElement { public: + static PassRefPtr<SVGRadialGradientElement> create(const QualifiedName&, Document*); + + RadialGradientAttributes collectGradientProperties(); + void calculateFocalCenterPointsAndRadius(const RadialGradientAttributes&, FloatPoint& focalPoint, FloatPoint& centerPoint, float& radius); + + private: SVGRadialGradientElement(const QualifiedName&, Document*); - virtual ~SVGRadialGradientElement(); virtual void parseMappedAttribute(Attribute*); virtual void svgAttributeChanged(const QualifiedName&); @@ -40,10 +45,6 @@ namespace WebCore { virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); - RadialGradientAttributes collectGradientProperties(); - void calculateFocalCenterPointsAndRadius(const RadialGradientAttributes&, FloatPoint& focalPoint, FloatPoint& centerPoint, float& radius); - - private: virtual bool selfHasRelativeLengths() const; DECLARE_ANIMATED_PROPERTY(SVGRadialGradientElement, SVGNames::cxAttr, SVGLength, Cx, cx) diff --git a/WebCore/svg/SVGRectElement.cpp b/WebCore/svg/SVGRectElement.cpp index d5451e2..43ba888 100644 --- a/WebCore/svg/SVGRectElement.cpp +++ b/WebCore/svg/SVGRectElement.cpp @@ -31,11 +31,8 @@ namespace WebCore { -SVGRectElement::SVGRectElement(const QualifiedName& tagName, Document *doc) - : SVGStyledTransformableElement(tagName, doc) - , SVGTests() - , SVGLangSpace() - , SVGExternalResourcesRequired() +inline SVGRectElement::SVGRectElement(const QualifiedName& tagName, Document* document) + : SVGStyledTransformableElement(tagName, document) , m_x(LengthModeWidth) , m_y(LengthModeHeight) , m_width(LengthModeWidth) @@ -45,8 +42,9 @@ SVGRectElement::SVGRectElement(const QualifiedName& tagName, Document *doc) { } -SVGRectElement::~SVGRectElement() +PassRefPtr<SVGRectElement> SVGRectElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGRectElement(tagName, document)); } void SVGRectElement::parseMappedAttribute(Attribute* attr) diff --git a/WebCore/svg/SVGRectElement.h b/WebCore/svg/SVGRectElement.h index bc90919..382078d 100644 --- a/WebCore/svg/SVGRectElement.h +++ b/WebCore/svg/SVGRectElement.h @@ -34,8 +34,10 @@ namespace WebCore { public SVGLangSpace, public SVGExternalResourcesRequired { public: + static PassRefPtr<SVGRectElement> create(const QualifiedName&, Document*); + + private: SVGRectElement(const QualifiedName&, Document*); - virtual ~SVGRectElement(); virtual bool isValid() const { return SVGTests::isValid(); } @@ -45,7 +47,6 @@ namespace WebCore { virtual Path toPathData() const; - private: virtual bool selfHasRelativeLengths() const; DECLARE_ANIMATED_PROPERTY(SVGRectElement, SVGNames::xAttr, SVGLength, X, x) diff --git a/WebCore/svg/SVGSVGElement.cpp b/WebCore/svg/SVGSVGElement.cpp index b7f9717..bc669a3 100644 --- a/WebCore/svg/SVGSVGElement.cpp +++ b/WebCore/svg/SVGSVGElement.cpp @@ -78,6 +78,11 @@ SVGSVGElement::SVGSVGElement(const QualifiedName& tagName, Document* doc) doc->registerForDocumentActivationCallbacks(this); } +PassRefPtr<SVGSVGElement> SVGSVGElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new SVGSVGElement(tagName, document)); +} + SVGSVGElement::~SVGSVGElement() { document()->unregisterForDocumentActivationCallbacks(this); @@ -181,8 +186,7 @@ void SVGSVGElement::setUseCurrentView(bool currentView) SVGViewSpec* SVGSVGElement::currentView() const { if (!m_viewSpec) - m_viewSpec.set(new SVGViewSpec(this)); - + m_viewSpec = adoptPtr(new SVGViewSpec(this)); return m_viewSpec.get(); } @@ -472,6 +476,12 @@ AffineTransform SVGSVGElement::localCoordinateSpaceTransform(SVGLocatable::CTMSc // RenderSVGRoot::localToBorderBoxTransform() (called through mapLocalToContainer(), called from localToAbsolute()) // also takes the viewBoxToViewTransform() into account, so we have to subtract it here (original cause of bug #27183) transform.translate(location.x() - viewBoxTransform.e(), location.y() - viewBoxTransform.f()); + + // Respect scroll offset. + if (FrameView* view = document()->view()) { + IntSize scrollOffset = view->scrollOffset(); + transform.translate(-scrollOffset.width(), -scrollOffset.height()); + } } } diff --git a/WebCore/svg/SVGSVGElement.h b/WebCore/svg/SVGSVGElement.h index b7c9b16..b5b10b1 100644 --- a/WebCore/svg/SVGSVGElement.h +++ b/WebCore/svg/SVGSVGElement.h @@ -45,11 +45,8 @@ namespace WebCore { public SVGFitToViewBox, public SVGZoomAndPan { public: - SVGSVGElement(const QualifiedName&, Document*); - virtual ~SVGSVGElement(); + static PassRefPtr<SVGSVGElement> create(const QualifiedName&, Document*); - virtual bool isSVG() const { return true; } - virtual bool isValid() const { return SVGTests::isValid(); } // 'SVGSVGElement' functions @@ -112,6 +109,20 @@ namespace WebCore { static SVGTransform createSVGTransform(); static SVGTransform createSVGTransformFromMatrix(const AffineTransform&); + AffineTransform viewBoxToViewTransform(float viewWidth, float viewHeight) const; + + void inheritViewAttributes(SVGViewElement*); + + bool isOutermostSVG() const; + + Element* getElementById(const AtomicString&) const; + + private: + SVGSVGElement(const QualifiedName&, Document*); + virtual ~SVGSVGElement(); + + virtual bool isSVG() const { return true; } + virtual void parseMappedAttribute(Attribute*); virtual bool rendererIsNeeded(RenderStyle* style) { return StyledElement::rendererIsNeeded(style); } @@ -123,15 +134,6 @@ namespace WebCore { virtual void svgAttributeChanged(const QualifiedName&); virtual void synchronizeProperty(const QualifiedName&); - AffineTransform viewBoxToViewTransform(float viewWidth, float viewHeight) const; - - void inheritViewAttributes(SVGViewElement*); - - bool isOutermostSVG() const; - - Element* getElementById(const AtomicString&) const; - - private: virtual bool selfHasRelativeLengths() const; DECLARE_ANIMATED_PROPERTY(SVGSVGElement, SVGNames::xAttr, SVGLength, X, x) diff --git a/WebCore/svg/SVGScriptElement.cpp b/WebCore/svg/SVGScriptElement.cpp index 4109aad..6532ac2 100644 --- a/WebCore/svg/SVGScriptElement.cpp +++ b/WebCore/svg/SVGScriptElement.cpp @@ -31,17 +31,16 @@ namespace WebCore { -SVGScriptElement::SVGScriptElement(const QualifiedName& tagName, Document* doc, bool createdByParser) - : SVGElement(tagName, doc) - , SVGURIReference() - , SVGExternalResourcesRequired() +inline SVGScriptElement::SVGScriptElement(const QualifiedName& tagName, Document* document, bool createdByParser) + : SVGElement(tagName, document) , m_data(this, this) { m_data.setCreatedByParser(createdByParser); } -SVGScriptElement::~SVGScriptElement() +PassRefPtr<SVGScriptElement> SVGScriptElement::create(const QualifiedName& tagName, Document* document, bool createdByParser) { + return adoptRef(new SVGScriptElement(tagName, document, createdByParser)); } String SVGScriptElement::scriptContent() const diff --git a/WebCore/svg/SVGScriptElement.h b/WebCore/svg/SVGScriptElement.h index 8f2a393..6dffea6 100644 --- a/WebCore/svg/SVGScriptElement.h +++ b/WebCore/svg/SVGScriptElement.h @@ -34,8 +34,13 @@ namespace WebCore { , public SVGExternalResourcesRequired , public ScriptElement { public: + static PassRefPtr<SVGScriptElement> create(const QualifiedName&, Document*, bool createdByParser); + + String type() const; + void setType(const String&); + + private: SVGScriptElement(const QualifiedName&, Document*, bool createdByParser); - virtual ~SVGScriptElement(); virtual String scriptContent() const; @@ -49,16 +54,12 @@ namespace WebCore { virtual bool isURLAttribute(Attribute*) const; virtual void finishParsingChildren(); - String type() const; - void setType(const String&); - virtual String scriptCharset() const; virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const; virtual bool shouldExecuteAsJavaScript() const; - protected: virtual bool haveLoadedRequiredResources(); virtual String sourceAttributeValue() const; @@ -73,14 +74,12 @@ namespace WebCore { virtual void dispatchLoadEvent(); virtual void dispatchErrorEvent(); - private: // SVGURIReference DECLARE_ANIMATED_PROPERTY(SVGScriptElement, XLinkNames::hrefAttr, String, Href, href) // SVGExternalResourcesRequired DECLARE_ANIMATED_PROPERTY(SVGScriptElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired) - private: ScriptElementData m_data; String m_type; }; diff --git a/WebCore/svg/SVGSetElement.cpp b/WebCore/svg/SVGSetElement.cpp index eceed12..d455c9b 100644 --- a/WebCore/svg/SVGSetElement.cpp +++ b/WebCore/svg/SVGSetElement.cpp @@ -24,10 +24,16 @@ namespace WebCore { -SVGSetElement::SVGSetElement(const QualifiedName& tagName, Document *doc) - : SVGAnimateElement(tagName, doc) +inline SVGSetElement::SVGSetElement(const QualifiedName& tagName, Document* document) + : SVGAnimateElement(tagName, document) { } + +PassRefPtr<SVGSetElement> SVGSetElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new SVGSetElement(tagName, document)); +} + } // vim:ts=4:noet diff --git a/WebCore/svg/SVGSetElement.h b/WebCore/svg/SVGSetElement.h index 975ad27..a519973 100644 --- a/WebCore/svg/SVGSetElement.h +++ b/WebCore/svg/SVGSetElement.h @@ -25,9 +25,13 @@ #include "SVGAnimateElement.h" namespace WebCore { + // SVGAnimateElement implements superset of the functionality. class SVGSetElement : public SVGAnimateElement { public: + static PassRefPtr<SVGSetElement> create(const QualifiedName&, Document*); + + private: SVGSetElement(const QualifiedName&, Document*); }; diff --git a/WebCore/svg/SVGStopElement.cpp b/WebCore/svg/SVGStopElement.cpp index 317774a..cd78a46 100644 --- a/WebCore/svg/SVGStopElement.cpp +++ b/WebCore/svg/SVGStopElement.cpp @@ -32,14 +32,15 @@ namespace WebCore { -SVGStopElement::SVGStopElement(const QualifiedName& tagName, Document* doc) - : SVGStyledElement(tagName, doc) +inline SVGStopElement::SVGStopElement(const QualifiedName& tagName, Document* document) + : SVGStyledElement(tagName, document) , m_offset(0) { } -SVGStopElement::~SVGStopElement() +PassRefPtr<SVGStopElement> SVGStopElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGStopElement(tagName, document)); } void SVGStopElement::parseMappedAttribute(Attribute* attr) diff --git a/WebCore/svg/SVGStopElement.h b/WebCore/svg/SVGStopElement.h index 1fb60b5..232b97a 100644 --- a/WebCore/svg/SVGStopElement.h +++ b/WebCore/svg/SVGStopElement.h @@ -29,16 +29,17 @@ namespace WebCore { class SVGStopElement : public SVGStyledElement { public: + static PassRefPtr<SVGStopElement> create(const QualifiedName&, Document*); + + Color stopColorIncludingOpacity() const; + + private: SVGStopElement(const QualifiedName&, Document*); - virtual ~SVGStopElement(); virtual void parseMappedAttribute(Attribute*); virtual void svgAttributeChanged(const QualifiedName&); virtual void synchronizeProperty(const QualifiedName&); - Color stopColorIncludingOpacity() const; - - private: virtual bool isGradientStop() const { return true; } virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); diff --git a/WebCore/svg/SVGStringList.cpp b/WebCore/svg/SVGStringList.cpp index 806c70a..9f4809f 100644 --- a/WebCore/svg/SVGStringList.cpp +++ b/WebCore/svg/SVGStringList.cpp @@ -32,10 +32,6 @@ SVGStringList::SVGStringList(const QualifiedName& attributeName) { } -SVGStringList::~SVGStringList() -{ -} - void SVGStringList::reset(const String& str) { ExceptionCode ec = 0; diff --git a/WebCore/svg/SVGStringList.h b/WebCore/svg/SVGStringList.h index bc234ff..e8841ea 100644 --- a/WebCore/svg/SVGStringList.h +++ b/WebCore/svg/SVGStringList.h @@ -30,7 +30,6 @@ namespace WebCore { class SVGStringList : public SVGList<String> { public: static PassRefPtr<SVGStringList> create(const QualifiedName& attributeName) { return adoptRef(new SVGStringList(attributeName)); } - virtual ~SVGStringList(); void reset(const String& str); void parse(const String& data, UChar delimiter = ','); diff --git a/WebCore/svg/SVGStylable.cpp b/WebCore/svg/SVGStylable.cpp index 510467d..6f54888 100644 --- a/WebCore/svg/SVGStylable.cpp +++ b/WebCore/svg/SVGStylable.cpp @@ -1,38 +1 @@ -/* - * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> - * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.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 - * 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 "SVGStylable.h" - -namespace WebCore { - -SVGStylable::SVGStylable() -{ -} - -SVGStylable::~SVGStylable() -{ -} - -} - -#endif // ENABLE(SVG) +// This file is now intentionally empty. Delete it after removing it from all the build systems and project files. diff --git a/WebCore/svg/SVGStylable.h b/WebCore/svg/SVGStylable.h index 37148f9..fee4e63 100644 --- a/WebCore/svg/SVGStylable.h +++ b/WebCore/svg/SVGStylable.h @@ -29,12 +29,10 @@ namespace WebCore { class CSSValue; class CSSStyleDeclaration; - class QualifiedName; class SVGStylable { public: - SVGStylable(); - virtual ~SVGStylable(); + virtual ~SVGStylable() { } virtual CSSStyleDeclaration* style() = 0; virtual PassRefPtr<CSSValue> getPresentationAttribute(const String&) = 0; diff --git a/WebCore/svg/SVGStyleElement.cpp b/WebCore/svg/SVGStyleElement.cpp index bb50e67..4a80319 100644 --- a/WebCore/svg/SVGStyleElement.cpp +++ b/WebCore/svg/SVGStyleElement.cpp @@ -34,13 +34,17 @@ namespace WebCore { -SVGStyleElement::SVGStyleElement(const QualifiedName& tagName, Document* document, bool createdByParser) +inline SVGStyleElement::SVGStyleElement(const QualifiedName& tagName, Document* document, bool createdByParser) : SVGElement(tagName, document) - , SVGLangSpace() , StyleElement(document, createdByParser) { } +PassRefPtr<SVGStyleElement> SVGStyleElement::create(const QualifiedName& tagName, Document* document, bool createdByParser) +{ + return adoptRef(new SVGStyleElement(tagName, document, createdByParser)); +} + const AtomicString& SVGStyleElement::type() const { DEFINE_STATIC_LOCAL(const AtomicString, defaultValue, ("text/css")); diff --git a/WebCore/svg/SVGStyleElement.h b/WebCore/svg/SVGStyleElement.h index 6385039..bb46549 100644 --- a/WebCore/svg/SVGStyleElement.h +++ b/WebCore/svg/SVGStyleElement.h @@ -32,17 +32,9 @@ class SVGStyleElement : public SVGElement , public SVGLangSpace , public StyleElement { public: - SVGStyleElement(const QualifiedName&, Document*, bool createdByParser); - - virtual void parseMappedAttribute(Attribute*); - virtual void insertedIntoDocument(); - virtual void removedFromDocument(); - virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); + static PassRefPtr<SVGStyleElement> create(const QualifiedName&, Document*, bool createdByParser); - virtual void finishParsingChildren(); - - virtual bool isLoading() const { return StyleElement::isLoading(); } - virtual bool sheetLoaded() { return StyleElement::sheetLoaded(document()); } + StyleSheet* sheet(); virtual const AtomicString& type() const; void setType(const AtomicString&, ExceptionCode&); @@ -53,7 +45,18 @@ public: virtual String title() const; void setTitle(const AtomicString&, ExceptionCode&); - StyleSheet* sheet(); +private: + SVGStyleElement(const QualifiedName&, Document*, bool createdByParser); + + virtual void parseMappedAttribute(Attribute*); + virtual void insertedIntoDocument(); + virtual void removedFromDocument(); + virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); + + virtual void finishParsingChildren(); + + virtual bool isLoading() const { return StyleElement::isLoading(); } + virtual bool sheetLoaded() { return StyleElement::sheetLoaded(document()); } }; } // namespace WebCore diff --git a/WebCore/svg/SVGStyledElement.cpp b/WebCore/svg/SVGStyledElement.cpp index 6f04382..f554846 100644 --- a/WebCore/svg/SVGStyledElement.cpp +++ b/WebCore/svg/SVGStyledElement.cpp @@ -55,12 +55,8 @@ void mapAttributeToCSSProperty(HashMap<AtomicStringImpl*, int>* propertyNameToId propertyNameToIdMap->set(attrName.localName().impl(), propertyId); } -SVGStyledElement::SVGStyledElement(const QualifiedName& tagName, Document* doc) - : SVGElement(tagName, doc) -{ -} - -SVGStyledElement::~SVGStyledElement() +SVGStyledElement::SVGStyledElement(const QualifiedName& tagName, Document* document) + : SVGElement(tagName, document) { } diff --git a/WebCore/svg/SVGStyledElement.h b/WebCore/svg/SVGStyledElement.h index 8431458..3482a4f 100644 --- a/WebCore/svg/SVGStyledElement.h +++ b/WebCore/svg/SVGStyledElement.h @@ -35,21 +35,29 @@ namespace WebCore { class SVGStyledElement : public SVGElement, public SVGStylable { public: - SVGStyledElement(const QualifiedName&, Document*); - virtual ~SVGStyledElement(); - virtual String title() const; bool hasRelativeLengths() const { return !m_elementsWithRelativeLengths.isEmpty(); } - virtual bool isStyled() const { return true; } virtual bool supportsMarkers() const { return false; } virtual PassRefPtr<CSSValue> getPresentationAttribute(const String& name); - virtual CSSStyleDeclaration* style() { return StyledElement::style(); } bool isKnownAttribute(const QualifiedName&); + // Centralized place to force a manual style resolution. Hacky but needed for now. + PassRefPtr<RenderStyle> resolveStyle(RenderStyle* parentStyle); + + bool instanceUpdatesBlocked() const; + void setInstanceUpdatesBlocked(bool); + + virtual AffineTransform localCoordinateSpaceTransform(SVGLocatable::CTMScope) const; + + virtual CSSStyleDeclaration* style() { return StyledElement::style(); } + + protected: + SVGStyledElement(const QualifiedName&, Document*); + virtual bool rendererIsNeeded(RenderStyle*); virtual bool mapToEntry(const QualifiedName&, MappedAttributeEntry&) const; @@ -62,15 +70,6 @@ namespace WebCore { virtual void removedFromDocument(); virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); - // Centralized place to force a manual style resolution. Hacky but needed for now. - PassRefPtr<RenderStyle> resolveStyle(RenderStyle* parentStyle); - - bool instanceUpdatesBlocked() const; - void setInstanceUpdatesBlocked(bool); - - virtual AffineTransform localCoordinateSpaceTransform(SVGLocatable::CTMScope) const; - - protected: static int cssPropertyIdForSVGAttributeName(const QualifiedName&); void updateRelativeLengthsInformation() { updateRelativeLengthsInformation(selfHasRelativeLengths(), this); } void updateRelativeLengthsInformation(bool hasRelativeLengths, SVGStyledElement*); @@ -78,7 +77,10 @@ namespace WebCore { virtual bool selfHasRelativeLengths() const { return false; } private: + virtual bool isStyled() const { return true; } + HashSet<SVGStyledElement*> m_elementsWithRelativeLengths; + DECLARE_ANIMATED_PROPERTY(SVGStyledElement, HTMLNames::classAttr, String, ClassName, className) }; diff --git a/WebCore/svg/SVGStyledLocatableElement.cpp b/WebCore/svg/SVGStyledLocatableElement.cpp index 6b49542..d22e708 100644 --- a/WebCore/svg/SVGStyledLocatableElement.cpp +++ b/WebCore/svg/SVGStyledLocatableElement.cpp @@ -30,13 +30,8 @@ namespace WebCore { -SVGStyledLocatableElement::SVGStyledLocatableElement(const QualifiedName& tagName, Document* doc) - : SVGLocatable() - , SVGStyledElement(tagName, doc) -{ -} - -SVGStyledLocatableElement::~SVGStyledLocatableElement() +SVGStyledLocatableElement::SVGStyledLocatableElement(const QualifiedName& tagName, Document* document) + : SVGStyledElement(tagName, document) { } diff --git a/WebCore/svg/SVGStyledLocatableElement.h b/WebCore/svg/SVGStyledLocatableElement.h index 6eab7b0..82b3436 100644 --- a/WebCore/svg/SVGStyledLocatableElement.h +++ b/WebCore/svg/SVGStyledLocatableElement.h @@ -32,11 +32,6 @@ namespace WebCore { class SVGStyledLocatableElement : public SVGStyledElement, virtual public SVGLocatable { public: - SVGStyledLocatableElement(const QualifiedName&, Document*); - virtual ~SVGStyledLocatableElement(); - - virtual bool isStyledLocatable() const { return true; } - virtual SVGElement* nearestViewportElement() const; virtual SVGElement* farthestViewportElement() const; @@ -45,6 +40,12 @@ namespace WebCore { virtual AffineTransform getScreenCTM(StyleUpdateStrategy = AllowStyleUpdate) const; virtual AffineTransform localCoordinateSpaceTransform(SVGLocatable::CTMScope mode) const { return SVGLocatable::localCoordinateSpaceTransform(mode); } + + protected: + SVGStyledLocatableElement(const QualifiedName&, Document*); + + private: + virtual bool isStyledLocatable() const { return true; } }; } // namespace WebCore diff --git a/WebCore/svg/SVGStyledTransformableElement.cpp b/WebCore/svg/SVGStyledTransformableElement.cpp index 279f437..af10ed7 100644 --- a/WebCore/svg/SVGStyledTransformableElement.cpp +++ b/WebCore/svg/SVGStyledTransformableElement.cpp @@ -32,17 +32,12 @@ namespace WebCore { -SVGStyledTransformableElement::SVGStyledTransformableElement(const QualifiedName& tagName, Document* doc) - : SVGStyledLocatableElement(tagName, doc) - , SVGTransformable() +SVGStyledTransformableElement::SVGStyledTransformableElement(const QualifiedName& tagName, Document* document) + : SVGStyledLocatableElement(tagName, document) , m_transform(SVGTransformList::create(SVGNames::transformAttr)) { } -SVGStyledTransformableElement::~SVGStyledTransformableElement() -{ -} - AffineTransform SVGStyledTransformableElement::getCTM(StyleUpdateStrategy styleUpdateStrategy) const { return SVGLocatable::computeCTM(this, SVGLocatable::NearestViewportScope, styleUpdateStrategy); diff --git a/WebCore/svg/SVGStyledTransformableElement.h b/WebCore/svg/SVGStyledTransformableElement.h index 1d7b197..7668889 100644 --- a/WebCore/svg/SVGStyledTransformableElement.h +++ b/WebCore/svg/SVGStyledTransformableElement.h @@ -33,11 +33,6 @@ class AffineTransform; class SVGStyledTransformableElement : public SVGStyledLocatableElement, public SVGTransformable { public: - SVGStyledTransformableElement(const QualifiedName&, Document*); - virtual ~SVGStyledTransformableElement(); - - virtual bool isStyledTransformable() const { return true; } - virtual AffineTransform getCTM(StyleUpdateStrategy = AllowStyleUpdate) const; virtual AffineTransform getScreenCTM(StyleUpdateStrategy = AllowStyleUpdate) const; virtual SVGElement* nearestViewportElement() const; @@ -49,8 +44,6 @@ public: virtual FloatRect getBBox(StyleUpdateStrategy = AllowStyleUpdate) const; - virtual void parseMappedAttribute(Attribute*); - virtual void synchronizeProperty(const QualifiedName&); bool isKnownAttribute(const QualifiedName&); // "base class" methods for all the elements which render as paths @@ -59,9 +52,16 @@ public: virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); protected: + SVGStyledTransformableElement(const QualifiedName&, Document*); + + virtual void parseMappedAttribute(Attribute*); + virtual void synchronizeProperty(const QualifiedName&); + DECLARE_ANIMATED_PROPERTY(SVGStyledTransformableElement, SVGNames::transformAttr, SVGTransformList*, Transform, transform) private: + virtual bool isStyledTransformable() const { return true; } + // Used by <animateMotion> OwnPtr<AffineTransform> m_supplementalTransform; }; diff --git a/WebCore/svg/SVGSwitchElement.cpp b/WebCore/svg/SVGSwitchElement.cpp index 5f397af..9b40a02 100644 --- a/WebCore/svg/SVGSwitchElement.cpp +++ b/WebCore/svg/SVGSwitchElement.cpp @@ -27,20 +27,21 @@ namespace WebCore { -SVGSwitchElement::SVGSwitchElement(const QualifiedName& tagName, Document* doc) - : SVGStyledTransformableElement(tagName, doc) - , SVGTests() - , SVGLangSpace() - , SVGExternalResourcesRequired() +inline SVGSwitchElement::SVGSwitchElement(const QualifiedName& tagName, Document* document) + : SVGStyledTransformableElement(tagName, document) { } -SVGSwitchElement::~SVGSwitchElement() +PassRefPtr<SVGSwitchElement> SVGSwitchElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGSwitchElement(tagName, document)); } bool SVGSwitchElement::childShouldCreateRenderer(Node* child) const { + // FIXME: This function does not do what the comment below implies it does. + // It will create a renderer for any valid SVG element children, not just the first one. + for (Node* n = firstChild(); n != 0; n = n->nextSibling()) { if (n->isSVGElement()) { SVGElement* element = static_cast<SVGElement*>(n); diff --git a/WebCore/svg/SVGSwitchElement.h b/WebCore/svg/SVGSwitchElement.h index 83b02d5..970cc1f 100644 --- a/WebCore/svg/SVGSwitchElement.h +++ b/WebCore/svg/SVGSwitchElement.h @@ -33,8 +33,10 @@ namespace WebCore { public SVGLangSpace, public SVGExternalResourcesRequired { public: + static PassRefPtr<SVGSwitchElement> create(const QualifiedName&, Document*); + + private: SVGSwitchElement(const QualifiedName&, Document*); - virtual ~SVGSwitchElement(); virtual bool isValid() const { return SVGTests::isValid(); } @@ -43,7 +45,6 @@ namespace WebCore { virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); virtual void synchronizeProperty(const QualifiedName&); - private: // SVGExternalResourcesRequired DECLARE_ANIMATED_PROPERTY(SVGSwitchElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired) }; diff --git a/WebCore/svg/SVGSymbolElement.cpp b/WebCore/svg/SVGSymbolElement.cpp index 9c110cb..7dab3e1 100644 --- a/WebCore/svg/SVGSymbolElement.cpp +++ b/WebCore/svg/SVGSymbolElement.cpp @@ -27,16 +27,14 @@ namespace WebCore { -SVGSymbolElement::SVGSymbolElement(const QualifiedName& tagName, Document* doc) - : SVGStyledElement(tagName, doc) - , SVGLangSpace() - , SVGExternalResourcesRequired() - , SVGFitToViewBox() +inline SVGSymbolElement::SVGSymbolElement(const QualifiedName& tagName, Document* document) + : SVGStyledElement(tagName, document) { } -SVGSymbolElement::~SVGSymbolElement() +PassRefPtr<SVGSymbolElement> SVGSymbolElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGSymbolElement(tagName, document)); } void SVGSymbolElement::parseMappedAttribute(Attribute* attr) diff --git a/WebCore/svg/SVGSymbolElement.h b/WebCore/svg/SVGSymbolElement.h index 7d6fdd3..1f310f8 100644 --- a/WebCore/svg/SVGSymbolElement.h +++ b/WebCore/svg/SVGSymbolElement.h @@ -34,15 +34,16 @@ namespace WebCore { public SVGExternalResourcesRequired, public SVGFitToViewBox { public: + static PassRefPtr<SVGSymbolElement> create(const QualifiedName&, Document*); + + private: SVGSymbolElement(const QualifiedName&, Document*); - virtual ~SVGSymbolElement(); virtual void parseMappedAttribute(Attribute*); virtual void svgAttributeChanged(const QualifiedName&); virtual void synchronizeProperty(const QualifiedName&); virtual bool rendererIsNeeded(RenderStyle*) { return false; } - private: virtual bool selfHasRelativeLengths() const; // SVGExternalResourcesRequired diff --git a/WebCore/svg/SVGTRefElement.cpp b/WebCore/svg/SVGTRefElement.cpp index c140f05..72a037a 100644 --- a/WebCore/svg/SVGTRefElement.cpp +++ b/WebCore/svg/SVGTRefElement.cpp @@ -32,14 +32,14 @@ namespace WebCore { -SVGTRefElement::SVGTRefElement(const QualifiedName& tagName, Document* doc) - : SVGTextPositioningElement(tagName, doc) - , SVGURIReference() +inline SVGTRefElement::SVGTRefElement(const QualifiedName& tagName, Document* document) + : SVGTextPositioningElement(tagName, document) { } -SVGTRefElement::~SVGTRefElement() +PassRefPtr<SVGTRefElement> SVGTRefElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGTRefElement(tagName, document)); } void SVGTRefElement::updateReferencedText() diff --git a/WebCore/svg/SVGTRefElement.h b/WebCore/svg/SVGTRefElement.h index f86f015..7a79ae5 100644 --- a/WebCore/svg/SVGTRefElement.h +++ b/WebCore/svg/SVGTRefElement.h @@ -30,17 +30,18 @@ namespace WebCore { class SVGTRefElement : public SVGTextPositioningElement, public SVGURIReference { public: + static PassRefPtr<SVGTRefElement> create(const QualifiedName&, Document*); + + private: SVGTRefElement(const QualifiedName&, Document*); - virtual ~SVGTRefElement(); virtual void parseMappedAttribute(Attribute*); virtual void svgAttributeChanged(const QualifiedName&); virtual void synchronizeProperty(const QualifiedName&); virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); - bool childShouldCreateRenderer(Node*) const; + virtual bool childShouldCreateRenderer(Node*) const; - private: void updateReferencedText(); // SVGURIReference diff --git a/WebCore/svg/SVGTSpanElement.cpp b/WebCore/svg/SVGTSpanElement.cpp index ef36780..d1deb70 100644 --- a/WebCore/svg/SVGTSpanElement.cpp +++ b/WebCore/svg/SVGTSpanElement.cpp @@ -29,13 +29,14 @@ namespace WebCore { -SVGTSpanElement::SVGTSpanElement(const QualifiedName& tagName, Document* doc) - : SVGTextPositioningElement(tagName, doc) +inline SVGTSpanElement::SVGTSpanElement(const QualifiedName& tagName, Document* document) + : SVGTextPositioningElement(tagName, document) { } -SVGTSpanElement::~SVGTSpanElement() +PassRefPtr<SVGTSpanElement> SVGTSpanElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGTSpanElement(tagName, document)); } bool SVGTSpanElement::childShouldCreateRenderer(Node* child) const diff --git a/WebCore/svg/SVGTSpanElement.h b/WebCore/svg/SVGTSpanElement.h index 3b9357b..9b276a8 100644 --- a/WebCore/svg/SVGTSpanElement.h +++ b/WebCore/svg/SVGTSpanElement.h @@ -28,11 +28,13 @@ namespace WebCore { class SVGTSpanElement : public SVGTextPositioningElement { public: + static PassRefPtr<SVGTSpanElement> create(const QualifiedName&, Document*); + + private: SVGTSpanElement(const QualifiedName&, Document*); - virtual ~SVGTSpanElement(); virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); - bool childShouldCreateRenderer(Node*) const; + virtual bool childShouldCreateRenderer(Node*) const; }; } // namespace WebCore diff --git a/WebCore/svg/SVGTests.cpp b/WebCore/svg/SVGTests.cpp index 9767432..e4813cd 100644 --- a/WebCore/svg/SVGTests.cpp +++ b/WebCore/svg/SVGTests.cpp @@ -64,11 +64,6 @@ SVGStringList* SVGTests::systemLanguage() const return m_systemLanguage.get(); } -bool SVGTests::hasExtension(const String&) const -{ - return false; -} - bool SVGTests::isValid() const { ExceptionCode ec = 0; diff --git a/WebCore/svg/SVGTests.h b/WebCore/svg/SVGTests.h index b638c0a..c5bb70f 100644 --- a/WebCore/svg/SVGTests.h +++ b/WebCore/svg/SVGTests.h @@ -33,20 +33,21 @@ namespace WebCore { class SVGTests { public: - SVGTests(); - virtual ~SVGTests(); - SVGStringList* requiredFeatures() const; SVGStringList* requiredExtensions() const; SVGStringList* systemLanguage() const; - bool hasExtension(const String&) const; + bool hasExtension(const String&) const { return false; } bool isValid() const; bool parseMappedAttribute(Attribute*); bool isKnownAttribute(const QualifiedName&); + protected: + SVGTests(); + ~SVGTests(); + private: mutable RefPtr<SVGStringList> m_features; mutable RefPtr<SVGStringList> m_extensions; diff --git a/WebCore/svg/SVGTextContentElement.cpp b/WebCore/svg/SVGTextContentElement.cpp index a96ce63..9d44b10 100644 --- a/WebCore/svg/SVGTextContentElement.cpp +++ b/WebCore/svg/SVGTextContentElement.cpp @@ -32,20 +32,13 @@ namespace WebCore { -SVGTextContentElement::SVGTextContentElement(const QualifiedName& tagName, Document* doc) - : SVGStyledElement(tagName, doc) - , SVGTests() - , SVGLangSpace() - , SVGExternalResourcesRequired() +SVGTextContentElement::SVGTextContentElement(const QualifiedName& tagName, Document* document) + : SVGStyledElement(tagName, document) , m_textLength(LengthModeOther) , m_lengthAdjust(LENGTHADJUST_SPACING) { } -SVGTextContentElement::~SVGTextContentElement() -{ -} - unsigned SVGTextContentElement::getNumberOfChars() const { document()->updateLayoutIgnorePendingStylesheets(); diff --git a/WebCore/svg/SVGTextContentElement.h b/WebCore/svg/SVGTextContentElement.h index d006a89..cf3698b 100644 --- a/WebCore/svg/SVGTextContentElement.h +++ b/WebCore/svg/SVGTextContentElement.h @@ -42,12 +42,6 @@ namespace WebCore { LENGTHADJUST_SPACINGANDGLYPHS = 2 }; - SVGTextContentElement(const QualifiedName&, Document*); - virtual ~SVGTextContentElement(); - - virtual bool isValid() const { return SVGTests::isValid(); } - virtual bool isTextContent() const { return true; } - unsigned getNumberOfChars() const; float getComputedTextLength() const; float getSubStringLength(unsigned charnum, unsigned nchars, ExceptionCode&) const; @@ -58,15 +52,21 @@ namespace WebCore { int getCharNumAtPosition(const FloatPoint&) const; void selectSubString(unsigned charnum, unsigned nchars, ExceptionCode&) const; - virtual void parseMappedAttribute(Attribute*); - virtual void synchronizeProperty(const QualifiedName&); - bool isKnownAttribute(const QualifiedName&); protected: + SVGTextContentElement(const QualifiedName&, Document*); + + virtual bool isValid() const { return SVGTests::isValid(); } + + virtual void parseMappedAttribute(Attribute*); + virtual void synchronizeProperty(const QualifiedName&); + virtual bool selfHasRelativeLengths() const; private: + virtual bool isTextContent() const { return true; } + DECLARE_ANIMATED_PROPERTY(SVGTextContentElement, SVGNames::textLengthAttr, SVGLength, TextLength, textLength) DECLARE_ANIMATED_PROPERTY(SVGTextContentElement, SVGNames::lengthAdjustAttr, int, LengthAdjust, lengthAdjust) diff --git a/WebCore/svg/SVGTextElement.cpp b/WebCore/svg/SVGTextElement.cpp index e13e611..c8f280e 100644 --- a/WebCore/svg/SVGTextElement.cpp +++ b/WebCore/svg/SVGTextElement.cpp @@ -35,15 +35,16 @@ namespace WebCore { -SVGTextElement::SVGTextElement(const QualifiedName& tagName, Document* doc) +inline SVGTextElement::SVGTextElement(const QualifiedName& tagName, Document* doc) : SVGTextPositioningElement(tagName, doc) , SVGTransformable() , m_transform(SVGTransformList::create(SVGNames::transformAttr)) { } -SVGTextElement::~SVGTextElement() +PassRefPtr<SVGTextElement> SVGTextElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGTextElement(tagName, document)); } void SVGTextElement::parseMappedAttribute(Attribute* attr) diff --git a/WebCore/svg/SVGTextElement.h b/WebCore/svg/SVGTextElement.h index 1788ea9..00afa59 100644 --- a/WebCore/svg/SVGTextElement.h +++ b/WebCore/svg/SVGTextElement.h @@ -30,10 +30,7 @@ namespace WebCore { class SVGTextElement : public SVGTextPositioningElement, public SVGTransformable { public: - SVGTextElement(const QualifiedName&, Document*); - virtual ~SVGTextElement(); - - virtual void parseMappedAttribute(Attribute*); + static PassRefPtr<SVGTextElement> create(const QualifiedName&, Document*); virtual SVGElement* nearestViewportElement() const; virtual SVGElement* farthestViewportElement() const; @@ -42,6 +39,12 @@ namespace WebCore { virtual AffineTransform getCTM(StyleUpdateStrategy = AllowStyleUpdate) const; virtual AffineTransform getScreenCTM(StyleUpdateStrategy = AllowStyleUpdate) const; virtual AffineTransform animatedLocalTransform() const; + + private: + SVGTextElement(const QualifiedName&, Document*); + + virtual void parseMappedAttribute(Attribute*); + virtual AffineTransform* supplementalTransform(); virtual AffineTransform localCoordinateSpaceTransform(SVGLocatable::CTMScope mode) const { return SVGTransformable::localCoordinateSpaceTransform(mode); } @@ -51,11 +54,10 @@ namespace WebCore { virtual void svgAttributeChanged(const QualifiedName&); virtual void synchronizeProperty(const QualifiedName&); - private: DECLARE_ANIMATED_PROPERTY(SVGTextElement, SVGNames::transformAttr, SVGTransformList*, Transform, transform) - // Used by <animateMotion> - OwnPtr<AffineTransform> m_supplementalTransform; + // Used by <animateMotion> + OwnPtr<AffineTransform> m_supplementalTransform; }; } // namespace WebCore diff --git a/WebCore/svg/SVGTextPathElement.cpp b/WebCore/svg/SVGTextPathElement.cpp index 8f21ab3..82adb29 100644 --- a/WebCore/svg/SVGTextPathElement.cpp +++ b/WebCore/svg/SVGTextPathElement.cpp @@ -34,17 +34,17 @@ namespace WebCore { -SVGTextPathElement::SVGTextPathElement(const QualifiedName& tagName, Document* doc) - : SVGTextContentElement(tagName, doc) - , SVGURIReference() +inline SVGTextPathElement::SVGTextPathElement(const QualifiedName& tagName, Document* document) + : SVGTextContentElement(tagName, document) , m_startOffset(LengthModeOther) , m_method(SVG_TEXTPATH_METHODTYPE_ALIGN) , m_spacing(SVG_TEXTPATH_SPACINGTYPE_EXACT) { } -SVGTextPathElement::~SVGTextPathElement() +PassRefPtr<SVGTextPathElement> SVGTextPathElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGTextPathElement(tagName, document)); } void SVGTextPathElement::parseMappedAttribute(Attribute* attr) diff --git a/WebCore/svg/SVGTextPathElement.h b/WebCore/svg/SVGTextPathElement.h index 537a107..b87dfa5 100644 --- a/WebCore/svg/SVGTextPathElement.h +++ b/WebCore/svg/SVGTextPathElement.h @@ -51,9 +51,11 @@ namespace WebCore { TEXTPATH_SPACINGTYPE_EXACT = SVG_TEXTPATH_SPACINGTYPE_EXACT }; - SVGTextPathElement(const QualifiedName&, Document*); - virtual ~SVGTextPathElement(); + static PassRefPtr<SVGTextPathElement> create(const QualifiedName&, Document*); + private: + SVGTextPathElement(const QualifiedName&, Document*); + virtual void insertedIntoDocument(); virtual void parseMappedAttribute(Attribute*); @@ -61,9 +63,8 @@ namespace WebCore { virtual void synchronizeProperty(const QualifiedName&); virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); - bool childShouldCreateRenderer(Node*) const; + virtual bool childShouldCreateRenderer(Node*) const; - private: virtual bool selfHasRelativeLengths() const; DECLARE_ANIMATED_PROPERTY(SVGTextPathElement, SVGNames::startOffsetAttr, SVGLength, StartOffset, startOffset) diff --git a/WebCore/svg/SVGTextPositioningElement.cpp b/WebCore/svg/SVGTextPositioningElement.cpp index 86231f8..4703482 100644 --- a/WebCore/svg/SVGTextPositioningElement.cpp +++ b/WebCore/svg/SVGTextPositioningElement.cpp @@ -32,8 +32,8 @@ namespace WebCore { -SVGTextPositioningElement::SVGTextPositioningElement(const QualifiedName& tagName, Document* doc) - : SVGTextContentElement(tagName, doc) +SVGTextPositioningElement::SVGTextPositioningElement(const QualifiedName& tagName, Document* document) + : SVGTextContentElement(tagName, document) , m_x(SVGLengthList::create(SVGNames::xAttr)) , m_y(SVGLengthList::create(SVGNames::yAttr)) , m_dx(SVGLengthList::create(SVGNames::dxAttr)) @@ -42,10 +42,6 @@ SVGTextPositioningElement::SVGTextPositioningElement(const QualifiedName& tagNam { } -SVGTextPositioningElement::~SVGTextPositioningElement() -{ -} - void SVGTextPositioningElement::parseMappedAttribute(Attribute* attr) { if (attr->name() == SVGNames::xAttr) diff --git a/WebCore/svg/SVGTextPositioningElement.h b/WebCore/svg/SVGTextPositioningElement.h index 0ad3090..57a4028 100644 --- a/WebCore/svg/SVGTextPositioningElement.h +++ b/WebCore/svg/SVGTextPositioningElement.h @@ -29,9 +29,8 @@ namespace WebCore { class SVGTextPositioningElement : public SVGTextContentElement { - public: + protected: SVGTextPositioningElement(const QualifiedName&, Document*); - virtual ~SVGTextPositioningElement(); virtual void parseMappedAttribute(Attribute*); virtual void svgAttributeChanged(const QualifiedName&); @@ -39,7 +38,6 @@ namespace WebCore { bool isKnownAttribute(const QualifiedName&); - private: virtual bool selfHasRelativeLengths() const; DECLARE_ANIMATED_PROPERTY(SVGTextPositioningElement, SVGNames::xAttr, SVGLengthList*, X, x) diff --git a/WebCore/svg/SVGTitleElement.cpp b/WebCore/svg/SVGTitleElement.cpp index 7fdb2e0..5eb2204 100644 --- a/WebCore/svg/SVGTitleElement.cpp +++ b/WebCore/svg/SVGTitleElement.cpp @@ -26,11 +26,16 @@ namespace WebCore { -SVGTitleElement::SVGTitleElement(const QualifiedName& tagName, Document* doc) - : SVGStyledElement(tagName, doc) +inline SVGTitleElement::SVGTitleElement(const QualifiedName& tagName, Document* document) + : SVGStyledElement(tagName, document) { } +PassRefPtr<SVGTitleElement> SVGTitleElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new SVGTitleElement(tagName, document)); +} + void SVGTitleElement::insertedIntoDocument() { SVGStyledElement::insertedIntoDocument(); diff --git a/WebCore/svg/SVGTitleElement.h b/WebCore/svg/SVGTitleElement.h index f3381b1..986f73e 100644 --- a/WebCore/svg/SVGTitleElement.h +++ b/WebCore/svg/SVGTitleElement.h @@ -26,9 +26,13 @@ #include "SVGStyledElement.h" namespace WebCore { + class SVGTitleElement : public SVGStyledElement, public SVGLangSpace { public: + static PassRefPtr<SVGTitleElement> create(const QualifiedName&, Document*); + + private: SVGTitleElement(const QualifiedName&, Document*); virtual void insertedIntoDocument(); diff --git a/WebCore/svg/SVGTransform.cpp b/WebCore/svg/SVGTransform.cpp index 594af16..86774db 100644 --- a/WebCore/svg/SVGTransform.cpp +++ b/WebCore/svg/SVGTransform.cpp @@ -52,10 +52,6 @@ SVGTransform::SVGTransform(const AffineTransform& matrix) { } -SVGTransform::~SVGTransform() -{ -} - bool SVGTransform::isValid() { return (m_type != SVG_TRANSFORM_UNKNOWN); diff --git a/WebCore/svg/SVGTransform.h b/WebCore/svg/SVGTransform.h index 071d908..db6a42f 100644 --- a/WebCore/svg/SVGTransform.h +++ b/WebCore/svg/SVGTransform.h @@ -44,8 +44,7 @@ namespace WebCore { SVGTransform(); SVGTransform(SVGTransformType); explicit SVGTransform(const AffineTransform&); - virtual ~SVGTransform(); - + SVGTransformType type() const; AffineTransform matrix() const; diff --git a/WebCore/svg/SVGTransformable.cpp b/WebCore/svg/SVGTransformable.cpp index a47cd1f..a25e086 100644 --- a/WebCore/svg/SVGTransformable.cpp +++ b/WebCore/svg/SVGTransformable.cpp @@ -33,15 +33,6 @@ namespace WebCore { -SVGTransformable::SVGTransformable() - : SVGLocatable() -{ -} - -SVGTransformable::~SVGTransformable() -{ -} - static int parseTransformParamList(const UChar*& ptr, const UChar* end, float* values, int required, int optional) { int optionalParams = 0, requiredParams = 0; diff --git a/WebCore/svg/SVGTransformable.h b/WebCore/svg/SVGTransformable.h index 8979eb1..e2fec4e 100644 --- a/WebCore/svg/SVGTransformable.h +++ b/WebCore/svg/SVGTransformable.h @@ -35,9 +35,6 @@ class QualifiedName; class SVGTransformable : virtual public SVGLocatable { public: - SVGTransformable(); - virtual ~SVGTransformable(); - enum TransformParsingMode { ClearList, DoNotClearList diff --git a/WebCore/svg/SVGURIReference.cpp b/WebCore/svg/SVGURIReference.cpp index 97003e5..af62eb4 100644 --- a/WebCore/svg/SVGURIReference.cpp +++ b/WebCore/svg/SVGURIReference.cpp @@ -27,14 +27,6 @@ namespace WebCore { -SVGURIReference::SVGURIReference() -{ -} - -SVGURIReference::~SVGURIReference() -{ -} - bool SVGURIReference::parseMappedAttribute(Attribute* attr) { if (attr->name().matches(XLinkNames::hrefAttr)) { diff --git a/WebCore/svg/SVGURIReference.h b/WebCore/svg/SVGURIReference.h index 0900215..92a93a9 100644 --- a/WebCore/svg/SVGURIReference.h +++ b/WebCore/svg/SVGURIReference.h @@ -31,8 +31,7 @@ namespace WebCore { class SVGURIReference { public: - SVGURIReference(); - virtual ~SVGURIReference(); + virtual ~SVGURIReference() { } bool parseMappedAttribute(Attribute*); bool isKnownAttribute(const QualifiedName&); diff --git a/WebCore/svg/SVGUseElement.cpp b/WebCore/svg/SVGUseElement.cpp index 68c087c..fc6c9fc 100644 --- a/WebCore/svg/SVGUseElement.cpp +++ b/WebCore/svg/SVGUseElement.cpp @@ -54,12 +54,8 @@ namespace WebCore { -SVGUseElement::SVGUseElement(const QualifiedName& tagName, Document* doc) - : SVGStyledTransformableElement(tagName, doc) - , SVGTests() - , SVGLangSpace() - , SVGExternalResourcesRequired() - , SVGURIReference() +inline SVGUseElement::SVGUseElement(const QualifiedName& tagName, Document* document) + : SVGStyledTransformableElement(tagName, document) , m_x(LengthModeWidth) , m_y(LengthModeHeight) , m_width(LengthModeWidth) @@ -70,8 +66,9 @@ SVGUseElement::SVGUseElement(const QualifiedName& tagName, Document* doc) { } -SVGUseElement::~SVGUseElement() +PassRefPtr<SVGUseElement> SVGUseElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGUseElement(tagName, document)); } SVGElementInstance* SVGUseElement::instanceRoot() const @@ -798,7 +795,7 @@ void SVGUseElement::expandUseElementsInShadowTree(SVGShadowTreeRootElement* shad // Don't ASSERT(target) here, it may be "pending", too. // Setup sub-shadow tree root node - RefPtr<SVGShadowTreeContainerElement> cloneParent = new SVGShadowTreeContainerElement(document()); + RefPtr<SVGShadowTreeContainerElement> cloneParent = SVGShadowTreeContainerElement::create(document()); // Spec: In the generated content, the 'use' will be replaced by 'g', where all attributes from the // 'use' element except for x, y, width, height and xlink:href are transferred to the generated 'g' element. @@ -848,7 +845,7 @@ void SVGUseElement::expandSymbolElementsInShadowTree(SVGShadowTreeRootElement* s // height are provided on the 'use' element, then these attributes will be transferred to // the generated 'svg'. If attributes width and/or height are not specified, the generated // 'svg' element will use values of 100% for these attributes. - RefPtr<SVGSVGElement> svgElement = new SVGSVGElement(SVGNames::svgTag, document()); + RefPtr<SVGSVGElement> svgElement = SVGSVGElement::create(SVGNames::svgTag, document()); // Transfer all attributes from <symbol> to the new <svg> element svgElement->attributes()->setAttributes(*element->attributes()); diff --git a/WebCore/svg/SVGUseElement.h b/WebCore/svg/SVGUseElement.h index 52f3f6e..9366d25 100644 --- a/WebCore/svg/SVGUseElement.h +++ b/WebCore/svg/SVGUseElement.h @@ -40,11 +40,17 @@ namespace WebCore { public SVGExternalResourcesRequired, public SVGURIReference { public: - SVGUseElement(const QualifiedName&, Document*); - virtual ~SVGUseElement(); + static PassRefPtr<SVGUseElement> create(const QualifiedName&, Document*); SVGElementInstance* instanceRoot() const; SVGElementInstance* animatedInstanceRoot() const; + SVGElementInstance* instanceForShadowTreeElement(Node*) const; + void invalidateShadowTree(); + + RenderObject* rendererClipChild() const; + + private: + SVGUseElement(const QualifiedName&, Document*); virtual bool isValid() const { return SVGTests::isValid(); } @@ -62,20 +68,15 @@ namespace WebCore { virtual void detach(); virtual Path toClipPath() const; - RenderObject* rendererClipChild() const; static void removeDisallowedElementsFromSubtree(Node* element); - SVGElementInstance* instanceForShadowTreeElement(Node* element) const; - void invalidateShadowTree(); void setUpdatesBlocked(bool blocked) { m_updatesBlocked = blocked; } - private: friend class RenderSVGShadowTreeRootContainer; bool isPendingResource() const { return m_isPendingResource; } void buildShadowAndInstanceTree(SVGShadowTreeRootElement*); - private: virtual bool selfHasRelativeLengths() const; DECLARE_ANIMATED_PROPERTY(SVGUseElement, SVGNames::xAttr, SVGLength, X, x) @@ -89,7 +90,6 @@ namespace WebCore { // SVGExternalResourcesRequired DECLARE_ANIMATED_PROPERTY(SVGUseElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired) - private: // Instance tree handling void buildInstanceTree(SVGElement* target, SVGElementInstance* targetInstance, bool& foundCycle); void handleDeepUseReferencing(SVGUseElement* use, SVGElementInstance* targetInstance, bool& foundCycle); diff --git a/WebCore/svg/SVGVKernElement.cpp b/WebCore/svg/SVGVKernElement.cpp index 662f714..b9f3c17 100644 --- a/WebCore/svg/SVGVKernElement.cpp +++ b/WebCore/svg/SVGVKernElement.cpp @@ -33,13 +33,14 @@ namespace WebCore { using namespace SVGNames; -SVGVKernElement::SVGVKernElement(const QualifiedName& tagName, Document* doc) - : SVGElement(tagName, doc) +inline SVGVKernElement::SVGVKernElement(const QualifiedName& tagName, Document* document) + : SVGElement(tagName, document) { } -SVGVKernElement::~SVGVKernElement() +PassRefPtr<SVGVKernElement> SVGVKernElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGVKernElement(tagName, document)); } void SVGVKernElement::insertedIntoDocument() diff --git a/WebCore/svg/SVGVKernElement.h b/WebCore/svg/SVGVKernElement.h index c4bc90f..c8bb1d4 100644 --- a/WebCore/svg/SVGVKernElement.h +++ b/WebCore/svg/SVGVKernElement.h @@ -34,15 +34,17 @@ class SVGFontData; class SVGVKernElement : public SVGElement { public: + static PassRefPtr<SVGVKernElement> create(const QualifiedName&, Document*); + + void buildVerticalKerningPair(KerningPairVector&); + +private: SVGVKernElement(const QualifiedName&, Document*); - virtual ~SVGVKernElement(); virtual void insertedIntoDocument(); virtual void removedFromDocument(); virtual bool rendererIsNeeded(RenderStyle*) { return false; } - - void buildVerticalKerningPair(KerningPairVector&); }; } // namespace WebCore diff --git a/WebCore/svg/SVGViewElement.cpp b/WebCore/svg/SVGViewElement.cpp index 2b9b6cc..6a83066 100644 --- a/WebCore/svg/SVGViewElement.cpp +++ b/WebCore/svg/SVGViewElement.cpp @@ -32,16 +32,14 @@ namespace WebCore { -SVGViewElement::SVGViewElement(const QualifiedName& tagName, Document* doc) - : SVGStyledElement(tagName, doc) - , SVGExternalResourcesRequired() - , SVGFitToViewBox() - , SVGZoomAndPan() +inline SVGViewElement::SVGViewElement(const QualifiedName& tagName, Document* document) + : SVGStyledElement(tagName, document) { } -SVGViewElement::~SVGViewElement() +PassRefPtr<SVGViewElement> SVGViewElement::create(const QualifiedName& tagName, Document* document) { + return adoptRef(new SVGViewElement(tagName, document)); } SVGStringList* SVGViewElement::viewTarget() const diff --git a/WebCore/svg/SVGViewElement.h b/WebCore/svg/SVGViewElement.h index 14ea19e..b483236 100644 --- a/WebCore/svg/SVGViewElement.h +++ b/WebCore/svg/SVGViewElement.h @@ -35,17 +35,18 @@ namespace WebCore { public SVGFitToViewBox, public SVGZoomAndPan { public: + static PassRefPtr<SVGViewElement> create(const QualifiedName&, Document*); + + SVGStringList* viewTarget() const; + + private: SVGViewElement(const QualifiedName&, Document*); - virtual ~SVGViewElement(); virtual void parseMappedAttribute(Attribute*); virtual void synchronizeProperty(const QualifiedName&); - SVGStringList* viewTarget() const; - virtual bool rendererIsNeeded(RenderStyle*) { return false; } - private: // SVGExternalResourcesRequired DECLARE_ANIMATED_PROPERTY(SVGViewElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired) diff --git a/WebCore/svg/SVGViewSpec.cpp b/WebCore/svg/SVGViewSpec.cpp index 25fb66b..20c58ac 100644 --- a/WebCore/svg/SVGViewSpec.cpp +++ b/WebCore/svg/SVGViewSpec.cpp @@ -32,17 +32,11 @@ namespace WebCore { SVGViewSpec::SVGViewSpec(const SVGSVGElement* contextElement) - : SVGFitToViewBox() - , SVGZoomAndPan() - , m_contextElement(contextElement) + : m_contextElement(contextElement) , m_transform(SVGTransformList::create(SVGNames::transformAttr)) { } -SVGViewSpec::~SVGViewSpec() -{ -} - void SVGViewSpec::setTransform(const String& transform) { SVGTransformable::parseTransformAttribute(m_transform.get(), transform); diff --git a/WebCore/svg/SVGViewSpec.h b/WebCore/svg/SVGViewSpec.h index 3355fce..cf64bca 100644 --- a/WebCore/svg/SVGViewSpec.h +++ b/WebCore/svg/SVGViewSpec.h @@ -37,7 +37,6 @@ namespace WebCore { public Noncopyable { public: SVGViewSpec(const SVGSVGElement*); - virtual ~SVGViewSpec(); bool parseViewSpec(const String&); diff --git a/WebCore/svg/SVGZoomAndPan.cpp b/WebCore/svg/SVGZoomAndPan.cpp index d256bd0..93ab3ad 100644 --- a/WebCore/svg/SVGZoomAndPan.cpp +++ b/WebCore/svg/SVGZoomAndPan.cpp @@ -29,20 +29,6 @@ namespace WebCore { -SVGZoomAndPan::SVGZoomAndPan() - : m_zoomAndPan(SVG_ZOOMANDPAN_MAGNIFY) -{ -} - -SVGZoomAndPan::~SVGZoomAndPan() -{ -} - -unsigned short SVGZoomAndPan::zoomAndPan() const -{ - return m_zoomAndPan; -} - void SVGZoomAndPan::setZoomAndPan(unsigned short zoomAndPan) { m_zoomAndPan = zoomAndPan; diff --git a/WebCore/svg/SVGZoomAndPan.h b/WebCore/svg/SVGZoomAndPan.h index a85304d..b2e9d83 100644 --- a/WebCore/svg/SVGZoomAndPan.h +++ b/WebCore/svg/SVGZoomAndPan.h @@ -22,7 +22,8 @@ #define SVGZoomAndPan_h #if ENABLE(SVG) -#include "PlatformString.h" + +#include <wtf/unicode/Unicode.h> namespace WebCore { @@ -37,10 +38,10 @@ namespace WebCore { SVG_ZOOMANDPAN_MAGNIFY = 2 }; - SVGZoomAndPan(); - virtual ~SVGZoomAndPan(); + SVGZoomAndPan() : m_zoomAndPan(SVG_ZOOMANDPAN_MAGNIFY) { } + virtual ~SVGZoomAndPan() { } - unsigned short zoomAndPan() const; + unsigned short zoomAndPan() const { return m_zoomAndPan; } virtual void setZoomAndPan(unsigned short zoomAndPan); bool parseMappedAttribute(Attribute*); @@ -55,4 +56,5 @@ namespace WebCore { } // namespace WebCore #endif // ENABLE(SVG) + #endif // SVGZoomAndPan_h diff --git a/WebCore/svg/SVGZoomEvent.cpp b/WebCore/svg/SVGZoomEvent.cpp index f8d94e4..784c32b 100644 --- a/WebCore/svg/SVGZoomEvent.cpp +++ b/WebCore/svg/SVGZoomEvent.cpp @@ -31,10 +31,6 @@ SVGZoomEvent::SVGZoomEvent() { } -SVGZoomEvent::~SVGZoomEvent() -{ -} - FloatRect SVGZoomEvent::zoomRectScreen() const { return m_zoomRectScreen; diff --git a/WebCore/svg/SVGZoomEvent.h b/WebCore/svg/SVGZoomEvent.h index d4b7de0..48a3636 100644 --- a/WebCore/svg/SVGZoomEvent.h +++ b/WebCore/svg/SVGZoomEvent.h @@ -31,7 +31,6 @@ namespace WebCore { class SVGZoomEvent : public UIEvent { public: static PassRefPtr<SVGZoomEvent> create() { return adoptRef(new SVGZoomEvent); } - virtual ~SVGZoomEvent(); // 'SVGZoomEvent' functions FloatRect zoomRectScreen() const; @@ -46,11 +45,11 @@ namespace WebCore { FloatPoint newTranslate() const; - virtual bool isSVGZoomEvent() const; - private: SVGZoomEvent(); + virtual bool isSVGZoomEvent() const; + float m_newScale; float m_previousScale; diff --git a/WebCore/svg/graphics/SVGImage.cpp b/WebCore/svg/graphics/SVGImage.cpp index 6608c9e..2d1d592 100644 --- a/WebCore/svg/graphics/SVGImage.cpp +++ b/WebCore/svg/graphics/SVGImage.cpp @@ -240,7 +240,7 @@ bool SVGImage::dataChanged(bool allDataReceived) static FrameLoaderClient* dummyFrameLoaderClient = new EmptyFrameLoaderClient; Page::PageClients pageClients; - m_chromeClient.set(new SVGImageChromeClient(this)); + m_chromeClient = adoptPtr(new SVGImageChromeClient(this)); pageClients.chromeClient = m_chromeClient.get(); #if ENABLE(CONTEXT_MENUS) static ContextMenuClient* dummyContextMenuClient = new EmptyContextMenuClient; diff --git a/WebCore/svg/svgtags.in b/WebCore/svg/svgtags.in index adf0b24..ee6765c 100644 --- a/WebCore/svg/svgtags.in +++ b/WebCore/svg/svgtags.in @@ -2,105 +2,105 @@ namespace="SVG" namespaceURI="http://www.w3.org/2000/svg" guardFactoryWith="ENABLE(SVG)" -a createWithNew +a #if ENABLE_SVG_FONTS -altGlyph createWithNew +altGlyph #endif #if 0 -altGlyphDef createWithNew -altGlyphItem createWithNew +altGlyphDef +altGlyphItem #endif #if ENABLE_SVG_ANIMATION -animate createWithNew -animateColor createWithNew -animateMotion JSInterfaceName=SVGElement, createWithNew -animateTransform createWithNew -set createWithNew +animate +animateColor +animateMotion JSInterfaceName=SVGElement +animateTransform +set #endif -circle createWithNew -clipPath createWithNew +circle +clipPath #if 0 -color_profile createWithNew +color_profile #endif -cursor createWithNew -defs createWithNew -desc createWithNew -ellipse createWithNew +cursor +defs +desc +ellipse #if ENABLE_FILTERS -feBlend createWithNew -feColorMatrix createWithNew -feComponentTransfer createWithNew -feComposite createWithNew -feConvolveMatrix createWithNew -feDiffuseLighting createWithNew -feDisplacementMap createWithNew -feDistantLight createWithNew -feFlood createWithNew -feFuncA createWithNew -feFuncB createWithNew -feFuncG createWithNew -feFuncR createWithNew -feGaussianBlur createWithNew -feImage createWithNew -feMerge createWithNew -feMergeNode createWithNew -feMorphology createWithNew -feOffset createWithNew -fePointLight createWithNew -feSpecularLighting createWithNew -feSpotLight createWithNew -feTile createWithNew -feTurbulence createWithNew -filter createWithNew +feBlend +feColorMatrix +feComponentTransfer +feComposite +feConvolveMatrix +feDiffuseLighting +feDisplacementMap +feDistantLight +feFlood +feFuncA +feFuncB +feFuncG +feFuncR +feGaussianBlur +feImage +feMerge +feMergeNode +feMorphology +feOffset +fePointLight +feSpecularLighting +feSpotLight +feTile +feTurbulence +filter #endif #if ENABLE_SVG_FONTS -font createWithNew -font_face createWithNew -font_face_format createWithNew -font_face_name createWithNew -font_face_src createWithNew -font_face_uri createWithNew +font +font_face +font_face_format +font_face_name +font_face_src +font_face_uri #endif #if ENABLE_SVG_FOREIGN_OBJECT -foreignObject createWithNew +foreignObject #endif -g createWithNew +g #if ENABLE_SVG_FONTS -glyph createWithNew +glyph #endif #if 0 -glyphRef createWithNew +glyphRef #endif #if ENABLE_SVG_FONTS -hkern interfaceName=SVGHKernElement, JSInterfaceName=SVGElement, createWithNew +hkern interfaceName=SVGHKernElement, JSInterfaceName=SVGElement #endif -image createWithNew -line createWithNew -linearGradient createWithNew -marker createWithNew -mask createWithNew -metadata createWithNew +image +line +linearGradient +marker +mask +metadata #if ENABLE_SVG_FONTS -missing_glyph createWithNew +missing_glyph #endif -mpath interfaceName=SVGMPathElement, JSInterfaceName=SVGElement, createWithNew -path createWithNew -pattern createWithNew -polygon createWithNew -polyline createWithNew -radialGradient createWithNew -rect createWithNew -script constructorNeedsCreatedByParser, createWithNew -stop createWithNew -style constructorNeedsCreatedByParser, createWithNew -svg interfaceName=SVGSVGElement, createWithNew -switch createWithNew -symbol createWithNew -text createWithNew -textPath createWithNew -title createWithNew -tref interfaceName=SVGTRefElement, createWithNew -tspan interfaceName=SVGTSpanElement, createWithNew -use createWithNew -view createWithNew -vkern interfaceName=SVGVKernElement, createWithNew +mpath interfaceName=SVGMPathElement, JSInterfaceName=SVGElement +path +pattern +polygon +polyline +radialGradient +rect +script constructorNeedsCreatedByParser +stop +style constructorNeedsCreatedByParser +svg interfaceName=SVGSVGElement +switch +symbol +text +textPath +title +tref interfaceName=SVGTRefElement +tspan interfaceName=SVGTSpanElement +use +view +vkern interfaceName=SVGVKernElement diff --git a/WebCore/wml/WMLAElement.cpp b/WebCore/wml/WMLAElement.cpp index 99e30e9..4d1bf95 100644 --- a/WebCore/wml/WMLAElement.cpp +++ b/WebCore/wml/WMLAElement.cpp @@ -51,6 +51,11 @@ WMLAElement::WMLAElement(const QualifiedName& tagName, Document* doc) { } +PassRefPtr<WMLAElement> WMLAElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new WMLAElement(tagName, document)); +} + void WMLAElement::parseMappedAttribute(Attribute* attr) { if (attr->name() == HTMLNames::hrefAttr) { diff --git a/WebCore/wml/WMLAElement.h b/WebCore/wml/WMLAElement.h index b21ebb6..9dcda6b 100644 --- a/WebCore/wml/WMLAElement.h +++ b/WebCore/wml/WMLAElement.h @@ -33,6 +33,8 @@ namespace WebCore { class WMLAElement : public WMLElement { public: + static PassRefPtr<WMLAElement> create(const QualifiedName& tagName, Document*); + WMLAElement(const QualifiedName& tagName, Document*); virtual bool supportsFocus() const; diff --git a/WebCore/wml/WMLAccessElement.cpp b/WebCore/wml/WMLAccessElement.cpp index d6e6768..0e13106 100644 --- a/WebCore/wml/WMLAccessElement.cpp +++ b/WebCore/wml/WMLAccessElement.cpp @@ -37,6 +37,11 @@ WMLAccessElement::WMLAccessElement(const QualifiedName& tagName, Document* doc) { } +PassRefPtr<WMLAccessElement> WMLAccessElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new WMLAccessElement(tagName, document)); +} + void WMLAccessElement::parseMappedAttribute(Attribute* attr) { if (attr->name() == domainAttr) { diff --git a/WebCore/wml/WMLAccessElement.h b/WebCore/wml/WMLAccessElement.h index 83290e4..eb7436c 100644 --- a/WebCore/wml/WMLAccessElement.h +++ b/WebCore/wml/WMLAccessElement.h @@ -28,6 +28,8 @@ namespace WebCore { class WMLAccessElement : public WMLElement { public: + static PassRefPtr<WMLAccessElement> create(const QualifiedName& tagName, Document*); + WMLAccessElement(const QualifiedName& tagName, Document*); virtual void parseMappedAttribute(Attribute*); diff --git a/WebCore/wml/WMLAnchorElement.cpp b/WebCore/wml/WMLAnchorElement.cpp index ac9c8f2..5b842bc 100644 --- a/WebCore/wml/WMLAnchorElement.cpp +++ b/WebCore/wml/WMLAnchorElement.cpp @@ -40,6 +40,11 @@ WMLAnchorElement::WMLAnchorElement(const QualifiedName& tagName, Document* doc) setIsLink(); } +PassRefPtr<WMLAnchorElement> WMLAnchorElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new WMLAnchorElement(tagName, document)); +} + WMLAnchorElement::~WMLAnchorElement() { } diff --git a/WebCore/wml/WMLAnchorElement.h b/WebCore/wml/WMLAnchorElement.h index abc01c9..6cb36c8 100644 --- a/WebCore/wml/WMLAnchorElement.h +++ b/WebCore/wml/WMLAnchorElement.h @@ -30,6 +30,8 @@ class WMLTaskElement; class WMLAnchorElement : public WMLAElement { public: + static PassRefPtr<WMLAnchorElement> create(const QualifiedName& tagName, Document*); + WMLAnchorElement(const QualifiedName& tagName, Document*); virtual ~WMLAnchorElement(); diff --git a/WebCore/wml/WMLBRElement.cpp b/WebCore/wml/WMLBRElement.cpp index d24d2a2..51a2f57 100644 --- a/WebCore/wml/WMLBRElement.cpp +++ b/WebCore/wml/WMLBRElement.cpp @@ -40,6 +40,11 @@ WMLBRElement::WMLBRElement(const QualifiedName& tagName, Document* doc) { } +PassRefPtr<WMLBRElement> WMLBRElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new WMLBRElement(tagName, document)); +} + bool WMLBRElement::mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const { if (attrName == HTMLNames::clearAttr) { diff --git a/WebCore/wml/WMLBRElement.h b/WebCore/wml/WMLBRElement.h index 41c8776..fb12688 100644 --- a/WebCore/wml/WMLBRElement.h +++ b/WebCore/wml/WMLBRElement.h @@ -32,6 +32,8 @@ namespace WebCore { class WMLBRElement : public WMLElement { public: + static PassRefPtr<WMLBRElement> create(const QualifiedName& tagName, Document*); + WMLBRElement(const QualifiedName& tagName, Document*); virtual bool mapToEntry(const QualifiedName&, MappedAttributeEntry&) const; diff --git a/WebCore/wml/WMLCardElement.cpp b/WebCore/wml/WMLCardElement.cpp index 645d0fc..38ba8ab 100644 --- a/WebCore/wml/WMLCardElement.cpp +++ b/WebCore/wml/WMLCardElement.cpp @@ -55,6 +55,11 @@ WMLCardElement::WMLCardElement(const QualifiedName& tagName, Document* doc) ASSERT(hasTagName(cardTag)); } +PassRefPtr<WMLCardElement> WMLCardElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new WMLCardElement(tagName, document)); +} + WMLCardElement::~WMLCardElement() { } diff --git a/WebCore/wml/WMLCardElement.h b/WebCore/wml/WMLCardElement.h index 40eec36..f82374d 100644 --- a/WebCore/wml/WMLCardElement.h +++ b/WebCore/wml/WMLCardElement.h @@ -33,6 +33,8 @@ class WMLTimerElement; class WMLCardElement : public WMLElement, public WMLEventHandlingElement { public: + static PassRefPtr<WMLCardElement> create(const QualifiedName& tagName, Document*); + WMLCardElement(const QualifiedName&, Document*); virtual ~WMLCardElement(); diff --git a/WebCore/wml/WMLDoElement.cpp b/WebCore/wml/WMLDoElement.cpp index 6a40fc9..9398aa0 100644 --- a/WebCore/wml/WMLDoElement.cpp +++ b/WebCore/wml/WMLDoElement.cpp @@ -51,6 +51,11 @@ WMLDoElement::WMLDoElement(const QualifiedName& tagName, Document* doc) { } +PassRefPtr<WMLDoElement> WMLDoElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new WMLDoElement(tagName, document)); +} + void WMLDoElement::defaultEventHandler(Event* event) { if (m_isOptional) diff --git a/WebCore/wml/WMLDoElement.h b/WebCore/wml/WMLDoElement.h index 024ef80..2ba6d9e 100644 --- a/WebCore/wml/WMLDoElement.h +++ b/WebCore/wml/WMLDoElement.h @@ -30,6 +30,8 @@ class WMLTaskElement; class WMLDoElement : public WMLElement { public: + static PassRefPtr<WMLDoElement> create(const QualifiedName& tagName, Document*); + WMLDoElement(const QualifiedName& tagName, Document*); virtual void defaultEventHandler(Event*); diff --git a/WebCore/wml/WMLDocument.h b/WebCore/wml/WMLDocument.h index 3057d9b..f2be938 100644 --- a/WebCore/wml/WMLDocument.h +++ b/WebCore/wml/WMLDocument.h @@ -34,7 +34,7 @@ class WMLDocument : public Document { public: static PassRefPtr<WMLDocument> create(Frame* frame, const KURL& url) { - return adoptRef(new WMLDocument(frame, url)); + return adoptRef(adoptRef(new WMLDocument(frame, url)))); } virtual ~WMLDocument(); diff --git a/WebCore/wml/WMLElement.cpp b/WebCore/wml/WMLElement.cpp index f359236..4d18e94 100644 --- a/WebCore/wml/WMLElement.cpp +++ b/WebCore/wml/WMLElement.cpp @@ -39,13 +39,13 @@ namespace WebCore { using namespace WMLNames; WMLElement::WMLElement(const QualifiedName& tagName, Document* document) - : StyledElement(tagName, document, CreateStyledElementZeroRefCount) + : StyledElement(tagName, document, CreateStyledElement) { } PassRefPtr<WMLElement> WMLElement::create(const QualifiedName& tagName, Document* document) { - return new WMLElement(tagName, document); + return adoptRef(new WMLElement(tagName, document)); } bool WMLElement::mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const diff --git a/WebCore/wml/WMLFieldSetElement.cpp b/WebCore/wml/WMLFieldSetElement.cpp index c89e669..86c1e46 100644 --- a/WebCore/wml/WMLFieldSetElement.cpp +++ b/WebCore/wml/WMLFieldSetElement.cpp @@ -39,6 +39,11 @@ WMLFieldSetElement::WMLFieldSetElement(const QualifiedName& tagName, Document* d { } +PassRefPtr<WMLFieldSetElement> WMLFieldSetElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new WMLFieldSetElement(tagName, document)); +} + WMLFieldSetElement::~WMLFieldSetElement() { } diff --git a/WebCore/wml/WMLFieldSetElement.h b/WebCore/wml/WMLFieldSetElement.h index 1087fa1..11ef2c1 100644 --- a/WebCore/wml/WMLFieldSetElement.h +++ b/WebCore/wml/WMLFieldSetElement.h @@ -28,6 +28,8 @@ namespace WebCore { class WMLFieldSetElement : public WMLElement { public: + static PassRefPtr<WMLFieldSetElement> create(const QualifiedName&, Document*); + WMLFieldSetElement(const QualifiedName& tagName, Document*); virtual ~WMLFieldSetElement(); diff --git a/WebCore/wml/WMLFormControlElement.cpp b/WebCore/wml/WMLFormControlElement.cpp index 93ffbda..c264340 100644 --- a/WebCore/wml/WMLFormControlElement.cpp +++ b/WebCore/wml/WMLFormControlElement.cpp @@ -35,6 +35,11 @@ WMLFormControlElement::WMLFormControlElement(const QualifiedName& tagName, Docum { } +PassRefPtr<WMLFormControlElement> WMLFormControlElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new WMLFormControlElement(tagName, document)); +} + WMLFormControlElement::~WMLFormControlElement() { } diff --git a/WebCore/wml/WMLGoElement.cpp b/WebCore/wml/WMLGoElement.cpp index d3a6216..cc41226 100644 --- a/WebCore/wml/WMLGoElement.cpp +++ b/WebCore/wml/WMLGoElement.cpp @@ -50,6 +50,11 @@ WMLGoElement::WMLGoElement(const QualifiedName& tagName, Document* doc) { } +PassRefPtr<WMLGoElement> WMLGoElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new WMLGoElement(tagName, document)); +} + void WMLGoElement::registerPostfieldElement(WMLPostfieldElement* postfield) { ASSERT(m_postfieldElements.find(postfield) == WTF::notFound); diff --git a/WebCore/wml/WMLGoElement.h b/WebCore/wml/WMLGoElement.h index d7f8991..d29e124 100644 --- a/WebCore/wml/WMLGoElement.h +++ b/WebCore/wml/WMLGoElement.h @@ -33,6 +33,8 @@ class WMLPostfieldElement; class WMLGoElement : public WMLTaskElement { public: + static PassRefPtr<WMLGoElement> create(const QualifiedName&, Document*); + WMLGoElement(const QualifiedName& tagName, Document*); void registerPostfieldElement(WMLPostfieldElement*); diff --git a/WebCore/wml/WMLImageElement.cpp b/WebCore/wml/WMLImageElement.cpp index f6b3f1e..c4f6b06 100644 --- a/WebCore/wml/WMLImageElement.cpp +++ b/WebCore/wml/WMLImageElement.cpp @@ -43,6 +43,11 @@ WMLImageElement::WMLImageElement(const QualifiedName& tagName, Document* doc) { } +PassRefPtr<WMLImageElement> WMLImageElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new WMLImageElement(tagName, document)); +} + WMLImageElement::~WMLImageElement() { } @@ -109,7 +114,9 @@ void WMLImageElement::attach() RenderObject* WMLImageElement::createRenderer(RenderArena* arena, RenderStyle*) { - return new (arena) RenderImage(this); + RenderImage* image = new (arena) RenderImage(this); + image->setImageResource(RenderImageResource::create()); + return image; } void WMLImageElement::insertedIntoDocument() diff --git a/WebCore/wml/WMLImageElement.h b/WebCore/wml/WMLImageElement.h index 2ec5031..6421f6e 100644 --- a/WebCore/wml/WMLImageElement.h +++ b/WebCore/wml/WMLImageElement.h @@ -29,6 +29,8 @@ namespace WebCore { class WMLImageElement : public WMLElement { public: + static PassRefPtr<WMLImageElement> create(const QualifiedName&, Document*); + WMLImageElement(const QualifiedName& tagName, Document*); virtual ~WMLImageElement(); diff --git a/WebCore/wml/WMLInputElement.cpp b/WebCore/wml/WMLInputElement.cpp index bf407c1..639658f 100644 --- a/WebCore/wml/WMLInputElement.cpp +++ b/WebCore/wml/WMLInputElement.cpp @@ -45,6 +45,11 @@ WMLInputElement::WMLInputElement(const QualifiedName& tagName, Document* doc) { } +PassRefPtr<WMLInputElement> WMLInputElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new WMLInputElement(tagName, document)); +} + WMLInputElement::~WMLInputElement() { if (m_isPasswordField) diff --git a/WebCore/wml/WMLInputElement.h b/WebCore/wml/WMLInputElement.h index 329d869..70d85e9 100644 --- a/WebCore/wml/WMLInputElement.h +++ b/WebCore/wml/WMLInputElement.h @@ -31,6 +31,8 @@ class FormDataList; class WMLInputElement : public WMLFormControlElement, public InputElement { public: + static PassRefPtr<WMLInputElement> create(const QualifiedName&, Document*); + WMLInputElement(const QualifiedName& tagName, Document*); virtual ~WMLInputElement(); diff --git a/WebCore/wml/WMLInsertedLegendElement.cpp b/WebCore/wml/WMLInsertedLegendElement.cpp index 1464e71..0a18b4a 100644 --- a/WebCore/wml/WMLInsertedLegendElement.cpp +++ b/WebCore/wml/WMLInsertedLegendElement.cpp @@ -30,6 +30,11 @@ WMLInsertedLegendElement::WMLInsertedLegendElement(const QualifiedName& tagName, { } +PassRefPtr<WMLInsertedLegendElement> WMLInsertedLegendElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new WMLInsertedLegendElement(tagName, document)); +} + WMLInsertedLegendElement::~WMLInsertedLegendElement() { } diff --git a/WebCore/wml/WMLInsertedLegendElement.h b/WebCore/wml/WMLInsertedLegendElement.h index 73392ad..e79550e 100644 --- a/WebCore/wml/WMLInsertedLegendElement.h +++ b/WebCore/wml/WMLInsertedLegendElement.h @@ -28,6 +28,8 @@ namespace WebCore { class WMLInsertedLegendElement : public WMLElement { public: + static PassRefPtr<WMLInsertedLegendElement> create(const QualifiedName&, Document*); + WMLInsertedLegendElement(const QualifiedName& tagName, Document*); virtual ~WMLInsertedLegendElement(); }; diff --git a/WebCore/wml/WMLIntrinsicEvent.cpp b/WebCore/wml/WMLIntrinsicEvent.cpp index bb631b9..ec5e987 100644 --- a/WebCore/wml/WMLIntrinsicEvent.cpp +++ b/WebCore/wml/WMLIntrinsicEvent.cpp @@ -43,6 +43,11 @@ WMLIntrinsicEvent::WMLIntrinsicEvent(Document* document, const String& targetURL m_taskElement->setAttribute(HTMLNames::hrefAttr, targetURL); } +PassRefPtr<WMLIntrinsicEvent> WMLIntrinsicEvent::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new WMLIntrinsicEvent(tagName, document)); +} + WMLIntrinsicEvent::WMLIntrinsicEvent(WMLTaskElement* taskElement) : m_taskElement(taskElement) { diff --git a/WebCore/wml/WMLMetaElement.cpp b/WebCore/wml/WMLMetaElement.cpp index e28afaf..2b8e00d 100644 --- a/WebCore/wml/WMLMetaElement.cpp +++ b/WebCore/wml/WMLMetaElement.cpp @@ -34,6 +34,11 @@ WMLMetaElement::WMLMetaElement(const QualifiedName& tagName, Document* doc) { } +PassRefPtr<WMLMetaElement> WMLMetaElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new WMLMetaElement(tagName, document)); +} + WMLMetaElement::~WMLMetaElement() { } diff --git a/WebCore/wml/WMLMetaElement.h b/WebCore/wml/WMLMetaElement.h index 765490d..16e2268 100644 --- a/WebCore/wml/WMLMetaElement.h +++ b/WebCore/wml/WMLMetaElement.h @@ -28,6 +28,8 @@ namespace WebCore { class WMLMetaElement : public WMLElement { public: + static PassRefPtr<WMLMetaElement> create(const QualifiedName&, Document*); + WMLMetaElement(const QualifiedName& tagName, Document*); virtual ~WMLMetaElement(); diff --git a/WebCore/wml/WMLNoopElement.cpp b/WebCore/wml/WMLNoopElement.cpp index b2ce506..3afddeb 100644 --- a/WebCore/wml/WMLNoopElement.cpp +++ b/WebCore/wml/WMLNoopElement.cpp @@ -36,6 +36,11 @@ WMLNoopElement::WMLNoopElement(const QualifiedName& tagName, Document* doc) { } +PassRefPtr<WMLNoopElement> WMLNoopElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new WMLNoopElement(tagName, document)); +} + WMLNoopElement::~WMLNoopElement() { } diff --git a/WebCore/wml/WMLNoopElement.h b/WebCore/wml/WMLNoopElement.h index 63b316e..be0413c 100644 --- a/WebCore/wml/WMLNoopElement.h +++ b/WebCore/wml/WMLNoopElement.h @@ -28,6 +28,8 @@ namespace WebCore { class WMLNoopElement : public WMLElement { public: + static PassRefPtr<WMLNoopElement> create(const QualifiedName&, Document*); + WMLNoopElement(const QualifiedName& tagName, Document*); virtual ~WMLNoopElement(); diff --git a/WebCore/wml/WMLOnEventElement.cpp b/WebCore/wml/WMLOnEventElement.cpp index 34518c3..ad6684b 100644 --- a/WebCore/wml/WMLOnEventElement.cpp +++ b/WebCore/wml/WMLOnEventElement.cpp @@ -41,6 +41,11 @@ WMLOnEventElement::WMLOnEventElement(const QualifiedName& tagName, Document* doc { } +PassRefPtr<WMLOnEventElement> WMLOnEventElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new WMLOnEventElement(tagName, document)); +} + void WMLOnEventElement::parseMappedAttribute(Attribute* attr) { if (attr->name() == HTMLNames::typeAttr) { diff --git a/WebCore/wml/WMLOnEventElement.h b/WebCore/wml/WMLOnEventElement.h index 4bc4bca..8bbaa1d 100644 --- a/WebCore/wml/WMLOnEventElement.h +++ b/WebCore/wml/WMLOnEventElement.h @@ -31,6 +31,8 @@ class WMLTaskElement; class WMLOnEventElement : public WMLElement { public: + static PassRefPtr<WMLOnEventElement> create(const QualifiedName&, Document*); + WMLOnEventElement(const QualifiedName& tagName, Document*); virtual void parseMappedAttribute(Attribute*); diff --git a/WebCore/wml/WMLOptGroupElement.cpp b/WebCore/wml/WMLOptGroupElement.cpp index fde3474..7c59a7e 100644 --- a/WebCore/wml/WMLOptGroupElement.cpp +++ b/WebCore/wml/WMLOptGroupElement.cpp @@ -40,6 +40,11 @@ WMLOptGroupElement::WMLOptGroupElement(const QualifiedName& tagName, Document* d { } +PassRefPtr<WMLOptGroupElement> WMLOptGroupElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new WMLOptGroupElement(tagName, document)); +} + WMLOptGroupElement::~WMLOptGroupElement() { } diff --git a/WebCore/wml/WMLOptGroupElement.h b/WebCore/wml/WMLOptGroupElement.h index 682c68c..3cfa47d 100644 --- a/WebCore/wml/WMLOptGroupElement.h +++ b/WebCore/wml/WMLOptGroupElement.h @@ -29,6 +29,8 @@ namespace WebCore { class WMLOptGroupElement : public WMLFormControlElement, public OptionGroupElement { public: + static PassRefPtr<WMLOptGroupElement> create(const QualifiedName&, Document*); + WMLOptGroupElement(const QualifiedName& tagName, Document*); virtual ~WMLOptGroupElement(); diff --git a/WebCore/wml/WMLOptionElement.cpp b/WebCore/wml/WMLOptionElement.cpp index ca4ea91..bc97215 100644 --- a/WebCore/wml/WMLOptionElement.cpp +++ b/WebCore/wml/WMLOptionElement.cpp @@ -39,6 +39,11 @@ WMLOptionElement::WMLOptionElement(const QualifiedName& tagName, Document* doc) { } +PassRefPtr<WMLOptionElement> WMLOptionElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new WMLOptionElement(tagName, document)); +} + WMLOptionElement::~WMLOptionElement() { } diff --git a/WebCore/wml/WMLOptionElement.h b/WebCore/wml/WMLOptionElement.h index 3831f7d..41a4638 100644 --- a/WebCore/wml/WMLOptionElement.h +++ b/WebCore/wml/WMLOptionElement.h @@ -30,6 +30,8 @@ namespace WebCore { class WMLOptionElement : public WMLFormControlElement, public WMLEventHandlingElement, public OptionElement { public: + static PassRefPtr<WMLOptionElement> create(const QualifiedName&, Document*); + WMLOptionElement(const QualifiedName& tagName, Document*); virtual ~WMLOptionElement(); diff --git a/WebCore/wml/WMLPElement.cpp b/WebCore/wml/WMLPElement.cpp index ca76022..629b49f 100644 --- a/WebCore/wml/WMLPElement.cpp +++ b/WebCore/wml/WMLPElement.cpp @@ -43,6 +43,11 @@ WMLPElement::WMLPElement(const QualifiedName& tagName, Document* doc) { } +PassRefPtr<WMLPElement> WMLPElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new WMLPElement(tagName, document)); +} + bool WMLPElement::mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const { if (attrName == HTMLNames::alignAttr) { diff --git a/WebCore/wml/WMLPElement.h b/WebCore/wml/WMLPElement.h index 48f98f8..32a35b1 100644 --- a/WebCore/wml/WMLPElement.h +++ b/WebCore/wml/WMLPElement.h @@ -31,6 +31,8 @@ namespace WebCore { class WMLPElement : public WMLElement { public: + static PassRefPtr<WMLPElement> create(const QualifiedName&, Document*); + WMLPElement(const QualifiedName& tagName, Document*); virtual bool mapToEntry(const QualifiedName&, MappedAttributeEntry&) const; diff --git a/WebCore/wml/WMLPostfieldElement.cpp b/WebCore/wml/WMLPostfieldElement.cpp index 5cf26c7..b168dbb 100644 --- a/WebCore/wml/WMLPostfieldElement.cpp +++ b/WebCore/wml/WMLPostfieldElement.cpp @@ -39,6 +39,11 @@ WMLPostfieldElement::WMLPostfieldElement(const QualifiedName& tagName, Document* { } +PassRefPtr<WMLPostfieldElement> WMLPostfieldElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new WMLPostfieldElement(tagName, document)); +} + void WMLPostfieldElement::insertedIntoDocument() { WMLElement::insertedIntoDocument(); diff --git a/WebCore/wml/WMLPostfieldElement.h b/WebCore/wml/WMLPostfieldElement.h index dd10b47..8d91073 100644 --- a/WebCore/wml/WMLPostfieldElement.h +++ b/WebCore/wml/WMLPostfieldElement.h @@ -28,6 +28,8 @@ namespace WebCore { class WMLPostfieldElement : public WMLElement { public: + static PassRefPtr<WMLPostfieldElement> create(const QualifiedName&, Document*); + WMLPostfieldElement(const QualifiedName& tagName, Document*); virtual void insertedIntoDocument(); diff --git a/WebCore/wml/WMLPrevElement.cpp b/WebCore/wml/WMLPrevElement.cpp index 3d487ea..b90e22b 100644 --- a/WebCore/wml/WMLPrevElement.cpp +++ b/WebCore/wml/WMLPrevElement.cpp @@ -36,6 +36,11 @@ WMLPrevElement::WMLPrevElement(const QualifiedName& tagName, Document* doc) { } +PassRefPtr<WMLPrevElement> WMLPrevElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new WMLPrevElement(tagName, document)); +} + WMLPrevElement::~WMLPrevElement() { } diff --git a/WebCore/wml/WMLPrevElement.h b/WebCore/wml/WMLPrevElement.h index ce8596e..2db8166 100644 --- a/WebCore/wml/WMLPrevElement.h +++ b/WebCore/wml/WMLPrevElement.h @@ -28,6 +28,8 @@ namespace WebCore { class WMLPrevElement : public WMLTaskElement { public: + static PassRefPtr<WMLPrevElement> create(const QualifiedName&, Document*); + WMLPrevElement(const QualifiedName& tagName, Document*); virtual ~WMLPrevElement(); diff --git a/WebCore/wml/WMLRefreshElement.cpp b/WebCore/wml/WMLRefreshElement.cpp index bcf87ac..8267e20 100644 --- a/WebCore/wml/WMLRefreshElement.cpp +++ b/WebCore/wml/WMLRefreshElement.cpp @@ -37,6 +37,11 @@ WMLRefreshElement::WMLRefreshElement(const QualifiedName& tagName, Document* doc { } +PassRefPtr<WMLRefreshElement> WMLRefreshElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new WMLRefreshElement(tagName, document)); +} + WMLRefreshElement::~WMLRefreshElement() { } diff --git a/WebCore/wml/WMLRefreshElement.h b/WebCore/wml/WMLRefreshElement.h index 43b71b5..1459a05 100644 --- a/WebCore/wml/WMLRefreshElement.h +++ b/WebCore/wml/WMLRefreshElement.h @@ -28,6 +28,8 @@ namespace WebCore { class WMLRefreshElement : public WMLTaskElement { public: + static PassRefPtr<WMLRefreshElement> create(const QualifiedName&, Document*); + WMLRefreshElement(const QualifiedName& tagName, Document*); virtual ~WMLRefreshElement(); diff --git a/WebCore/wml/WMLSelectElement.cpp b/WebCore/wml/WMLSelectElement.cpp index 3991b52..81c3a77 100644 --- a/WebCore/wml/WMLSelectElement.cpp +++ b/WebCore/wml/WMLSelectElement.cpp @@ -44,6 +44,11 @@ WMLSelectElement::WMLSelectElement(const QualifiedName& tagName, Document* docum { } +PassRefPtr<WMLSelectElement> WMLSelectElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new WMLSelectElement(tagName, document)); +} + WMLSelectElement::~WMLSelectElement() { } diff --git a/WebCore/wml/WMLSelectElement.h b/WebCore/wml/WMLSelectElement.h index 09a96f9..00b4649 100644 --- a/WebCore/wml/WMLSelectElement.h +++ b/WebCore/wml/WMLSelectElement.h @@ -29,6 +29,8 @@ namespace WebCore { class WMLSelectElement : public WMLFormControlElement, public SelectElement { public: + static PassRefPtr<WMLSelectElement> create(const QualifiedName&, Document*); + WMLSelectElement(const QualifiedName&, Document*); virtual ~WMLSelectElement(); diff --git a/WebCore/wml/WMLSetvarElement.cpp b/WebCore/wml/WMLSetvarElement.cpp index 1407b3f..a0fc3e8 100644 --- a/WebCore/wml/WMLSetvarElement.cpp +++ b/WebCore/wml/WMLSetvarElement.cpp @@ -36,6 +36,11 @@ WMLSetvarElement::WMLSetvarElement(const QualifiedName& tagName, Document* doc) { } +PassRefPtr<WMLSetvarElement> WMLSetvarElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new WMLSetvarElement(tagName, document)); +} + WMLSetvarElement::~WMLSetvarElement() { } diff --git a/WebCore/wml/WMLSetvarElement.h b/WebCore/wml/WMLSetvarElement.h index 410db70..0951360 100644 --- a/WebCore/wml/WMLSetvarElement.h +++ b/WebCore/wml/WMLSetvarElement.h @@ -28,6 +28,8 @@ namespace WebCore { class WMLSetvarElement : public WMLElement { public: + static PassRefPtr<WMLSetvarElement> create(const QualifiedName&, Document*); + WMLSetvarElement(const QualifiedName& tagName, Document*); virtual ~WMLSetvarElement(); diff --git a/WebCore/wml/WMLTableElement.cpp b/WebCore/wml/WMLTableElement.cpp index 4d5e785..eb22503 100644 --- a/WebCore/wml/WMLTableElement.cpp +++ b/WebCore/wml/WMLTableElement.cpp @@ -45,6 +45,11 @@ WMLTableElement::WMLTableElement(const QualifiedName& tagName, Document* doc) { } +PassRefPtr<WMLTableElement> WMLTableElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new WMLTableElement(tagName, document)); +} + WMLTableElement::~WMLTableElement() { } diff --git a/WebCore/wml/WMLTableElement.h b/WebCore/wml/WMLTableElement.h index 22a9676..9f0a592 100644 --- a/WebCore/wml/WMLTableElement.h +++ b/WebCore/wml/WMLTableElement.h @@ -30,6 +30,8 @@ class HTMLCollection; class WMLTableElement : public WMLElement { public: + static PassRefPtr<WMLTableElement> create(const QualifiedName&, Document*); + WMLTableElement(const QualifiedName& tagName, Document*); virtual ~WMLTableElement(); diff --git a/WebCore/wml/WMLTagNames.in b/WebCore/wml/WMLTagNames.in index 1c24f42..fd7c762 100644 --- a/WebCore/wml/WMLTagNames.in +++ b/WebCore/wml/WMLTagNames.in @@ -2,34 +2,34 @@ namespace="WML" namespaceURI="http://www.wapforum.org/DTD/wml_1.1.xml" guardFactoryWith="ENABLE(WML)" -a createWithNew -access createWithNew -anchor createWithNew -br interfaceName=WMLBRElement, createWithNew -card createWithNew -do createWithNew -fieldset interfaceName=WMLFieldSetElement, createWithNew -go createWithNew +a +access +anchor +br interfaceName=WMLBRElement +card +do +fieldset interfaceName=WMLFieldSetElement +go head interfaceName=WMLElement -img interfaceName=WMLImageElement, createWithNew -input createWithNew +img interfaceName=WMLImageElement +input #if 0 # Note: 'insertedLegend' is not an official WML element - internal purpose only! #endif -insertedLegend interfaceName=WMLInsertedLegendElement, createWithNew -meta createWithNew -noop createWithNew -onevent interfaceName=WMLOnEventElement, createWithNew -optgroup interfaceName=WMLOptGroupElement, createWithNew -option createWithNew -p createWithNew -postfield createWithNew -prev createWithNew -refresh createWithNew -select createWithNew -setvar createWithNew -table createWithNew +insertedLegend interfaceName=WMLInsertedLegendElement +meta +noop +onevent interfaceName=WMLOnEventElement +optgroup interfaceName=WMLOptGroupElement +option +p +postfield +prev +refresh +select +setvar +table td interfaceName=WMLElement -template createWithNew -timer createWithNew +template +timer tr interfaceName=WMLElement diff --git a/WebCore/wml/WMLTaskElement.cpp b/WebCore/wml/WMLTaskElement.cpp index d49a03e..4ef3496 100644 --- a/WebCore/wml/WMLTaskElement.cpp +++ b/WebCore/wml/WMLTaskElement.cpp @@ -39,6 +39,11 @@ WMLTaskElement::WMLTaskElement(const QualifiedName& tagName, Document* doc) { } +PassRefPtr<WMLTaskElement> WMLTaskElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new WMLTaskElement(tagName, document)); +} + WMLTaskElement::~WMLTaskElement() { } diff --git a/WebCore/wml/WMLTaskElement.h b/WebCore/wml/WMLTaskElement.h index b813285..b7c5376 100644 --- a/WebCore/wml/WMLTaskElement.h +++ b/WebCore/wml/WMLTaskElement.h @@ -33,6 +33,8 @@ class WMLSetvarElement; class WMLTaskElement : public WMLElement { public: + static PassRefPtr<WMLTaskElement> create(const QualifiedName& tagName, Document*); + WMLTaskElement(const QualifiedName& tagName, Document*); virtual ~WMLTaskElement(); diff --git a/WebCore/wml/WMLTemplateElement.cpp b/WebCore/wml/WMLTemplateElement.cpp index 27c828c..584a762 100644 --- a/WebCore/wml/WMLTemplateElement.cpp +++ b/WebCore/wml/WMLTemplateElement.cpp @@ -43,6 +43,11 @@ WMLTemplateElement::~WMLTemplateElement() { } +PassRefPtr<WMLTemplateElement> WMLTemplateElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new WMLTemplateElement(tagName, document)); +} + void WMLTemplateElement::parseMappedAttribute(Attribute* attr) { WMLIntrinsicEventType eventType = WMLIntrinsicEventUnknown; diff --git a/WebCore/wml/WMLTemplateElement.h b/WebCore/wml/WMLTemplateElement.h index e11d089..c168753 100644 --- a/WebCore/wml/WMLTemplateElement.h +++ b/WebCore/wml/WMLTemplateElement.h @@ -29,6 +29,8 @@ namespace WebCore { class WMLTemplateElement : public WMLElement, public WMLEventHandlingElement { public: + static PassRefPtr<WMLTemplateElement> create(const QualifiedName&, Document*); + WMLTemplateElement(const QualifiedName&, Document*); virtual ~WMLTemplateElement(); diff --git a/WebCore/wml/WMLTimerElement.cpp b/WebCore/wml/WMLTimerElement.cpp index 48eed34..feac38b 100644 --- a/WebCore/wml/WMLTimerElement.cpp +++ b/WebCore/wml/WMLTimerElement.cpp @@ -42,6 +42,11 @@ WMLTimerElement::WMLTimerElement(const QualifiedName& tagName, Document* doc) { } +PassRefPtr<WMLTimerElement> WMLTimerElement::create(const QualifiedName& tagName, Document* document) +{ + return adoptRef(new WMLTimerElement(tagName, document)); +} + void WMLTimerElement::parseMappedAttribute(Attribute* attr) { if (attr->name() == HTMLNames::nameAttr) diff --git a/WebCore/wml/WMLTimerElement.h b/WebCore/wml/WMLTimerElement.h index 09f3fbf..894c793 100644 --- a/WebCore/wml/WMLTimerElement.h +++ b/WebCore/wml/WMLTimerElement.h @@ -31,6 +31,8 @@ class WMLCardElement; class WMLTimerElement : public WMLElement { public: + static PassRefPtr<WMLTimerElement> create(const QualifiedName&, Document*); + WMLTimerElement(const QualifiedName& tagName, Document*); virtual void parseMappedAttribute(Attribute*); diff --git a/WebCore/workers/WorkerContext.cpp b/WebCore/workers/WorkerContext.cpp index 36a9f94..b52b285 100644 --- a/WebCore/workers/WorkerContext.cpp +++ b/WebCore/workers/WorkerContext.cpp @@ -43,6 +43,7 @@ #include "Event.h" #include "EventException.h" #include "InspectorController.h" +#include "KURL.h" #include "MessagePort.h" #include "NotImplemented.h" #include "ScriptSourceCode.h" @@ -322,6 +323,18 @@ EventTargetData* WorkerContext::ensureEventTargetData() return &m_eventTargetData; } +#if ENABLE(BLOB) +String WorkerContext::createBlobURL(Blob* blob) +{ + return scriptExecutionContext()->createPublicBlobURL(blob).string(); +} + +void WorkerContext::revokeBlobURL(const String& blobURLString) +{ + scriptExecutionContext()->revokePublicBlobURL(KURL(ParsedURLString, blobURLString)); +} +#endif + } // namespace WebCore #endif // ENABLE(WORKERS) diff --git a/WebCore/workers/WorkerContext.h b/WebCore/workers/WorkerContext.h index 9e9e54f..7fb8b46 100644 --- a/WebCore/workers/WorkerContext.h +++ b/WebCore/workers/WorkerContext.h @@ -43,6 +43,7 @@ namespace WebCore { + class Blob; class Database; class DatabaseCallback; class DatabaseSync; @@ -115,6 +116,10 @@ namespace WebCore { virtual bool isContextThread() const; virtual bool isJSExecutionTerminated() const; +#if ENABLE(BLOB) + String createBlobURL(Blob*); + void revokeBlobURL(const String&); +#endif // These methods are used for GC marking. See JSWorkerContext::markChildren(MarkStack&) in // JSWorkerContextCustom.cpp. diff --git a/WebCore/workers/WorkerContext.idl b/WebCore/workers/WorkerContext.idl index 27b4b14..02aa4ad 100644 --- a/WebCore/workers/WorkerContext.idl +++ b/WebCore/workers/WorkerContext.idl @@ -96,6 +96,14 @@ module threads { attribute [JSCCustomGetter,EnabledAtRuntime] WebSocketConstructor WebSocket; // Usable with the new operator #endif #endif + +#if defined(ENABLE_BLOB) && ENABLE_BLOB + attribute BlobBuilderConstructor BlobBuilder; + attribute FileReaderConstructor FileReader; + attribute FileReaderSyncConstructor FileReaderSync; + DOMString createBlobURL(in Blob blob); + void revokeBlobURL(in DOMString blobURL); +#endif }; } diff --git a/WebCore/xml/XMLHttpRequest.cpp b/WebCore/xml/XMLHttpRequest.cpp index 3e76407..9f93e1a 100644 --- a/WebCore/xml/XMLHttpRequest.cpp +++ b/WebCore/xml/XMLHttpRequest.cpp @@ -32,6 +32,7 @@ #include "EventException.h" #include "EventListener.h" #include "EventNames.h" +#include "File.h" #include "HTTPParsers.h" #include "InspectorController.h" #include "InspectorTimelineAgent.h" @@ -48,6 +49,7 @@ #include <wtf/text/CString.h> #include <wtf/StdLibExtras.h> #include <wtf/RefCountedLeakCounter.h> +#include <wtf/UnusedParam.h> #if USE(JSC) #include "JSDOMBinding.h" @@ -129,26 +131,22 @@ static bool isSetCookieHeader(const AtomicString& name) return equalIgnoringCase(name, "set-cookie") || equalIgnoringCase(name, "set-cookie2"); } -static void setCharsetInMediaType(String& mediaType, const String& charsetValue) +static void replaceCharsetInMediaType(String& mediaType, const String& charsetValue) { unsigned int pos = 0, len = 0; findCharsetInMediaType(mediaType, pos, len); if (!len) { - // When no charset found, append new charset. - mediaType.stripWhiteSpace(); - if (mediaType[mediaType.length() - 1] != ';') - mediaType.append(";"); - mediaType.append(" charset="); - mediaType.append(charsetValue); - } else { - // Found at least one existing charset, replace all occurrences with new charset. - while (len) { - mediaType.replace(pos, len, charsetValue); - unsigned int start = pos + charsetValue.length(); - findCharsetInMediaType(mediaType, pos, len, start); - } + // When no charset found, do nothing. + return; + } + + // Found at least one existing charset, replace all occurrences with new charset. + while (len) { + mediaType.replace(pos, len, charsetValue); + unsigned int start = pos + charsetValue.length(); + findCharsetInMediaType(mediaType, pos, len, start); } } @@ -171,6 +169,9 @@ XMLHttpRequest::XMLHttpRequest(ScriptExecutionContext* context) : ActiveDOMObject(context, this) , m_async(true) , m_includeCredentials(false) +#if ENABLE(XHR_RESPONSE_BLOB) + , m_asBlob(false) +#endif , m_state(UNSENT) , m_responseText("") , m_createdDocument(false) @@ -225,13 +226,28 @@ XMLHttpRequest::State XMLHttpRequest::readyState() const return m_state; } -const ScriptString& XMLHttpRequest::responseText() const +const ScriptString& XMLHttpRequest::responseText(ExceptionCode& ec) const { +#if ENABLE(XHR_RESPONSE_BLOB) + if (m_asBlob) + ec = INVALID_STATE_ERR; +#else + UNUSED_PARAM(ec); +#endif return m_responseText; } -Document* XMLHttpRequest::responseXML() const +Document* XMLHttpRequest::responseXML(ExceptionCode& ec) const { +#if ENABLE(XHR_RESPONSE_BLOB) + if (m_asBlob) { + ec = INVALID_STATE_ERR; + return 0; + } +#else + UNUSED_PARAM(ec); +#endif + if (m_state != DONE) return 0; @@ -256,6 +272,17 @@ Document* XMLHttpRequest::responseXML() const return m_responseXML.get(); } +#if ENABLE(XHR_RESPONSE_BLOB) +Blob* XMLHttpRequest::responseBlob(ExceptionCode& ec) const +{ + if (!m_asBlob) { + ec = INVALID_STATE_ERR; + return 0; + } + return m_responseBlob.get(); +} +#endif + XMLHttpRequestUpload* XMLHttpRequest::upload() { if (!m_upload) @@ -318,6 +345,18 @@ void XMLHttpRequest::setWithCredentials(bool value, ExceptionCode& ec) m_includeCredentials = value; } +#if ENABLE(XHR_RESPONSE_BLOB) +void XMLHttpRequest::setAsBlob(bool value, ExceptionCode& ec) +{ + if (m_state != OPENED || m_loader) { + ec = INVALID_STATE_ERR; + return; + } + + m_asBlob = value; +} +#endif + void XMLHttpRequest::open(const String& method, const KURL& url, ExceptionCode& ec) { open(method, url, true, ec); @@ -329,7 +368,9 @@ void XMLHttpRequest::open(const String& method, const KURL& url, bool async, Exc State previousState = m_state; m_state = UNSENT; m_error = false; - +#if ENABLE(XHR_RESPONSE_BLOB) + m_asBlob = false; +#endif m_uploadComplete = false; // clear stuff from possible previous load @@ -457,7 +498,7 @@ void XMLHttpRequest::send(const String& body, ExceptionCode& ec) #endif setRequestHeaderInternal("Content-Type", "application/xml"); } else { - setCharsetInMediaType(contentType, "UTF-8"); + replaceCharsetInMediaType(contentType, "UTF-8"); m_requestHeaders.set("Content-Type", contentType); } @@ -478,7 +519,12 @@ void XMLHttpRequest::send(Blob* body, ExceptionCode& ec) // FIXME: Should we set a Content-Type if one is not set. // FIXME: add support for uploading bundles. m_requestEntityBody = FormData::create(); - m_requestEntityBody->appendItems(body->items()); + if (body->isFile()) + m_requestEntityBody->appendFile(static_cast<File*>(body)->path()); +#if ENABLE(BLOB) + else + m_requestEntityBody->appendBlob(body->url()); +#endif } createRequest(ec); @@ -490,7 +536,7 @@ void XMLHttpRequest::send(DOMFormData* body, ExceptionCode& ec) return; if (m_method != "GET" && m_method != "HEAD" && m_url.protocolInHTTPFamily()) { - m_requestEntityBody = FormData::createMultiPart(body->items(), body->encoding(), document()); + m_requestEntityBody = FormData::createMultiPart(*(static_cast<FormDataList*>(body)), body->encoding(), document()); // We need to ask the client to provide the generated file names if needed. When FormData fills the element // for the file, it could set a flag to use the generated file name, i.e. a package file on Mac. @@ -509,6 +555,14 @@ void XMLHttpRequest::send(DOMFormData* body, ExceptionCode& ec) void XMLHttpRequest::createRequest(ExceptionCode& ec) { +#if ENABLE(BLOB) + // Only GET request is supported for blob URL. + if (m_url.protocolIs("blob") && m_method != "GET") { + ec = XMLHttpRequestException::NETWORK_ERR; + return; + } +#endif + // The presence of upload event listeners forces us to use preflighting because POSTing to an URL that does not // permit cross origin requests should look exactly like POSTing to an URL that does not respond at all. // Also, only async requests support upload progress events. @@ -594,6 +648,9 @@ void XMLHttpRequest::abort() m_responseText = ""; m_createdDocument = false; m_responseXML = 0; +#if ENABLE(XHR_RESPONSE_BLOB) + m_responseBlob = 0; +#endif // Clear headers as required by the spec m_requestHeaders.clear(); @@ -640,6 +697,9 @@ void XMLHttpRequest::clearResponse() m_responseText = ""; m_createdDocument = false; m_responseXML = 0; +#if ENABLE(XHR_RESPONSE_BLOB) + m_responseBlob = 0; +#endif } void XMLHttpRequest::clearRequest() @@ -902,6 +962,10 @@ void XMLHttpRequest::didFinishLoading(unsigned long identifier) if (m_decoder) m_responseText += m_decoder->flush(); +#if ENABLE(XHR_RESPONSE_BLOB) + // FIXME: Set m_responseBlob to something here in the m_asBlob case. +#endif + #if ENABLE(INSPECTOR) if (InspectorController* inspector = scriptExecutionContext()->inspectorController()) inspector->resourceRetrievedByXMLHttpRequest(identifier, m_responseText, m_url, m_lastSendURL, m_lastSendLineNumber); diff --git a/WebCore/xml/XMLHttpRequest.h b/WebCore/xml/XMLHttpRequest.h index 2947b46..d25f63f 100644 --- a/WebCore/xml/XMLHttpRequest.h +++ b/WebCore/xml/XMLHttpRequest.h @@ -70,6 +70,10 @@ public: State readyState() const; bool withCredentials() const { return m_includeCredentials; } void setWithCredentials(bool, ExceptionCode&); +#if ENABLE(XHR_RESPONSE_BLOB) + bool asBlob() const { return m_asBlob; } + void setAsBlob(bool, ExceptionCode&); +#endif void open(const String& method, const KURL&, ExceptionCode&); void open(const String& method, const KURL&, bool async, ExceptionCode&); void open(const String& method, const KURL&, bool async, const String& user, ExceptionCode&); @@ -84,8 +88,11 @@ public: void overrideMimeType(const String& override); String getAllResponseHeaders(ExceptionCode&) const; String getResponseHeader(const AtomicString& name, ExceptionCode&) const; - const ScriptString& responseText() const; - Document* responseXML() const; + const ScriptString& responseText(ExceptionCode&) const; + Document* responseXML(ExceptionCode&) const; +#if ENABLE(XHR_RESPONSE_BLOB) + Blob* responseBlob(ExceptionCode&) const; +#endif void setLastSendLineNumber(unsigned lineNumber) { m_lastSendLineNumber = lineNumber; } void setLastSendURL(const String& url) { m_lastSendURL = url; } @@ -155,6 +162,10 @@ private: String m_mimeTypeOverride; bool m_async; bool m_includeCredentials; +#if ENABLE(XHR_RESPONSE_BLOB) + bool m_asBlob; + RefPtr<Blob> m_responseBlob; +#endif RefPtr<ThreadableLoader> m_loader; State m_state; diff --git a/WebCore/xml/XMLHttpRequest.idl b/WebCore/xml/XMLHttpRequest.idl index 58413ff..59997f8 100644 --- a/WebCore/xml/XMLHttpRequest.idl +++ b/WebCore/xml/XMLHttpRequest.idl @@ -57,6 +57,11 @@ module xml { readonly attribute unsigned short readyState; // request +#if defined(ENABLE_XHR_RESPONSE_BLOB) && ENABLE_XHR_RESPONSE_BLOB + attribute [EnabledAtRuntime] boolean asBlob + setter raises(DOMException); +#endif + attribute boolean withCredentials setter raises(DOMException); // void open(in DOMString method, in DOMString url); @@ -82,8 +87,14 @@ module xml { raises(DOMException); [RequiresAllArguments=Raise, ConvertNullStringTo=Null] DOMString getResponseHeader(in DOMString header) raises(DOMException); - readonly attribute [CustomGetter] DOMString responseText; // The custom getter implements ConvertNullStringTo=Null - readonly attribute Document responseXML; + readonly attribute [CustomGetter] DOMString responseText // The custom getter implements ConvertNullStringTo=Null + getter raises(DOMException); + readonly attribute Document responseXML + getter raises(DOMException); +#if defined(ENABLE_XHR_RESPONSE_BLOB) && ENABLE_XHR_RESPONSE_BLOB + readonly attribute [EnabledAtRuntime] Blob responseBlob + getter raises(DOMException); +#endif readonly attribute unsigned short status getter raises(DOMException); readonly attribute DOMString statusText |