[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
dglazkov at chromium.org
dglazkov at chromium.org
Wed Dec 22 16:38:49 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit c2dd5289791bbb393a7cab9d844c99983165ff6f
Author: dglazkov at chromium.org <dglazkov at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Nov 29 21:27:45 2010 +0000
2010-11-29 Dimitri Glazkov <dglazkov at chromium.org>
Reviewed by Darin Adler.
Converge means of querying a parent node into one way, which is Node::parentNode.
https://bugs.webkit.org/show_bug.cgi?id=49686
A follow-up to r72259, which explicitly forbids further use of Node::parent by
making it private.
No change in behavior, so no new tests.
* dom/Document.cpp:
(WebCore::Document::styleForElementIgnoringPendingStylesheets): Changed to use parentNode.
(WebCore::Document::hoveredNodeDetached): Ditto.
(WebCore::Document::activeChainNodeDetached): Ditto.
* dom/Node.h: Made Node::parent private.
* page/SpatialNavigation.cpp:
(WebCore::canBeScrolledIntoView): Changed to use parentNode.
* xml/XSLTProcessorQt.cpp:
(WebCore::XSLTProcessor::transformToString): Ditto.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72825 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 4f2e9db..e760c6b 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,25 @@
+2010-11-29 Dimitri Glazkov <dglazkov at chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Converge means of querying a parent node into one way, which is Node::parentNode.
+ https://bugs.webkit.org/show_bug.cgi?id=49686
+
+ A follow-up to r72259, which explicitly forbids further use of Node::parent by
+ making it private.
+
+ No change in behavior, so no new tests.
+
+ * dom/Document.cpp:
+ (WebCore::Document::styleForElementIgnoringPendingStylesheets): Changed to use parentNode.
+ (WebCore::Document::hoveredNodeDetached): Ditto.
+ (WebCore::Document::activeChainNodeDetached): Ditto.
+ * dom/Node.h: Made Node::parent private.
+ * page/SpatialNavigation.cpp:
+ (WebCore::canBeScrolledIntoView): Changed to use parentNode.
+ * xml/XSLTProcessorQt.cpp:
+ (WebCore::XSLTProcessor::transformToString): Ditto.
+
2010-11-29 Tony Chang <tony at chromium.org>
Reviewed by James Robinson.
diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp
index 83ba885..1694a37 100644
--- a/WebCore/dom/Document.cpp
+++ b/WebCore/dom/Document.cpp
@@ -1687,7 +1687,7 @@ PassRefPtr<RenderStyle> Document::styleForElementIgnoringPendingStylesheets(Elem
bool oldIgnore = m_ignorePendingStylesheets;
m_ignorePendingStylesheets = true;
- RefPtr<RenderStyle> style = styleSelector()->styleForElement(element, element->parent() ? element->parent()->computedStyle() : 0);
+ RefPtr<RenderStyle> style = styleSelector()->styleForElement(element, element->parentNode() ? element->parentNode()->computedStyle() : 0);
m_ignorePendingStylesheets = oldIgnore;
return style.release();
}
@@ -3096,24 +3096,24 @@ void Document::removeFocusedNodeOfSubtree(Node* node, bool amongChildrenOnly)
void Document::hoveredNodeDetached(Node* node)
{
- if (!m_hoverNode || (node != m_hoverNode && (!m_hoverNode->isTextNode() || node != m_hoverNode->parent())))
+ if (!m_hoverNode || (node != m_hoverNode && (!m_hoverNode->isTextNode() || node != m_hoverNode->parentNode())))
return;
- m_hoverNode = node->parent();
+ m_hoverNode = node->parentNode();
while (m_hoverNode && !m_hoverNode->renderer())
- m_hoverNode = m_hoverNode->parent();
+ m_hoverNode = m_hoverNode->parentNode();
if (frame())
frame()->eventHandler()->scheduleHoverStateUpdate();
}
void Document::activeChainNodeDetached(Node* node)
{
- if (!m_activeNode || (node != m_activeNode && (!m_activeNode->isTextNode() || node != m_activeNode->parent())))
+ if (!m_activeNode || (node != m_activeNode && (!m_activeNode->isTextNode() || node != m_activeNode->parentNode())))
return;
- m_activeNode = node->parent();
+ m_activeNode = node->parentNode();
while (m_activeNode && !m_activeNode->renderer())
- m_activeNode = m_activeNode->parent();
+ m_activeNode = m_activeNode->parentNode();
}
#if ENABLE(DASHBOARD_SUPPORT)
diff --git a/WebCore/dom/Node.h b/WebCore/dom/Node.h
index 675de04..9fcea1e 100644
--- a/WebCore/dom/Node.h
+++ b/WebCore/dom/Node.h
@@ -656,6 +656,11 @@ private:
Element* ancestorElement() const;
+ // Use Node::parentNode as the consistent way of querying a parent node.
+ // This method is made private to ensure a compiler error on call sites that
+ // don't follow this rule.
+ using TreeShared<ContainerNode>::parent;
+
void trackForDebugging();
Document* m_document;
diff --git a/WebCore/page/SpatialNavigation.cpp b/WebCore/page/SpatialNavigation.cpp
index c7bdb51..ffc65b4 100644
--- a/WebCore/page/SpatialNavigation.cpp
+++ b/WebCore/page/SpatialNavigation.cpp
@@ -626,7 +626,7 @@ bool canBeScrolledIntoView(FocusDirection direction, const FocusCandidate& candi
{
ASSERT(candidate.node && candidate.isOffscreen);
IntRect candidateRect = candidate.rect;
- for (Node* parentNode = candidate.node->parent(); parentNode; parentNode = parentNode->parent()) {
+ for (Node* parentNode = candidate.node->parentNode(); parentNode; parentNode = parentNode->parentNode()) {
IntRect parentRect = nodeRectInAbsoluteCoordinates(parentNode);
if (!candidateRect.intersects(parentRect)) {
if (((direction == FocusDirectionLeft || direction == FocusDirectionRight) && parentNode->renderer()->style()->overflowX() == OHIDDEN)
diff --git a/WebCore/xml/XSLTProcessorQt.cpp b/WebCore/xml/XSLTProcessorQt.cpp
index cbb8b39..b61025b 100644
--- a/WebCore/xml/XSLTProcessorQt.cpp
+++ b/WebCore/xml/XSLTProcessorQt.cpp
@@ -119,7 +119,7 @@ bool XSLTProcessor::transformToString(Node* sourceNode, String&, String& resultS
RefPtr<XSLStyleSheet> stylesheet = m_stylesheet;
if (!stylesheet && m_stylesheetRootNode) {
Node* node = m_stylesheetRootNode.get();
- stylesheet = XSLStyleSheet::createForXSLTProcessor(node->parent() ? node->parent() : node,
+ stylesheet = XSLStyleSheet::createForXSLTProcessor(node->parentNode() ? node->parentNode() : node,
node->document()->url().string(),
node->document()->url()); // FIXME: Should we use baseURL here?
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list