2006-05-15 Eric Seidel <eseidel@apple.com>
authoreseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 May 2006 23:23:42 +0000 (23:23 +0000)
committereseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 May 2006 23:23:42 +0000 (23:23 +0000)
        Reviewed by Tim Hatcher.

        Split html_imageimpl.* into separate files (one per class).
        http://bugzilla.opendarwin.org/show_bug.cgi?id=8929

        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSCanvasRenderingContext2DBase.cpp:
        * bindings/js/kjs_events.cpp:
        * bindings/js/kjs_html.cpp:
        * bindings/objc/DOMHTML.mm:
        * bridge/mac/WebCoreFrameBridge.mm:
        * dom/Document.cpp:
        * editing/JSEditor.cpp:
        * html/CanvasRenderingContext2D.cpp:
        * html/HTMLAnchorElement.cpp:
        * html/HTMLAreaElement.cpp: Added.
        (WebCore::HTMLAreaElement::HTMLAreaElement):
        (WebCore::HTMLAreaElement::mapMouseEvent):
        (WebCore::HTMLAreaElement::getRect):
        (WebCore::HTMLAreaElement::getRegion):
        * html/HTMLAreaElement.h: Added.
        * html/HTMLCanvasElement.h:
        * html/HTMLDocument.cpp:
        * html/HTMLElementFactory.cpp:
        * html/HTMLFormCollection.cpp:
        * html/HTMLFormElement.cpp:
        * html/HTMLImageElement.cpp: Added.
        (WebCore::HTMLImageElement::HTMLImageElement):
        * html/HTMLImageElement.h: Added.
        * html/HTMLImageLoader.cpp: Added.
        (WebCore::HTMLImageLoader::HTMLImageLoader):
        * html/HTMLImageLoader.h: Added.
        * html/HTMLInputElement.cpp:
        * html/HTMLMapElement.cpp: Added.
        (WebCore::HTMLMapElement::mapMouseEvent):
        (WebCore::HTMLMapElement::parseMappedAttribute):
        * html/HTMLMapElement.h: Added.
        * html/HTMLObjectElement.cpp:
        * html/HTMLParser.cpp:
        * html/html_imageimpl.cpp: Removed.
        * html/html_imageimpl.h: Removed.
        * ksvg2/misc/SVGImageLoader.h:
        * kwq/WebCoreAXObject.mm:
        (-[WebCoreAXObject addChildrenToArray:]):
        * page/Frame.cpp:
        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::RenderImage):
        (WebCore::RenderImage::nodeAtPoint):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@14393 268f45cc-cd09-0410-ab3c-d52691b4dbfc

32 files changed:
WebCore/ChangeLog
WebCore/WebCore.vcproj/WebCore/WebCore.vcproj
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bindings/js/JSCanvasRenderingContext2DBase.cpp
WebCore/bindings/js/kjs_events.cpp
WebCore/bindings/js/kjs_html.cpp
WebCore/bindings/objc/DOMHTML.mm
WebCore/bridge/mac/WebCoreFrameBridge.mm
WebCore/dom/Document.cpp
WebCore/editing/JSEditor.cpp
WebCore/html/CanvasRenderingContext2D.cpp
WebCore/html/HTMLAnchorElement.cpp
WebCore/html/HTMLAreaElement.cpp [new file with mode: 0644]
WebCore/html/HTMLAreaElement.h [new file with mode: 0644]
WebCore/html/HTMLCanvasElement.h
WebCore/html/HTMLDocument.cpp
WebCore/html/HTMLElementFactory.cpp
WebCore/html/HTMLFormCollection.cpp
WebCore/html/HTMLFormElement.cpp
WebCore/html/HTMLImageElement.cpp [moved from WebCore/html/html_imageimpl.cpp with 50% similarity]
WebCore/html/HTMLImageElement.h [moved from WebCore/html/html_imageimpl.h with 50% similarity]
WebCore/html/HTMLImageLoader.cpp [new file with mode: 0644]
WebCore/html/HTMLImageLoader.h [new file with mode: 0644]
WebCore/html/HTMLInputElement.cpp
WebCore/html/HTMLMapElement.cpp [new file with mode: 0644]
WebCore/html/HTMLMapElement.h [new file with mode: 0644]
WebCore/html/HTMLObjectElement.cpp
WebCore/html/HTMLParser.cpp
WebCore/ksvg2/misc/SVGImageLoader.h
WebCore/kwq/WebCoreAXObject.mm
WebCore/page/Frame.cpp
WebCore/rendering/RenderImage.cpp

index e33e50e15f35f5fa5c21a81816d9bd5c03f28d74..e5d10f2630b597e63f6ce28c41c3d0c3a762b611 100644 (file)
@@ -1,3 +1,54 @@
+2006-05-15  Eric Seidel  <eseidel@apple.com>
+
+        Reviewed by Tim Hatcher.
+
+        Split html_imageimpl.* into separate files (one per class).
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=8929
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSCanvasRenderingContext2DBase.cpp:
+        * bindings/js/kjs_events.cpp:
+        * bindings/js/kjs_html.cpp:
+        * bindings/objc/DOMHTML.mm:
+        * bridge/mac/WebCoreFrameBridge.mm:
+        * dom/Document.cpp:
+        * editing/JSEditor.cpp:
+        * html/CanvasRenderingContext2D.cpp:
+        * html/HTMLAnchorElement.cpp:
+        * html/HTMLAreaElement.cpp: Added.
+        (WebCore::HTMLAreaElement::HTMLAreaElement):
+        (WebCore::HTMLAreaElement::mapMouseEvent):
+        (WebCore::HTMLAreaElement::getRect):
+        (WebCore::HTMLAreaElement::getRegion):
+        * html/HTMLAreaElement.h: Added.
+        * html/HTMLCanvasElement.h:
+        * html/HTMLDocument.cpp:
+        * html/HTMLElementFactory.cpp:
+        * html/HTMLFormCollection.cpp:
+        * html/HTMLFormElement.cpp:
+        * html/HTMLImageElement.cpp: Added.
+        (WebCore::HTMLImageElement::HTMLImageElement):
+        * html/HTMLImageElement.h: Added.
+        * html/HTMLImageLoader.cpp: Added.
+        (WebCore::HTMLImageLoader::HTMLImageLoader):
+        * html/HTMLImageLoader.h: Added.
+        * html/HTMLInputElement.cpp:
+        * html/HTMLMapElement.cpp: Added.
+        (WebCore::HTMLMapElement::mapMouseEvent):
+        (WebCore::HTMLMapElement::parseMappedAttribute):
+        * html/HTMLMapElement.h: Added.
+        * html/HTMLObjectElement.cpp:
+        * html/HTMLParser.cpp:
+        * html/html_imageimpl.cpp: Removed.
+        * html/html_imageimpl.h: Removed.
+        * ksvg2/misc/SVGImageLoader.h:
+        * kwq/WebCoreAXObject.mm:
+        (-[WebCoreAXObject addChildrenToArray:]):
+        * page/Frame.cpp:
+        * rendering/RenderImage.cpp:
+        (WebCore::RenderImage::RenderImage):
+        (WebCore::RenderImage::nodeAtPoint):
+
 2006-05-15  Eric Seidel  <eseidel@apple.com>
 
         Reviewed by beth.
index 712697eb8f179175704027ca0462bb348f099371..ba5a4730aa7b6ae3737716b22fdb80351784af97 100644 (file)
                                RelativePath="..\..\html\HTMLDivElement.h"\r
                                >\r
                        </File>\r
+\r
+                       <File\r
+                               RelativePath="..\..\html\HTMLMapElement.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\html\HTMLMapElement.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\html\HTMLImageElement.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\html\HTMLImageElement.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\html\HTMLAreaElement.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\html\HTMLAreaElement.h"\r
+                               >\r
+                       </File>\r
                        <File\r
-                               RelativePath="..\..\html\html_imageimpl.cpp"\r
+                               RelativePath="..\..\html\HTMLImageLoader.cpp"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\html\html_imageimpl.h"\r
+                               RelativePath="..\..\html\HTMLImageLoader.h"\r
                                >\r
                        </File>\r
                        <File\r
index 646fecda96fb4a544abb8b62694f620f90f75a73..973783176a5c9a9bfd9392c0d8d5aed0dcf72eef 100644 (file)
                93EEC27109C3218800C515D1 /* CanvasStyle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93EEC27009C3218800C515D1 /* CanvasStyle.cpp */; };
                93F198E508245E59001E9ABC /* HTMLDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D23C02DE4396018635CA /* HTMLDocument.h */; };
                93F198E608245E59001E9ABC /* HTMLElement.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D23F02DE4396018635CA /* HTMLElement.h */; };
