summaryrefslogtreecommitdiffstats
path: root/webkit/glue/dom_operations.cc
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-06 17:51:20 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-06 17:51:20 +0000
commita48146712aa765290165d2425d02518f14e22cf4 (patch)
tree0e1946292faea4359a9ec20f93f879d32a2ba78b /webkit/glue/dom_operations.cc
parenta8f643b401ec655adbe20d98dc862f168b25b17a (diff)
downloadchromium_src-a48146712aa765290165d2425d02518f14e22cf4.zip
chromium_src-a48146712aa765290165d2425d02518f14e22cf4.tar.gz
chromium_src-a48146712aa765290165d2425d02518f14e22cf4.tar.bz2
Port some test_shell_tests, and platform cleanup for more of them.
Many of these files that I don't added to the build would even compile and link, but don't yet pass with current test_shell on Linux. They just hang. Patch from Paweł Hajdan jr <phajdan.jr@gmail.com> on http://codereview.chromium.org/9417 Review URL: http://codereview.chromium.org/9641 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4892 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/dom_operations.cc')
-rw-r--r--webkit/glue/dom_operations.cc29
1 files changed, 27 insertions, 2 deletions
diff --git a/webkit/glue/dom_operations.cc b/webkit/glue/dom_operations.cc
index fe039a7..9e15d8a 100644
--- a/webkit/glue/dom_operations.cc
+++ b/webkit/glue/dom_operations.cc
@@ -21,6 +21,7 @@ MSVC_PUSH_WARNING_LEVEL(0);
#include "HTMLInputElement.h"
#include "HTMLLinkElement.h"
#include "HTMLMetaElement.h"
+#include "HTMLOptionElement.h"
#include "HTMLNames.h"
#include "KURL.h"
MSVC_POP_WARNING();
@@ -30,9 +31,8 @@ MSVC_POP_WARNING();
// first.
#include "webkit/glue/autocomplete_input_listener.h"
-#include "webkit/glue/dom_operations.h"
-
#include "base/string_util.h"
+#include "webkit/glue/dom_operations.h"
#include "webkit/glue/form_data.h"
#include "webkit/glue/glue_util.h"
#include "webkit/glue/password_autocomplete_listener.h"
@@ -152,6 +152,16 @@ void GetAllSavableResourceLinksForFrame(WebFrameImpl* current_frame,
}
}
+template <class HTMLNodeType>
+HTMLNodeType* CastHTMLElement(WebCore::Node* node,
+ const WebCore::QualifiedName& name) {
+ if (node->isHTMLElement() &&
+ static_cast<typename WebCore::HTMLElement*>(node)->hasTagName(name)) {
+ return static_cast<HTMLNodeType*>(node);
+ }
+ return NULL;
+}
+
} // namespace
namespace webkit_glue {
@@ -443,6 +453,21 @@ void FillPasswordForm(WebView* view,
}
}
+WebCore::HTMLLinkElement* CastToHTMLLinkElement(WebCore::Node* node) {
+ return CastHTMLElement<WebCore::HTMLLinkElement>(node,
+ WebCore::HTMLNames::linkTag);
+}
+
+WebCore::HTMLMetaElement* CastToHTMLMetaElement(WebCore::Node* node) {
+ return CastHTMLElement<WebCore::HTMLMetaElement>(node,
+ WebCore::HTMLNames::metaTag);
+}
+
+WebCore::HTMLOptionElement* CastToHTMLOptionElement(WebCore::Node* node) {
+ return CastHTMLElement<WebCore::HTMLOptionElement>(node,
+ WebCore::HTMLNames::optionTag);
+}
+
WebFrameImpl* GetWebFrameImplFromElement(WebCore::Element* element,
bool* is_frame_element) {
*is_frame_element = false;