[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

rjw rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:41:46 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit c15540003f4d9bce037a218deab4a57470c65ad4
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue May 25 21:37:44 2004 +0000

    	Part 1 of the new <CANVAS> tag implementation.  This patch
    	adds the boiler plate for the new element.
    
            Reviewed by Dave.
    
            * ForwardingHeaders/html/html_canvasimpl.h: Added.
            * ForwardingHeaders/rendering/render_canvasimage.h: Added.
            * WebCore.pbproj/project.pbxproj:
            * khtml/ecma/kjs_html.cpp:
            (KJS::HTMLElement::classInfo):
            (KJS::HTMLElementFunction::tryCall):
            * khtml/ecma/kjs_html.h:
            (KJS::HTMLElement::):
            * khtml/ecma/kjs_html.lut.h:
            (KJS::):
            * khtml/html/dtd.cpp:
            (DOM::checkChild):
            * khtml/html/html_canvasimpl.cpp: Added.
            (HTMLCanvasElementImpl::HTMLCanvasElementImpl):
            (HTMLCanvasElementImpl::~HTMLCanvasElementImpl):
            (HTMLCanvasElementImpl::id):
            (HTMLCanvasElementImpl::mapToEntry):
            (HTMLCanvasElementImpl::parseHTMLAttribute):
            (HTMLCanvasElementImpl::createRenderer):
            (HTMLCanvasElementImpl::attach):
            (HTMLCanvasElementImpl::detach):
            (HTMLCanvasElementImpl::isURLAttribute):
            * khtml/html/html_canvasimpl.h: Added.
            * khtml/html/htmlparser.cpp:
            (KHTMLParser::getElement):
            * khtml/misc/htmltags.c:
            (hash_tag):
            (findTag):
            * khtml/misc/htmltags.h:
            * khtml/misc/htmltags.in:
            * khtml/rendering/render_canvasimage.cpp: Added.
            (RenderCanvasImage::RenderCanvasImage):
            (RenderCanvasImage::~RenderCanvasImage):
            (RenderCanvasImage::paint):
            (RenderCanvasImage::layout):
            * khtml/rendering/render_canvasimage.h: Added.
            (khtml::RenderCanvasImage::renderName):
            (khtml::RenderCanvasImage::element):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6685 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index af9aaf0..05455ac 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,49 @@
+2004-05-25  Richard Williamson   <rjw at apple.com>
+
+	Part 1 of the new <CANVAS> tag implementation.  This patch
+	adds the boiler plate for the new element.
+
+        Reviewed by Dave.
+
+        * ForwardingHeaders/html/html_canvasimpl.h: Added.
+        * ForwardingHeaders/rendering/render_canvasimage.h: Added.
+        * WebCore.pbproj/project.pbxproj:
+        * khtml/ecma/kjs_html.cpp:
+        (KJS::HTMLElement::classInfo):
+        (KJS::HTMLElementFunction::tryCall):
+        * khtml/ecma/kjs_html.h:
+        (KJS::HTMLElement::):
+        * khtml/ecma/kjs_html.lut.h:
+        (KJS::):
+        * khtml/html/dtd.cpp:
+        (DOM::checkChild):
+        * khtml/html/html_canvasimpl.cpp: Added.
+        (HTMLCanvasElementImpl::HTMLCanvasElementImpl):
+        (HTMLCanvasElementImpl::~HTMLCanvasElementImpl):
+        (HTMLCanvasElementImpl::id):
+        (HTMLCanvasElementImpl::mapToEntry):
+        (HTMLCanvasElementImpl::parseHTMLAttribute):
+        (HTMLCanvasElementImpl::createRenderer):
+        (HTMLCanvasElementImpl::attach):
+        (HTMLCanvasElementImpl::detach):
+        (HTMLCanvasElementImpl::isURLAttribute):
+        * khtml/html/html_canvasimpl.h: Added.
+        * khtml/html/htmlparser.cpp:
+        (KHTMLParser::getElement):
+        * khtml/misc/htmltags.c:
+        (hash_tag):
+        (findTag):
+        * khtml/misc/htmltags.h:
+        * khtml/misc/htmltags.in:
+        * khtml/rendering/render_canvasimage.cpp: Added.
+        (RenderCanvasImage::RenderCanvasImage):
+        (RenderCanvasImage::~RenderCanvasImage):
+        (RenderCanvasImage::paint):
+        (RenderCanvasImage::layout):
+        * khtml/rendering/render_canvasimage.h: Added.
+        (khtml::RenderCanvasImage::renderName):
+        (khtml::RenderCanvasImage::element):
+
 2004-05-25  Chris Blumenberg  <cblu at apple.com>
 
 	Fixed: <rdar://problem/3546418>: (when dragging text within an editable HTML doc, the selection should be moved not copied)
diff --git a/WebCore/ForwardingHeaders/html/html_canvasimpl.h b/WebCore/ForwardingHeaders/html/html_canvasimpl.h
new file mode 100644
index 0000000..862704f
--- /dev/null
+++ b/WebCore/ForwardingHeaders/html/html_canvasimpl.h
@@ -0,0 +1 @@
+#include <html_canvasimpl.h>
diff --git a/WebCore/ForwardingHeaders/rendering/render_canvasimage.h b/WebCore/ForwardingHeaders/rendering/render_canvasimage.h
new file mode 100644
index 0000000..3ea9139
--- /dev/null
+++ b/WebCore/ForwardingHeaders/rendering/render_canvasimage.h
@@ -0,0 +1 @@
+#include <render_canvasimage.h>
diff --git a/WebCore/WebCore.pbproj/project.pbxproj b/WebCore/WebCore.pbproj/project.pbxproj
index d996faf..4ff5f6a 100644
--- a/WebCore/WebCore.pbproj/project.pbxproj
+++ b/WebCore/WebCore.pbproj/project.pbxproj
@@ -531,6 +531,8 @@
 				931D712C065FB91800C966E1,
 				931D7225065FC25900C966E1,
 				93859E33065FCAD300CF54EE,
+				51F6A3D80663BF04004D2919,
+				51F6A3E00663C2EC004D2919,
 			);
 			isa = PBXHeadersBuildPhase;
 			runOnlyForDeploymentPostprocessing = 0;
