safari patch splitup: HTMLElementImpl::isInline

Alexander Kellett lypanov at kde.org
Thu Jan 9 15:23:46 GMT 2003


(patch three)

this improves HTMLElementImpl::isInline,
changelog seems to hint that this is needed for the FOUC changes

mvg,
Alex
-- 
"[...] Konqueror open source project. Weighing in at less than
            one tenth the size of another open source renderer"
Apple,  Jan 2003 (http://www.apple.com/safari/)
-------------- next part --------------
Index: html_elementimpl.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/html/html_elementimpl.cpp,v
retrieving revision 1.150
diff -u -p -B -w -r1.150 html_elementimpl.cpp
--- html_elementimpl.cpp	9 Dec 2002 07:21:44 -0000	1.150
+++ html_elementimpl.cpp	9 Jan 2003 15:24:09 -0000
@@ -56,6 +56,48 @@ HTMLElementImpl::~HTMLElementImpl()
 {
 }
 
+bool HTMLElementImpl::isInline() const
+{
+    if (renderer())
+        return ElementImpl::isInline();
+
+    switch(id()) {
+        case ID_A:
+        case ID_FONT:
+        case ID_TT:
+        case ID_U:
+        case ID_B:
+        case ID_I:
+        case ID_S:
+        case ID_STRIKE:
+        case ID_BIG:
+        case ID_SMALL:
+
+            // %phrase
+        case ID_EM:
+        case ID_STRONG:
+        case ID_DFN:
+        case ID_CODE:
+        case ID_SAMP:
+        case ID_KBD:
+        case ID_VAR:
+        case ID_CITE:
+        case ID_ABBR:
+        case ID_ACRONYM:
+
+            // %special
+        case ID_SUB:
+        case ID_SUP:
+        case ID_SPAN:
+        case ID_NOBR:
+        case ID_WBR:
+            return true;
+
+        default:
+            return ElementImpl::isInline();
+    }
+}
+
 void HTMLElementImpl::parseAttribute(AttributeImpl *attr)
 {
     DOMString indexstring;
Index: html_elementimpl.h
===================================================================
RCS file: /home/kde/kdelibs/khtml/html/html_elementimpl.h,v
retrieving revision 1.61
diff -u -p -B -w -r1.61 html_elementimpl.h
--- html_elementimpl.h	9 Dec 2002 07:21:44 -0000	1.61
+++ html_elementimpl.h	9 Jan 2003 15:24:09 -0000
@@ -41,6 +41,8 @@ public:
 
     virtual bool isHTMLElement() const { return true; }
 
+    virtual bool isInline() const;
+
     virtual Id id() const = 0;
 
     virtual void parseAttribute(AttributeImpl *token);


More information about the kfm-devel mailing list