summaryrefslogtreecommitdiffstats
path: root/WebCore/dom/Element.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/dom/Element.cpp')
-rw-r--r--WebCore/dom/Element.cpp37
1 files changed, 22 insertions, 15 deletions
diff --git a/WebCore/dom/Element.cpp b/WebCore/dom/Element.cpp
index c408790..83e129e 100644
--- a/WebCore/dom/Element.cpp
+++ b/WebCore/dom/Element.cpp
@@ -44,7 +44,8 @@
#include "FrameView.h"
#include "HTMLElement.h"
#include "HTMLNames.h"
-#include "InspectorController.h"
+#include "HTMLParserIdioms.h"
+#include "InspectorInstrumentation.h"
#include "NodeList.h"
#include "NodeRenderStyle.h"
#include "Page.h"
@@ -93,6 +94,11 @@ NodeRareData* Element::createRareData()
return new ElementRareData;
}
+DEFINE_VIRTUAL_ATTRIBUTE_EVENT_LISTENER(Element, blur);
+DEFINE_VIRTUAL_ATTRIBUTE_EVENT_LISTENER(Element, error);
+DEFINE_VIRTUAL_ATTRIBUTE_EVENT_LISTENER(Element, focus);
+DEFINE_VIRTUAL_ATTRIBUTE_EVENT_LISTENER(Element, load);
+
PassRefPtr<DocumentFragment> Element::deprecatedCreateContextualFragment(const String& markup, FragmentScriptingPermission scriptingPermission)
{
RefPtr<DocumentFragment> fragment = document()->createDocumentFragment();
@@ -116,18 +122,19 @@ PassRefPtr<DocumentFragment> Element::deprecatedCreateContextualFragment(const S
for (RefPtr<Node> node = fragment->firstChild(); node; node = nextNode) {
nextNode = node->nextSibling();
if (node->hasTagName(htmlTag) || node->hasTagName(bodyTag)) {
- Node* firstChild = node->firstChild();
+ HTMLElement* element = static_cast<HTMLElement*>(node.get());
+ Node* firstChild = element->firstChild();
if (firstChild)
nextNode = firstChild;
RefPtr<Node> nextChild;
for (RefPtr<Node> child = firstChild; child; child = nextChild) {
nextChild = child->nextSibling();
- node->removeChild(child.get(), ignoredExceptionCode);
+ element->removeChild(child.get(), ignoredExceptionCode);
ASSERT(!ignoredExceptionCode);
- fragment->insertBefore(child, node.get(), ignoredExceptionCode);
+ fragment->insertBefore(child, element, ignoredExceptionCode);
ASSERT(!ignoredExceptionCode);
}
- fragment->removeChild(node.get(), ignoredExceptionCode);
+ fragment->removeChild(element, ignoredExceptionCode);
ASSERT(!ignoredExceptionCode);
} else if (node->hasTagName(headTag)) {
fragment->removeChild(node.get(), ignoredExceptionCode);
@@ -558,7 +565,7 @@ void Element::setAttribute(const AtomicString& name, const AtomicString& value,
#if ENABLE(INSPECTOR)
if (!isSynchronizingStyleAttribute())
- InspectorController::willModifyDOMAttr(this);
+ InspectorInstrumentation::willModifyDOMAttr(document(), this);
#endif
const AtomicString& localName = shouldIgnoreAttributeCase(this) ? name.lower() : name;
@@ -588,7 +595,7 @@ void Element::setAttribute(const AtomicString& name, const AtomicString& value,
#if ENABLE(INSPECTOR)
if (!isSynchronizingStyleAttribute())
- InspectorController::didModifyDOMAttr(this);
+ InspectorInstrumentation::didModifyDOMAttr(document(), this);
#endif
}
@@ -596,7 +603,7 @@ void Element::setAttribute(const QualifiedName& name, const AtomicString& value,
{
#if ENABLE(INSPECTOR)
if (!isSynchronizingStyleAttribute())
- InspectorController::willModifyDOMAttr(this);
+ InspectorInstrumentation::willModifyDOMAttr(document(), this);
#endif
document()->incDOMTreeVersion();
@@ -621,7 +628,7 @@ void Element::setAttribute(const QualifiedName& name, const AtomicString& value,
#if ENABLE(INSPECTOR)
if (!isSynchronizingStyleAttribute())
- InspectorController::didModifyDOMAttr(this);
+ InspectorInstrumentation::didModifyDOMAttr(document(), this);
#endif
}
@@ -680,7 +687,7 @@ static bool isEventHandlerAttribute(const QualifiedName& name)
static bool isAttributeToRemove(const QualifiedName& name, const AtomicString& value)
{
- return (name.localName().endsWith(hrefAttr.localName()) || name == srcAttr || name == actionAttr) && protocolIsJavaScript(deprecatedParseURL(value));
+ return (name.localName().endsWith(hrefAttr.localName()) || name == srcAttr || name == actionAttr) && protocolIsJavaScript(stripLeadingAndTrailingHTMLSpaces(value));
}
void Element::setAttributeMap(PassRefPtr<NamedNodeMap> list, FragmentScriptingPermission scriptingPermission)
@@ -769,7 +776,7 @@ KURL Element::baseURI() const
if (!base.protocol().isEmpty())
return base;
- Node* parent = parentNode();
+ ContainerNode* parent = parentNode();
if (!parent)
return base;
@@ -1257,7 +1264,7 @@ void Element::setAttributeNS(const AtomicString& namespaceURI, const AtomicStrin
void Element::removeAttribute(const String& name, ExceptionCode& ec)
{
- InspectorController::willModifyDOMAttr(this);
+ InspectorInstrumentation::willModifyDOMAttr(document(), this);
String localName = shouldIgnoreAttributeCase(this) ? name.lower() : name;
@@ -1267,7 +1274,7 @@ void Element::removeAttribute(const String& name, ExceptionCode& ec)
ec = 0;
}
- InspectorController::didModifyDOMAttr(this);
+ InspectorInstrumentation::didModifyDOMAttr(document(), this);
}
void Element::removeAttributeNS(const String& namespaceURI, const String& localName, ExceptionCode& ec)
@@ -1612,7 +1619,7 @@ KURL Element::getURLAttribute(const QualifiedName& name) const
ASSERT(isURLAttribute(attribute));
}
#endif
- return document()->completeURL(deprecatedParseURL(getAttribute(name)));
+ return document()->completeURL(stripLeadingAndTrailingHTMLSpaces(getAttribute(name)));
}
KURL Element::getNonEmptyURLAttribute(const QualifiedName& name) const
@@ -1623,7 +1630,7 @@ KURL Element::getNonEmptyURLAttribute(const QualifiedName& name) const
ASSERT(isURLAttribute(attribute));
}
#endif
- String value = deprecatedParseURL(getAttribute(name));
+ String value = stripLeadingAndTrailingHTMLSpaces(getAttribute(name));
if (value.isEmpty())
return KURL();
return document()->completeURL(value);