WebCore:
authorandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 May 2006 09:30:22 +0000 (09:30 +0000)
committerandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 May 2006 09:30:22 +0000 (09:30 +0000)
commite4b4c121740f4086b316c6b5a7a42383af561313
tree6ec101678c121cdbf4fd3f333875bc9f87bd1be0
parentadcee0f8d003b7908203f71102ebf63e334557bf
WebCore:

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: https://svn.webkit.org/repository/webkit/trunk@14414 268f45cc-cd09-0410-ab3c-d52691b4dbfc
37 files changed:
LayoutTests/ChangeLog
LayoutTests/css2.1/t0801-c412-hz-box-00-b-a-expected.txt
LayoutTests/dom/xhtml/level2/html/frame-expected.checksum
LayoutTests/dom/xhtml/level2/html/frame-expected.png
LayoutTests/dom/xhtml/level2/html/frame-expected.txt
LayoutTests/dom/xhtml/level2/html/iframe-expected.checksum
LayoutTests/dom/xhtml/level2/html/iframe-expected.png
LayoutTests/dom/xhtml/level2/html/iframe-expected.txt
LayoutTests/tables/mozilla/bugs/bug50695-2-expected.txt
WebCore/ChangeLog
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bridge/mac/WebCoreFrameBridge.h
WebCore/bridge/mac/WebCoreFrameBridge.mm
WebCore/dom/xml_tokenizer.h
WebCore/html/HTMLImageElement.h
WebCore/html/HTMLImageLoader.cpp
WebCore/html/HTMLImageLoader.h
WebCore/loader/DocLoader.h
WebCore/loader/ImageDocument.cpp [new file with mode: 0644]
WebCore/loader/ImageDocument.h [new file with mode: 0644]
WebCore/page/Frame.cpp
WebKit/ChangeLog
WebKit/WebCoreSupport/WebFrameBridge.m
WebKit/WebCoreSupport/WebImageRenderer.m
WebKit/WebKit.xcodeproj/project.pbxproj
WebKit/WebView/WebArchiver.h
WebKit/WebView/WebArchiver.m
WebKit/WebView/WebDataSource.m
WebKit/WebView/WebFrameView.m
WebKit/WebView/WebHTMLRepresentation.h
WebKit/WebView/WebHTMLRepresentation.m
WebKit/WebView/WebHTMLView.m
WebKit/WebView/WebHTMLViewPrivate.h
WebKit/WebView/WebImageRepresentation.h [deleted file]
WebKit/WebView/WebImageRepresentation.m [deleted file]
WebKit/WebView/WebImageView.h [deleted file]
WebKit/WebView/WebImageView.m [deleted file]