summaryrefslogtreecommitdiff
path: root/Source/WebCore/dom/Element.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-05-11 09:43:24 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-05-11 09:43:24 +0200
commit1b914638db989aaa98631a1c1e02c7b2d44805d8 (patch)
tree87f4fd2c7b38db320079a5de8877890d2ca3c485 /Source/WebCore/dom/Element.cpp
parent2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 (diff)
downloadqtwebkit-1b914638db989aaa98631a1c1e02c7b2d44805d8.tar.gz
Imported WebKit commit 9a52e27980f47e8b0d8f8b7cc0fd7b5741bceb92 (http://svn.webkit.org/repository/webkit/trunk@116736)
New snapshot to include QDeclarative* -> QQml* build fixes
Diffstat (limited to 'Source/WebCore/dom/Element.cpp')
-rw-r--r--Source/WebCore/dom/Element.cpp72
1 files changed, 23 insertions, 49 deletions
diff --git a/Source/WebCore/dom/Element.cpp b/Source/WebCore/dom/Element.cpp
index 646ce5e9f..cc49393d8 100644
--- a/Source/WebCore/dom/Element.cpp
+++ b/Source/WebCore/dom/Element.cpp
@@ -704,9 +704,17 @@ void Element::attributeChanged(Attribute* attr)
{
document()->incDOMTreeVersion();
- if (isIdAttributeName(attr->name()))
- idAttributeChanged(attr);
- else if (attr->name() == HTMLNames::nameAttr)
+ if (isIdAttributeName(attr->name())) {
+ if (attributeData()) {
+ if (attr->isNull())
+ attributeData()->setIdForStyleResolution(nullAtom);
+ else if (document()->inQuirksMode())
+ attributeData()->setIdForStyleResolution(attr->value().lower());
+ else
+ attributeData()->setIdForStyleResolution(attr->value());
+ }
+ setNeedsStyleRecalc();
+ } else if (attr->name() == HTMLNames::nameAttr)
setHasName(!attr->isNull());
if (!needsStyleRecalc() && document()->attached()) {
@@ -745,19 +753,6 @@ void Element::attributeChanged(Attribute* attr)
document()->axObjectCache()->postNotification(renderer(), AXObjectCache::AXInvalidStatusChanged, true);
}
-void Element::idAttributeChanged(Attribute* attr)
-{
- if (attributeData()) {
- if (attr->isNull())
- attributeData()->setIdForStyleResolution(nullAtom);
- else if (document()->inQuirksMode())
- attributeData()->setIdForStyleResolution(attr->value().lower());
- else
- attributeData()->setIdForStyleResolution(attr->value());
- }
- setNeedsStyleRecalc();
-}
-
// Returns true is the given attribute is an event handler.
// We consider an event handler any attribute that begins with "on".
// It is a simple solution that has the advantage of not requiring any
@@ -871,11 +866,6 @@ void Element::createAttributeData() const
m_attributeData = ElementAttributeData::create();
}
-bool Element::isURLAttribute(Attribute*) const
-{
- return false;
-}
-
const QualifiedName& Element::imageSourceAttributeName() const
{
return srcAttr;
@@ -902,17 +892,6 @@ void Element::setChangedSinceLastFormControlChangeEvent(bool)
{
}
-void Element::willRemove()
-{
-#if ENABLE(FULLSCREEN_API)
- if (containsFullScreenElement())
- setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(false);
-#endif
- if (ElementShadow* shadow = this->shadow())
- shadow->willRemove();
- ContainerNode::willRemove();
-}
-
Node::InsertionNotificationRequest Element::insertedInto(Node* insertionPoint)
{
// need to do superclass processing first so inDocument() is true
@@ -945,6 +924,11 @@ Node::InsertionNotificationRequest Element::insertedInto(Node* insertionPoint)
void Element::removedFrom(Node* insertionPoint)
{
+#if ENABLE(FULLSCREEN_API)
+ if (containsFullScreenElement())
+ setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(false);
+#endif
+
setSavedLayerScrollOffset(IntSize());
if (insertionPoint->inDocument()) {
@@ -1156,8 +1140,7 @@ void Element::recalcStyle(StyleChange change)
StyleResolverParentPusher parentPusher(this);
// FIXME: This does not care about sibling combinators. Will be necessary in XBL2 world.
- if (hasShadowRoot()) {
- ElementShadow* shadow = this->shadow();
+ if (ElementShadow* shadow = this->shadow()) {
if (change >= Inherit || shadow->childNeedsStyleRecalc() || shadow->needsStyleRecalc()) {
parentPusher.push();
shadow->recalcStyle(change);
@@ -1195,13 +1178,6 @@ void Element::recalcStyle(StyleChange change)
didRecalcStyle(change);
}
-bool Element::hasShadowRoot() const
-{
- if (ElementShadow* shadow = this->shadow())
- return shadow->hasShadowRoot();
- return false;
-}
-
ElementShadow* Element::shadow() const
{
if (!hasRareData())
@@ -1221,8 +1197,8 @@ ElementShadow* Element::ensureShadow()
ShadowRoot* Element::ensureShadowRoot()
{
- if (hasShadowRoot())
- return shadow()->oldestShadowRoot();
+ if (ElementShadow* shadow = this->shadow())
+ return shadow->oldestShadowRoot();
return ShadowRoot::create(this, ShadowRoot::CreatingUserAgentShadowRoot).get();
}
@@ -1357,10 +1333,8 @@ void Element::childrenChanged(bool changedByParser, Node* beforeChange, Node* af
else
checkForSiblingStyleChanges(this, renderStyle(), false, beforeChange, afterChange, childCountDelta);
- if (hasRareData()) {
- if (hasShadowRoot())
- shadow()->hostChildrenChanged();
- }
+ if (ElementShadow * shadow = this->shadow())
+ shadow->hostChildrenChanged();
}
void Element::beginParsingChildren()
@@ -1846,7 +1820,7 @@ KURL Element::getURLAttribute(const QualifiedName& name) const
#if !ASSERT_DISABLED
if (m_attributeData) {
if (Attribute* attribute = getAttributeItem(name))
- ASSERT(isURLAttribute(attribute));
+ ASSERT(isURLAttribute(*attribute));
}
#endif
return document()->completeURL(stripLeadingAndTrailingHTMLSpaces(getAttribute(name)));
@@ -1857,7 +1831,7 @@ KURL Element::getNonEmptyURLAttribute(const QualifiedName& name) const
#if !ASSERT_DISABLED
if (m_attributeData) {
if (Attribute* attribute = getAttributeItem(name))
- ASSERT(isURLAttribute(attribute));
+ ASSERT(isURLAttribute(*attribute));
}
#endif
String value = stripLeadingAndTrailingHTMLSpaces(getAttribute(name));