2011-03-31 Evan Martin <evan@chromium.org>
authorevan@chromium.org <evan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Mar 2011 15:17:13 +0000 (15:17 +0000)
committerevan@chromium.org <evan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Mar 2011 15:17:13 +0000 (15:17 +0000)
        Reviewed by Eric Seidel.

        <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, because in HTML the direction of
        a title can be set with the 'dir' attribute.

        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-31  Evan Martin  <evan@chromium.org>

        Reviewed by Eric Seidel.

        <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-31  Evan Martin  <evan@chromium.org>

        Reviewed by Eric Seidel.

        <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-31  Evan Martin  <evan@chromium.org>

        Reviewed by Eric Seidel.

        <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-31  Evan Martin  <evan@chromium.org>

        Reviewed by Eric Seidel.

        <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-31  Evan Martin  <evan@chromium.org>

        Reviewed by Eric Seidel.

        <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-31  Evan Martin  <evan@chromium.org>

        Reviewed by Eric Seidel.

        <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-31  Evan Martin  <evan@chromium.org>

        Reviewed by Eric Seidel.

        <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-31  Evan Martin  <evan@chromium.org>

        Reviewed by Eric Seidel.

        <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-31  Evan Martin  <evan@chromium.org>

        Reviewed by Eric Seidel.

        <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-31  Evan Martin  <evan@chromium.org>

        Reviewed by Eric Seidel.

        <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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@82580 268f45cc-cd09-0410-ab3c-d52691b4dbfc

53 files changed:
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.am
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/html/HTMLTitleElement.cpp
Source/WebCore/html/HTMLTitleElement.h
Source/WebCore/loader/DocumentLoader.cpp
Source/WebCore/loader/DocumentLoader.h
Source/WebCore/loader/EmptyClients.h
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/FrameLoader.h
Source/WebCore/loader/FrameLoaderClient.h
Source/WebCore/loader/HistoryController.cpp
Source/WebCore/loader/HistoryController.h
Source/WebCore/platform/text/StringWithDirection.h [new file with mode: 0644]
Source/WebCore/svg/SVGTitleElement.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp
Source/WebKit/chromium/src/FrameLoaderClientImpl.h
Source/WebKit/chromium/src/WebDataSourceImpl.cpp
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h
Source/WebKit/haiku/ChangeLog
Source/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp
Source/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
Source/WebKit/mac/WebView/WebHTMLRepresentation.mm
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
Source/WebKit/win/WebDataSource.cpp
Source/WebKit/wince/ChangeLog
Source/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp
Source/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.h
Source/WebKit/wx/ChangeLog
Source/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
Source/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h

index 9f08a12..1d50ded 100644 (file)
@@ -1,3 +1,65 @@
+2011-03-31  Evan Martin  <evan@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        <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, because in HTML the direction of
+        a title can be set with the 'dir' attribute.
+
+        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-31  Alexander Pavlov  <apavlov@chromium.org>
 
         Reviewed by Yury Semikhatsky.
index e2c49b4..88a1f07 100644 (file)
@@ -2689,6 +2689,7 @@ webcore_sources += \
        Source/WebCore/platform/text/SegmentedString.cpp \
        Source/WebCore/platform/text/SegmentedString.h \
        Source/WebCore/platform/text/String.cpp \
+       Source/WebCore/platform/text/StringWithDirection.h \
        Source/WebCore/platform/text/SuffixTree.h \
        Source/WebCore/platform/text/TextBoundaries.cpp \
        Source/WebCore/platform/text/TextBoundaries.h \
index f43cd5b..1b2a9c2 100644 (file)
@@ -341,7 +341,7 @@ __ZN7WebCore14DocumentLoader22cancelMainResourceLoadERKNS_13ResourceErrorE
 __ZN7WebCore14DocumentLoader24removePlugInStreamLoaderEPNS_14ResourceLoaderE
 __ZN7WebCore14DocumentLoader7requestEv
 __ZN7WebCore14DocumentLoader8setFrameEPNS_5FrameE
