summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/html/HTMLTitleElement.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/html/HTMLTitleElement.cpp')
-rw-r--r--Source/WebCore/html/HTMLTitleElement.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/Source/WebCore/html/HTMLTitleElement.cpp b/Source/WebCore/html/HTMLTitleElement.cpp
index 78c8b6a..b046c7b 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,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;