-               93F198E908245E59001E9ABC /* html_imageimpl.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D24502DE4396018635CA /* html_imageimpl.h */; };
                93F198EF08245E59001E9ABC /* HTMLParser.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D25102DE4396018635CA /* HTMLParser.h */; };
                93F198F008245E59001E9ABC /* HTMLTokenizer.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D25302DE4396018635CA /* HTMLTokenizer.h */; };
                93F198F608245E59001E9ABC /* Decoder.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D27902DE43D7018635CA /* Decoder.h */; };
                93F19A5F08245E59001E9ABC /* WebCoreViewFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = F587855502DE375901EA4122 /* WebCoreViewFactory.m */; };
                93F19A9108245E59001E9ABC /* HTMLDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D23B02DE4396018635CA /* HTMLDocument.cpp */; };
                93F19A9208245E59001E9ABC /* HTMLElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D23E02DE4396018635CA /* HTMLElement.cpp */; };
-               93F19A9508245E59001E9ABC /* html_imageimpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D24402DE4396018635CA /* html_imageimpl.cpp */; };
                93F19A9B08245E59001E9ABC /* HTMLParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D25002DE4396018635CA /* HTMLParser.cpp */; };
                93F19A9C08245E59001E9ABC /* HTMLTokenizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D25202DE4396018635CA /* HTMLTokenizer.cpp */; };
                93F19A9D08245E59001E9ABC /* Decoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D27802DE43D7018635CA /* Decoder.cpp */; };
                A8EA7CB60A192B9C00A8EF5F /* HTMLBlockquoteElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8EA7CA80A192B9C00A8EF5F /* HTMLBlockquoteElement.cpp */; };
                A8EA7CB70A192B9C00A8EF5F /* HTMLDivElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA7CA90A192B9C00A8EF5F /* HTMLDivElement.h */; };
                A8EA7CB80A192B9C00A8EF5F /* HTMLHeadingElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA7CAA0A192B9C00A8EF5F /* HTMLHeadingElement.h */; };
+               A8EA7D2B0A19385500A8EF5F /* HTMLImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA7D230A19385500A8EF5F /* HTMLImageLoader.h */; };
+               A8EA7D2C0A19385500A8EF5F /* HTMLMapElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA7D240A19385500A8EF5F /* HTMLMapElement.h */; };
+               A8EA7D2D0A19385500A8EF5F /* HTMLImageElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA7D250A19385500A8EF5F /* HTMLImageElement.h */; };
+               A8EA7D2E0A19385500A8EF5F /* HTMLAreaElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA7D260A19385500A8EF5F /* HTMLAreaElement.h */; };
+               A8EA7D2F0A19385500A8EF5F /* HTMLAreaElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8EA7D270A19385500A8EF5F /* HTMLAreaElement.cpp */; };
+               A8EA7D300A19385500A8EF5F /* HTMLImageLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8EA7D280A19385500A8EF5F /* HTMLImageLoader.cpp */; };
+               A8EA7D310A19385500A8EF5F /* HTMLImageElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8EA7D290A19385500A8EF5F /* HTMLImageElement.cpp */; };
+               A8EA7D320A19385500A8EF5F /* HTMLMapElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8EA7D2A0A19385500A8EF5F /* HTMLMapElement.cpp */; };
                A8FD8B86087CB44C00DC3707 /* KWQWMatrix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A85D7A8C0879EC64006A9172 /* KWQWMatrix.cpp */; };
                A8FD8B87087CB45700DC3707 /* KWQWMatrix.h in Headers */ = {isa = PBXBuildFile; fileRef = A85D7A8D0879EC64006A9172 /* KWQWMatrix.h */; };
                A8FEFB0A0979F472005839FD /* RenderForeignObject.h in Headers */ = {isa = PBXBuildFile; fileRef = A8FEFB080979F472005839FD /* RenderForeignObject.h */; };
                A8EA7CA80A192B9C00A8EF5F /* HTMLBlockquoteElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLBlockquoteElement.cpp; sourceTree = "<group>"; };
                A8EA7CA90A192B9C00A8EF5F /* HTMLDivElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HTMLDivElement.h; sourceTree = "<group>"; };
                A8EA7CAA0A192B9C00A8EF5F /* HTMLHeadingElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HTMLHeadingElement.h; sourceTree = "<group>"; };
+               A8EA7D230A19385500A8EF5F /* HTMLImageLoader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HTMLImageLoader.h; sourceTree = "<group>"; };
+               A8EA7D240A19385500A8EF5F /* HTMLMapElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HTMLMapElement.h; sourceTree = "<group>"; };
+               A8EA7D250A19385500A8EF5F /* HTMLImageElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HTMLImageElement.h; sourceTree = "<group>"; };
+               A8EA7D260A19385500A8EF5F /* HTMLAreaElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HTMLAreaElement.h; sourceTree = "<group>"; };
+               A8EA7D270A19385500A8EF5F /* HTMLAreaElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLAreaElement.cpp; sourceTree = "<group>"; };
+               A8EA7D280A19385500A8EF5F /* HTMLImageLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLImageLoader.cpp; sourceTree = "<group>"; };
+               A8EA7D290A19385500A8EF5F /* HTMLImageElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLImageElement.cpp; sourceTree = "<group>"; };
+               A8EA7D2A0A19385500A8EF5F /* HTMLMapElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLMapElement.cpp; sourceTree = "<group>"; };
                A8FEFB080979F472005839FD /* RenderForeignObject.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderForeignObject.h; sourceTree = "<group>"; };
                A8FEFB090979F472005839FD /* RenderForeignObject.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderForeignObject.cpp; sourceTree = "<group>"; };
                A8FEFB2F0979F4F6005839FD /* SVGForeignObjectElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGForeignObjectElement.cpp; sourceTree = "<group>"; };
                F523D23C02DE4396018635CA /* HTMLDocument.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = HTMLDocument.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F523D23E02DE4396018635CA /* HTMLElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLElement.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F523D23F02DE4396018635CA /* HTMLElement.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = HTMLElement.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               F523D24402DE4396018635CA /* html_imageimpl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = html_imageimpl.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               F523D24502DE4396018635CA /* html_imageimpl.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = html_imageimpl.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F523D25002DE4396018635CA /* HTMLParser.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLParser.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F523D25102DE4396018635CA /* HTMLParser.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = HTMLParser.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F523D25202DE4396018635CA /* HTMLTokenizer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLTokenizer.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                                93EEC1EF09C2877700C515D1 /* CanvasStyle.h */,
                                A8136D370973A8E700D74463 /* FormDataList.cpp */,
                                A8136D360973A8E700D74463 /* FormDataList.h */,
-                               F523D24402DE4396018635CA /* html_imageimpl.cpp */,
-                               F523D24502DE4396018635CA /* html_imageimpl.h */,
                                A8CFF79A0A156978000A4234 /* HTMLAnchorElement.cpp */,
                                A8CFF7A10A156978000A4234 /* HTMLAnchorElement.h */,
                                A871D4540A127CBC00B12A68 /* HTMLAppletElement.cpp */,
                                A871D4530A127CBC00B12A68 /* HTMLAppletElement.h */,
+                               A8EA7D270A19385500A8EF5F /* HTMLAreaElement.cpp */,
+                               A8EA7D260A19385500A8EF5F /* HTMLAreaElement.h */,
                                A871DC1E0A15205700B12A68 /* HTMLBaseElement.cpp */,
                                A871DC130A15205700B12A68 /* HTMLBaseElement.h */,
                                A8DF3FCB097FA0FB0052981B /* HTMLBaseFontElement.cpp */,
                                A871DE1B0A152AC800B12A68 /* HTMLHtmlElement.h */,
                                A871DE180A152AC800B12A68 /* HTMLIFrameElement.cpp */,
                                A871DE1E0A152AC800B12A68 /* HTMLIFrameElement.h */,
+                               A8EA7D290A19385500A8EF5F /* HTMLImageElement.cpp */,
+                               A8EA7D250A19385500A8EF5F /* HTMLImageElement.h */,
+                               A8EA7D280A19385500A8EF5F /* HTMLImageLoader.cpp */,
+                               A8EA7D230A19385500A8EF5F /* HTMLImageLoader.h */,
                                A81369B1097374F500D74463 /* HTMLInputElement.cpp */,
                                A81369B0097374F500D74463 /* HTMLInputElement.h */,
                                A81369AF097374F500D74463 /* HTMLIsIndexElement.cpp */,
                                A8EA79EA0A1916DF00A8EF5F /* HTMLLIElement.h */,
                                A871DC150A15205700B12A68 /* HTMLLinkElement.cpp */,
                                A871DC140A15205700B12A68 /* HTMLLinkElement.h */,