-__ZN7WebCore14DocumentLoader8setTitleERKN3WTF6StringE
+__ZN7WebCore14DocumentLoader8setTitleERKNS_19StringWithDirectionE
 __ZN7WebCore14DocumentLoaderC1ERKNS_15ResourceRequestERKNS_14SubstituteDataE
 __ZN7WebCore14DocumentLoaderC2ERKNS_15ResourceRequestERKNS_14SubstituteDataE
 __ZN7WebCore14DocumentLoaderD2Ev
index 87cefa3..ef071dc 100644 (file)
             'platform/text/RegularExpression.cpp',
             'platform/text/SegmentedString.cpp',
             'platform/text/String.cpp',
+            'platform/text/StringWithDirection.h',
             'platform/text/SuffixTree.h',
             'platform/text/TextBoundaries.cpp',
             'platform/text/TextBreakIteratorICU.cpp',
index afdb455..edb7079 100755 (executable)
                                        >
                                </File>
                                <File
+                                       RelativePath="..\platform\text\StringWithDirection.h"
+                                       >
+                               </File>
+                               <File
                                        RelativePath="..\platform\text\SuffixTree.h"
                                        >
                                </File>
index fe182f0..8a7ec17 100644 (file)
                98EB1F951313FE0500D0E1EA /* NotImplemented.h in Headers */ = {isa = PBXBuildFile; fileRef = 98EB1F941313FE0500D0E1EA /* NotImplemented.h */; settings = {ATTRIBUTES = (Private, ); }; };
                9B417064125662B3006B28FC /* ApplyBlockElementCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B417062125662B3006B28FC /* ApplyBlockElementCommand.h */; settings = {ATTRIBUTES = (Private, ); }; };
                9B417065125662B3006B28FC /* ApplyBlockElementCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9B417063125662B3006B28FC /* ApplyBlockElementCommand.cpp */; };
+               9B6C41531344949000085B62 /* StringWithDirection.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B6C41521344949000085B62 /* StringWithDirection.h */; settings = {ATTRIBUTES = (Private, ); }; };
                9BAB6C6C12550631001626D4 /* EditingStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 9BAB6C6A12550631001626D4 /* EditingStyle.h */; settings = {ATTRIBUTES = (Private, ); }; };
                9BAB6C6D12550631001626D4 /* EditingStyle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9BAB6C6B12550631001626D4 /* EditingStyle.cpp */; };
                9BAF3B2412C1A39800014BF1 /* WritingDirection.h in Headers */ = {isa = PBXBuildFile; fileRef = 9BAF3B2312C1A39800014BF1 /* WritingDirection.h */; settings = {ATTRIBUTES = (Private, ); }; };
                98EB1F941313FE0500D0E1EA /* NotImplemented.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotImplemented.h; sourceTree = "<group>"; };
                9B417062125662B3006B28FC /* ApplyBlockElementCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApplyBlockElementCommand.h; sourceTree = "<group>"; };
                9B417063125662B3006B28FC /* ApplyBlockElementCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ApplyBlockElementCommand.cpp; sourceTree = "<group>"; };
+               9B6C41521344949000085B62 /* StringWithDirection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringWithDirection.h; sourceTree = "<group>"; };
                9BAB6C6A12550631001626D4 /* EditingStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditingStyle.h; sourceTree = "<group>"; };
                9BAB6C6B12550631001626D4 /* EditingStyle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EditingStyle.cpp; sourceTree = "<group>"; };
                9BAF3B2312C1A39800014BF1 /* WritingDirection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WritingDirection.h; sourceTree = "<group>"; };
                                B2C3D9FE0D006C1D00EF6F26 /* SegmentedString.cpp */,
                                B2C3D9FF0D006C1D00EF6F26 /* SegmentedString.h */,
                                B2C3DA000D006C1D00EF6F26 /* String.cpp */,
