summaryrefslogtreecommitdiffstats
path: root/WebCore/loader/DocumentLoader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/loader/DocumentLoader.cpp')
-rw-r--r--WebCore/loader/DocumentLoader.cpp67
1 files changed, 2 insertions, 65 deletions
diff --git a/WebCore/loader/DocumentLoader.cpp b/WebCore/loader/DocumentLoader.cpp
index e8c3652..dca416e 100644
--- a/WebCore/loader/DocumentLoader.cpp
+++ b/WebCore/loader/DocumentLoader.cpp
@@ -50,7 +50,6 @@
#include "PlatformString.h"
#include "Settings.h"
#include "SharedBuffer.h"
-#include "StringBuffer.h"
#include "XMLTokenizer.h"
#include <wtf/Assertions.h>
@@ -58,67 +57,6 @@
namespace WebCore {
-/*
- * Performs four operations:
- * 1. Convert backslashes to currency symbols
- * 2. Convert control characters to spaces
- * 3. Trim leading and trailing spaces
- * 4. Collapse internal whitespace.
- */
-static inline String canonicalizedTitle(const String& title, Frame* frame)
-{
- ASSERT(!title.isEmpty());
-
- const UChar* characters = title.characters();
- unsigned length = title.length();
- unsigned i;
-
- StringBuffer buffer(length);
- unsigned builderIndex = 0;
-
- // Skip leading spaces and leading characters that would convert to spaces
- for (i = 0; i < length; ++i) {
- UChar c = characters[i];
- if (!(c <= 0x20 || c == 0x7F))
- break;
- }
-
- if (i == length)
- return "";
-
- // Replace control characters with spaces, and backslashes with currency symbols, and collapse whitespace.
- bool previousCharWasWS = false;
- for (; i < length; ++i) {
- UChar c = characters[i];
- if (c <= 0x20 || c == 0x7F || (WTF::Unicode::category(c) & (WTF::Unicode::Separator_Line | WTF::Unicode::Separator_Paragraph))) {
- if (previousCharWasWS)
- continue;
- buffer[builderIndex++] = ' ';
- previousCharWasWS = true;
- } else {
- buffer[builderIndex++] = c;
- previousCharWasWS = false;
- }
- }
-
- // Strip trailing spaces
- while (builderIndex > 0) {
- --builderIndex;
- if (buffer[builderIndex] != ' ')
- break;
- }
-
- if (!builderIndex && buffer[builderIndex] == ' ')
- return "";
-
- buffer.shrink(builderIndex + 1);
-
- // Replace the backslashes with currency symbols if the encoding requires it.
- frame->document()->displayBufferModifiedByEncoding(buffer.characters(), buffer.length());
-
- return String::adopt(buffer);
-}
-
static void cancelAll(const ResourceLoaderSet& loaders)
{
const ResourceLoaderSet copy = loaders;
@@ -672,10 +610,9 @@ void DocumentLoader::setTitle(const String& title)
if (title.isEmpty())
return;
- String trimmed = canonicalizedTitle(title, m_frame);
- if (!trimmed.isEmpty() && m_pageTitle != trimmed) {
+ if (m_pageTitle != title) {
frameLoader()->willChangeTitle(this);
- m_pageTitle = trimmed;
+ m_pageTitle = title;
frameLoader()->didChangeTitle(this);
}
}