summaryrefslogtreecommitdiffstats
path: root/WebCore/html/HTMLViewSourceDocument.cpp
diff options
context:
space:
mode:
authorFeng Qian <fqian@google.com>2009-06-18 18:20:56 -0700
committerFeng Qian <fqian@google.com>2009-06-18 18:20:56 -0700
commit1edef79f87f9c52c21d69c87c19f8e2b140a9119 (patch)
treecad337ef493b0d9710bf3ae478cb87cb534f598d /WebCore/html/HTMLViewSourceDocument.cpp
parentb83fc086000e27bc227580bd0e35b9d7bee1179a (diff)
parentc9c4d65c1547996ed3748026904d6e7f09aec2b4 (diff)
downloadexternal_webkit-1edef79f87f9c52c21d69c87c19f8e2b140a9119.zip
external_webkit-1edef79f87f9c52c21d69c87c19f8e2b140a9119.tar.gz
external_webkit-1edef79f87f9c52c21d69c87c19f8e2b140a9119.tar.bz2
Merge commit 'goog/master-webkit-merge' into webkit-merge-44544
Diffstat (limited to 'WebCore/html/HTMLViewSourceDocument.cpp')
-rw-r--r--WebCore/html/HTMLViewSourceDocument.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/WebCore/html/HTMLViewSourceDocument.cpp b/WebCore/html/HTMLViewSourceDocument.cpp
index 596f16e..d4d6df7 100644
--- a/WebCore/html/HTMLViewSourceDocument.cpp
+++ b/WebCore/html/HTMLViewSourceDocument.cpp
@@ -26,18 +26,19 @@
#include "HTMLViewSourceDocument.h"
#include "DOMImplementation.h"
-#include "HTMLTokenizer.h"
-#include "HTMLHtmlElement.h"
#include "HTMLAnchorElement.h"
#include "HTMLBodyElement.h"
#include "HTMLDivElement.h"
-#include "HTMLTableElement.h"
+#include "HTMLHtmlElement.h"
+#include "HTMLNames.h"
#include "HTMLTableCellElement.h"
+#include "HTMLTableElement.h"
#include "HTMLTableRowElement.h"
#include "HTMLTableSectionElement.h"
+#include "HTMLTokenizer.h"
+#include "MappedAttribute.h"
#include "Text.h"
#include "TextDocument.h"
-#include "HTMLNames.h"
namespace WebCore {
@@ -150,6 +151,17 @@ void HTMLViewSourceDocument::addViewSourceToken(Token* token)
m_current = static_cast<Element*>(m_current->parent());
} else {
const String& value = attr->value().string();
+
+ // Compare ignoring case since HTMLTokenizer doesn't
+ // lower names when passing in tokens to
+ // HTMLViewSourceDocument.
+ if (equalIgnoringCase(token->tagName, "base") && equalIgnoringCase(attr->name().localName(), "href")) {
+ // Catch the href attribute in the base element.
+ // It will be used for rendering anchors created
+ // by addLink() below.
+ setBaseElementURL(KURL(url(), value));
+ }
+
// FIXME: XML could use namespace prefixes and confuse us.
if (equalIgnoringCase(attr->name().localName(), "src") || equalIgnoringCase(attr->name().localName(), "href"))
m_current = addLink(value, equalIgnoringCase(token->tagName, "a"));