+                               9B6C41521344949000085B62 /* StringWithDirection.h */,
                                97C0784F1165D5BE003A32EF /* SuffixTree.h */,
                                372C00C3129611F1005C9575 /* TextBoundaries.cpp */,
                                B2C3DA040D006C1D00EF6F26 /* TextBoundaries.h */,
                                3AB02D2A12D4F91600FBB694 /* StorageTracker.h in Headers */,
                                3AC3680012EF7A09006A3D6F /* StorageTrackerClient.h in Headers */,
                                81AC6C36131C57D30009A7E0 /* StringCallback.h in Headers */,
+                               9B6C41531344949000085B62 /* StringWithDirection.h in Headers */,
                                65488D6B0DD5A83D009D83B2 /* StringSourceProvider.h in Headers */,
                                B23540F30D00782E002382FA /* StringTruncator.h in Headers */,
                                849F77760EFEC6200090849D /* StrokeStyleApplier.h in Headers */,
index e3d7f53..5144703 100644 (file)
@@ -389,8 +389,6 @@ 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_titleSetExplicitly(false)
     , m_updateFocusAppearanceTimer(this, &Document::updateFocusAppearanceTimerFired)
     , m_startTime(currentTime())
@@ -1271,8 +1269,9 @@ Element* Document::getElementByAccessKey(const String& key) const
  *  2. Trim leading and trailing spaces
  *  3. Collapse internal whitespace.
  */
-static inline String canonicalizedTitle(Document* document, const String& title)
+static inline StringWithDirection canonicalizedTitle(Document* document, const StringWithDirection& titleWithDirection)
 {
+    const String& title = titleWithDirection.string();
     const UChar* characters = title.characters();
     unsigned length = title.length();
     unsigned i;
@@ -1288,7 +1287,7 @@ static inline String canonicalizedTitle(Document* document, const String& title)
     }
 
     if (i == length)
-        return "";
+        return StringWithDirection();
 
     // Replace control characters with spaces, and backslashes with currency symbols, and collapse whitespace.
     bool previousCharWasWS = false;
@@ -1313,17 +1312,17 @@ static inline String canonicalizedTitle(Document* document, const String& title)
     }
 
     if (!builderIndex && buffer[builderIndex] == ' ')
-        return "";
+        return StringWithDirection();
 
     buffer.shrink(builderIndex + 1);
 
     // Replace the backslashes with currency symbols if the encoding requires it.
     document->displayBufferModifiedByEncoding(buffer.characters(), buffer.length());
     
-    return String::adopt(buffer);
+    return StringWithDirection(String::adopt(buffer), titleWithDirection.direction());
 }
 
-void Document::updateTitle(const String& title)
+void Document::updateTitle(const StringWithDirection& title)
 {
     if (m_rawTitle == title)
         return;
@@ -1349,16 +1348,17 @@ void Document::setTitle(const String& title)
         }
     }
 
-    updateTitle(title);
+    // The DOM API has no method of specifying direction, so assume LTR.
+    updateTitle(StringWithDirection(title, LTR));
 
     if (m_titleElement) {
         ASSERT(m_titleElement->hasTagName(titleTag));
         if (m_titleElement->hasTagName(titleTag))
-            static_cast<HTMLTitleElement*>(m_titleElement.get())->setText(m_title);
+            static_cast<HTMLTitleElement*>(m_titleElement.get())->setText(title);
     }
 }
 
-void Document::setTitleElement(const String& title, Element* titleElement)
+void Document::setTitleElement(const StringWithDirection& title, Element* titleElement)
 {
     if (titleElement != m_titleElement) {
         if (m_titleElement || m_titleSetExplicitly)
@@ -1383,13 +1383,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);
-                setTitleElement(titleElement->text(), titleElement);
+                setTitleElement(titleElement->textWithDirection(), titleElement);
                 break;
             }
     }
 
     if (!m_titleElement)
