Commit 22af8ec0 authored by sigbjornf@opera.com's avatar sigbjornf@opera.com

Oilpan: update remaining Document uses of RefPtr<Node>s.

Made hoverNode()/setHoveNode() private accessors while converting over
remaining PassRefPtr<Node>/RefPtr<Node> uses to transition types.

R=tkent@chromium.org
BUG=357163

Review URL: https://codereview.chromium.org/311053003

git-svn-id: svn://svn.chromium.org/blink/trunk@175470 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 8ed3b5c1
......@@ -913,10 +913,10 @@ PassRefPtrWillBeRawPtr<Text> Document::createEditingTextNode(const String& text)
return Text::createEditingText(*this, text);
}
bool Document::importContainerNodeChildren(ContainerNode* oldContainerNode, PassRefPtr<ContainerNode> newContainerNode, ExceptionState& exceptionState)
bool Document::importContainerNodeChildren(ContainerNode* oldContainerNode, PassRefPtrWillBeRawPtr<ContainerNode> newContainerNode, ExceptionState& exceptionState)
{
for (Node* oldChild = oldContainerNode->firstChild(); oldChild; oldChild = oldChild->nextSibling()) {
RefPtr<Node> newChild = importNode(oldChild, true, exceptionState);
RefPtrWillBeRawPtr<Node> newChild = importNode(oldChild, true, exceptionState);
if (exceptionState.hadException())
return false;
newContainerNode->appendChild(newChild.release(), exceptionState);
......@@ -2434,9 +2434,9 @@ HTMLElement* Document::body() const
return 0;
}
void Document::setBody(PassRefPtr<HTMLElement> prpNewBody, ExceptionState& exceptionState)
void Document::setBody(PassRefPtrWillBeRawPtr<HTMLElement> prpNewBody, ExceptionState& exceptionState)
{
RefPtr<HTMLElement> newBody = prpNewBody;
RefPtrWillBeRawPtr<HTMLElement> newBody = prpNewBody;
if (!newBody) {
exceptionState.throwDOMException(HierarchyRequestError, ExceptionMessages::argumentNullOrIncorrectType(1, "HTMLElement"));
......@@ -3463,7 +3463,7 @@ void Document::styleResolverMayHaveChanged()
styleResolverChanged(hasNodesWithPlaceholderStyle() ? FullStyleUpdate : AnalyzedStyleUpdate);
}
void Document::setHoverNode(PassRefPtr<Node> newHoverNode)
void Document::setHoverNode(PassRefPtrWillBeRawPtr<Node> newHoverNode)
{
m_hoverNode = newHoverNode;
}
......@@ -5452,7 +5452,7 @@ void Document::updateHoverActiveState(const HitTestRequest& request, Element* in
// at the time the mouse went down.
bool mustBeInActiveChain = request.active() && request.move();
RefPtr<Node> oldHoverNode = hoverNode();
RefPtrWillBeRawPtr<Node> oldHoverNode = hoverNode();
// Check to see if the hovered node has changed.
// If it hasn't, we do not need to do anything.
......@@ -5469,10 +5469,10 @@ void Document::updateHoverActiveState(const HitTestRequest& request, Element* in
// Locate the common ancestor render object for the two renderers.
RenderObject* ancestor = nearestCommonHoverAncestor(oldHoverObj, newHoverObj);
RefPtr<Node> ancestorNode(ancestor ? ancestor->node() : 0);
RefPtrWillBeRawPtr<Node> ancestorNode(ancestor ? ancestor->node() : 0);
Vector<RefPtr<Node>, 32> nodesToRemoveFromChain;
Vector<RefPtr<Node>, 32> nodesToAddToChain;
WillBeHeapVector<RefPtrWillBeMember<Node>, 32> nodesToRemoveFromChain;
WillBeHeapVector<RefPtrWillBeMember<Node>, 32> nodesToAddToChain;
if (oldHoverObj != newHoverObj) {
// If the old hovered node is not nil but it's renderer is, it was probably detached as part of the :hover style
......
......@@ -643,9 +643,6 @@ public:
void setAutofocusElement(Element*);
Element* autofocusElement() const { return m_autofocusElement.get(); }
void setHoverNode(PassRefPtr<Node>);
Node* hoverNode() const { return m_hoverNode.get(); }
void setActiveHoverElement(PassRefPtrWillBeRawPtr<Element>);
Element* activeHoverElement() const { return m_activeHoverElement.get(); }
......@@ -796,7 +793,7 @@ public:
static bool hasValidNamespaceForAttributes(const QualifiedName&);
HTMLElement* body() const;
void setBody(PassRefPtr<HTMLElement>, ExceptionState&);
void setBody(PassRefPtrWillBeRawPtr<HTMLElement>, ExceptionState&);
HTMLHeadElement* head() const;
......@@ -1092,7 +1089,7 @@ protected:
virtual PassRefPtrWillBeRawPtr<Document> cloneDocumentWithoutChildren();
bool importContainerNodeChildren(ContainerNode* oldContainerNode, PassRefPtr<ContainerNode> newContainerNode, ExceptionState&);
bool importContainerNodeChildren(ContainerNode* oldContainerNode, PassRefPtrWillBeRawPtr<ContainerNode> newContainerNode, ExceptionState&);
void lockCompatibilityMode() { m_compatibilityModeLocked = true; }
private:
......@@ -1186,6 +1183,9 @@ private:
bool haveStylesheetsLoaded() const;
void setHoverNode(PassRefPtrWillBeRawPtr<Node>);
Node* hoverNode() const { return m_hoverNode.get(); }
typedef HashSet<EventFactoryBase*> EventFactorySet;
static EventFactorySet& eventFactories();
......
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