+                               A8EA7D2A0A19385500A8EF5F /* HTMLMapElement.cpp */,
+                               A8EA7D240A19385500A8EF5F /* HTMLMapElement.h */,
                                A8EA7C9E0A192B9C00A8EF5F /* HTMLMarqueeElement.cpp */,
                                A8EA7C9D0A192B9C00A8EF5F /* HTMLMarqueeElement.h */,
                                A8EA79EC0A1916DF00A8EF5F /* HTMLMenuElement.cpp */,
                        files = (
                                93F198E508245E59001E9ABC /* HTMLDocument.h in Headers */,
                                93F198E608245E59001E9ABC /* HTMLElement.h in Headers */,
-                               93F198E908245E59001E9ABC /* html_imageimpl.h in Headers */,
                                93F198EF08245E59001E9ABC /* HTMLParser.h in Headers */,
                                93F198F008245E59001E9ABC /* HTMLTokenizer.h in Headers */,
                                93F198F608245E59001E9ABC /* Decoder.h in Headers */,
                                A8EA7CB50A192B9C00A8EF5F /* HTMLParagraphElement.h in Headers */,
                                A8EA7CB70A192B9C00A8EF5F /* HTMLDivElement.h in Headers */,
                                A8EA7CB80A192B9C00A8EF5F /* HTMLHeadingElement.h in Headers */,
+                               A8EA7D2B0A19385500A8EF5F /* HTMLImageLoader.h in Headers */,
+                               A8EA7D2C0A19385500A8EF5F /* HTMLMapElement.h in Headers */,
+                               A8EA7D2D0A19385500A8EF5F /* HTMLImageElement.h in Headers */,
+                               A8EA7D2E0A19385500A8EF5F /* HTMLAreaElement.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                93F19A5F08245E59001E9ABC /* WebCoreViewFactory.m in Sources */,
                                93F19A9108245E59001E9ABC /* HTMLDocument.cpp in Sources */,
                                93F19A9208245E59001E9ABC /* HTMLElement.cpp in Sources */,
-                               93F19A9508245E59001E9ABC /* html_imageimpl.cpp in Sources */,
                                93F19A9B08245E59001E9ABC /* HTMLParser.cpp in Sources */,
                                93F19A9C08245E59001E9ABC /* HTMLTokenizer.cpp in Sources */,
                                93F19A9D08245E59001E9ABC /* Decoder.cpp in Sources */,
                                A8EA7CB20A192B9C00A8EF5F /* HTMLParagraphElement.cpp in Sources */,
                                A8EA7CB30A192B9C00A8EF5F /* HTMLHRElement.cpp in Sources */,
                                A8EA7CB60A192B9C00A8EF5F /* HTMLBlockquoteElement.cpp in Sources */,
+                               A8EA7D2F0A19385500A8EF5F /* HTMLAreaElement.cpp in Sources */,
+                               A8EA7D300A19385500A8EF5F /* HTMLImageLoader.cpp in Sources */,
+                               A8EA7D310A19385500A8EF5F /* HTMLImageElement.cpp in Sources */,
+                               A8EA7D320A19385500A8EF5F /* HTMLMapElement.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index fb762ef0225e47a165086c0e4f255c20566a24f4..0818aa40a60ee56cbe732ec9ef0eac5e4819ca0d 100644 (file)
@@ -26,6 +26,7 @@
 #include "CanvasStyle.h"
 #include "ExceptionCode.h"
 #include "HTMLCanvasElement.h"
+#include "HTMLImageElement.h"
 #include "JSCanvasGradient.h"
 #include "JSCanvasPattern.h"
 #include "JSCanvasRenderingContext2D.h"
index bba78177665c6d8d27db803ab7b44bc4d9c6b4dd..6873b35ed4c3c31e2c4e87f73330939397253815 100644 (file)
@@ -30,8 +30,8 @@
 #include "JSMouseEvent.h"
 #include "JSKeyboardEvent.h"
 #include "dom2_eventsimpl.h"
-#include "html_imageimpl.h"
 #include "HTMLNames.h"
+#include "HTMLImageElement.h"
 #include "kjs_proxy.h"
 #include "kjs_window.h"
 
index 00526ecdf10a6e3c0421de8236873b042e9b01ab..9e32fcd4d80dab52a9449ffa5febbb40bf9a7ba3 100644 (file)
@@ -25,7 +25,9 @@
 #include "DocLoader.h"
 #include "EventNames.h"
 #include "Frame.h"
+#include "HTMLAnchorElement.h"
 #include "HTMLAppletElement.h"
+#include "HTMLAreaElement.h"
 #include "HTMLBaseElement.h"
 #include "HTMLBaseFontElement.h"
 #include "HTMLBlockquoteElement.h"
 #include "HTMLHRElement.h"
 #include "HTMLHtmlElement.h"
 #include "HTMLIFrameElement.h"
+#include "HTMLImageElement.h"
 #include "HTMLIsIndexElement.h"
 #include "HTMLLabelElement.h"
 #include "HTMLLegendElement.h"
 #include "HTMLLIElement.h"
 #include "HTMLLinkElement.h"
+#include "HTMLMapElement.h"
 #include "HTMLMenuElement.h"
 #include "HTMLMetaElement.h"
 #include "HTMLModElement.h"
@@ -81,7 +85,6 @@
 #include "Text.h"
 #include "css_ruleimpl.h"
 #include "dom2_eventsimpl.h"
-#include "html_imageimpl.h"
 #include "kjs_css.h"
 #include "kjs_events.h"
 #include "kjs_proxy.h"
index bb457c2d5c89ca4e3106a6e3ecaf2b2cd3454bc5..05fed24bd073c0a8ff6889dd6405fe840181c21e 100644 (file)
@@ -32,6 +32,7 @@
 #import "DocumentFragment.h"
 #import "FoundationExtras.h"
 #import "HTMLAppletElement.h"
+#import "HTMLAreaElement.h"
 #import "HTMLBaseElement.h"
 #import "HTMLBaseFontElement.h"
 #import "HTMLBodyElement.h"
 #import "HTMLHRElement.h"
 #import "HTMLHtmlElement.h"
 #import "HTMLIFrameElement.h"
+#import "HTMLImageElement.h"
 #import "HTMLIsIndexElement.h"
 #import "HTMLLabelElement.h"
 #import "HTMLLegendElement.h"
 #import "HTMLLIElement.h"
 #import "HTMLLinkElement.h"
+#import "HTMLMapElement.h"
 #import "HTMLMenuElement.h"
 #import "HTMLMetaElement.h"
 #import "HTMLNames.h"
@@ -81,7 +84,6 @@
 #import "HTMLTitleElement.h"
 #import "HTMLUListElement.h"
 #import "NameNodeList.h"
-#import "html_imageimpl.h"
 #import "markup.h"
 #import "RenderTextField.h"
 #import "FrameView.h"
index a8f00c59296846dc4fac0e86f10082f33ba0023b..5b98b6f08604041b3d6545b2c6a5ec93b52a422d 100644 (file)
@@ -55,7 +55,6 @@
 #import "csshelper.h"
 #import "DeleteSelectionCommand.h"
 #import "HTMLDocument.h"
-#import "html_imageimpl.h"
 #import "htmlediting.h"
 #import "HTMLNames.h"
 #import "kjs_proxy.h"
index e1d6d122b048aa3d79a7187c4e3d17cdc1c85017..09163ebb2c1887d7ec8671c0d4f132774b4023ce 100644 (file)
 #include "HTMLBodyElement.h"
 #include "HTMLDocument.h"
 #include "HTMLElementFactory.h"
+#include "HTMLImageLoader.h"
 #include "HTMLInputElement.h"
 #include "HTMLLinkElement.h"
+#include "HTMLMapElement.h"
 #include "HTMLNameCollection.h"
 #include "HTMLNames.h"
 #include "HTMLStyleElement.h"
@@ -66,7 +68,6 @@
 #include "cssstyleselector.h"
 #include "dom2_eventsimpl.h"
 #include "dom_xmlimpl.h"
-#include "html_imageimpl.h"
 #include "kjs_binding.h"
 #include "kjs_proxy.h"
 #include "xml_tokenizer.h"
index 83e7ab210c5d2b1b0bc1e71dbbfdecdef28e1be4..b8d4a8645e1371c06e8c6c87217331ada9153a9a 100644 (file)
 #include "DocumentFragment.h"
 #include "Frame.h"
 #include "HTMLNames.h"
+#include "HTMLImageElement.h"
 #include "ReplaceSelectionCommand.h"
 #include "SelectionController.h"
 #include "TypingCommand.h"
 #include "UnlinkCommand.h"
-#include "html_imageimpl.h"
 #include "htmlediting.h"
 #include "markup.h"
 
index 17b0bc74b9e00cca42380d62d6b810fb0953e49b..3c9f69790c3094eea0ae0fc72aa53fb2bbd5d406 100644 (file)
 #include "config.h"
 #include "CanvasRenderingContext2D.h"
 
+#include "CachedImage.h"
 #include "CanvasGradient.h"
 #include "CanvasPattern.h"
 #include "CanvasStyle.h"
 #include "ExceptionCode.h"
 #include "GraphicsContext.h"
 #include "HTMLCanvasElement.h"
+#include "HTMLImageElement.h"
 #include "HTMLNames.h"
 #include "RenderHTMLCanvas.h"
 #include "cssparser.h"
index a25b6b646ab878079a3c21f110871718fcda5081..122118d1c0a167fe68cacddfc49cd08347051e50 100644 (file)
@@ -29,7 +29,7 @@
 #include "dom2_eventsimpl.h"
 #include "EventNames.h"
 #include "Frame.h"
-#include "html_imageimpl.h"
+#include "HTMLImageElement.h"
 #include "HTMLNames.h"
 #include "RenderFlow.h"
 #include "RenderImage.h"
diff --git a/WebCore/html/HTMLAreaElement.cpp b/WebCore/html/HTMLAreaElement.cpp
new file mode 100644 (file)
index 0000000..c692f7d
--- /dev/null
@@ -0,0 +1,233 @@
+/**
+ * This file is part of the DOM implementation for KDE.
+ *
+ * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
+ *           (C) 1999 Antti Koivisto (koivisto@kde.org)
+ * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
+ *
+ * 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., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+#include "config.h"
+#include "HTMLAreaElement.h"
+
+#include "Document.h"
+#include "HTMLNames.h"
+#include "FloatRect.h"
+#include "IntSize.h"
+
+using namespace std;
+
+namespace WebCore {
+
+using namespace HTMLNames;
+
+HTMLAreaElement::HTMLAreaElement(Document *doc)
+    : HTMLAnchorElement(areaTag, doc)
+    , m_coords(0)
+    , m_coordsLen(0)
+    , m_lastSize(-1, -1)
+    , m_shape(Unknown)
+{
+}
+
+HTMLAreaElement::~HTMLAreaElement()
+{
+    delete [] m_coords;
+}
+
+void HTMLAreaElement::parseMappedAttribute(MappedAttribute *attr)
+{
+    if (attr->name() == shapeAttr) {
+        if (equalIgnoringCase(attr->value(), "default"))
+            m_shape = Default;
+        else if (equalIgnoringCase(attr->value(), "circle"))
+            m_shape = Circle;
+        else if (equalIgnoringCase(attr->value(), "poly"))
+            m_shape = Poly;
+        else if (equalIgnoringCase(attr->value(), "rect"))
+            m_shape = Rect;
+    } else if (attr->name() == coordsAttr) {
+        delete [] m_coords;
+        m_coords = attr->value().toCoordsArray(m_coordsLen);
+    } else if (attr->name() == targetAttr) {
+        m_hasTarget = !attr->isNull();
+    } else if (attr->name() == altAttr || attr->name() == accesskeyAttr) {
+        // Do nothing.
+    } else
+        HTMLAnchorElement::parseMappedAttribute(attr);
+}
+
+bool HTMLAreaElement::mapMouseEvent(int x, int y, const IntSize& size, RenderObject::NodeInfo& info)
+{
+    if (m_lastSize != size) {
+        region = getRegion(size);
+        m_lastSize = size;
+    }
+
+    if (!region.contains(IntPoint(x, y)))
+        return false;
+    
+    info.setInnerNode(this);
+    info.setURLElement(this);
+    return true;
+}
+
+IntRect HTMLAreaElement::getRect(RenderObject* obj) const
+{
+    int dx, dy;
+    obj->absolutePosition(dx, dy);
+    Path p = getRegion(m_lastSize);
+    p.translate(IntSize(dx, dy));
+    return enclosingIntRect(p.boundingRect());
+}
+
+Path HTMLAreaElement::getRegion(const IntSize& size) const
+{
+    if (!m_coords)
+        return Path();
+        
+    int width = size.width();
+    int height = size.height();
+
+    // If element omits the shape attribute, select shape based on number of coordinates.
+    Shape shape = m_shape;
+    if (shape == Unknown) {
+        if (m_coordsLen == 3)
+            shape = Circle;
+        else if (m_coordsLen == 4)
+            shape = Rect;
+        else if (m_coordsLen >= 6)
+            shape = Poly;
+    }
+
+    Path path;
+    switch (shape) {
+        case Poly:
+            if (m_coordsLen >= 6) {
+                int numPoints = m_coordsLen / 2;
+                path.moveTo(FloatPoint(m_coords[0].calcMinValue(width), m_coords[1].calcMinValue(height)));
+                for (int i = 1; i < numPoints; ++i)
+                    path.addLineTo(FloatPoint(m_coords[i * 2].calcMinValue(width), m_coords[i * 2 + 1].calcMinValue(height)));
+                path.closeSubpath();
+            }
+            break;
+        case Circle:
+            if (m_coordsLen >= 3) {
+                Length radius = m_coords[2];
+                int r = min(radius.calcMinValue(width), radius.calcMinValue(height));
+                path.addEllipse(FloatRect(m_coords[0].calcMinValue(width) - r, m_coords[1].calcMinValue(height) - r, 2 * r, 2 * r));
+            }
+            break;
+        case Rect:
+            if (m_coordsLen >= 4) {
+                int x0 = m_coords[0].calcMinValue(width);
+                int y0 = m_coords[1].calcMinValue(height);
+                int x1 = m_coords[2].calcMinValue(width);
+                int y1 = m_coords[3].calcMinValue(height);
+                path.addRect(FloatRect(x0, y0, x1 - x0, y1 - y0));
+            }
+            break;
+        case Default:
+            path.addRect(FloatRect(0, 0, width, height));
+            break;
+        case Unknown:
+            break;
+    }
+
+    return path;
+}
+
+String HTMLAreaElement::accessKey() const
+{
+    return getAttribute(accesskeyAttr);
+}
+
+void HTMLAreaElement::setAccessKey(const String& value)
+{
+    setAttribute(accesskeyAttr, value);
+}
+
+String HTMLAreaElement::alt() const
+{
+    return getAttribute(altAttr);
+}
+
+void HTMLAreaElement::setAlt(const String& value)
+{
+    setAttribute(altAttr, value);
+}
+
+String HTMLAreaElement::coords() const
+{
+    return getAttribute(coordsAttr);
+}
+
+void HTMLAreaElement::setCoords(const String& value)
+{
+    setAttribute(coordsAttr, value);
+}
+
+String HTMLAreaElement::href() const
+{
+    return document()->completeURL(getAttribute(hrefAttr));
+}
+
+void HTMLAreaElement::setHref(const String& value)
+{
+    setAttribute(hrefAttr, value);
+}
+
+bool HTMLAreaElement::noHref() const
+{
+    return !getAttribute(nohrefAttr).isNull();
+}
+
+void HTMLAreaElement::setNoHref(bool noHref)
+{
+    setAttribute(nohrefAttr, noHref ? "" : 0);
+}
+
+String HTMLAreaElement::shape() const
+{
+    return getAttribute(shapeAttr);
+}
+
+void HTMLAreaElement::setShape(const String& value)
+{
+    setAttribute(shapeAttr, value);
+}
+
+int HTMLAreaElement::tabIndex() const
+{
+    return getAttribute(tabindexAttr).toInt();
+}
+
+void HTMLAreaElement::setTabIndex(int tabIndex)
+{
+    setAttribute(tabindexAttr, String::number(tabIndex));
+}
+
+String HTMLAreaElement::target() const
+{
+    return getAttribute(targetAttr);
+}
+
+void HTMLAreaElement::setTarget(const String& value)
+{
+    setAttribute(targetAttr, value);
+}
+
+}
diff --git a/WebCore/html/HTMLAreaElement.h b/WebCore/html/HTMLAreaElement.h
new file mode 100644 (file)
index 0000000..31b1f10
--- /dev/null
@@ -0,0 +1,87 @@
+/*
+ * This file is part of the DOM implementation for KDE.
+ *
+ * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
+ *           (C) 1999 Antti Koivisto (koivisto@kde.org)
+ * Copyright (C) 2004 Apple Computer, Inc.
+ *
+ * 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., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef HTMLAreaElement_H
+#define HTMLAreaElement_H
+
+#include "HTMLAnchorElement.h"
+#include "Path.h"
+#include "RenderObject.h" // for RenderObject::NodeInfo
+
+namespace WebCore {
+
+class HTMLAreaElement : public HTMLAnchorElement {
+public:
+    enum Shape { Default, Poly, Rect, Circle, Unknown };
+
+    HTMLAreaElement(Document*);
+    ~HTMLAreaElement();
+
+    virtual HTMLTagStatus endTagRequirement() const { return TagStatusForbidden; }
+    virtual int tagPriority() const { return 0; }
+
+    virtual void parseMappedAttribute(MappedAttribute*);
+
+    bool isDefault() const { return m_shape == Default; }
+
+    bool mapMouseEvent(int x, int y, const IntSize&, RenderObject::NodeInfo&);
+
+    virtual IntRect getRect(RenderObject*) const;
+
+    String accessKey() const;
+    void setAccessKey(const String&);
+
+    String alt() const;
+    void setAlt(const String&);
+
+    String coords() const;
+    void setCoords(const String&);
+
+    String href() const;
+    void setHref(const String&);
+
+    bool noHref() const;
+    void setNoHref(bool);
+
+    String shape() const;
+    void setShape(const String&);
+
+    int tabIndex() const;
+    void setTabIndex(int);
+
+    String target() const;
+    void setTarget(const String&);
+
+protected:
+    Path getRegion(const IntSize&) const;
+    Path region;
+    Length* m_coords;
+    int m_coordsLen;
+    IntSize m_lastSize;
+    Shape m_shape;
+};
+
+} //namespace
+
+#endif
index 00376362b841fd87bea7928044dd013fa1871ab6..be5f3ca34985c00bd91cbc4095fbe8f5f858d164 100644 (file)
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#ifndef HTML_CANVASIMPL_H
-#define HTML_CANVASIMPL_H
+#ifndef HTMLCanvasElement_H
+#define HTMLCanvasElement_H
 
-#include "html_imageimpl.h"
+#include "HTMLElement.h"
+#include "IntSize.h"
 
 #if __APPLE__
 // FIXME: Mac-specific parts need to move to the platform directory.
@@ -38,6 +39,7 @@ namespace WebCore {
 
 class CanvasRenderingContext2D;
 typedef CanvasRenderingContext2D CanvasRenderingContext;
+class FloatRect;
 
 class HTMLCanvasElement : public HTMLElement {
 public:
index babbe35376fc610475cc720769367ddb4517301e..b24707f94b2afd658621fa6ab8c38d9ee008f244 100644 (file)
@@ -61,8 +61,8 @@
 #include "Frame.h"
 #include "cssstyleselector.h"
 #include "CSSPropertyNames.h"
-#include "html_imageimpl.h"
 #include "HTMLTokenizer.h"
+#include "HTMLElement.h"
 #include "HTMLElementFactory.h"
 #include "HTMLNames.h"
 #include "dom2_eventsimpl.h"
index 6d233fe4b84f647856ab67e301083de678a1251f..f352f63ab7a5e353128216a84f53268bada69b52 100644 (file)
@@ -23,7 +23,9 @@
 #include "config.h"
 #include "HTMLElementFactory.h"
 
+#include "HTMLAnchorElement.h"
 #include "HTMLAppletElement.h"
+#include "HTMLAreaElement.h"
 #include "HTMLBaseFontElement.h"
 #include "HTMLBaseElement.h"
 #include "HTMLBlockquoteElement.h"
 #include "HTMLHRElement.h"
 #include "HTMLHtmlElement.h"
 #include "HTMLIFrameElement.h"
+#include "HTMLImageElement.h"
 #include "HTMLIsIndexElement.h"
 #include "HTMLLabelElement.h"
 #include "HTMLLegendElement.h"
 #include "HTMLLIElement.h"
 #include "HTMLLinkElement.h"
+#include "HTMLMapElement.h"
 #include "HTMLMarqueeElement.h"
 #include "HTMLMenuElement.h"
 #include "HTMLMetaElement.h"
index cc4ee8d1ce7182bc046f237ff4a58a439fe820f2..f77714b5eed837258ad6c104c92dfd494e83703c 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "HTMLGenericFormElement.h"
 #include "HTMLFormElement.h"
-#include "html_imageimpl.h"
+#include "HTMLImageElement.h"
 #include "HTMLNames.h"
 
 namespace WebCore {
index db72a5899e8c516b78fb74b4df3dea22e44d1cd5..a2822c1491bc443268ffc89161f2767f0dd1c108 100644 (file)
 #include "Frame.h"
 #include "HTMLDocument.h"
 #include "HTMLFormCollection.h"
+#include "HTMLImageElement.h"
 #include "HTMLInputElement.h"
 #include "HTMLNames.h"
 #include "csshelper.h"
-#include "html_imageimpl.h"
 #include "RenderLineEdit.h"
 
 namespace WebCore {
similarity index 50%
rename from WebCore/html/html_imageimpl.cpp
rename to WebCore/html/HTMLImageElement.cpp
index 6ba00f5c8305ffe9be544822e60fc682321dba57..aaadec9ee311309f7708cbe595d26020bf6f9457 100644 (file)
  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  * Boston, MA 02111-1307, USA.
  */
-
 #include "config.h"
-#include "html_imageimpl.h"
+#include "HTMLImageElement.h"
 
-#include "DocLoader.h"
-#include "EventNames.h"
-#include "FloatRect.h"
-#include "HTMLFormElement.h"
 #include "csshelper.h"
 #include "CSSPropertyNames.h"
 #include "CSSValueKeywords.h"
+#include "EventNames.h"
 #include "HTMLDocument.h"
-#include "RenderImage.h"
+#include "HTMLFormElement.h"
 #include "HTMLNames.h"
+#include "RenderImage.h"
 
 using namespace std;
 
@@ -42,92 +39,22 @@ namespace WebCore {
 using namespace EventNames;
 using namespace HTMLNames;
 
-HTMLImageLoader::HTMLImageLoader(Element* elt)
-    : m_element(elt), m_image(0), m_firedLoad(true), m_imageComplete(true)
-{
-}
-
-HTMLImageLoader::~HTMLImageLoader()
-{
-    if (m_image)
-        m_image->deref(this);
-    m_element->document()->removeImage(this);
-}
-
-void HTMLImageLoader::setLoadingImage(CachedImage *loadingImage)
-{
-    m_firedLoad = false;
-    m_imageComplete = false;
-    m_image = loadingImage;
-}
-
-void HTMLImageLoader::updateFromElement()
-{
-    // If we're not making renderers for the page, then don't load images.  We don't want to slow
-    // down the raw HTML parsing case by loading images we don't intend to display.
-    Element* elem = element();
-    Document* doc = elem->document();
-    if (!doc->renderer())
-        return;
-
-    AtomicString attr = elem->getAttribute(elem->hasLocalName(objectTag) ? dataAttr : srcAttr);
-    
-    // Treat a lack of src or empty string for src as no image at all.
-    CachedImage *newImage = 0;
-    if (!attr.isEmpty())
-        newImage = doc->docLoader()->requestImage(parseURL(attr));
-
-    CachedImage *oldImage = m_image;
-    if (newImage != oldImage) {
-#ifdef INSTRUMENT_LAYOUT_SCHEDULING
-        if (!doc->ownerElement() && newImage)
-            printf("Image requested at %d\n", doc->elapsedTime());
-#endif
-        setLoadingImage(newImage);
-        if (newImage)
-            newImage->ref(this);
-        if (oldImage)
-            oldImage->deref(this);
-    }
-
-    if (RenderImage* renderer = static_cast<RenderImage*>(elem->renderer()))
-        renderer->resetAnimation();
-}
-
-void HTMLImageLoader::dispatchLoadEvent()
-{
-    if (!m_firedLoad && m_image) {
-        m_firedLoad = true;
-        element()->dispatchHTMLEvent(m_image->isErrorImage() ? errorEvent : loadEvent, false, false);
-    }
-}
-
-void HTMLImageLoader::notifyFinished(CachedObject *image)
-{
-    m_imageComplete = true;
-    Element* elem = element();
-    Document* doc = elem->document();
-    doc->dispatchImageLoadEventSoon(this);
-#ifdef INSTRUMENT_LAYOUT_SCHEDULING
-        if (!doc->ownerElement())
-            printf("Image loaded at %d\n", doc->elapsedTime());
-#endif
-    if (RenderImage* renderer = static_cast<RenderImage*>(elem->renderer()))
-        renderer->setCachedImage(m_image);
-}
-
-// -------------------------------------------------------------------------
-
-HTMLImageElement::HTMLImageElement(Document *doc, HTMLFormElement *f)
-    : HTMLElement(imgTag, doc), m_imageLoader(this), ismap(false), m_form(f)
+HTMLImageElement::HTMLImageElement(Document* doc, HTMLFormElement* f)
+    : HTMLElement(imgTag, doc)
+    , m_imageLoader(this)
+    , ismap(false)
+    , m_form(f)
     , m_compositeOperator(CompositeSourceOver)
 {
     if (f)
         f->registerImgElement(this);
 }
 
-HTMLImageElement::HTMLImageElement(const QualifiedName& tagName, Document *doc)
-    : HTMLElement(tagName, doc), m_imageLoader(this), ismap(false), m_form(0)
+HTMLImageElement::HTMLImageElement(const QualifiedName& tagName, Document* doc)
+    : HTMLElement(tagName, doc)
+    , m_imageLoader(this)
+    , ismap(false)
+    , m_form(0)
     , m_compositeOperator(CompositeSourceOver)
 {
 }
@@ -447,268 +374,4 @@ bool HTMLImageElement::complete() const
     return m_imageLoader.imageComplete();
 }
 
-// -------------------------------------------------------------------------
-
-HTMLMapElement::HTMLMapElement(Document *doc)
-    : HTMLElement(mapTag, doc)
-{
-}
-
-HTMLMapElement::~HTMLMapElement()
-{
-    document()->removeImageMap(this);
-}
-
-bool HTMLMapElement::checkDTD(const Node* newChild)
-{
-    // FIXME: This seems really odd, allowing only blocks inside map elements.
-    return newChild->hasTagName(areaTag) || newChild->hasTagName(scriptTag) || inBlockTagList(newChild);
-}
-
-bool HTMLMapElement::mapMouseEvent(int x, int y, int width, int height, RenderObject::NodeInfo& info)
-{
-    Node *node = this;
-    while ((node = node->traverseNextNode(this)))
-        if (node->hasTagName(areaTag))
-            if (static_cast<HTMLAreaElement *>(node)->mapMouseEvent(x, y, width, height, info))
-                return true;
-    return false;
-}
-
-void HTMLMapElement::parseMappedAttribute(MappedAttribute *attr)
-{
-    const QualifiedName& attrName = attr->name();
-    if (attrName == idAttr || attrName == nameAttr) {
-        Document* doc = document();
-        if (attrName == idAttr) {
-            // Call base class so that hasID bit gets set.
-            HTMLElement::parseMappedAttribute(attr);
-            if (doc->htmlMode() != Document::XHtml)
-                return;
-        }
-        doc->removeImageMap(this);
-        m_name = attr->value();
-        if (m_name[0] == '#') {
-            String mapName(m_name.domString().copy());
-            mapName.remove(0, 1);
-            m_name = mapName;
-        }
-        doc->addImageMap(this);
-    } else
-        HTMLElement::parseMappedAttribute(attr);
-}
-
-PassRefPtr<HTMLCollection> HTMLMapElement::areas()
-{
-    return new HTMLCollection(this, HTMLCollection::MAP_AREAS);
-}
-
-String HTMLMapElement::name() const
-{
-    return getAttribute(nameAttr);
-}
-
-void HTMLMapElement::setName(const String& value)
-{
-    setAttribute(nameAttr, value);
-}
-
-// -------------------------------------------------------------------------
-
-HTMLAreaElement::HTMLAreaElement(Document *doc)
-    : HTMLAnchorElement(areaTag, doc)
-{
-    m_coords = 0;
-    m_coordsLen = 0;
-    m_shape = Unknown;
-    lasth = -1;
-    lastw = -1;
-}
-
-HTMLAreaElement::~HTMLAreaElement()
-{
-    delete [] m_coords;
-}
-
-void HTMLAreaElement::parseMappedAttribute(MappedAttribute *attr)
-{
-    if (attr->name() == shapeAttr) {
-        if (equalIgnoringCase(attr->value(), "default"))
-            m_shape = Default;
-        else if (equalIgnoringCase(attr->value(), "circle"))
-            m_shape = Circle;
-        else if (equalIgnoringCase(attr->value(), "poly"))
-            m_shape = Poly;
-        else if (equalIgnoringCase(attr->value(), "rect"))
-            m_shape = Rect;
-    } else if (attr->name() == coordsAttr) {
-        delete [] m_coords;
-        m_coords = attr->value().toCoordsArray(m_coordsLen);
-    } else if (attr->name() == targetAttr) {
-        m_hasTarget = !attr->isNull();
-    } else if (attr->name() == altAttr || attr->name() == accesskeyAttr) {
-        // Do nothing.
-    } else
-        HTMLAnchorElement::parseMappedAttribute(attr);
-}
-
-bool HTMLAreaElement::mapMouseEvent(int x, int y, int width, int height, RenderObject::NodeInfo& info)
-{
-    if (width != lastw || height != lasth) {
-        region = getRegion(width, height);
-        lastw = width;
-        lasth = height;
-    }
-
-    if (!region.contains(IntPoint(x, y)))
-        return false;
-    
-    info.setInnerNode(this);
-    info.setURLElement(this);
-    return true;
-}
-
-IntRect HTMLAreaElement::getRect(RenderObject* obj) const
-{
-    int dx, dy;
-    obj->absolutePosition(dx, dy);
-    Path p = getRegion(lastw, lasth);
-    p.translate(IntSize(dx, dy));
-    return enclosingIntRect(p.boundingRect());
-}
-
-Path HTMLAreaElement::getRegion(int width, int height) const
-{
-    if (!m_coords)
-        return Path();
-
-    // If element omits the shape attribute, select shape based on number of coordinates.
-    Shape shape = m_shape;
-    if (shape == Unknown) {
-        if (m_coordsLen == 3)
-            shape = Circle;
-        else if (m_coordsLen == 4)
-            shape = Rect;
-        else if (m_coordsLen >= 6)
-            shape = Poly;
-    }
-
-    Path path;
-    switch (shape) {
-        case Poly:
-            if (m_coordsLen >= 6) {
-                int numPoints = m_coordsLen / 2;
-                path.moveTo(FloatPoint(m_coords[0].calcMinValue(width), m_coords[1].calcMinValue(height)));
-                for (int i = 1; i < numPoints; ++i)
-                    path.addLineTo(FloatPoint(m_coords[i * 2].calcMinValue(width), m_coords[i * 2 + 1].calcMinValue(height)));
-                path.closeSubpath();
-            }
-            break;
-        case Circle:
-            if (m_coordsLen >= 3) {
-                Length radius = m_coords[2];
-                int r = min(radius.calcMinValue(width), radius.calcMinValue(height));
-                path.addEllipse(FloatRect(m_coords[0].calcMinValue(width) - r, m_coords[1].calcMinValue(height) - r,
-                    2 * r, 2 * r));
-            }
-            break;
-        case Rect:
-            if (m_coordsLen >= 4) {
-                int x0 = m_coords[0].calcMinValue(width);
-                int y0 = m_coords[1].calcMinValue(height);
-                int x1 = m_coords[2].calcMinValue(width);
-                int y1 = m_coords[3].calcMinValue(height);
-                path.addRect(FloatRect(x0, y0, x1 - x0, y1 - y0));
-            }
-            break;
-        case Default:
-            path.addRect(FloatRect(0, 0, width, height));
-            break;
-        case Unknown:
-            break;
-    }
-
-    return path;
-}
-
-String HTMLAreaElement::accessKey() const
-{
-    return getAttribute(accesskeyAttr);
-}
-
-void HTMLAreaElement::setAccessKey(const String& value)
-{
-    setAttribute(accesskeyAttr, value);
-}
-
-String HTMLAreaElement::alt() const
-{
-    return getAttribute(altAttr);
-}
-
-void HTMLAreaElement::setAlt(const String& value)
-{
-    setAttribute(altAttr, value);
-}
-
-String HTMLAreaElement::coords() const
-{
-    return getAttribute(coordsAttr);
-}
-
-void HTMLAreaElement::setCoords(const String& value)
-{
-    setAttribute(coordsAttr, value);
-}
-
-String HTMLAreaElement::href() const
-{
-    return document()->completeURL(getAttribute(hrefAttr));
-}
-
-void HTMLAreaElement::setHref(const String& value)
-{
-    setAttribute(hrefAttr, value);
-}
-
-bool HTMLAreaElement::noHref() const
-{
-    return !getAttribute(nohrefAttr).isNull();
-}
-
-void HTMLAreaElement::setNoHref(bool noHref)
-{
-    setAttribute(nohrefAttr, noHref ? "" : 0);
-}
-
-String HTMLAreaElement::shape() const
-{
-    return getAttribute(shapeAttr);
-}
-
-void HTMLAreaElement::setShape(const String& value)
-{
-    setAttribute(shapeAttr, value);
-}
-
-int HTMLAreaElement::tabIndex() const
-{
-    return getAttribute(tabindexAttr).toInt();
-}
-
-void HTMLAreaElement::setTabIndex(int tabIndex)
-{
-    setAttribute(tabindexAttr, String::number(tabIndex));
-}
-
-String HTMLAreaElement::target() const
-{
-    return getAttribute(targetAttr);
-}
-
-void HTMLAreaElement::setTarget(const String& value)
-{
-    setAttribute(targetAttr, value);
-}
-
 }