-        updateTitle("");
+        updateTitle(StringWithDirection());
 }
 
 String Document::nodeName() const
index 05dfb76..8a83d59 100644 (file)
@@ -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,9 +812,11 @@ public:
     // Returns 0 if this is the top level document.
     HTMLFrameOwnerElement* ownerElement() const;
 
-    String title() const { return m_title; }
+    // Used by DOM bindings; no direction known.
+    String title() const { return m_title.string(); }
     void setTitle(const String&);
-    void setTitleElement(const String& title, Element* titleElement);
+
+    void setTitleElement(const StringWithDirection&, Element* titleElement);
     void removeTitle(Element* titleElement);
 
     String cookie(ExceptionCode&) const;
@@ -1158,7 +1161,7 @@ private:
 
     String encoding() const;
 
-    void updateTitle(const String& title);
+    void updateTitle(const StringWithDirection&);
     void updateFocusAppearanceTimerFired(Timer<Document>*);
     void updateBaseURL();
 
@@ -1295,8 +1298,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;
 
index 78c8b6a..b046c7b 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "Document.h"
 #include "HTMLNames.h"
+#include "RenderStyle.h"
 #include "Text.h"
 
 namespace WebCore {
@@ -33,7 +34,6 @@ using namespace HTMLNames;
 
 inline HTMLTitleElement::HTMLTitleElement(const QualifiedName& tagName, Document* document)
     : HTMLElement(tagName, document)
-    , m_title("")
 {
     ASSERT(hasTagName(titleTag));
 }
@@ -57,7 +57,7 @@ void HTMLTitleElement::removedFromDocument()
 
 void HTMLTitleElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
 {
-    m_title = text();
+    m_title = textWithDirection();
     if (inDocument())
         document()->setTitleElement(m_title, this);
     HTMLElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
@@ -71,10 +71,20 @@ String HTMLTitleElement::text() const
         if (n->isTextNode())
             val += static_cast<Text*>(n)->data();
     }
-    
+
     return val;
 }
 
+StringWithDirection HTMLTitleElement::textWithDirection()
+{
+    TextDirection direction = LTR;
+    if (RenderStyle* style = computedStyle())
+        direction = style->direction();
+    else if (RefPtr<RenderStyle> style = styleForRenderer())
+        direction = style->direction();
+    return StringWithDirection(text(), direction);
+}
+
 void HTMLTitleElement::setText(const String &value)
 {
     ExceptionCode ec = 0;
index 8b90f56..6920997 100644 (file)
@@ -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
index 121045b..1437adc 100644 (file)
@@ -649,7 +649,7 @@ void DocumentLoader::stopRecordingResponses()
     m_stopRecordingResponses = true;
 }
 
-void DocumentLoader::setTitle(const String& title)
+void DocumentLoader::setTitle(const StringWithDirection& title)
 {
     if (title.isEmpty())
         return;
index 1f88272..c6f0bc5 100644 (file)
@@ -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;
index 59fd897..6acf992 100644 (file)
@@ -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 ""; }
 
index 347a41e..f1020e1 100644 (file)
@@ -610,7 +610,7 @@ 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())
             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.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);
 }
index 1fb9e3c..9062f21 100644 (file)
@@ -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();
index 7d64912..d5d49ec 100644 (file)
@@ -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&) = 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&, const KURL&) = 0;
 
         virtual String userAgent(const KURL&) = 0;
         
