summaryrefslogtreecommitdiffstats
path: root/WebCore/html/HTMLViewSourceDocument.cpp
diff options
context:
space:
mode:
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"));