similarity index 50%
rename from WebCore/html/html_imageimpl.h
rename to WebCore/html/HTMLImageElement.h
index 6ec160b8489f2cf8f746135896a4e590aece6a99..e744efcf96165824aa2b61715f49b68e8c1c705d 100644 (file)
  *
  */
 
-#ifndef HTML_IMAGEIMPL_H
-#define HTML_IMAGEIMPL_H
+#ifndef HTMLImageElement_H
+#define HTMLImageElement_H
 
-#include "CachedImage.h"
-#include "HTMLAnchorElement.h"
-#include "Image.h"
-#include "Path.h"
-#include "RenderObject.h"
+#include "HTMLElement.h"
+#include "GraphicsTypes.h"
+#include "HTMLImageLoader.h"
 
 namespace WebCore {
 
-class HTMLCollection;
-class HTMLFormElement;
-class Image;
-class String;
-
-struct Length;
-
-class HTMLImageLoader : public CachedObjectClient {
-public:
-    HTMLImageLoader(Element*);
-    virtual ~HTMLImageLoader();
-
-    virtual void updateFromElement();
-
-    void dispatchLoadEvent();
-
-    Element* element() const { return m_element; }
-    bool imageComplete() const { return m_imageComplete; }
-    CachedImage* image() const { return m_image; }
-
-    // CachedObjectClient API
-    virtual void notifyFinished(CachedObject*);
-
-protected:
-    void setLoadingImage(CachedImage*);
-
-private:
-    Element* m_element;
-    CachedImage* m_image;
-    bool m_firedLoad : 1;
-    bool m_imageComplete : 1;
-};
-
 class HTMLImageElement : public HTMLElement {
     friend class HTMLFormElement;
 public:
     HTMLImageElement(Document*, HTMLFormElement* = 0);
-    HTMLImageElement(const QualifiedName& tagName, Document*);
+    HTMLImageElement(const QualifiedName&, Document*);
     ~HTMLImageElement();
 
     virtual HTMLTagStatus endTagRequirement() const { return TagStatusForbidden; }
@@ -147,85 +112,6 @@ protected:
     CompositeOperator m_compositeOperator;
 };
 
-//------------------------------------------------------------------
-
-class HTMLAreaElement : public HTMLAnchorElement {
-public:
-    enum Shape { Default, Poly, Rect, Circle, Unknown };
-
-    HTMLAreaElement(Document*);
-    ~HTMLAreaElement();
-
-    virtual HTMLTagStatus endTagRequirement() const { return TagStatusForbidden; }
-    virtual int tagPriority() const { return 0; }
-
-    virtual void parseMappedAttribute(MappedAttribute*);
-
-    bool isDefault() const { return m_shape == Default; }
-
-    bool mapMouseEvent(int x, int y, int width, int height, RenderObject::NodeInfo& info);
-
-    virtual IntRect getRect(RenderObject*) const;
-
-    String accessKey() const;
-    void setAccessKey(const String&);
-
-    String alt() const;
-    void setAlt(const String&);
-
-    String coords() const;
-    void setCoords(const String&);
-
-    String href() const;
-    void setHref(const String&);
-
-    bool noHref() const;
-    void setNoHref(bool);
-
-    String shape() const;
-    void setShape(const String&);
-
-    int tabIndex() const;
-    void setTabIndex(int);
-
-    String target() const;
-    void setTarget(const String&);
-
-protected:
-    Path getRegion(int width, int height) const;
-    Path region;
-    Length* m_coords;
-    int m_coordsLen;
-    int lastw, lasth;
-    Shape m_shape;
-};
-
-// -------------------------------------------------------------------------
-
-class HTMLMapElement : public HTMLElement {
-public:
-    HTMLMapElement(Document*);
-    ~HTMLMapElement();
-
-    virtual HTMLTagStatus endTagRequirement() const { return TagStatusRequired; }
-    virtual int tagPriority() const { return 1; }
-    virtual bool checkDTD(const Node*);
-
-    const AtomicString& getName() const { return m_name; }
-
-    virtual void parseMappedAttribute(MappedAttribute*);
-
-    bool mapMouseEvent(int x, int y, int width, int height, RenderObject::NodeInfo&);
-
-    PassRefPtr<HTMLCollection> areas();
-
-    String name() const;
-    void setName(const String&);
-
-private:
-    AtomicString m_name;
-};
-
 } //namespace
 
 #endif