index b8bece9..c1c5414 100644 (file)
@@ -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().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().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().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().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().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.direction() as well.
+        m_currentItem->setTitle(title.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 title directionality in history as well.
+    item->setTitle(title.string());
     item->setOriginalURLString(originalURL.string());
 
     if (!unreachableURL.isEmpty() || documentLoader->response().httpStatusCode() >= 400)
index 59f11a2..15e12c0 100644 (file)
@@ -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 (file)
index 0000000..ea34ab6
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * 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.
+//
+// Note that is explicitly *not* the direction of the string as learned
+// from the characters of the string; it's extra metadata we have external
+// to the string.
+class StringWithDirection {
+public:
+    StringWithDirection() {}
+    StringWithDirection(const String& string, TextDirection dir) : m_string(string), m_direction(dir) {}
+
+    const String& string() const { return m_string; }
+    TextDirection direction() const { return m_direction; }
+
+    bool isEmpty() const { return m_string.isEmpty(); }
+    bool isNull() const { return m_string.isNull(); }
+
+    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); }
+
+private:
+    String m_string;
+    TextDirection m_direction;
+};
+
+}
+
+#endif // StringWithDirection_h
index ebcddb4..d925603 100644 (file)
@@ -40,7 +40,8 @@ void SVGTitleElement::insertedIntoDocument()
 {
     SVGStyledElement::insertedIntoDocument();
     if (firstChild())
-        document()->setTitleElement(textContent(), this);
+        // FIXME: does SVG have a title text direction?
+        document()->setTitleElement(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()->setTitleElement(textContent(), this);
+        // FIXME: does SVG have title text direction?
+        document()->setTitleElement(StringWithDirection(textContent(), LTR), this);
 }
 
 AttributeToPropertyTypeMap& SVGTitleElement::attributeToPropertyTypeMap()
index 2b0e13c..dd8269a 100644 (file)
@@ -1,3 +1,19 @@
+2011-03-31  Evan Martin  <evan@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        <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-30  David Levin  <levin@chromium.org>
 
         Reviewed by Dmitry Titov.
index 647a70c..cd76491 100644 (file)
@@ -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.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.
 }
index f19c26c..2b1c26f 100644 (file)
@@ -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*);
index 1366a80..3170aff 100644 (file)
@@ -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().string();
 }
 
 WebNavigationType WebDataSourceImpl::navigationType() const
index 35da09c..7cea65a 100644 (file)
@@ -1,3 +1,17 @@
+2011-03-31  Evan Martin  <evan@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        <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-29  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
 
         Reviewed by Antonio Gomes.
index fa34ac9..96b859b 100644 (file)
@@ -576,9 +576,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.string().utf8();
     ewk_frame_title_set(m_frame, cs.data());
 
     if (ewk_view_frame_main_get(m_view) != m_frame)
@@ -709,7 +710,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
 }
index 5ea4e8c..bd07a30 100644 (file)
@@ -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&);
 
index 05c15d4..ed73a7e 100644 (file)
@@ -1,3 +1,17 @@
+2011-03-31  Evan Martin  <evan@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        <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-29  Philippe Normand  <pnormand@igalia.com>
 
         Unreviewed, disable an assert in testwebview due to
index ca8bf9a..5c594e8 100644 (file)
@@ -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.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.string().utf8().data());
 }
 
 void FrameLoaderClient::dispatchDidReceiveContentLength(WebCore::DocumentLoader*, unsigned long identifier, int lengthReceived)
index b7ead7a..97eb0ff 100644 (file)
@@ -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 WebCore::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 WebCore::StringWithDirection& title, const WebCore::KURL&);
 
         virtual WTF::String userAgent(const WebCore::KURL&);
 
index 7757fe7..996a1f4 100644 (file)
@@ -1,3 +1,16 @@
+2011-03-31  Evan Martin  <evan@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        <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.
index 24a98d5..c04cb7d 100644 (file)
@@ -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.string());
         m_messenger->SendMessage(&message);
     }
 }
index dbd3084..f576545 100644 (file)
@@ -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&);
 
index d2c20ed..c962a69 100644 (file)
@@ -1,3 +1,17 @@
+2011-03-31  Evan Martin  <evan@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        <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-30  Dominic Cooney  <dominicc@google.com>
 
         Reviewed by Dimitri Glazkov.