@@ -811,6 +813,8 @@
 				842F72DD06405FDF00CC271B,
 				9342E3EA0646C8FF00004B05,
 				931D722B065FC40800C966E1,
+				51F6A3D70663BF04004D2919,
+				51F6A3DF0663C2EC004D2919,
 			);
 			isa = PBXSourcesBuildPhase;
 			runOnlyForDeploymentPostprocessing = 0;
@@ -939,6 +943,62 @@
 			settings = {
 			};
 		};
+		51F6A3D50663BF04004D2919 = {
+			fileEncoding = 30;
+			isa = PBXFileReference;
+			lastKnownFileType = sourcecode.cpp.cpp;
+			path = html_canvasimpl.cpp;
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		51F6A3D60663BF04004D2919 = {
+			fileEncoding = 30;
+			isa = PBXFileReference;
+			lastKnownFileType = sourcecode.c.h;
+			path = html_canvasimpl.h;
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		51F6A3D70663BF04004D2919 = {
+			fileRef = 51F6A3D50663BF04004D2919;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		51F6A3D80663BF04004D2919 = {
+			fileRef = 51F6A3D60663BF04004D2919;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		51F6A3DD0663C2EC004D2919 = {
+			fileEncoding = 30;
+			isa = PBXFileReference;
+			lastKnownFileType = sourcecode.cpp.cpp;
+			path = render_canvasimage.cpp;
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		51F6A3DE0663C2EC004D2919 = {
+			fileEncoding = 30;
+			isa = PBXFileReference;
+			lastKnownFileType = sourcecode.c.h;
+			path = render_canvasimage.h;
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		51F6A3DF0663C2EC004D2919 = {
+			fileRef = 51F6A3DD0663C2EC004D2919;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		51F6A3E00663C2EC004D2919 = {
+			fileRef = 51F6A3DE0663C2EC004D2919;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
 //510
 //511
 //512
@@ -5358,6 +5418,8 @@
 				F523D23802DE4396018635CA,
 				F523D23902DE4396018635CA,
 				F523D23A02DE4396018635CA,
+				51F6A3D50663BF04004D2919,
+				51F6A3D60663BF04004D2919,
 				F523D23B02DE4396018635CA,
 				F523D23C02DE4396018635CA,
 				F523D23E02DE4396018635CA,
@@ -6121,6 +6183,8 @@
 				F523D2A902DE4438018635CA,
 				BC80A6930468B78100DBCC9C,
 				BC80A6940468B78100DBCC9C,
+				51F6A3DD0663C2EC004D2919,
+				51F6A3DE0663C2EC004D2919,
 				F523D2AC02DE4438018635CA,
 				F523D2AB02DE4438018635CA,
 				F523D2AE02DE4438018635CA,
diff --git a/WebCore/khtml/ecma/kjs_html.cpp b/WebCore/khtml/ecma/kjs_html.cpp
index 017f84a..f6cdec7 100644
--- a/WebCore/khtml/ecma/kjs_html.cpp
+++ b/WebCore/khtml/ecma/kjs_html.cpp
@@ -471,6 +471,7 @@ const ClassInfo KJS::HTMLElement::font_info = { "HTMLFontElement", &KJS::HTMLEle
 const ClassInfo KJS::HTMLElement::hr_info = { "HTMLHRElement", &KJS::HTMLElement::info, &HTMLHRElementTable, 0 };
 const ClassInfo KJS::HTMLElement::mod_info = { "HTMLModElement", &KJS::HTMLElement::info, &HTMLModElementTable, 0 };
 const ClassInfo KJS::HTMLElement::a_info = { "HTMLAnchorElement", &KJS::HTMLElement::info, &HTMLAnchorElementTable, 0 };
+const ClassInfo KJS::HTMLElement::canvas_info = { "HTMLCanvasElement", &KJS::HTMLElement::info, &HTMLCanvasElementTable, 0 };
 const ClassInfo KJS::HTMLElement::img_info = { "HTMLImageElement", &KJS::HTMLElement::info, &HTMLImageElementTable, 0 };
 const ClassInfo KJS::HTMLElement::object_info = { "HTMLObjectElement", &KJS::HTMLElement::info, &HTMLObjectElementTable, 0 };
 const ClassInfo KJS::HTMLElement::param_info = { "HTMLParamElement", &KJS::HTMLElement::info, &HTMLParamElementTable, 0 };
@@ -573,6 +574,8 @@ const ClassInfo* KJS::HTMLElement::classInfo() const
     return &mod_info;
   case ID_A:
     return &a_info;
+  case ID_CANVAS:
+    return &canvas_info;
   case ID_IMG:
     return &img_info;
   case ID_OBJECT:
@@ -1077,6 +1080,10 @@ const ClassInfo* KJS::HTMLElement::classInfo() const
   start           KJS::HTMLElement::MarqueeStart		DontDelete|Function 0
   stop            KJS::HTMLElement::MarqueeStop                 DontDelete|Function 0
 @end
+
+ at begin HTMLCanvasElementTable 1
+  getContext      KJS::HTMLElement::GetContext                  DontDelete|Function 0
+ at end
 */
 
 Value KJS::HTMLElement::tryGet(ExecState *exec, const Identifier &propertyName) const
@@ -2127,7 +2134,16 @@ Value KJS::HTMLElementFunction::tryCall(ExecState *exec, Object &thisObj, const
         }
         break;
     }
-        
+    case ID_CANVAS: {
+        if (id == KJS::HTMLElement::GetContext) {
+            if (args.size() == 0 || (args.size() == 1 && args[0].toString(exec).qstring().lower() == "2d-context")) {
+                // FIXME:  Implement canvas.
+                printf ("%s:%d: %s  create 2D context\n", __FILE__, __LINE__, __FUNCTION__);
+            }
+            return Undefined();
+        }
+    }
+    
     break;
   }
 
diff --git a/WebCore/khtml/ecma/kjs_html.h b/WebCore/khtml/ecma/kjs_html.h
index 17f4484..6467ff8 100644
--- a/WebCore/khtml/ecma/kjs_html.h
+++ b/WebCore/khtml/ecma/kjs_html.h
@@ -72,7 +72,7 @@ namespace KJS {
       button_info, label_info, fieldSet_info, legend_info, ul_info, ol_info,
       dl_info, dir_info, menu_info, li_info, div_info, p_info, heading_info,
       blockQuote_info, q_info, pre_info, br_info, baseFont_info, font_info,
-      hr_info, mod_info, a_info, img_info, object_info, param_info,
+      hr_info, mod_info, a_info, canvas_info, img_info, object_info, param_info,
       applet_info, map_info, area_info, script_info, table_info,
       caption_info, col_info, tablesection_info, tr_info,
       tablecell_info, frameSet_info, frame_info, iFrame_info, marquee_info;
@@ -146,6 +146,7 @@ namespace KJS {
            IFrameFrameBorder, IFrameSrc, IFrameName, IFrameHeight,
            IFrameMarginHeight, IFrameMarginWidth, IFrameScrolling, IFrameWidth, IFrameContentDocument,
            MarqueeStart, MarqueeStop,
+           GetContext,
            ElementInnerHTML, ElementTitle, ElementId, ElementDir, ElementLang,
            ElementClassName, ElementInnerText, ElementDocument, ElementChildren, ElementContentEditable,
            ElementIsContentEditable, ElementOuterHTML, ElementOuterText};
diff --git a/WebCore/khtml/ecma/kjs_html.lut.h b/WebCore/khtml/ecma/kjs_html.lut.h
index 4e3660c..02fcb75 100644
--- a/WebCore/khtml/ecma/kjs_html.lut.h
+++ b/WebCore/khtml/ecma/kjs_html.lut.h
@@ -1000,6 +1000,16 @@ const struct HashTable HTMLMarqueeElementTable = { 2, 3, HTMLMarqueeElementTable
 
 namespace KJS {
 
+const struct HashEntry HTMLCanvasElementTableEntries[] = {
+   { "getContext", KJS::HTMLElement::GetContext, DontDelete|Function, 0, 0 }
+};
+
+const struct HashTable HTMLCanvasElementTable = { 2, 1, HTMLCanvasElementTableEntries, 1 };
+
+} // namespace
+
+namespace KJS {
+
 const struct HashEntry HTMLCollectionProtoTableEntries[] = {
    { 0, 0, 0, 0, 0 },
    { "namedItem", HTMLCollection::NamedItem, DontDelete|Function, 1, 0 },
diff --git a/WebCore/khtml/html/dtd.cpp b/WebCore/khtml/html/dtd.cpp
index 6a22e1b..cb964e7 100644
--- a/WebCore/khtml/html/dtd.cpp
+++ b/WebCore/khtml/html/dtd.cpp
@@ -61,6 +61,7 @@ const unsigned short DOM::tagPriority[] = {
    10, // ID_BODY
     0, // ID_BR
     1, // ID_BUTTON
+    0, // ID_CANVAS
     5, // ID_CAPTION
     5, // ID_CENTER
     1, // ID_CITE
@@ -167,6 +168,7 @@ const tagStatus DOM::endTag[] = {
     REQUIRED,  // ID_BODY
     FORBIDDEN, // ID_BR
     REQUIRED,  // ID_BUTTON
+    FORBIDDEN, // ID_CANVAS
     REQUIRED,  // ID_CAPTION
     REQUIRED,  // ID_CENTER
     REQUIRED,  // ID_CITE
@@ -278,6 +280,7 @@ static const ushort tag_list_0[] = {
     ID_ABBR,
     ID_ACRONYM,
     ID_A,
+    ID_CANVAS,
     ID_IMG,
     ID_APPLET,
     ID_OBJECT,
@@ -353,6 +356,7 @@ static const ushort tag_list_1[] = {
     ID_ABBR,
     ID_ACRONYM,
     ID_A,
+    ID_CANVAS,
     ID_IMG,
     ID_APPLET,
     ID_OBJECT,
@@ -476,6 +480,7 @@ static const ushort tag_list_4[] = {
     ID_ABBR,
     ID_ACRONYM,
     ID_A,
+    ID_CANVAS,
     ID_IMG,
     ID_APPLET,
     ID_OBJECT,
@@ -601,6 +606,7 @@ bool DOM::checkChild(ushort tagID, ushort childID)
     case ID_BR:
     case ID_AREA:
     case ID_LINK:
+    case ID_CANVAS:
     case ID_IMG:
     case ID_PARAM:
     case ID_HR:
diff --git a/WebCore/khtml/html/html_canvasimpl.cpp b/WebCore/khtml/html/html_canvasimpl.cpp
new file mode 100644
index 0000000..73d15e0
--- /dev/null
+++ b/WebCore/khtml/html/html_canvasimpl.cpp
@@ -0,0 +1,112 @@
+/*
+ * Copyright (C) 2004 Apple Computer, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include "html/html_canvasimpl.h"
+#include "html/html_documentimpl.h"
+
+#include "misc/htmlhashes.h"
+#include "khtmlview.h"
+#include "khtml_part.h"
+
+#include <kstringhandler.h>
+#include <kglobal.h>
+#include <kdebug.h>
+
+#include "rendering/render_canvasimage.h"
+#include "rendering/render_flow.h"
+#include "css/cssstyleselector.h"
+#include "css/cssproperties.h"
+#include "css/cssvalues.h"
+#include "css/csshelper.h"
+#include "xml/dom2_eventsimpl.h"
+
+#include <qstring.h>
+#include <qpoint.h>
+#include <qregion.h>
+#include <qptrstack.h>
+#include <qimage.h>
+#include <qpointarray.h>
+
+using namespace DOM;
+using namespace khtml;
+
+// -------------------------------------------------------------------------
+
+HTMLCanvasElementImpl::HTMLCanvasElementImpl(DocumentPtr *doc)
+    : HTMLImageElementImpl(doc)
+{
+    printf ("%s:%d: %s\n", __FILE__, __LINE__, __FUNCTION__);
+}
+
+HTMLCanvasElementImpl::~HTMLCanvasElementImpl()
+{
+}
+
+NodeImpl::Id HTMLCanvasElementImpl::id() const
+{
+    return ID_CANVAS;
+}
+
+bool HTMLCanvasElementImpl::mapToEntry(NodeImpl::Id attr, MappedAttributeEntry& result) const
+{
+    return HTMLImageElementImpl::mapToEntry(attr, result);
+}
+
+void HTMLCanvasElementImpl::parseHTMLAttribute(HTMLAttributeImpl *attr)
+{
+    switch (attr->id())
+    {
+        case ATTR_SRC: {
+            // Do nothing.  
+            break;
+        }
+        default: {
+            HTMLImageElementImpl::parseHTMLAttribute(attr);
+        }
+    }
+}
+
+
+RenderObject *HTMLCanvasElementImpl::createRenderer(RenderArena *arena, RenderStyle *style)
+{
+     return new (arena) RenderCanvasImage(this);
+}
+
+void HTMLCanvasElementImpl::attach()
+{
+    // Don't want to call image's attach().
+    HTMLElementImpl::attach();
+}
+
+void HTMLCanvasElementImpl::detach()
+{
+    // Don't want to call image's detach().
+    HTMLElementImpl::detach();
+}
+
+bool HTMLCanvasElementImpl::isURLAttribute(AttributeImpl *attr) const
+{
+    return ((attr->id() == ATTR_USEMAP && attr->value().domString()[0] != '#'));
+}
diff --git a/WebCore/khtml/xml/dom_edititerator.h b/WebCore/khtml/html/html_canvasimpl.h
similarity index 63%
copy from WebCore/khtml/xml/dom_edititerator.h
copy to WebCore/khtml/html/html_canvasimpl.h
index 8e4aa0f..9cd252b 100644
--- a/WebCore/khtml/xml/dom_edititerator.h
+++ b/WebCore/khtml/html/html_canvasimpl.h
@@ -22,40 +22,43 @@
  * (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 HTML_CANVASIMPL_H
+#define HTML_CANVASIMPL_H
 
-#ifndef _EditIterator_h_
-#define _EditIterator_h_
+#include "html/html_imageimpl.h"
+#include "html/html_inlineimpl.h"
+#include "misc/khtmllayout.h"
+#include "rendering/render_object.h"
 
-#include "dom_position.h"
+#include <qregion.h>
+#include <qmap.h>
+#include <qpixmap.h>
 
 namespace DOM {
 
-class NodeImpl;
-class Position;
-
-class EditIterator
+class DOMString;
+    
+class HTMLCanvasElementImpl
+    : public HTMLImageElementImpl
 {
 public:
-    EditIterator() : m_current() {}
-    EditIterator(NodeImpl *node, long offset) : m_current(node, offset) {}
-    EditIterator(const Position &o) : m_current(o) {}
+    HTMLCanvasElementImpl(DocumentPtr *doc);
 
-    Position current() const { return m_current; }
-    Position previous() { return m_current = peekPrevious(); }
-    Position next() { return m_current = peekNext(); }
-    Position peekPrevious() const;
-    Position peekNext() const;
+    ~HTMLCanvasElementImpl();
 
-    void setPosition(const Position &pos) { m_current = pos; }
+    virtual Id id() const;
 
-    bool atStart() const;
-    bool atEnd() const;
-    bool isEmpty() const { return m_current.isEmpty(); }
+    virtual bool mapToEntry(NodeImpl::Id attr, MappedAttributeEntry& result) const;
+    virtual void parseHTMLAttribute(HTMLAttributeImpl *);
 
-private:
-    Position m_current;
+    virtual void attach();
+    virtual khtml::RenderObject *createRenderer(RenderArena *, khtml::RenderStyle *);
+    virtual void detach();
+    
+    virtual bool isURLAttribute(AttributeImpl *attr) const;
 };
 
-} // namespace DOM
 
-#endif // _EditIterator_h_
+}; //namespace
+
+#endif
diff --git a/WebCore/khtml/html/htmlparser.cpp b/WebCore/khtml/html/htmlparser.cpp
index e739292..19323ef 100644
--- a/WebCore/khtml/html/htmlparser.cpp
+++ b/WebCore/khtml/html/htmlparser.cpp
@@ -33,6 +33,7 @@
 
 #include "html/html_baseimpl.h"
 #include "html/html_blockimpl.h"
+#include "html/html_canvasimpl.h"
 #include "html/html_documentimpl.h"
 #include "html/html_elementimpl.h"
 #include "html/html_formimpl.h"
@@ -948,6 +949,13 @@ NodeImpl *KHTMLParser::getElement(Token* t)
         n = new HTMLAnchorElementImpl(document);
         break;
 
+#if APPLE_CHANGES
+// canvas
+    case ID_CANVAS:
+        n = new HTMLCanvasElementImpl(document);
+        break;
+#endif
+
 // images
     case ID_IMG:
         n = new HTMLImageElementImpl(document);
diff --git a/WebCore/khtml/misc/htmltags.c b/WebCore/khtml/misc/htmltags.c
index 05a6dfb..175e798 100644
--- a/WebCore/khtml/misc/htmltags.c
+++ b/WebCore/khtml/misc/htmltags.c
@@ -25,8 +25,8 @@ hash_tag (register const char *str, register unsigned int len)
       306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
       306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
       306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
-      306, 306, 306, 306, 306, 306, 306, 306, 306,  25,
-       30,  35,  40,  10,  15, 306, 306, 306, 306, 306,
+      306, 306, 306, 306, 306, 306, 306, 306, 306,  30,
+       35,  40,  15,  25,  10, 306, 306, 306, 306, 306,
       306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
       306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
       306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
@@ -86,7 +86,7 @@ findTag (register const char *str, register unsigned int len)
 {
   enum
     {
-      TOTAL_KEYWORDS = 104,
+      TOTAL_KEYWORDS = 105,
       MIN_WORD_LENGTH = 1,
       MAX_WORD_LENGTH = 10,
       MIN_HASH_VALUE = 1,
@@ -101,8 +101,8 @@ findTag (register const char *str, register unsigned int len)
        3,  2,  2,  3,  2,  4,  5,  1,  2,  7,  3,  4,  5,  1,
        6,  6,  3,  5,  6,  6,  7,  4,  3,  4,  7,  6,  3,  2,
        4,  3,  5,  7,  4,  5,  4,  3,  7,  5,  6,  3,  4,  5,
-       7,  8,  4,  6,  5,  8,  6,  7,  8,  5,  8,  9,  7,  5,
-       3, 10,  8,  6,  8,  8
+       7,  8,  4,  6,  5,  6,  8,  6,  7,  8,  5,  8,  9,  7,
+       5,  3, 10,  8,  6,  8,  8
     };
   static const struct tags wordlist_tag[] =
     {
@@ -138,25 +138,25 @@ findTag (register const char *str, register unsigned int len)
       {"center", ID_CENTER},
       {"li", ID_LI},
       {"ins", ID_INS},
-      {"h5", ID_H5},
+      {"h6", ID_H6},
       {"title", ID_TITLE},
       {"strong", ID_STRONG},
-      {"h6", ID_H6},
+      {"h4", ID_H4},
       {"kbd", ID_KBD},
       {"code", ID_CODE},
       {"dd", ID_DD},
-      {"h1", ID_H1},
+      {"h5", ID_H5},
       {"embed", ID_EMBED},
       {"strike", ID_STRIKE},
       {"col", ID_COL},
-      {"h2", ID_H2},
+      {"h1", ID_H1},
       {"dl", ID_DL},
       {"del", ID_DEL},
-      {"h3", ID_H3},
+      {"h2", ID_H2},
       {"head", ID_HEAD},
       {"thead", ID_THEAD},
       {"u", ID_U},
-      {"h4", ID_H4},
+      {"h3", ID_H3},
       {"noembed", ID_NOEMBED},
       {"var", ID_VAR},
       {"link", ID_LINK},
@@ -195,6 +195,7 @@ findTag (register const char *str, register unsigned int len)
       {"samp", ID_SAMP},
       {"keygen", ID_KEYGEN},
       {"layer", ID_LAYER},
+      {"canvas", ID_CANVAS},
       {"frameset", ID_FRAMESET},
       {"script", ID_SCRIPT},
       {"nolayer", ID_NOLAYER},
@@ -218,8 +219,8 @@ findTag (register const char *str, register unsigned int len)
         -1,    4,   -1,    5,    6,    7,   -1,   -1,
         -1,   -1,   -1,    8,   -1,   -1,   -1,    9,
         -1,   -1,   10,   -1,   -1,   11,   -1,   12,
-        13,   14,   15,   -1,   -1, -150,   -1,   18,
-        -1,   19,   -1,   20,   21,  -88,   -2,   22,
+        13,   14,   15,   -1,   -1, -151,   -1,   18,
+        -1,   19,   -1,   20,   21,  -89,   -2,   22,
         23,   24,   25,   -1,   -1,   26,   27,   28,
         29,   30,   31,   32,   33,   34,   -1,   -1,
         35,   -1,   -1,   -1,   36,   37,   -1,   -1,
@@ -235,24 +236,24 @@ findTag (register const char *str, register unsigned int len)
         74,   75,   -1,   -1,   -1,   76,   -1,   -1,
         -1,   77,   78,   79,   80,   -1,   81,   82,
         83,   -1,   84,   85,   86,   -1,   87,   -1,
-        -1,   -1,   88,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   89,   -1,   -1,   90,   -1,   -1,
-        -1,   -1,   -1,   91,   -1,   -1,   -1,   -1,
-        -1,   92,   -1,   93,   -1,   -1,   94,   95,
-        -1,   -1,   96,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   88,   89,   -1,   -1,   -1,   -1,
+        -1,   -1,   90,   -1,   -1,   91,   -1,   -1,
+        -1,   -1,   -1,   92,   -1,   -1,   -1,   -1,
+        -1,   93,   -1,   94,   -1,   -1,   95,   96,
+        -1,   -1,   97,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   97,   -1,   -1,   98,   -1,   -1,   -1,
-        -1,   -1,   -1,   99,   -1,   -1,   -1,   -1,
-        -1,  100,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   98,   -1,   -1,   99,   -1,   -1,   -1,
+        -1,   -1,   -1,  100,   -1,   -1,   -1,   -1,
+        -1,  101,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,  101,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,  102,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-       102,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+       103,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,  103
+        -1,  104
     };
 
   if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
@@ -316,6 +317,7 @@ static const char * const tagList[] = {
     "BODY",
     "BR",
     "BUTTON",
+    "CANVAS",
     "CAPTION",
     "CENTER",
     "CITE",
@@ -419,6 +421,7 @@ static const char * const tagList[] = {
     "/BODY",
     "/BR",
     "/BUTTON",
+    "/CANVAS",
     "/CAPTION",
     "/CENTER",
     "/CITE",
diff --git a/WebCore/khtml/misc/htmltags.h b/WebCore/khtml/misc/htmltags.h
index 487bb74..b79b6ed 100644
--- a/WebCore/khtml/misc/htmltags.h
+++ b/WebCore/khtml/misc/htmltags.h
@@ -23,95 +23,96 @@ DOM::DOMString getTagName(unsigned short id);
 #define ID_BODY 13
 #define ID_BR 14
 #define ID_BUTTON 15
-#define ID_CAPTION 16
-#define ID_CENTER 17
-#define ID_CITE 18
-#define ID_CODE 19
-#define ID_COL 20
-#define ID_COLGROUP 21
-#define ID_DD 22
-#define ID_DEL 23
-#define ID_DFN 24
-#define ID_DIR 25
-#define ID_DIV 26
-#define ID_DL 27
-#define ID_DT 28
-#define ID_EM 29
-#define ID_EMBED 30
-#define ID_FIELDSET 31
-#define ID_FONT 32
-#define ID_FORM 33
-#define ID_FRAME 34
-#define ID_FRAMESET 35
-#define ID_H1 36
-#define ID_H2 37
-#define ID_H3 38
-#define ID_H4 39
-#define ID_H5 40
-#define ID_H6 41
-#define ID_HEAD 42
-#define ID_HR 43
-#define ID_HTML 44
-#define ID_I 45
-#define ID_IFRAME 46
-#define ID_IMG 47
-#define ID_INPUT 48
-#define ID_INS 49
-#define ID_ISINDEX 50
-#define ID_KBD 51
-#define ID_KEYGEN 52
-#define ID_LABEL 53
-#define ID_LAYER 54
-#define ID_LEGEND 55
-#define ID_LI 56
-#define ID_LINK 57
-#define ID_MAP 58
-#define ID_MARQUEE 59
-#define ID_MENU 60
-#define ID_META 61
-#define ID_NOBR 62
-#define ID_NOEMBED 63
-#define ID_NOFRAMES 64
-#define ID_NOSCRIPT 65
-#define ID_NOLAYER 66
-#define ID_OBJECT 67
-#define ID_OL 68
-#define ID_OPTGROUP 69
-#define ID_OPTION 70
-#define ID_P 71
-#define ID_PARAM 72
-#define ID_PLAINTEXT 73
-#define ID_PRE 74
-#define ID_Q 75
-#define ID_S 76
-#define ID_SAMP 77
-#define ID_SCRIPT 78
-#define ID_SELECT 79
-#define ID_SMALL 80
-#define ID_SPAN 81
-#define ID_STRIKE 82
-#define ID_STRONG 83
-#define ID_STYLE 84
-#define ID_SUB 85
-#define ID_SUP 86
-#define ID_TABLE 87
-#define ID_TBODY 88
-#define ID_TD 89
-#define ID_TEXTAREA 90
-#define ID_TFOOT 91
-#define ID_TH 92
-#define ID_THEAD 93
-#define ID_TITLE 94
-#define ID_TR 95
-#define ID_TT 96
-#define ID_U 97
-#define ID_UL 98
-#define ID_VAR 99
-#define ID_WBR 100
-#define ID_XMP 101
-#define ID_TEXT 102
-#define ID_COMMENT 103
-#define ID_CLOSE_TAG 103
-#define ID_LAST_TAG 103
+#define ID_CANVAS 16
+#define ID_CAPTION 17
+#define ID_CENTER 18
+#define ID_CITE 19
+#define ID_CODE 20
+#define ID_COL 21
+#define ID_COLGROUP 22
+#define ID_DD 23
+#define ID_DEL 24
+#define ID_DFN 25
+#define ID_DIR 26
+#define ID_DIV 27
+#define ID_DL 28
+#define ID_DT 29
+#define ID_EM 30
+#define ID_EMBED 31
+#define ID_FIELDSET 32
+#define ID_FONT 33
+#define ID_FORM 34
+#define ID_FRAME 35
+#define ID_FRAMESET 36
+#define ID_H1 37
+#define ID_H2 38
+#define ID_H3 39
+#define ID_H4 40
+#define ID_H5 41
+#define ID_H6 42
+#define ID_HEAD 43
+#define ID_HR 44
+#define ID_HTML 45
+#define ID_I 46
+#define ID_IFRAME 47
+#define ID_IMG 48
+#define ID_INPUT 49
+#define ID_INS 50
+#define ID_ISINDEX 51
+#define ID_KBD 52
+#define ID_KEYGEN 53
+#define ID_LABEL 54
+#define ID_LAYER 55
+#define ID_LEGEND 56
+#define ID_LI 57
+#define ID_LINK 58
+#define ID_MAP 59
+#define ID_MARQUEE 60
+#define ID_MENU 61
+#define ID_META 62
+#define ID_NOBR 63
+#define ID_NOEMBED 64
+#define ID_NOFRAMES 65
+#define ID_NOSCRIPT 66
+#define ID_NOLAYER 67
+#define ID_OBJECT 68
+#define ID_OL 69
+#define ID_OPTGROUP 70
+#define ID_OPTION 71
+#define ID_P 72
+#define ID_PARAM 73
+#define ID_PLAINTEXT 74
+#define ID_PRE 75
+#define ID_Q 76
+#define ID_S 77
+#define ID_SAMP 78
+#define ID_SCRIPT 79
+#define ID_SELECT 80
+#define ID_SMALL 81
+#define ID_SPAN 82
+#define ID_STRIKE 83
+#define ID_STRONG 84
+#define ID_STYLE 85
+#define ID_SUB 86
+#define ID_SUP 87
+#define ID_TABLE 88
+#define ID_TBODY 89
+#define ID_TD 90
+#define ID_TEXTAREA 91
+#define ID_TFOOT 92
+#define ID_TH 93
+#define ID_THEAD 94
+#define ID_TITLE 95
+#define ID_TR 96
+#define ID_TT 97
+#define ID_U 98
+#define ID_UL 99
+#define ID_VAR 100
+#define ID_WBR 101
+#define ID_XMP 102
+#define ID_TEXT 103
+#define ID_COMMENT 104
+#define ID_CLOSE_TAG 104
+#define ID_LAST_TAG 104
 
 #endif
diff --git a/WebCore/khtml/misc/htmltags.in b/WebCore/khtml/misc/htmltags.in
index e6f5aba..ebc659d 100644
--- a/WebCore/khtml/misc/htmltags.in
+++ b/WebCore/khtml/misc/htmltags.in
@@ -13,6 +13,7 @@ blockquote
 body
 br
 button
+canvas
 caption
 center
 cite
diff --git a/WebCore/khtml/xml/dom_edititerator.cpp b/WebCore/khtml/rendering/render_canvasimage.cpp
similarity index 52%
copy from WebCore/khtml/xml/dom_edititerator.cpp
copy to WebCore/khtml/rendering/render_canvasimage.cpp
index 1caed18..adbf59a 100644
--- a/WebCore/khtml/xml/dom_edititerator.cpp
+++ b/WebCore/khtml/rendering/render_canvasimage.cpp
@@ -23,66 +23,65 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#include "dom_edititerator.h"
+//#define DEBUG_LAYOUT
 
-#include "dom_nodeimpl.h"
+#include "render_canvasimage.h"
+#include "render_canvas.h"
 
-namespace DOM {
+#include <qdrawutil.h>
+#include <qpainter.h>
 
-Position EditIterator::peekPrevious() const
+#include <kapplication.h>
+#include <kdebug.h>
+
+#include "css/csshelper.h"
+#include "misc/helper.h"
+#include "misc/htmlattrs.h"
+#include "misc/htmltags.h"
+#include "html/html_formimpl.h"
+#include "html/html_imageimpl.h"
+#include "html/dtd.h"
+#include "xml/dom2_eventsimpl.h"
+#include "html/html_documentimpl.h"
+#include <math.h>
+
+using namespace DOM;
+using namespace khtml;
+
+// -------------------------------------------------------------------------
+
+RenderCanvasImage::RenderCanvasImage(NodeImpl *_node)
+    : RenderImage(_node)
 {
-    Position pos = m_current;
-    
-    if (pos.isEmpty())
-        return pos;
-    
-    if (pos.offset() <= 0) {
-        NodeImpl *prevNode = pos.node()->previousEditable();
-        if (prevNode)
-            pos = Position(prevNode, prevNode->maxOffset());
-    }
-    else {
-        pos = Position(pos.node(), pos.offset() - 1);
-    }
-    
-    return pos;
 }
 
-Position EditIterator::peekNext() const
+RenderCanvasImage::~RenderCanvasImage()
 {
-    Position pos = m_current;
-    
-    if (pos.isEmpty())
-        return pos;
-    
-    if (pos.offset() >= pos.node()->maxOffset()) {
-        NodeImpl *nextNode = pos.node()->nextEditable();
-        if (nextNode)
-            pos = Position(nextNode, 0);
-    }
-    else {
-        pos = Position(pos.node(), pos.offset() + 1);
-    }
-    
-    return pos;
 }
 
-bool EditIterator::atStart() const
-{
-    if (m_current.isEmpty())
-        return true;
 
-    return m_current.offset() == 0 && 
-        m_current.node()->previousEditable() == 0;
+void RenderCanvasImage::paint(PaintInfo& i, int _tx, int _ty)
+{
+    printf ("%s:%d: %s\n", __FILE__, __LINE__, __FUNCTION__);
 }
 
-bool EditIterator::atEnd() const
+void RenderCanvasImage::layout()
 {
-    if (m_current.isEmpty())
-        return true;
+    printf ("%s:%d: %s\n", __FILE__, __LINE__, __FUNCTION__);
 
-    return m_current.offset() == m_current.node()->maxOffset() && 
-        m_current.node()->nextEditable() == 0;
-}
+    KHTMLAssert(needsLayout());
+    KHTMLAssert(minMaxKnown());
 
-} // namespace DOM
+    QRect oldBounds;
+    bool checkForRepaint = checkForRepaintDuringLayout();
+    if (checkForRepaint)
+        oldBounds = getAbsoluteRepaintRect();
+    
+    calcWidth();
+    calcHeight();
+
+    if (checkForRepaint)
+        repaintAfterLayoutIfNeeded(oldBounds, oldBounds);
+    
+    setNeedsLayout(false);
+}
diff --git a/WebCore/khtml/misc/khtml_text_operations.h b/WebCore/khtml/rendering/render_canvasimage.h
similarity index 65%
copy from WebCore/khtml/misc/khtml_text_operations.h
copy to WebCore/khtml/rendering/render_canvasimage.h
index 23065b0..eb4c7b1 100644
--- a/WebCore/khtml/misc/khtml_text_operations.h
+++ b/WebCore/khtml/rendering/render_canvasimage.h
@@ -23,21 +23,39 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#ifndef __khtml_text_operations_h__
-#define __khtml_text_operations_h__
+#ifndef RENDER_CANVASIMAGE_H
+#define RENDER_CANVASIMAGE_H
 
-#include <dom/dom2_range.h>
+#include "html/dtd.h"
+#include "html/html_elementimpl.h"
+#include "rendering/render_image.h"
+#include "dom/dom_string.h"
 
-// FIXME: This class should probably use the render tree and not the DOM tree, since elements could
-// be hidden using CSS, or additional generated content could be added.  For now, we just make sure
-// text objects walk their renderers' InlineTextBox objects, so that we at least get the whitespace 
-// stripped out properly and obey CSS visibility for text runs.
+#include <qmap.h>
+#include <qpixmap.h>
 
 namespace khtml {
 
-QString plainText(const DOM::Range &);
-DOM::Range findPlainText(const DOM::Range &, const QString &, bool forward, bool caseSensitive);
+class DocLoader;
 
-}
+class RenderCanvasImage : public RenderImage
+{
+public:
+    RenderCanvasImage(DOM::NodeImpl*);
+    virtual ~RenderCanvasImage();
+
+    virtual const char *renderName() const { return "RenderCanvasImage"; }
+    
+    virtual void paint(PaintInfo& i, int tx, int ty);
+
+    virtual void layout();
+
+    // don't even think about making this method virtual!
+    DOM::HTMLElementImpl* element() const
+    { return static_cast<DOM::HTMLElementImpl*>(RenderObject::element()); }
+};
+
+
+}; //namespace
 
 #endif

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list