-
andersca authored
2006-05-16 Anders Carlsson <acarlsson@apple.com> Reviewed by Maciej. http://bugzilla.opendarwin.org/show_bug.cgi?id=8921 Use WebCore to render full-frame images. * WebCore.xcodeproj/project.pbxproj: Add ImageDocument. * bridge/mac/WebCoreFrameBridge.h: Add mainResourceURLResponse and imageTitleForFilename. * bridge/mac/WebCoreFrameBridge.mm: (+[WebCoreFrameBridge supportedNonImageMIMETypes]): This used to be supportedMIMETypes but WebKit requires that we handle the image MIME types separately. (+[WebCoreFrameBridge supportedImageMIMETypes]): Add image types from WebCoreImageRendererFactory. (-[WebCoreFrameBridge canProvideDocumentSource]): Return no for image types. * dom/xml_tokenizer.h: (WebCore::Tokenizer::wantsRawData): (WebCore::Tokenizer::writeRawData): New virtual functions which tokenizers can override if they want to get raw data (which isn't fed through the decoder) * html/HTMLImageElement.h: (WebCore::HTMLImageElement::setLoadManually): New function which calls HTMLImageLoader::setLoadManually * html/HTMLImageLoader.cpp: (WebCore::HTMLImageLoader::HTMLImageLoader): (WebCore::HTMLImageLoader::updateFromElement): Don't request the image from the loader if the load is set to be manual. * html/HTMLImageLoader.h: (WebCore::HTMLImageLoader::setLoadManually): New function which decides if the image data should be fed manually or loaded by the loader. * loader/DocLoader.h: Add HTMLImageLoader as a friend. * loader/ImageDocument.cpp: Added. (WebCore::ImageTokenizer::ImageTokenizer): (WebCore::ImageTokenizer::wantsRawData): (WebCore::ImageTokenizer::write): (WebCore::ImageTokenizer::writeRawData): (WebCore::ImageTokenizer::stopParsing): (WebCore::ImageTokenizer::finish): (WebCore::ImageTokenizer::isWaitingForScripts): (WebCore::ImageDocument::ImageDocument): (WebCore::ImageDocument::createTokenizer): * loader/ImageDocument.h: Added. Add new ImageDocument class which will feed its data to a created image element. * loader/TextDocument.h: Inherit from HTMLDocument here too, in case any broken web pages want to manipulate the DOM of any plain text documents. * page/Frame.cpp: (WebCore::Frame::begin): (WebCore::Frame::write): Don't create or use the decoder if the tokenizer is in "raw mode". WebKit: 2006-05-16 Anders Carlsson <acarlsson@apple.com> Reviewed by Maciej. http://bugzilla.opendarwin.org/show_bug.cgi?id=8921 Use WebCore to render full-frame images * WebCoreSupport/WebFrameBridge.m: (-[WebFrameBridge determineObjectFromMIMEType:URL:]): Remove WebImageView handling. (-[WebFrameBridge mainResourceURLResponse]): New function which returns the URL response for the main resource. This is used by the manual loading of images. (-[WebFrameBridge imageTitleForFilename:size:]): New function which returns a correctly translated image title given a filename and a size. * WebCoreSupport/WebImageRenderer.m: (-[WebImageRenderer _startOrContinueAnimationIfNecessary]): Remove WebImageView handling. * WebKit.xcodeproj/project.pbxproj: Remove WebImageRepresentation and WebImageView. * WebView/WebArchiver.h: * WebView/WebArchiver.m: (+[WebArchiver archiveMainResourceForFrame:]): New functions which returns a WebArchive with just the main resource, ignoring any subresources. * WebView/WebDataSource.m: (+[WebDataSource _repTypesAllowImageTypeOmission:]): Use MIME types from WebHTMLRepresentation instead of WebImageRepresentation. * WebView/WebFrameView.m: (+[WebFrameView _viewTypesAllowImageTypeOmission:]): Use MIME types from WebHTMLRepresentation instead of WebImageRepresentation. (+[WebHTMLRepresentation supportedMIMETypes]): Create an array of image and non-image MIME Types. (+[WebHTMLRepresentation supportedNonImageMIMETypes]): (+[WebHTMLRepresentation supportedImageMIMETypes]): New functions, separating the list of MIME types into image and non-image ones. * WebView/WebHTMLView.m: (+[WebHTMLView supportedImageMIMETypes]): (+[WebHTMLView supportedNonImageMIMETypes]): New functions which call down to WebHTMLRepresentation. (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]): If the image element comes from an ImageDocument, just use an archive of the main resource instead of the generated HTML document. * WebView/WebHTMLViewPrivate.h: Declare new functions. * WebView/WebImageRepresentation.h: Removed. * WebView/WebImageRepresentation.m: Removed. * WebView/WebImageView.h: Removed. * WebView/WebImageView.m: Removed. LayoutTests: 2006-05-16 Anders Carlsson <acarlsson@apple.com> Reviewed by Maciej. http://bugzilla.opendarwin.org/show_bug.cgi?id=8921 Use WebCore to render full-frame images. * css2.1/t0801-c412-hz-box-00-b-a-expected.txt: * dom/xhtml/level2/html/frame-expected.checksum: * dom/xhtml/level2/html/frame-expected.png: * dom/xhtml/level2/html/frame-expected.txt: * dom/xhtml/level2/html/iframe-expected.checksum: * dom/xhtml/level2/html/iframe-expected.png: * dom/xhtml/level2/html/iframe-expected.txt: * tables/mozilla/bugs/bug50695-2-expected.txt: Update tests. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@14414 268f45cc-cd09-0410-ab3c-d52691b4dbfc
e3516cb3