index 4fe5664..df8b34b 100644 (file)
@@ -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 WebCore::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 WebCore::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);
index 92c2b03..27ce62a 100644 (file)
@@ -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.string(), m_webFrame.get());
 }
 
 void WebFrameLoaderClient::dispatchDidChangeIcons()
@@ -893,7 +894,7 @@ void WebFrameLoaderClient::updateGlobalHistory()
         WebHistoryDelegateImplementationCache* implementations = WebViewGetHistoryDelegateImplementations(view);
         if (implementations->navigatedFunc) {
             WebNavigationData *data = [[WebNavigationData alloc] initWithURLString:loader->urlForHistory()
-                                                                             title:loader->title()
+                                                                             title:loader->title().string()
                                                                    originalRequest:loader->originalRequestCopy().nsURLRequest()
                                                                           response:loader->response().nsURLResponse()
                                                                  hasSubstituteData:loader->substituteData().isValid()
@@ -907,7 +908,7 @@ void WebFrameLoaderClient::updateGlobalHistory()
     }
 
     [[WebHistory optionalSharedHistory] _visitedURL:loader->urlForHistory() 
-                                          withTitle:loader->title()
+                                          withTitle:loader->title().string()
                                              method:loader->originalRequestCopy().httpMethod()
                                          wasFailure:loader->urlForHistoryReflectsFailure()
                                  increaseVisitCount:!loader->clientRedirectSourceForHistory()]; // Do not increase visit count due to navigations that were not initiated by the user directly, avoiding growth from programmatic reloads.
@@ -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.string(), (NSString *)url);
         return;
     }
     
@@ -1196,7 +1198,7 @@ void WebFrameLoaderClient::setTitle(const String& title, const KURL& url)
     nsURL = [nsURL _webkit_canonicalize];
     if(!nsURL)
         return;
-    NSString *titleNSString = title;
+    NSString *titleNSString = title.string();
        
     [[[WebHistory optionalSharedHistory] itemForURL:nsURL] setTitle:titleNSString];
 }
@@ -1285,7 +1287,7 @@ void WebFrameLoaderClient::transitionToCommittedForNewPage()
         // like the ones that Safari uses for bookmarks it is the only way the DocumentLoader
         // will get the proper title.
         if (DocumentLoader* documentLoader = [dataSource _documentLoader])
-            documentLoader->setTitle([dataSource pageTitle]);
+            documentLoader->setTitle(StringWithDirection([dataSource pageTitle], LTR));
     }
 
     if (HTMLFrameOwnerElement* owner = coreFrame->ownerElement())
index 03edd5d..842e605 100644 (file)
@@ -261,7 +261,7 @@ static NSArray *concatenateArrays(NSArray *first, NSArray *second)
 
 - (NSString *)title
 {
-    return nsStringNilIfEmpty([_private->dataSource _documentLoader]->title());
+    return nsStringNilIfEmpty([_private->dataSource _documentLoader]->title().string());
 }
 
 - (DOMDocument *)DOMDocument
index 7bab6a9..fb5e6b3 100644 (file)
@@ -1,3 +1,17 @@
+2011-03-31  Evan Martin  <evan@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        <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-30  Yi Shen  <yi.4.shen@nokia.com>
 
         Reviewed by Kenneth Rohde Christiansen.
index d318494..8089bfe 100644 (file)
@@ -447,15 +447,16 @@ 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)));
+        printf("%s - didReceiveTitle: %s\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)), qPrintable(QString(title.string())));
 
     if (!m_webFrame)
         return;
 
-    emit titleChanged(title);
+    emit titleChanged(title.string());
 }
 
 
@@ -709,16 +710,17 @@ void FrameLoaderClientQt::prepareForDataSourceReplacement()
 {
 }
 
-void FrameLoaderClientQt::setTitle(const String& title, const KURL& url)
+void FrameLoaderClientQt::setTitle(const StringWithDirection& 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.string())));
     }
 }
 
