[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
cblu
cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:27:45 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit fb20471e6f8b91f10b3a91b97e826290834a2369
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Feb 27 00:44:42 2004 +0000
Fixed a few problems I found with reconstructed source while on my way to implementing "Mail Page".
Reviewed by hyatt.
* khtml/html/html_headimpl.cpp:
(HTMLLinkElementImpl::isSubresourceURLAttribute): only true for stylesheet and icon
* khtml/html/html_imageimpl.cpp:
(HTMLAreaElementImpl::isURLAttribute): implement isURLAttribute not isSubresourceURLAttribute
* khtml/html/html_imageimpl.h:
* khtml/rendering/render_box.cpp:
(RenderBox::dirtyLineBoxes): crasher fix that I found using libgmalloc
* khtml/xml/dom_nodeimpl.cpp:
(NodeImpl::recursive_toHTMLWithOptions): don't escape SCRIPT and TEXTAREA text, write close tags for tags that need them instead of relying on the children check
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge HTMLString:]): call recursive_toHTMLWithOptions on the first child of the document so <#document /> isn't part of the source
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6120 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 6a3e916..af62974 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,21 @@
+2004-02-26 Chris Blumenberg <cblu at apple.com>
+
+ Fixed a few problems I found with reconstructed source while on my way to implementing "Mail Page".
+
+ Reviewed by hyatt.
+
+ * khtml/html/html_headimpl.cpp:
+ (HTMLLinkElementImpl::isSubresourceURLAttribute): only true for stylesheet and icon
+ * khtml/html/html_imageimpl.cpp:
+ (HTMLAreaElementImpl::isURLAttribute): implement isURLAttribute not isSubresourceURLAttribute
+ * khtml/html/html_imageimpl.h:
+ * khtml/rendering/render_box.cpp:
+ (RenderBox::dirtyLineBoxes): crasher fix that I found using libgmalloc
+ * khtml/xml/dom_nodeimpl.cpp:
+ (NodeImpl::recursive_toHTMLWithOptions): don't escape SCRIPT and TEXTAREA text, write close tags for tags that need them instead of relying on the children check
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge HTMLString:]): call recursive_toHTMLWithOptions on the first child of the document so <#document /> isn't part of the source
+
2004-02-26 David Hyatt <hyatt at apple.com>
Convert render object widths from short to int. There was a bug on this, but I can't find it in Radar.
diff --git a/WebCore/khtml/html/html_headimpl.cpp b/WebCore/khtml/html/html_headimpl.cpp
index 3fc52a7..e608bb6 100644
--- a/WebCore/khtml/html/html_headimpl.cpp
+++ b/WebCore/khtml/html/html_headimpl.cpp
@@ -298,11 +298,25 @@ void HTMLLinkElementImpl::sheetLoaded()
getDocument()->stylesheetLoaded();
}
-bool HTMLLinkElementImpl::isSubresourceURLAttribute(AttributeImpl *attr) const
+bool HTMLLinkElementImpl::isURLAttribute(AttributeImpl *attr) const
{
return attr->id() == ATTR_HREF;
}
+bool HTMLLinkElementImpl::isSubresourceURLAttribute(AttributeImpl *attr) const
+{
+ if (attr->id() == ATTR_HREF) {
+ AttributeImpl *attr = attributes()->getAttributeItem(ATTR_REL);
+ if (attr) {
+ QString value = attr->value().string().lower();
+ if (value.contains("stylesheet") || value.contains("icon")) {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
// -------------------------------------------------------------------------
HTMLMetaElementImpl::HTMLMetaElementImpl(DocumentPtr *doc) : HTMLElementImpl(doc)
diff --git a/WebCore/khtml/html/html_headimpl.h b/WebCore/khtml/html/html_headimpl.h
index abd0258..a682e5f 100644
--- a/WebCore/khtml/html/html_headimpl.h
+++ b/WebCore/khtml/html/html_headimpl.h
@@ -96,7 +96,8 @@ public:
int disabledState() { return m_disabledState; }
void setDisabledState(bool _disabled);
-
+
+ virtual bool isURLAttribute(AttributeImpl *attr) const;
virtual bool isSubresourceURLAttribute(AttributeImpl *attr) const;
protected:
diff --git a/WebCore/khtml/html/html_imageimpl.cpp b/WebCore/khtml/html/html_imageimpl.cpp
index a328810..cbd4cbc 100644
--- a/WebCore/khtml/html/html_imageimpl.cpp
+++ b/WebCore/khtml/html/html_imageimpl.cpp
@@ -507,7 +507,7 @@ QRegion HTMLAreaElementImpl::getRegion(int width_, int height_) const
return region;
}
-bool HTMLAreaElementImpl::isSubresourceURLAttribute(AttributeImpl *attr) const
+bool HTMLAreaElementImpl::isURLAttribute(AttributeImpl *attr) const
{
return attr->id() == ATTR_HREF;
}
diff --git a/WebCore/khtml/html/html_imageimpl.h b/WebCore/khtml/html/html_imageimpl.h
index 6b3c27d..4668a77 100644
--- a/WebCore/khtml/html/html_imageimpl.h
+++ b/WebCore/khtml/html/html_imageimpl.h
@@ -92,7 +92,7 @@ public:
virtual QRect getRect() const;
- virtual bool isSubresourceURLAttribute(AttributeImpl *attr) const;
+ virtual bool isURLAttribute(AttributeImpl *attr) const;
protected:
QRegion getRegion(int width_, int height) const;
diff --git a/WebCore/khtml/rendering/render_box.cpp b/WebCore/khtml/rendering/render_box.cpp
index fe17d7b..5774652 100644
--- a/WebCore/khtml/rendering/render_box.cpp
+++ b/WebCore/khtml/rendering/render_box.cpp
@@ -546,7 +546,6 @@ void RenderBox::dirtyLineBoxes(bool fullLayout, bool)
{
if (m_inlineBoxWrapper) {
if (fullLayout) {
- m_inlineBoxWrapper->remove();
m_inlineBoxWrapper->detach(renderArena());
m_inlineBoxWrapper = 0;
}
diff --git a/WebCore/khtml/xml/dom_nodeimpl.cpp b/WebCore/khtml/xml/dom_nodeimpl.cpp
index 56d8dcb..6b02538 100644
--- a/WebCore/khtml/xml/dom_nodeimpl.cpp
+++ b/WebCore/khtml/xml/dom_nodeimpl.cpp
@@ -44,6 +44,8 @@
#include "khtmlview.h"
#include "khtml_part.h"
+#include "html/dtd.h"
+
#ifndef KHTML_NO_XBL
#include "xbl/xbl_binding_manager.h"
#endif
@@ -332,7 +334,8 @@ QString NodeImpl::recursive_toHTMLWithOptions(bool start, bool completeURLs, con
str.remove(0, range->startOffset(exceptionCode));
}
}
- me += escapeHTML(str.string());
+ Id parentID = parentNode()->id();
+ me += (parentID == ID_SCRIPT || parentID == ID_TEXTAREA) ? str.string() : escapeHTML(str.string());
} else {
// If I am an element, not a text
me += QChar('<') + nodeName().string();
@@ -357,17 +360,15 @@ QString NodeImpl::recursive_toHTMLWithOptions(bool start, bool completeURLs, con
}
}
}
- if (isHTMLElement()) {
- me += ">";
- } else {
- me += "/>";
- }
+ me += isHTMLElement() ? ">" : "/>";
}
}
- if ((n = firstChild())) {
+ if (!isHTMLElement() || endTag[ident] != FORBIDDEN) {
// print firstChild
- me += n->recursive_toHTMLWithOptions(false, completeURLs, range, subresourceURLs);
+ if ((n = firstChild())) {
+ me += n->recursive_toHTMLWithOptions(false, completeURLs, range, subresourceURLs);
+ }
// Print my ending tag
if (isNodeIncluded && nodeType() != Node::TEXT_NODE) {
me += "</" + nodeName().string() + ">";
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index c97c24a..b855340 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -439,18 +439,34 @@ static bool initializedKJS = FALSE;
if (subresourceURLStrings) {
subresourceURLs = new QStringList();
}
+ NSString *docTypeString = nil;
NSString *HTMLString = nil;
DOM::DocumentImpl *doc = _part->xmlDocImpl();
if (doc) {
- HTMLString = doc->recursive_toHTMLWithOptions(true, false, NULL, subresourceURLs).getNSString();
- if (subresourceURLStrings) {
- *subresourceURLStrings = [NSMutableArray array];
- for (QStringList::Iterator it = subresourceURLs->begin(); it != subresourceURLs->end(); ++it) {
- [(NSMutableArray *)*subresourceURLStrings addObject:(*it).getNSString()];
+ DocumentTypeImpl *doctype = doc->doctype();
+ if (doctype) {
+ docTypeString = doctype->toString().string().getNSString();
+ }
+ ElementImpl *documentElement = doc->documentElement();
+ if (documentElement) {
+ HTMLString = documentElement->recursive_toHTMLWithOptions(true, false, NULL, subresourceURLs).getNSString();
+ if (subresourceURLStrings) {
+ *subresourceURLStrings = [NSMutableArray array];
+ for (QStringList::Iterator it = subresourceURLs->begin(); it != subresourceURLs->end(); ++it) {
+ [(NSMutableArray *)*subresourceURLStrings addObject:(*it).getNSString()];
+ }
}
}
}
- return HTMLString ? HTMLString : @"";
+ if (docTypeString && HTMLString) {
+ return [NSString stringWithFormat:@"%@\n%@", docTypeString, HTMLString];
+ } else if (docTypeString) {
+ return docTypeString;
+ } else if (HTMLString) {
+ return HTMLString;
+ } else {
+ return @"";
+ }
}
- (NSString *)selectedString
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list