diff --git a/WebCore/html/HTMLImageLoader.cpp b/WebCore/html/HTMLImageLoader.cpp
new file mode 100644 (file)
index 0000000..9b0d4be
--- /dev/null
@@ -0,0 +1,119 @@
+/**
+ * This file is part of the DOM implementation for KDE.
+ *
+ * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
+ *           (C) 1999 Antti Koivisto (koivisto@kde.org)
+ * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
+ *
+ * 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., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+#include "config.h"
+#include "HTMLImageLoader.h"
+
+#include "csshelper.h"
+#include "CachedImage.h"
+#include "DocLoader.h"
+#include "Document.h"
+#include "Element.h"
+#include "EventNames.h"
+#include "HTMLNames.h"
+#include "RenderImage.h"
+
+using namespace std;
+
+namespace WebCore {
+
+using namespace EventNames;
+using namespace HTMLNames;
+
+HTMLImageLoader::HTMLImageLoader(Element* elt)
+    : m_element(elt)
+    , m_image(0)
+    , m_firedLoad(true)
+    , m_imageComplete(true)
+{
+}
+
+HTMLImageLoader::~HTMLImageLoader()
+{
+    if (m_image)
+        m_image->deref(this);
+    m_element->document()->removeImage(this);
+}
+
+void HTMLImageLoader::setLoadingImage(CachedImage *loadingImage)
+{
+    m_firedLoad = false;
+    m_imageComplete = false;
+    m_image = loadingImage;
+}
+
+void HTMLImageLoader::updateFromElement()
+{
+    // If we're not making renderers for the page, then don't load images.  We don't want to slow
+    // down the raw HTML parsing case by loading images we don't intend to display.
+    Element* elem = element();
+    Document* doc = elem->document();
+    if (!doc->renderer())
+        return;
+
+    AtomicString attr = elem->getAttribute(elem->hasLocalName(objectTag) ? dataAttr : srcAttr);
+    
+    // Treat a lack of src or empty string for src as no image at all.
+    CachedImage *newImage = 0;
+    if (!attr.isEmpty())
+        newImage = doc->docLoader()->requestImage(parseURL(attr));
+
+    CachedImage *oldImage = m_image;
+    if (newImage != oldImage) {
+#ifdef INSTRUMENT_LAYOUT_SCHEDULING
+        if (!doc->ownerElement() && newImage)
+            printf("Image requested at %d\n", doc->elapsedTime());
+#endif
+        setLoadingImage(newImage);
+        if (newImage)
+            newImage->ref(this);
+        if (oldImage)
+            oldImage->deref(this);
+    }
+
+    if (RenderImage* renderer = static_cast<RenderImage*>(elem->renderer()))
+        renderer->resetAnimation();
+}
+
+void HTMLImageLoader::dispatchLoadEvent()
+{
+    if (!m_firedLoad && m_image) {
+        m_firedLoad = true;
+        element()->dispatchHTMLEvent(m_image->isErrorImage() ? errorEvent : loadEvent, false, false);
+    }
+}
+
+void HTMLImageLoader::notifyFinished(CachedObject *image)
+{
+    m_imageComplete = true;
+    Element* elem = element();
+    Document* doc = elem->document();
+    doc->dispatchImageLoadEventSoon(this);
+#ifdef INSTRUMENT_LAYOUT_SCHEDULING
+        if (!doc->ownerElement())
+            printf("Image loaded at %d\n", doc->elapsedTime());
+#endif
+    if (RenderImage* renderer = static_cast<RenderImage*>(elem->renderer()))
+        renderer->setCachedImage(m_image);
+}
+
+}
diff --git a/WebCore/html/HTMLImageLoader.h b/WebCore/html/HTMLImageLoader.h
new file mode 100644 (file)
index 0000000..efb81b7
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * This file is part of the DOM implementation for KDE.
+ *
+ * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
+ *           (C) 1999 Antti Koivisto (koivisto@kde.org)
+ * Copyright (C) 2004 Apple Computer, Inc.
+ *
+ * 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., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef HTMLImageLoader_H
+#define HTMLImageLoader_H
+
+#include "CachedObjectClient.h"
+
+namespace WebCore {
+
+class Element;
+
+class HTMLImageLoader : public CachedObjectClient {
+public:
+    HTMLImageLoader(Element*);
+    virtual ~HTMLImageLoader();
+
+    virtual void updateFromElement();
+
+    void dispatchLoadEvent();
+
+    Element* element() const { return m_element; }
+    bool imageComplete() const { return m_imageComplete; }
+    CachedImage* image() const { return m_image; }
+
+    // CachedObjectClient API
+    virtual void notifyFinished(CachedObject*);
+
+protected:
+    void setLoadingImage(CachedImage*);
+
+private:
+    Element* m_element;
+    CachedImage* m_image;
+    bool m_firedLoad : 1;
+    bool m_imageComplete : 1;
+};
+
+} //namespace
+
+#endif
index 22ea0aa760f3b164e7409fe1d602ed228550304e..4e2283bd083a1934eddaf9fe067cd6df9828ea34 100644 (file)
@@ -34,6 +34,7 @@
 #include "FormDataList.h"
 #include "Frame.h"
 #include "HTMLFormElement.h"
+#include "HTMLImageLoader.h"
 #include "HTMLNames.h"
 #include "LocalizedStrings.h"
 #include "RenderFileButton.h"
@@ -44,7 +45,6 @@
 #include "RenderTheme.h"
 #include "RenderSlider.h"
 #include "SelectionController.h"
-#include "html_imageimpl.h"
 #include "RenderButton.h"
 #include <unicode/ubrk.h>
 
diff --git a/WebCore/html/HTMLMapElement.cpp b/WebCore/html/HTMLMapElement.cpp
new file mode 100644 (file)
index 0000000..661b460
--- /dev/null
@@ -0,0 +1,101 @@
+/**
+ * This file is part of the DOM implementation for KDE.
+ *
+ * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
+ *           (C) 1999 Antti Koivisto (koivisto@kde.org)
+ * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
+ *
+ * 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., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+#include "config.h"
+#include "HTMLMapElement.h"
+
+#include "Document.h"
+#include "HTMLAreaElement.h"
+#include "HTMLCollection.h"
+#include "HTMLNames.h"
+
+using namespace std;
+
+namespace WebCore {
+
+using namespace HTMLNames;
+
+HTMLMapElement::HTMLMapElement(Document *doc)
+    : HTMLElement(mapTag, doc)
+{
+}
+
+HTMLMapElement::~HTMLMapElement()
+{
+    document()->removeImageMap(this);
+}
+
+bool HTMLMapElement::checkDTD(const Node* newChild)
+{
+    // FIXME: This seems really odd, allowing only blocks inside map elements.
+    return newChild->hasTagName(areaTag) || newChild->hasTagName(scriptTag) || inBlockTagList(newChild);
+}
+
+bool HTMLMapElement::mapMouseEvent(int x, int y, const IntSize& size, RenderObject::NodeInfo& info)
+{
+    Node *node = this;
+    while ((node = node->traverseNextNode(this)))
+        if (node->hasTagName(areaTag))
+            if (static_cast<HTMLAreaElement*>(node)->mapMouseEvent(x, y, size, info))
+                return true;
+    return false;
+}
+
+void HTMLMapElement::parseMappedAttribute(MappedAttribute* attr)
+{
+    const QualifiedName& attrName = attr->name();
+    if (attrName == idAttr || attrName == nameAttr) {
+        Document* doc = document();
+        if (attrName == idAttr) {
+            // Call base class so that hasID bit gets set.
+            HTMLElement::parseMappedAttribute(attr);
+            if (doc->htmlMode() != Document::XHtml)
+                return;
+        }
+        doc->removeImageMap(this);
+        m_name = attr->value();
+        if (m_name[0] == '#') {
+            String mapName(m_name.domString().copy());
+            mapName.remove(0, 1);
+            m_name = mapName;
+        }
+        doc->addImageMap(this);
+    } else
+        HTMLElement::parseMappedAttribute(attr);
+}
+
+PassRefPtr<HTMLCollection> HTMLMapElement::areas()
+{
+    return new HTMLCollection(this, HTMLCollection::MAP_AREAS);
+}
+
+String HTMLMapElement::name() const
+{
+    return getAttribute(nameAttr);
+}
+
+void HTMLMapElement::setName(const String& value)
+{
+    setAttribute(nameAttr, value);
+}
+
+}
diff --git a/WebCore/html/HTMLMapElement.h b/WebCore/html/HTMLMapElement.h
new file mode 100644 (file)
index 0000000..d19de4e
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * This file is part of the DOM implementation for KDE.
+ *
+ * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
+ *           (C) 1999 Antti Koivisto (koivisto@kde.org)
+ * Copyright (C) 2004 Apple Computer, Inc.
+ *
+ * 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., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef HTMLMapElement_H
+#define HTMLMapElement_H
+
+#include "HTMLElement.h"
+#include "RenderObject.h" // for RenderObject::NodeInfo
+
+namespace WebCore {
+
+class HTMLMapElement : public HTMLElement {
+public:
+    HTMLMapElement(Document*);
+    ~HTMLMapElement();
+
+    virtual HTMLTagStatus endTagRequirement() const { return TagStatusRequired; }
+    virtual int tagPriority() const { return 1; }
+    virtual bool checkDTD(const Node*);
+
+    const AtomicString& getName() const { return m_name; }
+
+    virtual void parseMappedAttribute(MappedAttribute*);
+
+    bool mapMouseEvent(int x, int y, const IntSize&, RenderObject::NodeInfo&);
+
+    PassRefPtr<HTMLCollection> areas();
+
+    String name() const;
+    void setName(const String&);
+
+private:
+    AtomicString m_name;
+};
+
+} //namespace
+
+#endif
index ceb0e307a501d58cba9c77aea3ada64677af697c..d4d422b67ad69407abb18c954ac41b63921f22fb 100644 (file)
 #include "Frame.h"
 #include "HTMLFormElement.h"
 #include "HTMLDocument.h"
+#include "HTMLImageLoader.h"
 #include "HTMLNames.h"
+#include "Image.h"
 #include "RenderImage.h"
 #include "RenderPartObject.h"
 #include "RenderWidget.h"
 #include "Text.h"
 #include "csshelper.h"
-#include "html_imageimpl.h"
 
 namespace WebCore {
 
index fe9d04def00313b6ae1ceb31cf53e5bab9c1222e..c04271bce65e8085d97ff66025d2b898628c814b 100644 (file)
@@ -41,6 +41,7 @@
 #include "HTMLHRElement.h"
 #include "HTMLHtmlElement.h"
 #include "HTMLIsIndexElement.h"
+#include "HTMLMapElement.h"
 #include "HTMLNames.h"
 #include "HTMLTableCellElement.h"
 #include "HTMLTableRowElement.h"
index 1c089299cddd1fa61e7d3fc60111b70f5ed9f15b..985f89c1462da48cd919947c0ff27b4f38d61744 100644 (file)
 #define KSVG_SVGImageLoader_H
 #if SVG_SUPPORT
 
-#include "html_imageimpl.h"
+#include "HTMLImageLoader.h"
 
 namespace WebCore
 {
     class SVGImageElement;
-    class SVGImageLoader : public WebCore::HTMLImageLoader {
+    class SVGImageLoader : public HTMLImageLoader {
     public:
         SVGImageLoader(SVGImageElement *node);
         virtual ~SVGImageLoader();
index 327948904ca3380b433776680f051ad99879c7d3..fb9b38f7e965ea9e1ced4756bb152719ec925769 100644 (file)
 #import "EventNames.h"
 #import "FoundationExtras.h"
 #import "FrameMac.h"
+#import "HTMLAreaElement.h"
 #import "HTMLCollection.h"
 #import "HTMLInputElement.h"
+#import "HTMLMapElement.h"
 #import "HTMLNames.h"
 #import "RenderCanvas.h"
 #import "RenderImage.h"
@@ -49,7 +51,6 @@
 #import "WebCoreFrameBridge.h"
 #import "WebCoreFrameView.h"
 #import "WebCoreViewFactory.h"
-#import "html_imageimpl.h"
 #import "kjs_html.h"
 #import "visible_units.h"
 
@@ -259,7 +260,7 @@ using namespace HTMLNames;
     if (m_renderer->isImage() && !m_areaElement) {
         HTMLMapElement* map = static_cast<RenderImage*>(m_renderer)->imageMap();
         if (map) {
-            for (Node *current = map->firstChild(); current; current = current->traverseNextNode(map)) {
+            for (Nodecurrent = map->firstChild(); current; current = current->traverseNextNode(map)) {
                 // add an <area> element for this child if it has a link
                 // NOTE: can't cache these because they all have the same renderer, which is the cache key, right?
                 // plus there may be little reason to since they are being added to the handy array
index b55bef1d5f19d98983dcaba8a58bd2482ab878c1..7211ccdda2fd98c15f3174c083e1700b91f823a1 100644 (file)
@@ -62,7 +62,6 @@
 #include "TypingCommand.h"
 #include "cssstyleselector.h"
 #include "dom2_eventsimpl.h"
-#include "html_imageimpl.h"
 #include "htmlediting.h"
 #include "kjs_window.h"
 #include "markup.h"
index ee3b80c1a635bab23667c5df6b6351138fe70eb6..93ab39e7b883136f95220710a3ff7a7cd5db9a8e 100644 (file)
@@ -30,8 +30,9 @@
 
 #include "Document.h"
 #include "GraphicsContext.h"
+#include "HTMLImageElement.h"
 #include "HTMLInputElement.h"
-#include "html_imageimpl.h"
+#include "HTMLMapElement.h"
 #include "HTMLNames.h"
 #include "RenderCanvas.h"
 
@@ -41,10 +42,10 @@ namespace WebCore {
 
 using namespace HTMLNames;
 
-RenderImage::RenderImage(Node *_node)
-    : RenderReplaced(_node)
+RenderImage::RenderImage(Node* n)
+    : RenderReplaced(n)
+    , m_cachedImage(0)
 {
-    m_cachedImage = 0;
     m_selectionState = SelectionNone;
     setIntrinsicWidth(0);
     setIntrinsicHeight(0);
@@ -297,8 +298,7 @@ HTMLMapElement* RenderImage::imageMap()
     return i ? i->document()->getImageMap(i->imageMap()) : 0;
 }
 
-bool RenderImage::nodeAtPoint(NodeInfo& info, int _x, int _y, int _tx, int _ty,
-                              HitTestAction hitTestAction)
+bool RenderImage::nodeAtPoint(NodeInfo& info, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction)
 {
     bool inside = RenderReplaced::nodeAtPoint(info, _x, _y, _tx, _ty, hitTestAction);
 
@@ -309,7 +309,7 @@ bool RenderImage::nodeAtPoint(NodeInfo& info, int _x, int _y, int _tx, int _ty,
         HTMLMapElement* map = imageMap();
         if (map) {
             // we're a client side image map
-            inside = map->mapMouseEvent(_x - tx, _y - ty, contentWidth(), contentHeight(), info);
+            inside = map->mapMouseEvent(_x - tx, _y - ty, IntSize(contentWidth(), contentHeight()), info);
             info.setInnerNonSharedNode(element());
         }
     }