WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-50961-20110328083040.patch (text/plain), 60.56 KB, created by
Evan Martin
on 2011-03-28 08:26:42 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Evan Martin
Created:
2011-03-28 08:26:42 PDT
Size:
60.56 KB
patch
obsolete
>Subversion Revision: 82090 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 34a953f2b4e64ea9a15e6e88819af84a27b95d5a..83732a05ed804d482b21f5adffd6f465c2dc81e1 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,5 +1,64 @@ > 2011-03-28 Evan Martin <evan@chromium.org> > >+ Reviewed by NOBODY (OOPS!). >+ >+ <title> should support dir attribute >+ https://bugs.webkit.org/show_bug.cgi?id=50961 >+ >+ Introduce a new StringWithDirection object that carries a String along >+ with the TextDirection associated with the String. Use this object for >+ document titles used within WebCore. Put FIXMEs at the WebKit level to >+ expose the new direction information to clients. >+ >+ No behavioral change intended, so no new tests. A follow-up will expose >+ the title direction and hopefully can be accompanied by tests that verify >+ it is correct. >+ >+ * dom/Document.cpp: >+ (WebCore::Document::Document): >+ (WebCore::Document::updateTitle): >+ (WebCore::Document::setTitle): >+ (WebCore::Document::removeTitle): >+ * dom/Document.h: >+ (WebCore::Document::title): >+ * html/HTMLTitleElement.cpp: >+ (WebCore::HTMLTitleElement::HTMLTitleElement): >+ (WebCore::HTMLTitleElement::childrenChanged): >+ (WebCore::HTMLTitleElement::text): >+ (WebCore::HTMLTitleElement::textWithDirection): >+ * html/HTMLTitleElement.h: >+ * loader/DocumentLoader.cpp: >+ (WebCore::DocumentLoader::setTitle): >+ * loader/DocumentLoader.h: >+ (WebCore::DocumentLoader::title): >+ * loader/EmptyClients.h: >+ (WebCore::EmptyFrameLoaderClient::dispatchDidReceiveTitle): >+ (WebCore::EmptyFrameLoaderClient::setTitle): >+ * loader/FrameLoader.cpp: >+ (WebCore::FrameLoader::receivedFirstData): >+ (WebCore::FrameLoader::commitProvisionalLoad): >+ (WebCore::FrameLoader::setTitle): >+ * loader/FrameLoader.h: >+ * loader/FrameLoaderClient.h: >+ * loader/HistoryController.cpp: >+ (WebCore::HistoryController::updateForBackForwardNavigation): >+ (WebCore::HistoryController::updateForReload): >+ (WebCore::HistoryController::updateForRedirectWithLockedBackForwardList): >+ (WebCore::HistoryController::updateForClientRedirect): >+ (WebCore::HistoryController::updateForCommit): >+ (WebCore::HistoryController::setCurrentItemTitle): >+ (WebCore::HistoryController::initializeItem): >+ * loader/HistoryController.h: >+ * platform/text/StringWithDirection.h: Added. >+ (WebCore::StringWithDirection::StringWithDirection): >+ (WebCore::StringWithDirection::operator==): >+ (WebCore::StringWithDirection::operator!=): >+ * svg/SVGTitleElement.cpp: >+ (WebCore::SVGTitleElement::insertedIntoDocument): >+ (WebCore::SVGTitleElement::childrenChanged): >+ >+2011-03-28 Evan Martin <evan@chromium.org> >+ > Reviewed by Ryosuke Niwa. > > Refactor duplicate code in HTMLTextElement >diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp >index 949a62a5a5aa8742ec9c8b313d5e5663d6886f76..24a01b6fdf7ba0e9e7000aa47c8ffe306eba819c 100644 >--- a/Source/WebCore/dom/Document.cpp >+++ b/Source/WebCore/dom/Document.cpp >@@ -389,8 +389,8 @@ Document::Document(Frame* frame, const KURL& url, bool isXHTML, bool isHTML) > , m_containsValidityStyleRules(false) > , m_updateFocusAppearanceRestoresSelection(false) > , m_ignoreDestructiveWriteCount(0) >- , m_title("") >- , m_rawTitle("") >+ , m_title("", LTR) >+ , m_rawTitle("", LTR) > , m_titleSetExplicitly(false) > , m_updateFocusAppearanceTimer(this, &Document::updateFocusAppearanceTimerFired) > , m_startTime(currentTime()) >@@ -1325,12 +1325,17 @@ static inline String canonicalizedTitle(Document* document, const String& title) > > void Document::updateTitle() > { >- m_title = canonicalizedTitle(this, m_rawTitle); >+ m_title = StringWithDirection(canonicalizedTitle(this, m_rawTitle.m_string), m_rawTitle.m_direction); > if (Frame* f = frame()) > f->loader()->setTitle(m_title); > } > >-void Document::setTitle(const String& title, Element* titleElement) >+void Document::setTitle(const String& title) >+{ >+ setTitle(StringWithDirection(title, LTR), 0); >+} >+ >+void Document::setTitle(const StringWithDirection& title, Element* titleElement) > { > if (!titleElement) { > // Title set by JavaScript -- overrides any title elements. >@@ -1359,7 +1364,7 @@ void Document::setTitle(const String& title, Element* titleElement) > updateTitle(); > > if (m_titleSetExplicitly && m_titleElement && m_titleElement->hasTagName(titleTag) && !titleElement) >- static_cast<HTMLTitleElement*>(m_titleElement.get())->setText(m_title); >+ static_cast<HTMLTitleElement*>(m_titleElement.get())->setText(m_title.m_string); > } > > void Document::removeTitle(Element* titleElement) >@@ -1375,13 +1380,13 @@ void Document::removeTitle(Element* titleElement) > for (Node* e = headElement->firstChild(); e; e = e->nextSibling()) > if (e->hasTagName(titleTag)) { > HTMLTitleElement* titleElement = static_cast<HTMLTitleElement*>(e); >- setTitle(titleElement->text(), titleElement); >+ setTitle(titleElement->textWithDirection(), titleElement); > break; > } > } > >- if (!m_titleElement && !m_rawTitle.isEmpty()) { >- m_rawTitle = ""; >+ if (!m_titleElement && !m_rawTitle.m_string.isEmpty()) { >+ m_rawTitle.m_string = ""; > updateTitle(); > } > } >diff --git a/Source/WebCore/dom/Document.h b/Source/WebCore/dom/Document.h >index 732cefd9e229590f8fb89e8658864be9ff8f1f1f..a31d922df6b7399966a0353d84941930a3d78698 100644 >--- a/Source/WebCore/dom/Document.h >+++ b/Source/WebCore/dom/Document.h >@@ -37,6 +37,7 @@ > #include "DocumentTiming.h" > #include "QualifiedName.h" > #include "ScriptExecutionContext.h" >+#include "StringWithDirection.h" > #include "Timer.h" > #include "ViewportArguments.h" > #include <wtf/FixedArray.h> >@@ -811,8 +812,9 @@ public: > // Returns 0 if this is the top level document. > HTMLFrameOwnerElement* ownerElement() const; > >- String title() const { return m_title; } >- void setTitle(const String&, Element* titleElement = 0); >+ String title() const { return m_title.m_string; } >+ void setTitle(const String&); >+ void setTitle(const StringWithDirection&, Element* titleElement = 0); > void removeTitle(Element* titleElement); > > String cookie(ExceptionCode&) const; >@@ -1294,8 +1296,8 @@ private: > // http://www.whatwg.org/specs/web-apps/current-work/#ignore-destructive-writes-counter > unsigned m_ignoreDestructiveWriteCount; > >- String m_title; >- String m_rawTitle; >+ StringWithDirection m_title; >+ StringWithDirection m_rawTitle; > bool m_titleSetExplicitly; > RefPtr<Element> m_titleElement; > >diff --git a/Source/WebCore/html/HTMLTitleElement.cpp b/Source/WebCore/html/HTMLTitleElement.cpp >index 31b1b2bcd2b8e4e1a638a7508bd07eb7faa775b2..fa75e8983843702516ba1de7a57d551c47b63f89 100644 >--- a/Source/WebCore/html/HTMLTitleElement.cpp >+++ b/Source/WebCore/html/HTMLTitleElement.cpp >@@ -25,6 +25,7 @@ > > #include "Document.h" > #include "HTMLNames.h" >+#include "RenderStyle.h" > #include "Text.h" > > namespace WebCore { >@@ -33,7 +34,7 @@ using namespace HTMLNames; > > inline HTMLTitleElement::HTMLTitleElement(const QualifiedName& tagName, Document* document) > : HTMLElement(tagName, document) >- , m_title("") >+ , m_title("", LTR) > { > ASSERT(hasTagName(titleTag)); > } >@@ -57,7 +58,7 @@ void HTMLTitleElement::removedFromDocument() > > void HTMLTitleElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) > { >- m_title = text(); >+ m_title = textWithDirection(); > if (inDocument()) > document()->setTitle(m_title, this); > HTMLElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta); >@@ -71,10 +72,16 @@ String HTMLTitleElement::text() const > if (n->isTextNode()) > val += static_cast<Text*>(n)->data(); > } >- >+ > return val; > } > >+StringWithDirection HTMLTitleElement::textWithDirection() >+{ >+ RenderStyle* style = computedStyle(); >+ return StringWithDirection(text(), style->direction()); >+} >+ > void HTMLTitleElement::setText(const String &value) > { > ExceptionCode ec = 0; >diff --git a/Source/WebCore/html/HTMLTitleElement.h b/Source/WebCore/html/HTMLTitleElement.h >index 8b90f564f3aaf16103146ac05822f6d9e6a1fae1..69209978395b0453b245ec4235104029fd42448c 100644 >--- a/Source/WebCore/html/HTMLTitleElement.h >+++ b/Source/WebCore/html/HTMLTitleElement.h >@@ -23,6 +23,7 @@ > #define HTMLTitleElement_h > > #include "HTMLElement.h" >+#include "StringWithDirection.h" > > namespace WebCore { > >@@ -33,6 +34,8 @@ public: > String text() const; > void setText(const String&); > >+ StringWithDirection textWithDirection(); >+ > private: > HTMLTitleElement(const QualifiedName&, Document*); > >@@ -40,7 +43,7 @@ private: > virtual void removedFromDocument(); > virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); > >- String m_title; >+ StringWithDirection m_title; > }; > > } //namespace >diff --git a/Source/WebCore/loader/DocumentLoader.cpp b/Source/WebCore/loader/DocumentLoader.cpp >index 121045b5b99ffa079b6059f7e197add4d3dbc3d2..d42928c667f731a279d7561722e01b5495a377b5 100644 >--- a/Source/WebCore/loader/DocumentLoader.cpp >+++ b/Source/WebCore/loader/DocumentLoader.cpp >@@ -649,9 +649,9 @@ void DocumentLoader::stopRecordingResponses() > m_stopRecordingResponses = true; > } > >-void DocumentLoader::setTitle(const String& title) >+void DocumentLoader::setTitle(const StringWithDirection& title) > { >- if (title.isEmpty()) >+ if (title.m_string.isEmpty()) > return; > > if (m_pageTitle != title) { >diff --git a/Source/WebCore/loader/DocumentLoader.h b/Source/WebCore/loader/DocumentLoader.h >index 1f88272b192005d62e3207170bf7c5b825792ba5..c6f0bc5b26944febf964bfddc2657b76675e35d0 100644 >--- a/Source/WebCore/loader/DocumentLoader.h >+++ b/Source/WebCore/loader/DocumentLoader.h >@@ -36,6 +36,7 @@ > #include "ResourceError.h" > #include "ResourceRequest.h" > #include "ResourceResponse.h" >+#include "StringWithDirection.h" > #include "SubstituteData.h" > #include "Timer.h" > #include <wtf/HashSet.h> >@@ -121,7 +122,7 @@ namespace WebCore { > bool wasOnloadHandled() { return m_wasOnloadHandled; } > bool isLoadingInAPISense() const; > void setPrimaryLoadComplete(bool); >- void setTitle(const String&); >+ void setTitle(const StringWithDirection&); > void setIconURL(const String&); > const String& overrideEncoding() const { return m_overrideEncoding; } > >@@ -168,7 +169,7 @@ namespace WebCore { > const ResourceRequest& lastCheckedRequest() { return m_lastCheckedRequest; } > > void stopRecordingResponses(); >- const String& title() const { return m_pageTitle; } >+ const StringWithDirection& title() const { return m_pageTitle; } > const String& iconURL() const { return m_pageIconURL; } > > KURL urlForHistory() const; >@@ -298,7 +299,7 @@ namespace WebCore { > bool m_isClientRedirect; > bool m_wasOnloadHandled; > >- String m_pageTitle; >+ StringWithDirection m_pageTitle; > String m_pageIconURL; > > String m_overrideEncoding; >diff --git a/Source/WebCore/loader/EmptyClients.h b/Source/WebCore/loader/EmptyClients.h >index 59fd8979cbeefccfe905ade7d26ffb1ddae6e9a3..6acf99219bace3cc2d023329fd61e7f03fb255a4 100644 >--- a/Source/WebCore/loader/EmptyClients.h >+++ b/Source/WebCore/loader/EmptyClients.h >@@ -266,7 +266,7 @@ public: > virtual void dispatchWillClose() { } > virtual void dispatchDidReceiveIcon() { } > virtual void dispatchDidStartProvisionalLoad() { } >- virtual void dispatchDidReceiveTitle(const String&) { } >+ virtual void dispatchDidReceiveTitle(const StringWithDirection&) { } > virtual void dispatchDidChangeIcons() { } > virtual void dispatchDidCommitLoad() { } > virtual void dispatchDidFailProvisionalLoad(const ResourceError&) { } >@@ -334,7 +334,7 @@ public: > virtual void prepareForDataSourceReplacement() { } > > virtual PassRefPtr<DocumentLoader> createDocumentLoader(const ResourceRequest& request, const SubstituteData& substituteData) { return DocumentLoader::create(request, substituteData); } >- virtual void setTitle(const String&, const KURL&) { } >+ virtual void setTitle(const StringWithDirection&, const KURL&) { } > > virtual String userAgent(const KURL&) { return ""; } > >diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp >index 347a41eaae3ab617da301cac12975257db84a59d..d361d2d5c6e044bfcc30f32d49ba9bf7ece71124 100644 >--- a/Source/WebCore/loader/FrameLoader.cpp >+++ b/Source/WebCore/loader/FrameLoader.cpp >@@ -610,9 +610,9 @@ void FrameLoader::receivedFirstData() > dispatchDidClearWindowObjectsInAllWorlds(); > > if (m_documentLoader) { >- String ptitle = m_documentLoader->title(); >+ StringWithDirection ptitle = m_documentLoader->title(); > // If we have a title let the WebView know about it. >- if (!ptitle.isNull()) >+ if (!ptitle.m_string.isNull()) > m_client->dispatchDidReceiveTitle(ptitle); > } > >@@ -1924,9 +1924,9 @@ void FrameLoader::commitProvisionalLoad() > dispatchDidCommitLoad(); > > // If we have a title let the WebView know about it. >- String title = m_documentLoader->title(); >- if (!title.isNull()) >- m_client->dispatchDidReceiveTitle(title); >+ StringWithDirection title = m_documentLoader->title(); >+ if (!title.m_string.isNull()) >+ m_client->dispatchDidReceiveTitle(title); > > checkCompleted(); > } else { >@@ -3375,7 +3375,7 @@ bool FrameLoader::canAuthenticateAgainstProtectionSpace(ResourceLoader* loader, > } > #endif > >-void FrameLoader::setTitle(const String& title) >+void FrameLoader::setTitle(const StringWithDirection& title) > { > documentLoader()->setTitle(title); > } >diff --git a/Source/WebCore/loader/FrameLoader.h b/Source/WebCore/loader/FrameLoader.h >index 1fb9e3c45f490e299fafc54f4d35e67e4eb1295c..9062f215ced8159fda89c85af6e16d81ac5f5122 100644 >--- a/Source/WebCore/loader/FrameLoader.h >+++ b/Source/WebCore/loader/FrameLoader.h >@@ -78,6 +78,7 @@ class ScriptValue; > class SecurityOrigin; > class SerializedScriptValue; > class SharedBuffer; >+class StringWithDirection; > class SubstituteData; > class TextResourceDecoder; > >@@ -282,7 +283,7 @@ public: > > void cancelAndClear(); > >- void setTitle(const String&); >+ void setTitle(const StringWithDirection&); > void setIconURL(const String&); > > void commitProvisionalLoad(); >diff --git a/Source/WebCore/loader/FrameLoaderClient.h b/Source/WebCore/loader/FrameLoaderClient.h >index 7d64912bdb413ae959ab0e8f5accaac662fff993..192ad33b1d170306127c710220275f9d75806187 100644 >--- a/Source/WebCore/loader/FrameLoaderClient.h >+++ b/Source/WebCore/loader/FrameLoaderClient.h >@@ -84,6 +84,7 @@ namespace WebCore { > class ResourceResponse; > class SecurityOrigin; > class SharedBuffer; >+ class StringWithDirection; > class SubstituteData; > class Widget; > >@@ -139,7 +140,7 @@ namespace WebCore { > virtual void dispatchWillClose() = 0; > virtual void dispatchDidReceiveIcon() = 0; > virtual void dispatchDidStartProvisionalLoad() = 0; >- virtual void dispatchDidReceiveTitle(const String& title) = 0; >+ virtual void dispatchDidReceiveTitle(const StringWithDirection& title) = 0; > virtual void dispatchDidChangeIcons() = 0; > virtual void dispatchDidCommitLoad() = 0; > virtual void dispatchDidFailProvisionalLoad(const ResourceError&) = 0; >@@ -227,7 +228,7 @@ namespace WebCore { > virtual void prepareForDataSourceReplacement() = 0; > > virtual PassRefPtr<DocumentLoader> createDocumentLoader(const ResourceRequest&, const SubstituteData&) = 0; >- virtual void setTitle(const String& title, const KURL&) = 0; >+ virtual void setTitle(const StringWithDirection& title, const KURL&) = 0; > > virtual String userAgent(const KURL&) = 0; > >diff --git a/Source/WebCore/loader/HistoryController.cpp b/Source/WebCore/loader/HistoryController.cpp >index b8bece9b750c5386d8a3d8e1d28c8d1ed7b31bb9..7b06f1a8a01561de68b3ce216c884d6def993ebc 100644 >--- a/Source/WebCore/loader/HistoryController.cpp >+++ b/Source/WebCore/loader/HistoryController.cpp >@@ -265,7 +265,7 @@ void HistoryController::updateForBackForwardNavigation() > { > #if !LOG_DISABLED > if (m_frame->loader()->documentLoader()) >- LOG(History, "WebCoreHistory: Updating History for back/forward navigation in frame %s", m_frame->loader()->documentLoader()->title().utf8().data()); >+ LOG(History, "WebCoreHistory: Updating History for back/forward navigation in frame %s", m_frame->loader()->documentLoader()->title().m_string.utf8().data()); > #endif > > // Must grab the current scroll position before disturbing it >@@ -281,7 +281,7 @@ void HistoryController::updateForReload() > { > #if !LOG_DISABLED > if (m_frame->loader()->documentLoader()) >- LOG(History, "WebCoreHistory: Updating History for reload in frame %s", m_frame->loader()->documentLoader()->title().utf8().data()); >+ LOG(History, "WebCoreHistory: Updating History for reload in frame %s", m_frame->loader()->documentLoader()->title().m_string.utf8().data()); > #endif > > if (m_currentItem) { >@@ -343,7 +343,7 @@ void HistoryController::updateForRedirectWithLockedBackForwardList() > { > #if !LOG_DISABLED > if (m_frame->loader()->documentLoader()) >- LOG(History, "WebCoreHistory: Updating History for redirect load in frame %s", m_frame->loader()->documentLoader()->title().utf8().data()); >+ LOG(History, "WebCoreHistory: Updating History for redirect load in frame %s", m_frame->loader()->documentLoader()->title().m_string.utf8().data()); > #endif > > Settings* settings = m_frame->settings(); >@@ -385,7 +385,7 @@ void HistoryController::updateForClientRedirect() > { > #if !LOG_DISABLED > if (m_frame->loader()->documentLoader()) >- LOG(History, "WebCoreHistory: Updating History for client redirect in frame %s", m_frame->loader()->documentLoader()->title().utf8().data()); >+ LOG(History, "WebCoreHistory: Updating History for client redirect in frame %s", m_frame->loader()->documentLoader()->title().m_string.utf8().data()); > #endif > > // Clear out form data so we don't try to restore it into the incoming page. Must happen after >@@ -410,7 +410,7 @@ void HistoryController::updateForCommit() > FrameLoader* frameLoader = m_frame->loader(); > #if !LOG_DISABLED > if (frameLoader->documentLoader()) >- LOG(History, "WebCoreHistory: Updating History for commit in frame %s", frameLoader->documentLoader()->title().utf8().data()); >+ LOG(History, "WebCoreHistory: Updating History for commit in frame %s", frameLoader->documentLoader()->title().m_string.utf8().data()); > #endif > FrameLoadType type = frameLoader->loadType(); > if (isBackForwardLoadType(type) >@@ -526,10 +526,11 @@ void HistoryController::setCurrentItem(HistoryItem* item) > m_currentItem = item; > } > >-void HistoryController::setCurrentItemTitle(const String& title) >+void HistoryController::setCurrentItemTitle(const StringWithDirection& title) > { > if (m_currentItem) >- m_currentItem->setTitle(title); >+ // FIXME: make use of title.m_direction as well. >+ m_currentItem->setTitle(title.m_string); > } > > bool HistoryController::currentItemShouldBeReplaced() const >@@ -576,12 +577,13 @@ void HistoryController::initializeItem(HistoryItem* item) > > Frame* parentFrame = m_frame->tree()->parent(); > String parent = parentFrame ? parentFrame->tree()->uniqueName() : ""; >- String title = documentLoader->title(); >+ StringWithDirection title = documentLoader->title(); > > item->setURL(url); > item->setTarget(m_frame->tree()->uniqueName()); > item->setParent(parent); >- item->setTitle(title); >+ // FIXME: should store item directionality in history as well. >+ item->setTitle(title.m_string); > item->setOriginalURLString(originalURL.string()); > > if (!unreachableURL.isEmpty() || documentLoader->response().httpStatusCode() >= 400) >diff --git a/Source/WebCore/loader/HistoryController.h b/Source/WebCore/loader/HistoryController.h >index 59f11a25c933d3d7c97251b90a93b32d56b99ad4..15e12c099a3ef072754e67e6cd567f6be08ba5dd 100644 >--- a/Source/WebCore/loader/HistoryController.h >+++ b/Source/WebCore/loader/HistoryController.h >@@ -40,6 +40,7 @@ namespace WebCore { > class Frame; > class HistoryItem; > class SerializedScriptValue; >+class StringWithDirection; > > class HistoryController { > WTF_MAKE_NONCOPYABLE(HistoryController); >@@ -71,7 +72,7 @@ public: > > HistoryItem* currentItem() const { return m_currentItem.get(); } > void setCurrentItem(HistoryItem*); >- void setCurrentItemTitle(const String&); >+ void setCurrentItemTitle(const StringWithDirection&); > bool currentItemShouldBeReplaced() const; > > HistoryItem* previousItem() const { return m_previousItem.get(); } >diff --git a/Source/WebCore/platform/text/StringWithDirection.h b/Source/WebCore/platform/text/StringWithDirection.h >new file mode 100644 >index 0000000000000000000000000000000000000000..3a09b1ff1dc35f65aa8ad92e9fa7ee85fdf60f82 >--- /dev/null >+++ b/Source/WebCore/platform/text/StringWithDirection.h >@@ -0,0 +1,60 @@ >+/* >+ * Copyright (C) 2011 Google Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions are >+ * met: >+ * >+ * * Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * * Redistributions in binary form must reproduce the above >+ * copyright notice, this list of conditions and the following disclaimer >+ * in the documentation and/or other materials provided with the >+ * distribution. >+ * * Neither the name of Google Inc. nor the names of its >+ * contributors may be used to endorse or promote products derived from >+ * this software without specific prior written permission. >+ * >+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS >+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT >+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR >+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT >+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, >+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT >+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, >+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY >+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#ifndef StringWithDirection_h >+#define StringWithDirection_h >+ >+#include "PlatformString.h" >+#include "TextDirection.h" >+ >+namespace WebCore { >+ >+// In some circumstances we want to store a String along with the TextDirection >+// of the String as learned from the context of the String. For example, >+// consider storing the title derived from <title dir='rtl'>some title</title> >+// in the history. >+class StringWithDirection { >+public: >+ StringWithDirection() {} >+ StringWithDirection(const String& string, TextDirection dir) : m_string(string), m_direction(dir) {} >+ >+ bool operator==(const StringWithDirection& other) const >+ { >+ return other.m_string == m_string && other.m_direction == m_direction; >+ } >+ bool operator!=(const StringWithDirection& other) const { return !((*this) == other); } >+ >+ String m_string; >+ TextDirection m_direction; >+}; >+ >+} >+ >+#endif // StringWithDirection_h >diff --git a/Source/WebCore/svg/SVGTitleElement.cpp b/Source/WebCore/svg/SVGTitleElement.cpp >index 6281f10b14fd14f587a9ec2912c8ee923c731998..5af088a5b5731927afd231af3be3d84ac6332864 100644 >--- a/Source/WebCore/svg/SVGTitleElement.cpp >+++ b/Source/WebCore/svg/SVGTitleElement.cpp >@@ -40,7 +40,8 @@ void SVGTitleElement::insertedIntoDocument() > { > SVGStyledElement::insertedIntoDocument(); > if (firstChild()) >- document()->setTitle(textContent(), this); >+ // FIXME: does SVG have a concept of text direction? >+ document()->setTitle(StringWithDirection(textContent(), LTR), this); > } > > void SVGTitleElement::removedFromDocument() >@@ -53,7 +54,8 @@ void SVGTitleElement::childrenChanged(bool changedByParser, Node* beforeChange, > { > SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta); > if (inDocument()) >- document()->setTitle(textContent(), this); >+ // FIXME: does SVG have a concept of text direction? >+ document()->setTitle(StringWithDirection(textContent(), LTR), this); > } > > AttributeToPropertyTypeMap& SVGTitleElement::attributeToPropertyTypeMap() >diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog >index df10a9c0756ead94e094410666be1a65e1870d09..839cb30e431af31088402825eeb5637e263c1fc4 100644 >--- a/Source/WebKit/chromium/ChangeLog >+++ b/Source/WebKit/chromium/ChangeLog >@@ -1,3 +1,19 @@ >+2011-03-28 Evan Martin <evan@chromium.org> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ <title> should support dir attribute >+ https://bugs.webkit.org/show_bug.cgi?id=50961 >+ >+ Update to new FrameLoaderClient interface. >+ >+ * src/FrameLoaderClientImpl.cpp: >+ (WebKit::FrameLoaderClientImpl::dispatchDidReceiveTitle): >+ (WebKit::FrameLoaderClientImpl::setTitle): >+ * src/FrameLoaderClientImpl.h: >+ * src/WebDataSourceImpl.cpp: >+ (WebKit::WebDataSourceImpl::pageTitle): >+ > 2011-03-25 Andy Estes <aestes@apple.com> > > Reviewed by Adele Peterson. >diff --git a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp >index 647a70c285b67ce0d54a3ae0881498e11436d653..4d89fd4b1c2262948429e214c2db58a0d8ac85bb 100644 >--- a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp >+++ b/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp >@@ -734,10 +734,11 @@ void FrameLoaderClientImpl::dispatchDidStartProvisionalLoad() > } > } > >-void FrameLoaderClientImpl::dispatchDidReceiveTitle(const String& title) >+void FrameLoaderClientImpl::dispatchDidReceiveTitle(const StringWithDirection& title) > { >+ // FIXME: use direction of title. > if (m_webFrame->client()) >- m_webFrame->client()->didReceiveTitle(m_webFrame, title); >+ m_webFrame->client()->didReceiveTitle(m_webFrame, title.m_string); > } > > void FrameLoaderClientImpl::dispatchDidChangeIcons() >@@ -1328,7 +1329,7 @@ PassRefPtr<DocumentLoader> FrameLoaderClientImpl::createDocumentLoader( > return ds.release(); > } > >-void FrameLoaderClientImpl::setTitle(const String& title, const KURL& url) >+void FrameLoaderClientImpl::setTitle(const StringWithDirection& title, const KURL& url) > { > // FIXME: inform consumer of changes to the title. > } >diff --git a/Source/WebKit/chromium/src/FrameLoaderClientImpl.h b/Source/WebKit/chromium/src/FrameLoaderClientImpl.h >index f19c26c539a1c1b5a2657b7aa25895c1b2f52126..2b1c26f5ddbcccadd26ea48af8d8adf45b2ba781 100644 >--- a/Source/WebKit/chromium/src/FrameLoaderClientImpl.h >+++ b/Source/WebKit/chromium/src/FrameLoaderClientImpl.h >@@ -104,7 +104,7 @@ public: > virtual void dispatchWillClose(); > virtual void dispatchDidReceiveIcon(); > virtual void dispatchDidStartProvisionalLoad(); >- virtual void dispatchDidReceiveTitle(const WTF::String& title); >+ virtual void dispatchDidReceiveTitle(const WebCore::StringWithDirection&); > virtual void dispatchDidChangeIcons(); > virtual void dispatchDidCommitLoad(); > virtual void dispatchDidFailProvisionalLoad(const WebCore::ResourceError&); >@@ -166,7 +166,7 @@ public: > virtual void prepareForDataSourceReplacement(); > virtual PassRefPtr<WebCore::DocumentLoader> createDocumentLoader( > const WebCore::ResourceRequest&, const WebCore::SubstituteData&); >- virtual void setTitle(const WTF::String& title, const WebCore::KURL&); >+ virtual void setTitle(const WebCore::StringWithDirection&, const WebCore::KURL&); > virtual WTF::String userAgent(const WebCore::KURL&); > virtual void savePlatformDataToCachedFrame(WebCore::CachedFrame*); > virtual void transitionToCommittedFromCachedFrame(WebCore::CachedFrame*); >diff --git a/Source/WebKit/chromium/src/WebDataSourceImpl.cpp b/Source/WebKit/chromium/src/WebDataSourceImpl.cpp >index 1366a8094a506397e094834080265dbca7be661a..147636d950496246911ca026fd082b85471dcd3a 100644 >--- a/Source/WebKit/chromium/src/WebDataSourceImpl.cpp >+++ b/Source/WebKit/chromium/src/WebDataSourceImpl.cpp >@@ -82,7 +82,8 @@ void WebDataSourceImpl::redirectChain(WebVector<WebURL>& result) const > > WebString WebDataSourceImpl::pageTitle() const > { >- return title(); >+ // FIXME: use direction of title as well. >+ return title().m_string; > } > > WebNavigationType WebDataSourceImpl::navigationType() const >diff --git a/Source/WebKit/efl/ChangeLog b/Source/WebKit/efl/ChangeLog >index d38d952c84144dec7214a2cf6844070962bf55ce..48be7fb1c526a37da7cd6832a81f62499ce8e644 100644 >--- a/Source/WebKit/efl/ChangeLog >+++ b/Source/WebKit/efl/ChangeLog >@@ -1,3 +1,17 @@ >+2011-03-28 Evan Martin <evan@chromium.org> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ <title> should support dir attribute >+ https://bugs.webkit.org/show_bug.cgi?id=50961 >+ >+ Update to new FrameLoaderClient interface. >+ >+ * WebCoreSupport/FrameLoaderClientEfl.cpp: >+ (WebCore::FrameLoaderClientEfl::dispatchDidReceiveTitle): >+ (WebCore::FrameLoaderClientEfl::setTitle): >+ * WebCoreSupport/FrameLoaderClientEfl.h: >+ > 2011-03-27 Patrick Gansterer <paroga@webkit.org> > > Reviewed by Andreas Kling. >diff --git a/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp b/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp >index f9cd0d32eb8513e19dbd8eeb8fe2bc850979e1fe..9cc57e56e5c0f1b26fd7a61feb39d5dba9296497 100644 >--- a/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp >+++ b/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp >@@ -577,9 +577,10 @@ void FrameLoaderClientEfl::dispatchDidStartProvisionalLoad() > ewk_view_load_provisional(m_view); > } > >-void FrameLoaderClientEfl::dispatchDidReceiveTitle(const String& title) >+void FrameLoaderClientEfl::dispatchDidReceiveTitle(const StringWithDirection& title) > { >- CString cs = title.utf8(); >+ // FIXME: use direction of title. >+ CString cs = title.m_string.utf8(); > ewk_frame_title_set(m_frame, cs.data()); > > if (ewk_view_frame_main_get(m_view) != m_frame) >@@ -713,7 +714,7 @@ void FrameLoaderClientEfl::prepareForDataSourceReplacement() > notImplemented(); > } > >-void FrameLoaderClientEfl::setTitle(const String& title, const KURL& url) >+void FrameLoaderClientEfl::setTitle(const StringWithDirection& title, const KURL& url) > { > // no need for, dispatchDidReceiveTitle is the right callback > } >diff --git a/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h b/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h >index 5ea4e8cac97c0ba9e8ee69c9227739ce1781a40c..bd07a3034b6186b04ab049e3df120bbd5f9c45ef 100644 >--- a/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h >+++ b/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h >@@ -102,7 +102,7 @@ class FrameLoaderClientEfl : public FrameLoaderClient { > virtual void dispatchWillClose(); > virtual void dispatchDidReceiveIcon(); > virtual void dispatchDidStartProvisionalLoad(); >- virtual void dispatchDidReceiveTitle(const String&); >+ virtual void dispatchDidReceiveTitle(const StringWithDirection&); > virtual void dispatchDidChangeIcons(); > virtual void dispatchDidCommitLoad(); > virtual void dispatchDidFailProvisionalLoad(const ResourceError&); >@@ -193,7 +193,7 @@ class FrameLoaderClientEfl : public FrameLoaderClient { > virtual void prepareForDataSourceReplacement(); > > virtual WTF::PassRefPtr<DocumentLoader> createDocumentLoader(const ResourceRequest&, const SubstituteData&); >- virtual void setTitle(const String& title, const KURL&); >+ virtual void setTitle(const StringWithDirection& title, const KURL&); > > virtual String userAgent(const KURL&); > >diff --git a/Source/WebKit/gtk/ChangeLog b/Source/WebKit/gtk/ChangeLog >index d7de61d2c7f9d11a245cce8c41673550257dd717..373c1fb347b4071e114dc3843e5a7716d251bdc1 100644 >--- a/Source/WebKit/gtk/ChangeLog >+++ b/Source/WebKit/gtk/ChangeLog >@@ -1,3 +1,17 @@ >+2011-03-28 Evan Martin <evan@chromium.org> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ <title> should support dir attribute >+ https://bugs.webkit.org/show_bug.cgi?id=50961 >+ >+ Update to new FrameLoaderClient interface. >+ >+ * WebCoreSupport/FrameLoaderClientGtk.cpp: >+ (WebKit::FrameLoaderClient::dispatchDidReceiveTitle): >+ (WebKit::FrameLoaderClient::setTitle): >+ * WebCoreSupport/FrameLoaderClientGtk.h: >+ > 2011-03-25 Andy Estes <aestes@apple.com> > > Reviewed by Adele Peterson. >diff --git a/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp b/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp >index ca8bf9a089ad7383c8d45327a87d8534b85de097..2187d9ea146eb466a1821f0701719c2fe0276f84 100644 >--- a/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp >+++ b/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp >@@ -949,14 +949,15 @@ void FrameLoaderClient::dispatchDidStartProvisionalLoad() > notifyStatus(m_frame, WEBKIT_LOAD_PROVISIONAL); > } > >-void FrameLoaderClient::dispatchDidReceiveTitle(const String& title) >+void FrameLoaderClient::dispatchDidReceiveTitle(const StringWithDirection& title) > { > if (m_loadingErrorPage) > return; > > WebKitWebFramePrivate* priv = m_frame->priv; > g_free(priv->title); >- priv->title = g_strdup(title.utf8().data()); >+ // FIXME: use direction of title. >+ priv->title = g_strdup(title.m_string.utf8().data()); > > g_signal_emit_by_name(m_frame, "title-changed", priv->title); > g_object_notify(G_OBJECT(m_frame), "title"); >@@ -1119,11 +1120,12 @@ void FrameLoaderClient::prepareForDataSourceReplacement() > notImplemented(); > } > >-void FrameLoaderClient::setTitle(const String& title, const KURL& url) >+void FrameLoaderClient::setTitle(const StringWithDirection& title, const KURL& url) > { > WebKitWebFramePrivate* frameData = m_frame->priv; > g_free(frameData->title); >- frameData->title = g_strdup(title.utf8().data()); >+ // FIXME: use direction of title. >+ frameData->title = g_strdup(title.m_string.utf8().data()); > } > > void FrameLoaderClient::dispatchDidReceiveContentLength(WebCore::DocumentLoader*, unsigned long identifier, int lengthReceived) >diff --git a/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h b/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h >index b7ead7af5ebb9e6765c946c355ac99e89c1e9541..6eb24e9291efc9627fa98542716bafea47270ec9 100644 >--- a/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h >+++ b/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h >@@ -81,7 +81,7 @@ namespace WebKit { > virtual void dispatchWillClose(); > virtual void dispatchDidReceiveIcon(); > virtual void dispatchDidStartProvisionalLoad(); >- virtual void dispatchDidReceiveTitle(const WTF::String&); >+ virtual void dispatchDidReceiveTitle(const WTF::StringWithDirection&); > virtual void dispatchDidChangeIcons(); > virtual void dispatchDidCommitLoad(); > virtual void dispatchDidFailProvisionalLoad(const WebCore::ResourceError&); >@@ -174,7 +174,7 @@ namespace WebKit { > virtual void prepareForDataSourceReplacement(); > > virtual WTF::PassRefPtr<WebCore::DocumentLoader> createDocumentLoader(const WebCore::ResourceRequest&, const WebCore::SubstituteData&); >- virtual void setTitle(const WTF::String& title, const WebCore::KURL&); >+ virtual void setTitle(const WTF::StringWithDirection& title, const WebCore::KURL&); > > virtual WTF::String userAgent(const WebCore::KURL&); > >diff --git a/Source/WebKit/haiku/ChangeLog b/Source/WebKit/haiku/ChangeLog >index 7757fe7923165dfc8cb1cd4de4e95383eb09f9df..1185c26bcfacf5afb4c29e0553954fa6c3311b16 100644 >--- a/Source/WebKit/haiku/ChangeLog >+++ b/Source/WebKit/haiku/ChangeLog >@@ -1,3 +1,16 @@ >+2011-03-28 Evan Martin <evan@chromium.org> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ <title> should support dir attribute >+ https://bugs.webkit.org/show_bug.cgi?id=50961 >+ >+ Update to new FrameLoaderClient interface. >+ >+ * WebCoreSupport/FrameLoaderClientHaiku.cpp: >+ (WebCore::FrameLoaderClientHaiku::dispatchDidReceiveTitle): >+ * WebCoreSupport/FrameLoaderClientHaiku.h: >+ > 2011-03-25 Andy Estes <aestes@apple.com> > > Reviewed by Adele Peterson. >diff --git a/Source/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp b/Source/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp >index 24a98d5634286e7b449c110b3e1db53ba85e0d0b..589e1d04a588846ade7b7fceba4d971474ab219c 100644 >--- a/Source/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp >+++ b/Source/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp >@@ -237,13 +237,13 @@ void FrameLoaderClientHaiku::dispatchDidStartProvisionalLoad() > } > } > >-void FrameLoaderClientHaiku::dispatchDidReceiveTitle(const String& title) >+void FrameLoaderClientHaiku::dispatchDidReceiveTitle(const StringWithTitle& title) > { > if (m_webView) { >- m_webView->SetPageTitle(title); >- >+ // FIXME: use direction of title. >+ m_webView->SetPageTitle(title.m_string); > BMessage message(TITLE_CHANGED); >- message.AddString("title", title); >+ message.AddString("title", title.m_string); > m_messenger->SendMessage(&message); > } > } >diff --git a/Source/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h b/Source/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h >index dbd3084ca4cb7f29aeb76d244fddd930e98970b2..f576545c86a6ba437a1d66d7cfefe2745fdb767d 100644 >--- a/Source/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h >+++ b/Source/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h >@@ -102,7 +102,7 @@ namespace WebCore { > virtual void dispatchWillClose(); > virtual void dispatchDidReceiveIcon(); > virtual void dispatchDidStartProvisionalLoad(); >- virtual void dispatchDidReceiveTitle(const String& title); >+ virtual void dispatchDidReceiveTitle(const StringWithDirection& title); > virtual void dispatchDidCommitLoad(); > virtual void dispatchDidFinishDocumentLoad(); > virtual void dispatchDidFinishLoad(); >@@ -143,7 +143,7 @@ namespace WebCore { > virtual void addHistoryItemForFragmentScroll(); > virtual void didFinishLoad(); > virtual void prepareForDataSourceReplacement(); >- virtual void setTitle(const String& title, const KURL&); >+ virtual void setTitle(const StringWithDirection&, const KURL&); > > virtual String userAgent(const KURL&); > >diff --git a/Source/WebKit/mac/ChangeLog b/Source/WebKit/mac/ChangeLog >index e1c0eea234477288cff5307e001c0f2ca25f6ba7..4be964cb9835474086d057d141c36b1fbfd28706 100644 >--- a/Source/WebKit/mac/ChangeLog >+++ b/Source/WebKit/mac/ChangeLog >@@ -1,3 +1,17 @@ >+2011-03-28 Evan Martin <evan@chromium.org> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ <title> should support dir attribute >+ https://bugs.webkit.org/show_bug.cgi?id=50961 >+ >+ Update to new FrameLoaderClient interface. >+ >+ * WebCoreSupport/WebFrameLoaderClient.h: >+ * WebCoreSupport/WebFrameLoaderClient.mm: >+ (WebFrameLoaderClient::dispatchDidReceiveTitle): >+ (WebFrameLoaderClient::setTitle): >+ > 2011-03-27 Jer Noble <jer.noble@apple.com> > > Reviewed by Maciej Stachowiak. >diff --git a/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h b/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h >index 4fe5664dd60516c1186e855db23b37e524d38366..d5917b8f54c0703930b3b27b17dea45df7820fdb 100644 >--- a/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h >+++ b/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h >@@ -101,7 +101,7 @@ private: > virtual void dispatchWillClose(); > virtual void dispatchDidReceiveIcon(); > virtual void dispatchDidStartProvisionalLoad(); >- virtual void dispatchDidReceiveTitle(const WTF::String& title); >+ virtual void dispatchDidReceiveTitle(const WTF::StringWithDirection&); > virtual void dispatchDidChangeIcons(); > virtual void dispatchDidCommitLoad(); > virtual void dispatchDidFailProvisionalLoad(const WebCore::ResourceError&); >@@ -196,7 +196,7 @@ private: > virtual void prepareForDataSourceReplacement(); > virtual PassRefPtr<WebCore::DocumentLoader> createDocumentLoader(const WebCore::ResourceRequest&, const WebCore::SubstituteData&); > >- virtual void setTitle(const WTF::String& title, const WebCore::KURL&); >+ virtual void setTitle(const WTF::StringWithDirection&, const WebCore::KURL&); > > virtual PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL& url, const WTF::String& name, WebCore::HTMLFrameOwnerElement*, > const WTF::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight); >diff --git a/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm b/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm >index 92c2b03b1c9cf0c8bbef11117a008fdb9363e0c0..26b9aa31b3cf242f05c4570fc8ebc2894432d505 100644 >--- a/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm >+++ b/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm >@@ -624,12 +624,13 @@ void WebFrameLoaderClient::dispatchDidStartProvisionalLoad() > CallFrameLoadDelegate(implementations->didStartProvisionalLoadForFrameFunc, webView, @selector(webView:didStartProvisionalLoadForFrame:), m_webFrame.get()); > } > >-void WebFrameLoaderClient::dispatchDidReceiveTitle(const String& title) >+void WebFrameLoaderClient::dispatchDidReceiveTitle(const StringWithDirection& title) > { > WebView *webView = getWebView(m_webFrame.get()); > WebFrameLoadDelegateImplementationCache* implementations = WebViewGetFrameLoadDelegateImplementations(webView); > if (implementations->didReceiveTitleForFrameFunc) >- CallFrameLoadDelegate(implementations->didReceiveTitleForFrameFunc, webView, @selector(webView:didReceiveTitle:forFrame:), (NSString *)title, m_webFrame.get()); >+ // FIXME: use direction of title. >+ CallFrameLoadDelegate(implementations->didReceiveTitleForFrameFunc, webView, @selector(webView:didReceiveTitle:forFrame:), (NSString *)title.m_string, m_webFrame.get()); > } > > void WebFrameLoaderClient::dispatchDidChangeIcons() >@@ -1179,7 +1180,7 @@ PassRefPtr<DocumentLoader> WebFrameLoaderClient::createDocumentLoader(const Reso > return loader.release(); > } > >-void WebFrameLoaderClient::setTitle(const String& title, const KURL& url) >+void WebFrameLoaderClient::setTitle(const StringWithDirection& title, const KURL& url) > { > WebView* view = getWebView(m_webFrame.get()); > >@@ -1188,7 +1189,8 @@ void WebFrameLoaderClient::setTitle(const String& title, const KURL& url) > if (!implementations->setTitleFunc) > return; > >- CallHistoryDelegate(implementations->setTitleFunc, view, @selector(webView:updateHistoryTitle:forURL:), (NSString *)title, (NSString *)url); >+ // FIXME: use direction of title. >+ CallHistoryDelegate(implementations->setTitleFunc, view, @selector(webView:updateHistoryTitle:forURL:), (NSString *)title.m_string, (NSString *)url); > return; > } > >diff --git a/Source/WebKit/qt/ChangeLog b/Source/WebKit/qt/ChangeLog >index 3cd5b081048b0091e8f22bf1a5355a7d3295343d..4dad2933f63222c9023b26f124725ba400fb2d71 100644 >--- a/Source/WebKit/qt/ChangeLog >+++ b/Source/WebKit/qt/ChangeLog >@@ -1,3 +1,17 @@ >+2011-03-28 Evan Martin <evan@chromium.org> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ <title> should support dir attribute >+ https://bugs.webkit.org/show_bug.cgi?id=50961 >+ >+ Update to new FrameLoaderClient interface. >+ >+ * WebCoreSupport/FrameLoaderClientQt.cpp: >+ (WebCore::FrameLoaderClientQt::dispatchDidReceiveTitle): >+ (WebCore::FrameLoaderClientQt::setTitle): >+ * WebCoreSupport/FrameLoaderClientQt.h: >+ > 2011-03-27 Andreas Kling <kling@webkit.org> > > Fix build warning about IconDatabaseClient.h (wrong path.) >diff --git a/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp >index 64fd5ec6df501302b6addacf704c493a96ee702c..e8ebe324bc96d326b2ad961b458b4b6853a503a1 100644 >--- a/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp >+++ b/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp >@@ -447,8 +447,9 @@ void FrameLoaderClientQt::dispatchDidStartProvisionalLoad() > } > > >-void FrameLoaderClientQt::dispatchDidReceiveTitle(const String& title) >+void FrameLoaderClientQt::dispatchDidReceiveTitle(const StringWithDirection& title) > { >+ // FIXME: use direction of title. > if (dumpFrameLoaderCallbacks) > printf("%s - didReceiveTitle: %s\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)), qPrintable(QString(title))); > >@@ -709,16 +710,17 @@ void FrameLoaderClientQt::prepareForDataSourceReplacement() > { > } > >-void FrameLoaderClientQt::setTitle(const String& title, const KURL& url) >+void FrameLoaderClientQt::setTitle(const StringWithTitle& title, const KURL& url) > { > // Used by Apple WebKit to update the title of an existing history item. > // QtWebKit doesn't accomodate this on history items. If it ever does, > // it should be privateBrowsing-aware.For now, we are just passing > // globalhistory layout tests. >+ // FIXME: use direction of title. > if (dumpHistoryCallbacks) { > printf("WebView updated the title for history URL \"%s\" to \"%s\".\n", > qPrintable(drtDescriptionSuitableForTestResult(url)), >- qPrintable(QString(title))); >+ qPrintable(QString(title.m_string))); > } > } > >diff --git a/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h b/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h >index 3ec5f20db82f0e684538fc564b4bf13defd7f82a..314a550ff7d3ec3e0b4f3e4977a517f8024cc711 100644 >--- a/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h >+++ b/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h >@@ -110,7 +110,7 @@ public: > virtual void dispatchWillClose(); > virtual void dispatchDidReceiveIcon(); > virtual void dispatchDidStartProvisionalLoad(); >- virtual void dispatchDidReceiveTitle(const String& title); >+ virtual void dispatchDidReceiveTitle(const StringWithTitle&); > virtual void dispatchDidChangeIcons(); > virtual void dispatchDidCommitLoad(); > virtual void dispatchDidFailProvisionalLoad(const ResourceError&); >@@ -186,7 +186,7 @@ public: > virtual void prepareForDataSourceReplacement(); > > virtual WTF::PassRefPtr<WebCore::DocumentLoader> createDocumentLoader(const WebCore::ResourceRequest&, const WebCore::SubstituteData&); >- virtual void setTitle(const String& title, const KURL&); >+ virtual void setTitle(const StringWithTitle&, const KURL&); > > virtual String userAgent(const WebCore::KURL&); > >diff --git a/Source/WebKit/win/ChangeLog b/Source/WebKit/win/ChangeLog >index dca61be310168c04c5db47ec70d3babb9a7ddac1..b63f825aec0426cba4e5a7f3a3a8b8d1cab10aa6 100644 >--- a/Source/WebKit/win/ChangeLog >+++ b/Source/WebKit/win/ChangeLog >@@ -1,3 +1,16 @@ >+2011-03-28 Evan Martin <evan@chromium.org> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ <title> should support dir attribute >+ https://bugs.webkit.org/show_bug.cgi?id=50961 >+ >+ Update to new FrameLoaderClient interface. >+ >+ * WebCoreSupport/WebFrameLoaderClient.cpp: >+ (WebFrameLoaderClient::dispatchDidReceiveTitle): >+ * WebCoreSupport/WebFrameLoaderClient.h: >+ > 2011-03-25 Sam Weinig <sam@webkit.org> > > Reviewed by Jon Honeycutt. >diff --git a/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp b/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp >index 03041a64c32a67bdfa3b4ce6b76d4cf999fdd56b..ec74bf25145df2631c37574ac5f672f08a8970bb 100644 >--- a/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp >+++ b/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp >@@ -366,12 +366,13 @@ void WebFrameLoaderClient::dispatchDidStartProvisionalLoad() > frameLoadDelegate->didStartProvisionalLoadForFrame(webView, m_webFrame); > } > >-void WebFrameLoaderClient::dispatchDidReceiveTitle(const String& title) >+void WebFrameLoaderClient::dispatchDidReceiveTitle(const StringWithTitle& title) > { > WebView* webView = m_webFrame->webView(); > COMPtr<IWebFrameLoadDelegate> frameLoadDelegate; > if (SUCCEEDED(webView->frameLoadDelegate(&frameLoadDelegate))) >- frameLoadDelegate->didReceiveTitle(webView, BString(title), m_webFrame); >+ // FIXME: use direction of title. >+ frameLoadDelegate->didReceiveTitle(webView, BString(title.m_string), m_webFrame); > } > > void WebFrameLoaderClient::dispatchDidChangeIcons() >diff --git a/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h b/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h >index 57de2ad079a3dc42d4618048de3444b41518855a..9adfda5e7a3edea3258d0bf4be4cced4d09de1e9 100644 >--- a/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h >+++ b/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h >@@ -70,7 +70,7 @@ public: > virtual void dispatchWillClose(); > virtual void dispatchDidReceiveIcon(); > virtual void dispatchDidStartProvisionalLoad(); >- virtual void dispatchDidReceiveTitle(const WTF::String&); >+ virtual void dispatchDidReceiveTitle(const WTF::StringWithDirection&); > virtual void dispatchDidChangeIcons(); > virtual void dispatchDidCommitLoad(); > virtual void dispatchDidFinishDocumentLoad(); >@@ -104,7 +104,7 @@ public: > virtual void didRunInsecureContent(WebCore::SecurityOrigin*, const WebCore::KURL&); > > virtual PassRefPtr<WebCore::DocumentLoader> createDocumentLoader(const WebCore::ResourceRequest&, const WebCore::SubstituteData&); >- virtual void setTitle(const WTF::String& title, const WebCore::KURL&); >+ virtual void setTitle(const WTF::StringWithDirection&, const WebCore::KURL&); > > virtual void savePlatformDataToCachedFrame(WebCore::CachedFrame*); > virtual void transitionToCommittedFromCachedFrame(WebCore::CachedFrame*); >diff --git a/Source/WebKit/wince/ChangeLog b/Source/WebKit/wince/ChangeLog >index e595f25dc783511bd97bece41443752e4ea02506..ac0405c99d1acf5ca42fd564f7f242c17774870c 100644 >--- a/Source/WebKit/wince/ChangeLog >+++ b/Source/WebKit/wince/ChangeLog >@@ -1,3 +1,17 @@ >+2011-03-28 Evan Martin <evan@chromium.org> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ <title> should support dir attribute >+ https://bugs.webkit.org/show_bug.cgi?id=50961 >+ >+ Update to new FrameLoaderClient interface. >+ >+ * WebCoreSupport/FrameLoaderClientWinCE.cpp: >+ (WebKit::FrameLoaderClientWinCE::dispatchDidReceiveTitle): >+ (WebKit::FrameLoaderClientWinCE::setTitle): >+ * WebCoreSupport/FrameLoaderClientWinCE.h: >+ > 2011-03-27 Patrick Gansterer <paroga@webkit.org> > > Reviewed by Andreas Kling. >diff --git a/Source/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp b/Source/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp >index 2d8812fa0da16226b20c6cfe1ef887c78cafb8b9..70d78a09ece1862a5629e8f3eba2eabcd161a122 100644 >--- a/Source/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp >+++ b/Source/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp >@@ -371,7 +371,7 @@ void FrameLoaderClientWinCE::dispatchDidStartProvisionalLoad() > notImplemented(); > } > >-void FrameLoaderClientWinCE::dispatchDidReceiveTitle(const String&) >+void FrameLoaderClientWinCE::dispatchDidReceiveTitle(const StringWithDirection&) > { > notImplemented(); > } >@@ -490,7 +490,7 @@ void FrameLoaderClientWinCE::prepareForDataSourceReplacement() > notImplemented(); > } > >-void FrameLoaderClientWinCE::setTitle(const String&, const KURL&) >+void FrameLoaderClientWinCE::setTitle(const StringWithTitle&, const KURL&) > { > notImplemented(); > } >diff --git a/Source/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.h b/Source/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.h >index 401225d229e8693c9e6ad1b9d5e4f15f7c2b9fbe..61539c556730874ec1cda8d012cdcd7bc7962eed 100644 >--- a/Source/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.h >+++ b/Source/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.h >@@ -76,7 +76,7 @@ public: > virtual void dispatchWillClose(); > virtual void dispatchDidReceiveIcon(); > virtual void dispatchDidStartProvisionalLoad(); >- virtual void dispatchDidReceiveTitle(const WTF::String&); >+ virtual void dispatchDidReceiveTitle(const WTF::StringWithDirection&); > virtual void dispatchDidChangeIcons(); > virtual void dispatchDidCommitLoad(); > virtual void dispatchDidFailProvisionalLoad(const WebCore::ResourceError&); >@@ -169,7 +169,7 @@ public: > virtual void prepareForDataSourceReplacement(); > > virtual WTF::PassRefPtr<WebCore::DocumentLoader> createDocumentLoader(const WebCore::ResourceRequest&, const WebCore::SubstituteData&); >- virtual void setTitle(const WTF::String& title, const WebCore::KURL&); >+ virtual void setTitle(const WTF::StringWithDirection&, const WebCore::KURL&); > > virtual WTF::String userAgent(const WebCore::KURL&); > >diff --git a/Source/WebKit/wx/ChangeLog b/Source/WebKit/wx/ChangeLog >index 980fa8a02b3da91a55af44543415b633e20176aa..014a90d5718a2c148b27fbe367fc4a60cd730729 100644 >--- a/Source/WebKit/wx/ChangeLog >+++ b/Source/WebKit/wx/ChangeLog >@@ -1,3 +1,17 @@ >+2011-03-28 Evan Martin <evan@chromium.org> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ <title> should support dir attribute >+ https://bugs.webkit.org/show_bug.cgi?id=50961 >+ >+ Update to new FrameLoaderClient interface. >+ >+ * WebKitSupport/FrameLoaderClientWx.cpp: >+ (WebCore::FrameLoaderClientWx::dispatchDidReceiveTitle): >+ (WebCore::FrameLoaderClientWx::setTitle): >+ * WebKitSupport/FrameLoaderClientWx.h: >+ > 2011-03-25 Andy Estes <aestes@apple.com> > > Reviewed by Adele Peterson. >diff --git a/Source/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp b/Source/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp >index afc255ccacf94b74bd43229d366ccbacb016f208..539b5d108fb4d11d50ab7962a3ee30f23243f93e 100644 >--- a/Source/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp >+++ b/Source/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp >@@ -295,12 +295,13 @@ void FrameLoaderClientWx::dispatchDidStartProvisionalLoad() > } > > >-void FrameLoaderClientWx::dispatchDidReceiveTitle(const String& title) >+void FrameLoaderClientWx::dispatchDidReceiveTitle(const StringWithTitle& title) > { > if (m_webView) { >- m_webView->SetPageTitle(title); >+ // FIXME: use direction of title. >+ m_webView->SetPageTitle(title.m_string); > wxWebViewReceivedTitleEvent wkEvent(m_webView); >- wkEvent.SetTitle(title); >+ wkEvent.SetTitle(title.m_string); > m_webView->GetEventHandler()->ProcessEvent(wkEvent); > } > } >@@ -525,7 +526,7 @@ void FrameLoaderClientWx::prepareForDataSourceReplacement() > } > > >-void FrameLoaderClientWx::setTitle(const String& title, const KURL&) >+void FrameLoaderClientWx::setTitle(const StringWithDirection& title, const KURL&) > { > notImplemented(); > } >diff --git a/Source/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h b/Source/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h >index 254f95c42c42294fcde268e860decfbe1fecc76a..b28d3897ac9bd0a5cee6216dc415463f34cb384f 100644 >--- a/Source/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h >+++ b/Source/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h >@@ -103,7 +103,7 @@ namespace WebCore { > virtual void dispatchWillClose(); > virtual void dispatchDidReceiveIcon(); > virtual void dispatchDidStartProvisionalLoad(); >- virtual void dispatchDidReceiveTitle(const String& title); >+ virtual void dispatchDidReceiveTitle(const StringWithDirection& title); > virtual void dispatchDidCommitLoad(); > virtual void dispatchDidFinishDocumentLoad(); > virtual void dispatchDidFinishLoad(); >@@ -145,7 +145,7 @@ namespace WebCore { > virtual void addHistoryItemForFragmentScroll(); > virtual void didFinishLoad(); > virtual void prepareForDataSourceReplacement(); >- virtual void setTitle(const String& title, const KURL&); >+ virtual void setTitle(const StringWithDirection&, const KURL&); > > virtual String userAgent(const KURL&); > >diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog >index 5631ccc04f6b8a0453e85a0b665988f686993939..483308302beb4ce1633518b16a238944c6a9d6ec 100644 >--- a/Source/WebKit2/ChangeLog >+++ b/Source/WebKit2/ChangeLog >@@ -1,3 +1,17 @@ >+2011-03-28 Evan Martin <evan@chromium.org> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ <title> should support dir attribute >+ https://bugs.webkit.org/show_bug.cgi?id=50961 >+ >+ Update to new FrameLoaderClient interface. >+ >+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: >+ (WebKit::WebFrameLoaderClient::dispatchDidReceiveTitle): >+ (WebKit::WebFrameLoaderClient::setTitle): >+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: >+ > 2011-03-27 Andy Estes <aestes@apple.com> > > Reviewed by Maciej Stachowiak. >diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp >index fa3cdcef7b55202430e597f1ed741673cb0b0058..f24186c31c8c685c546f6a2ffa9b7c5c232a0d07 100644 >--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp >+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp >@@ -403,7 +403,7 @@ void WebFrameLoaderClient::dispatchDidStartProvisionalLoad() > webPage->send(Messages::WebPageProxy::DidStartProvisionalLoadForFrame(m_frame->frameID(), url, unreachableURL, InjectedBundleUserMessageEncoder(userData.get()))); > } > >-void WebFrameLoaderClient::dispatchDidReceiveTitle(const String& title) >+void WebFrameLoaderClient::dispatchDidReceiveTitle(const StringWithDirection& title) > { > WebPage* webPage = m_frame->page(); > if (!webPage) >@@ -412,10 +412,11 @@ void WebFrameLoaderClient::dispatchDidReceiveTitle(const String& title) > RefPtr<APIObject> userData; > > // Notify the bundle client. >- webPage->injectedBundleLoaderClient().didReceiveTitleForFrame(webPage, title, m_frame, userData); >+ // FIXME: use direction of title. >+ webPage->injectedBundleLoaderClient().didReceiveTitleForFrame(webPage, title.m_string, m_frame, userData); > > // Notify the UIProcess. >- webPage->send(Messages::WebPageProxy::DidReceiveTitleForFrame(m_frame->frameID(), title, InjectedBundleUserMessageEncoder(userData.get()))); >+ webPage->send(Messages::WebPageProxy::DidReceiveTitleForFrame(m_frame->frameID(), title.m_string, InjectedBundleUserMessageEncoder(userData.get()))); > } > > void WebFrameLoaderClient::dispatchDidChangeIcons() >@@ -1061,14 +1062,15 @@ PassRefPtr<DocumentLoader> WebFrameLoaderClient::createDocumentLoader(const Reso > return DocumentLoader::create(request, data); > } > >-void WebFrameLoaderClient::setTitle(const String& title, const KURL& url) >+void WebFrameLoaderClient::setTitle(const StringWithDirection& title, const KURL& url) > { > WebPage* webPage = m_frame->page(); > if (!webPage) > return; > >+ // FIXME: use direction of title. > WebProcess::shared().connection()->send(Messages::WebContext::DidUpdateHistoryTitle(webPage->pageID(), >- title, url.string(), m_frame->frameID()), 0); >+ title.m_string, url.string(), m_frame->frameID()), 0); > } > > String WebFrameLoaderClient::userAgent(const KURL&) >diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h b/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h >index 194854192073102d0e7de7282ba7403df6a9851b..cb3008bec1316f026d7976ad4c611b441550fa6d 100644 >--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h >+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h >@@ -84,7 +84,7 @@ private: > virtual void dispatchWillClose(); > virtual void dispatchDidReceiveIcon(); > virtual void dispatchDidStartProvisionalLoad(); >- virtual void dispatchDidReceiveTitle(const String& title); >+ virtual void dispatchDidReceiveTitle(const StringWithDirection& title); > virtual void dispatchDidChangeIcons(); > virtual void dispatchDidCommitLoad(); > virtual void dispatchDidFailProvisionalLoad(const WebCore::ResourceError&); >@@ -165,7 +165,7 @@ private: > virtual void prepareForDataSourceReplacement(); > > virtual PassRefPtr<WebCore::DocumentLoader> createDocumentLoader(const WebCore::ResourceRequest&, const WebCore::SubstituteData&); >- virtual void setTitle(const String& title, const WebCore::KURL&); >+ virtual void setTitle(const StringWithDirection& title, const WebCore::KURL&); > > virtual String userAgent(const WebCore::KURL&); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 50961
:
87148
|
87293
|
87312
|
87512
|
87687
|
87695
|
87699
|
87704
|
87705
|
87722