Commit 96d600d4 authored by hausmann@webkit.org's avatar hausmann@webkit.org

2008-11-05 Sriram Yadavalli <sriram.yadavalli@nokia.com>

        Reviewed by Simon Hausmann.

        Added QWebFrame::metaData() to provide a way in the public API
        to retrieve the values of the <meta> tags.

        See https://bugs.webkit.org/show_bug.cgi?id=22071

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@38159 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 5400b938
......@@ -70,6 +70,7 @@
#include <qevent.h>
#include <qfileinfo.h>
#include <qpainter.h>
#include <QMultiMap>
#if QT_VERSION >= 0x040400
#include <qnetworkrequest.h>
#else
......@@ -77,6 +78,8 @@
#endif
#include <qregion.h>
#include <qprinter.h>
#include "HTMLMetaElement.h"
#include "NodeList.h"
using namespace WebCore;
......@@ -280,6 +283,27 @@ QString QWebFrame::title() const
else return QString();
}
/*!
\since 4.5
\brief Returns the meta data in this frame as a QMultiMap
\sa metaData()
*/
QMultiMap<QString, QString> QWebFrame::metaData() const
{
if(!d->frame->document())
return QMap<QString,QString>();
QMultiMap<QString,QString> map;
Document* doc = d->frame->document();
RefPtr<NodeList> list = doc->getElementsByTagName("meta");
unsigned len = list->length();
for (unsigned i = 0; i < len; i++) {
HTMLMetaElement* meta = static_cast<HTMLMetaElement*>(list->item(i));
map.insert(meta->name(), meta->content());
}
return map;
}
static inline QUrl ensureAbsoluteUrl(const QUrl &url)
{
if (!url.isRelative())
......
......@@ -133,6 +133,7 @@ public:
void setUrl(const QUrl &url);
QUrl url() const;
QIcon icon() const;
QMultiMap<QString, QString> metaData() const;
QString frameName() const;
......
2008-11-05 Sriram Yadavalli <sriram.yadavalli@nokia.com>
Reviewed by Simon Hausmann.
Added QWebFrame::metaData() to provide a way in the public API
to retrieve the values of the <meta> tags.
See https://bugs.webkit.org/show_bug.cgi?id=22071
* Api/qwebframe.cpp:
(QWebFrame::metaData):
* Api/qwebframe.h:
2008-10-24 Yael Aharon <yael.aharon@nokia.com>
Reviewed by Simon Hausmann.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment