+2006-07-04 Kevin Ollivier <kevino@theolliviers.com>
+
+ Reviewed by Maciej, reworked a bit by Darin.
+
+ Compile fixes for wx port / gcc 4.0.2
+
+ * platform/PlatformString.h:
+ * platform/StringImpl.h:
+ Include CoreFoundation for CF-specific code.
+
+ * dom/DocPtr.h:
+ * doc/EventTargetNode.h:
+ Silence warnings about 'extra tokens' after #endif on gcc 4.0.2.
+ (Not an error but warnings appear frequently.)
+
+ * WebCoreSources.bkl:
+ * webcore-base.bkl:
+ Synching ports sources file with TOT. Also, making sure SRCDIR variable
+ overrides any previous values.
+
+ * loader/ImageDocument.cpp:
+ Use PLATFORM(MAC) for the parts that are specific to the Macintosh version,
+ and move the Objective-C parts to another file.
+
+ * loader/mac/ImageDocumentMac.h: Added.
+ * loader/mac/ImageDocumentMac.mm: Added.
+
2006-07-04 Sam Weinig <sam.weinig@gmail.com>
Build fix.
1A762C790A074F2600989F5B /* JSXPathResult.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A762C710A074F2600989F5B /* JSXPathResult.cpp */; };
1A762C7A0A074F2600989F5B /* JSXPathResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A762C720A074F2600989F5B /* JSXPathResult.h */; };
1A8086CC0A4D097600DFB6A7 /* DOMCSSInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8083730A4C7CDA00DFB6A7 /* DOMCSSInternal.h */; };
- 1A820D910A13EBA600AF843C /* ImageDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A820D8F0A13EBA600AF843C /* ImageDocument.cpp */; settings = {COMPILER_FLAGS = "-xobjective-c++"; }; };
+ 1A820D910A13EBA600AF843C /* ImageDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A820D8F0A13EBA600AF843C /* ImageDocument.cpp */; };
1A820D920A13EBA600AF843C /* ImageDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A820D900A13EBA600AF843C /* ImageDocument.h */; };
1A85B18F0A1B18A200D8C87C /* JSHTMLHtmlElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A85B18D0A1B18A200D8C87C /* JSHTMLHtmlElement.cpp */; };
1A85B1900A1B18A200D8C87C /* JSHTMLHtmlElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A85B18E0A1B18A200D8C87C /* JSHTMLHtmlElement.h */; };
938E685409F0BE04008A48EC /* GraphicsTypes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 938E685309F0BE04008A48EC /* GraphicsTypes.cpp */; };
939885C308B7E3D100E707C4 /* EventNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 939885C108B7E3D100E707C4 /* EventNames.cpp */; };
939885C408B7E3D100E707C4 /* EventNames.h in Headers */ = {isa = PBXBuildFile; fileRef = 939885C208B7E3D100E707C4 /* EventNames.h */; };
+ 93A1EAA00A5634C9006960A0 /* ImageDocumentMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93A1EA9F0A5634C9006960A0 /* ImageDocumentMac.mm */; };
+ 93A1EAA80A563508006960A0 /* ImageDocumentMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 93A1EAA70A563508006960A0 /* ImageDocumentMac.h */; };
93B70D5B09EB0C7C009D8468 /* JSDOMParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93B70D3F09EB0C7C009D8468 /* JSDOMParser.cpp */; };
93B70D5C09EB0C7C009D8468 /* JSDOMParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B70D4009EB0C7C009D8468 /* JSDOMParser.h */; };
93B70D5D09EB0C7C009D8468 /* JSXMLHttpRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93B70D4109EB0C7C009D8468 /* JSXMLHttpRequest.cpp */; };
FAE04190097596C9000540BE /* SVGImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = FAE0418E097596C9000540BE /* SVGImageLoader.h */; };
/* End PBXBuildFile section */
-/* Begin PBXBuildStyle section */
- D06749E30A54CE6D00DA0E29 /* Development */ = {
- isa = PBXBuildStyle;
- buildSettings = {
- COPY_PHASE_STRIP = NO;
- };
- name = Development;
- };
- D06749E40A54CE6D00DA0E29 /* Deployment */ = {
- isa = PBXBuildStyle;
- buildSettings = {
- COPY_PHASE_STRIP = YES;
- };
- name = Deployment;
- };
-/* End PBXBuildStyle section */
-
/* Begin PBXContainerItemProxy section */
DD041FF009D9E3250010AF2A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
93955A4203D72932008635CE /* RenderTreeAsText.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderTreeAsText.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
939885C108B7E3D100E707C4 /* EventNames.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventNames.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
939885C208B7E3D100E707C4 /* EventNames.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = EventNames.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+ 93A1EA9F0A5634C9006960A0 /* ImageDocumentMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ImageDocumentMac.mm; sourceTree = "<group>"; };
+ 93A1EAA70A563508006960A0 /* ImageDocumentMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageDocumentMac.h; sourceTree = "<group>"; };
93ABCE5D06E1A42E0085925B /* FormData.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FormData.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
93ABCE5E06E1A42E0085925B /* FormData.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = FormData.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
93B641F106E28C5C0055F610 /* KWQFormData.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQFormData.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
path = editing;
sourceTree = "<group>";
};
+ 93A1EAA20A5634D8006960A0 /* mac */ = {
+ isa = PBXGroup;
+ children = (
+ 93A1EAA70A563508006960A0 /* ImageDocumentMac.h */,
+ 93A1EA9F0A5634C9006960A0 /* ImageDocumentMac.mm */,
+ );
+ path = mac;
+ sourceTree = "<group>";
+ };
93EEC1EC09C2877700C515D1 /* html */ = {
isa = PBXGroup;
children = (
BCB16BFB0979C38700467741 /* loader */ = {
isa = PBXGroup;
children = (
+ 93A1EAA20A5634D8006960A0 /* mac */,
BCB16BFE0979C3BD00467741 /* Cache.cpp */,
BCB16BFF0979C3BD00467741 /* Cache.h */,
BCB16C000979C3BD00467741 /* CachedCSSStyleSheet.cpp */,
1A8086CC0A4D097600DFB6A7 /* DOMCSSInternal.h in Headers */,
1A1D13800A5325520064BF5F /* DOMXPath.h in Headers */,
1A1D13CA0A5329090064BF5F /* DOMXPathInternal.h in Headers */,
+ 93A1EAA80A563508006960A0 /* ImageDocumentMac.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
- buildSettings = {
- };
- buildStyles = (
- D06749E30A54CE6D00DA0E29 /* Development */,
- D06749E40A54CE6D00DA0E29 /* Deployment */,
- );
hasScannedForEncodings = 1;
knownRegions = (
English,
E1052C320A4D70010072D99B /* DOMEventsNonstandard.mm in Sources */,
516149ED0A525E3A003DFC7A /* SiteIcon.cpp in Sources */,
1A1D13810A5325520064BF5F /* DOMXPath.mm in Sources */,
+ 93A1EAA00A5634C9006960A0 /* ImageDocumentMac.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
kwq/KWQTextStream.cpp
</set>
<set append="1" var="WEBCORE_SOURCES_DERIVEDSOURCES">
+
DerivedSources/WebCore/CharsetData.cpp
DerivedSources/WebCore/ColorData.c
DerivedSources/WebCore/CSSGrammar.cpp
DerivedSources/WebCore/XLinkNames.cpp
DerivedSources/WebCore/XMLNames.cpp
DerivedSources/WebCore/XPathGrammar.cpp
- </set>
- <set append="1" var="WEBCORE_SOURCES_KHTML">
</set>
+ <set append="1" var="WEBCORE_SOURCES_KHTML">
+
- <set append="1" var="WEBCORE_SOURCES_MISC">
</set>
+ <set append="1" var="WEBCORE_SOURCES_MISC">
+
+ </set>
<set append="1" var="WEBCORE_SOURCES_PAGE">
page/DOMWindow.cpp
loader/FormData.cpp
loader/ImageDocument.cpp
loader/loader.cpp
+ loader/PluginDocument.cpp
loader/Request.cpp
loader/TextDocument.cpp
loader/PluginDocument.cpp
platform/image-decoders/gif/GIFImageReader.cpp
</set>
-
- <set append="1" var="WEBCORE_SOURCES_XBM">
- platform/image-decoders/xbm/XBMImageDecoder.cpp
- </set>
-
- <set append="1" var="WEBCORE_SOURCES_ICO">
- platform/image-decoders/ico/ICOImageDecoder.cpp
- </set>
-
- <set append="1" var="WEBCORE_SOURCES_BMP">
- platform/image-decoders/bmp/BMPImageDecoder.cpp
- </set>
-
<set append="1" var="WEBCORE_SOURCES_PNG">
platform/image-decoders/png/png.c
platform/image-decoders/png/pngwutil.c
</set>
-
<set append="1" var="WEBCORE_SOURCES_ZLIB">
platform/image-decoders/zlib/adler32.c
platform/image-decoders/jpeg/jquant2.c
platform/image-decoders/jpeg/jutils.c
+ </set>
+ <set append="1" var="WEBCORE_SOURCES_BMP">
+
+ platform/image-decoders/bmp/BMPImageDecoder.cpp
+
+ </set>
+ <set append="1" var="WEBCORE_SOURCES_ICO">
+
+ platform/image-decoders/ico/ICOImageDecoder.cpp
+
+ </set>
+ <set append="1" var="WEBCORE_SOURCES_XBM">
+
+ platform/image-decoders/xbm/XBMImageDecoder.cpp
+
</set>
<set append="1" var="WEBCORE_SOURCES_CAIRO">
platform/cairo/pixman/src/renderedge.c
</set>
- <set append="1" var="WEBCORE_SOURCES_CAIRO_CAIRO">
+ <set append="1" var="WEBCORE_SOURCES_CAIRO">
platform/cairo/cairo/src/cairo-arc.c
platform/cairo/cairo/src/cairo-array.c
rendering/AutoTableLayout.cpp
rendering/bidi.cpp
rendering/break_lines.cpp
+ rendering/DeprecatedRenderSelect.cpp
+ rendering/DeprecatedSlider.cpp
rendering/EllipsisBox.cpp
rendering/FixedTableLayout.cpp
rendering/InlineBox.cpp
rendering/RenderFileButton.cpp
rendering/RenderFlexibleBox.cpp
rendering/RenderFlow.cpp
- rendering/RenderView.cpp
rendering/RenderFormElement.cpp
rendering/RenderFrame.cpp
rendering/RenderFrameSet.cpp
rendering/RenderTextField.cpp
rendering/RenderTextFragment.cpp
rendering/RenderTheme.cpp
+
rendering/RenderTreeAsText.cpp
+ rendering/RenderView.cpp
rendering/RenderWidget.cpp
rendering/RootInlineBox.cpp
dom/Attr.cpp
dom/Attribute.cpp
dom/BeforeTextInsertedEvent.cpp
+ dom/BeforeUnloadEvent.cpp
dom/CDATASection.cpp
dom/CharacterData.cpp
dom/ChildNodeList.cpp
+ dom/ClipboardEvent.cpp
dom/Comment.cpp
dom/ContainerNode.cpp
dom/CSSMappedAttributeDeclaration.cpp
dom/ProcessingInstruction.cpp
dom/QualifiedName.cpp
dom/Range.cpp
- dom/RegisteredEventListener.cpp
+ dom/RegisteredEventListener.cpp
dom/StyledElement.cpp
dom/Text.cpp
dom/Traversal.cpp
dom/TreeWalker.cpp
- dom/WheelEvent.cpp
dom/UIEvent.cpp
+ dom/WheelEvent.cpp
dom/xml_tokenizer.cpp
</set>
bindings/js/kjs_proxy.cpp
bindings/js/kjs_traversal.cpp
bindings/js/kjs_window.cpp
- </set>
+ </set>
</makefile>
} // namespace WebCore
-#endif DOM_DocPtr_h
+#endif // DOM_DocPtr_h
inline void forbidEventDispatch() { }
inline void allowEventDispatch() { }
-#endif NDEBUG
+#endif // NDEBUG
} //namespace WebCore
*/
#include "config.h"
-
#include "ImageDocument.h"
#include "CachedImage.h"
#include "Element.h"
+#include "HTMLImageElement.h"
#include "HTMLNames.h"
#include "SegmentedString.h"
#include "Text.h"
-#include "HTMLImageElement.h"
#include "xml_tokenizer.h"
-#ifdef __APPLE__
-#include <Cocoa/Cocoa.h>
-#include "FrameMac.h"
-#include "WebCoreFrameBridge.h"
+#if PLATFORM(MAC)
+#include "ImageDocumentMac.h"
#endif
namespace WebCore {
virtual bool isWaitingForScripts() const;
virtual bool wantsRawData() const { return true; }
- virtual bool writeRawData(const char *data, int len);
+ virtual bool writeRawData(const char* data, int len);
void createDocumentStructure();
private:
cachedImage->data(buffer, true);
// FIXME: Need code to set the title for platforms other than Mac OS X.
-
-#ifdef __APPLE__
- // FIXME: This is terrible! Makes an extra copy of the image data!
- // Can't we get the NSData from NSURLConnection?
- // Why is this different from image subresources?
- NSData* nsData = [[NSData alloc] initWithBytes:buffer.data() length:buffer.size()];
- cachedImage->setAllData(nsData);
- [nsData release];
-
- WebCoreFrameBridge* bridge = Mac(m_doc->frame())->bridge();
- NSURLResponse* response = [bridge mainResourceURLResponse];
- cachedImage->setResponse(response);
-
- if (cachedImage->imageSize().width() > 0)
- m_doc->setTitle([bridge imageTitleForFilename:[response suggestedFilename]
- size:cachedImage->imageSize()]);
+#if PLATFORM(MAC)
+ finishImageLoad(m_doc, cachedImage, buffer.data(), buffer.size());
#endif
}
--- /dev/null
+/*
+ * Copyright (C) 2006 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,
+ * 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 ImageDocumentMac_h
+#define ImageDocumentMac_h
+
+namespace WebCore {
+
+ class CachedImage;
+ class Document;
+
+ void finishImageLoad(Document*, CachedImage*, const void* imageData, size_t imageDataSize);
+
+}
+
+#endif
--- /dev/null
+/*
+ * Copyright (C) 2006 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,
+ * 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 "config.h"
+#import "ImageDocumentMac.h"
+
+#include "CachedImage.h"
+#include "Document.h"
+#include "FrameMac.h"
+#include "WebCoreFrameBridge.h"
+
+namespace WebCore {
+
+void finishImageLoad(Document* document, CachedImage* image, const void* imageData, size_t imageDataSize)
+{
+ // FIXME: This is terrible! Makes an extra copy of the image data!
+ // Can't we get the NSData from NSURLConnection?
+ // Why is this different from image subresources?
+ NSData* nsData = [[NSData alloc] initWithBytes:imageData length:imageDataSize];
+ image->setAllData(nsData);
+ [nsData release];
+
+ WebCoreFrameBridge* bridge = Mac(document->frame())->bridge();
+ NSURLResponse* response = [bridge mainResourceURLResponse];
+ image->setResponse(response);
+
+ IntSize size = image->imageSize();
+ if (size.width())
+ document->setTitle([bridge imageTitleForFilename:[response suggestedFilename] size:size]);
+}
+
+}
#include "StringImpl.h"
+#if __APPLE__
+#include <CoreFoundation/CoreFoundation.h>
+#endif
+
namespace WebCore {
/**
#include <unicode/umachine.h>
#include <limits.h>
+#if __APPLE__
+#include <CoreFoundation/CoreFoundation.h>
+#endif
+
#if __OBJC__
@class NSString;
#endif
RenderFlexibleBox::addChild(divRenderer);
}
- HTMLGenericFormElement* element = static_cast<HTMLGenericFormElement*>(node());
- m_div->renderer()->style()->setUserModify(element->isReadOnlyControl() ? READ_ONLY : READ_WRITE_PLAINTEXT_ONLY);
- String value;
- if (m_multiLine)
- value = static_cast<HTMLTextAreaElement*>(element)->value().copy();
- else
- value = static_cast<HTMLInputElement*>(element)->value().copy();
- if (!element->valueMatchesRenderer() || m_multiLine) {
- String oldText = text();
- if (value.isNull())
- value = "";
- value.replace('\\', backslashAsCurrencySymbol());
- if (value != oldText || !m_div->hasChildNodes()) {
- ExceptionCode ec = 0;
- m_div->setInnerText(value, ec);
- setEdited(false);
- }
- element->setValueMatchesRenderer();
+ HTMLGenericFormElement* element = static_cast<HTMLGenericFormElement*>(node());
+ m_div->renderer()->style()->setUserModify(element->isReadOnlyControl() ? READ_ONLY : READ_WRITE_PLAINTEXT_ONLY);
+ String value;
+ if (m_multiLine)
+ value = static_cast<HTMLTextAreaElement*>(element)->value().copy();
+ else
+ value = static_cast<HTMLInputElement*>(element)->value().copy();
+ if (!element->valueMatchesRenderer() || m_multiLine) {
+ String oldText = text();
+ if (value.isNull())
+ value = "";
+ value.replace('\\', backslashAsCurrencySymbol());
+ if (value != oldText || !m_div->hasChildNodes()) {
+ ExceptionCode ec = 0;
+ m_div->setInnerText(value, ec);
+ setEdited(false);
+ }
+ element->setValueMatchesRenderer();
}
}
<!-- Common definitions etc.: -->
- <set var="SRCDIR">../..</set>
+ <set var="SRCDIR" append="0">../..</set>
<include file="../Bakefiles/presets.bkl"/>
<include file="WebCoreSources.bkl"/>
$(WEBCORE_SOURCES_BMP)
$(WEBCORE_SOURCES_GIF)
$(WEBCORE_SOURCES_ICO)
- $(WEBCORE_SOURCES_ICON)
$(WEBCORE_SOURCES_PNG)
$(WEBCORE_SOURCES_XBM)
$(WEBCORE_SOURCES_ZLIB)