index 3ec5f20..900489d 100644 (file)
@@ -110,7 +110,7 @@ public:
     virtual void dispatchWillClose();
     virtual void dispatchDidReceiveIcon();
     virtual void dispatchDidStartProvisionalLoad();
-    virtual void dispatchDidReceiveTitle(const String& title);
+    virtual void dispatchDidReceiveTitle(const StringWithDirection&);
     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 StringWithDirection&, const KURL&);
 
     virtual String userAgent(const WebCore::KURL&);
 
index 18fae8a..f671fbc 100644 (file)
@@ -1,3 +1,16 @@
+2011-03-31  Evan Martin  <evan@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        <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-30  Steve Falkenburg  <sfalken@apple.com>
 
         Reviewed by Adam Roben.
index 10a3190..ca61d30 100644 (file)
@@ -364,12 +364,13 @@ void WebFrameLoaderClient::dispatchDidStartProvisionalLoad()
         frameLoadDelegate->didStartProvisionalLoadForFrame(webView, m_webFrame);
 }
 
-void WebFrameLoaderClient::dispatchDidReceiveTitle(const String& title)
+void WebFrameLoaderClient::dispatchDidReceiveTitle(const StringWithDirection& 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.string()), m_webFrame);
 }
 
 void WebFrameLoaderClient::dispatchDidChangeIcons()
@@ -542,7 +543,7 @@ void WebFrameLoaderClient::updateGlobalHistory()
         COMPtr<IWebURLRequest> urlRequest(AdoptCOM, WebMutableURLRequest::createInstance(loader->originalRequestCopy()));
         
         COMPtr<IWebNavigationData> navigationData(AdoptCOM, WebNavigationData::createInstance(
-            loader->urlForHistory(), loader->title(), urlRequest.get(), urlResponse.get(), loader->substituteData().isValid(), loader->clientRedirectSourceForHistory()));
+            loader->urlForHistory(), loader->title().string(), urlRequest.get(), urlResponse.get(), loader->substituteData().isValid(), loader->clientRedirectSourceForHistory()));
 
         historyDelegate->didNavigateWithNavigationData(webView, navigationData.get(), m_webFrame);
         return;
@@ -552,7 +553,7 @@ void WebFrameLoaderClient::updateGlobalHistory()
     if (!history)
         return;
 
-    history->visitedURL(loader->urlForHistory(), loader->title(), loader->originalRequestCopy().httpMethod(), loader->urlForHistoryReflectsFailure(), !loader->clientRedirectSourceForHistory());
+    history->visitedURL(loader->urlForHistory(), loader->title().string(), loader->originalRequestCopy().httpMethod(), loader->urlForHistoryReflectsFailure(), !loader->clientRedirectSourceForHistory());
 }
 
 void WebFrameLoaderClient::updateGlobalHistoryRedirectLinks()
@@ -672,13 +673,13 @@ 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* webView = m_webFrame->webView();
     COMPtr<IWebHistoryDelegate> historyDelegate;
     webView->historyDelegate(&historyDelegate);
     if (historyDelegate) {
-        BString titleBSTR(title);
+        BString titleBSTR(title.string());
         BString urlBSTR(url.string());
         historyDelegate->updateHistoryTitle(webView, titleBSTR, urlBSTR);
         return;
@@ -704,7 +705,7 @@ void WebFrameLoaderClient::setTitle(const String& title, const KURL& url)
     if (!itemPrivate)
         return;
 
-    itemPrivate->setTitle(BString(title));
+    itemPrivate->setTitle(BString(title.string()));
 }
 
 void WebFrameLoaderClient::savePlatformDataToCachedFrame(CachedFrame* cachedFrame)
index d864b23..1857088 100644 (file)
@@ -69,7 +69,7 @@ public:
     virtual void dispatchWillClose();
     virtual void dispatchDidReceiveIcon();
     virtual void dispatchDidStartProvisionalLoad();
-    virtual void dispatchDidReceiveTitle(const WTF::String&);
+    virtual void dispatchDidReceiveTitle(const WebCore::StringWithDirection&);
     virtual void dispatchDidChangeIcons();
     virtual void dispatchDidCommitLoad();
     virtual void dispatchDidFinishDocumentLoad();
@@ -103,7 +103,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 WebCore::StringWithDirection&, const WebCore::KURL&);
 
     virtual void savePlatformDataToCachedFrame(WebCore::CachedFrame*);
     virtual void transitionToCommittedFromCachedFrame(WebCore::CachedFrame*);
index 0350373..1498f6e 100644 (file)
@@ -246,7 +246,7 @@ HRESULT STDMETHODCALLTYPE WebDataSource::isLoading(
 HRESULT STDMETHODCALLTYPE WebDataSource::pageTitle( 
     /* [retval][out] */ BSTR* title)
 {
-    *title = BString(m_loader->title()).release();
+    *title = BString(m_loader->title().string()).release();
     return S_OK;
 }
 
index e595f25..ce91c98 100644 (file)
@@ -1,3 +1,17 @@
+2011-03-31  Evan Martin  <evan@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        <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.
index 2d8812f..648c4a5 100644 (file)
@@ -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 StringWithDirection&, const KURL&)
 {
     notImplemented();
 }
index 401225d..61539c5 100644 (file)
@@ -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&);
 
index 980fa8a..1a0a314 100644 (file)
@@ -1,3 +1,17 @@
+2011-03-31  Evan Martin  <evan@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        <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.
index afc255c..b408636 100644 (file)
@@ -295,12 +295,13 @@ void FrameLoaderClientWx::dispatchDidStartProvisionalLoad()
 }
 
 
-void FrameLoaderClientWx::dispatchDidReceiveTitle(const String& title)
+void FrameLoaderClientWx::dispatchDidReceiveTitle(const StringWithDirection& title)
 {
     if (m_webView) {
-        m_webView->SetPageTitle(title);
+        // FIXME: use direction of title.
+        m_webView->SetPageTitle(title.string());
         wxWebViewReceivedTitleEvent wkEvent(m_webView);
-        wkEvent.SetTitle(title);
+        wkEvent.SetTitle(title.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();
 }
index 254f95c..b28d389 100644 (file)
@@ -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&);
 
index 701b013..3181361 100644 (file)
@@ -1,3 +1,17 @@
+2011-03-31  Evan Martin  <evan@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        <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-31  Balazs Kelemen  <kbalazs@webkit.org>
 
         Reviewed by Csaba Osztrogon√°c.
index fa3cdce..1487a35 100644 (file)
@@ -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.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.string(), InjectedBundleUserMessageEncoder(userData.get())));
 }
 
 void WebFrameLoaderClient::dispatchDidChangeIcons()
@@ -846,7 +847,8 @@ void WebFrameLoaderClient::updateGlobalHistory()
 
     WebNavigationDataStore data;
     data.url = loader->urlForHistory().string();
-    data.title = loader->title();
+    // FIXME: use direction of title.
+    data.title = loader->title().string();
 
     WebProcess::shared().connection()->send(Messages::WebContext::DidNavigateWithNavigationData(webPage->pageID(), data, m_frame->frameID()), 0);
 }
@@ -1061,14 +1063,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.string(), url.string(), m_frame->frameID()), 0);
 }
 
 String WebFrameLoaderClient::userAgent(const KURL&)
index 1948541..6c83e9d 100644 (file)
@@ -84,7 +84,7 @@ private:
     virtual void dispatchWillClose();
     virtual void dispatchDidReceiveIcon();
     virtual void dispatchDidStartProvisionalLoad();
-    virtual void dispatchDidReceiveTitle(const String& title);
+    virtual void dispatchDidReceiveTitle(const WebCore::StringWithDirection&);
     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 WebCore::StringWithDirection&, const WebCore::KURL&);
     
     virtual String userAgent(const WebCore::KURL&);