Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(800)

Unified Diff: Source/core/html/HTMLElement.cpp

Issue 22043003: [oilpan] Handlify childrenChanged. (Closed) Base URL: svn://svn.chromium.org/blink/branches/oilpan
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/HTMLElement.h ('k') | Source/core/html/HTMLFieldSetElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLElement.cpp
diff --git a/Source/core/html/HTMLElement.cpp b/Source/core/html/HTMLElement.cpp
index 7120402cb9b42b0a4b3579eb5dabe009acfc3a13..5fc898aab6f96aa12ba9ba09837b775a550848f1 100644
--- a/Source/core/html/HTMLElement.cpp
+++ b/Source/core/html/HTMLElement.cpp
@@ -796,7 +796,7 @@ static void setHasDirAutoFlagRecursively(Node* firstNode, bool flag, Node* lastN
}
}
-void HTMLElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
+void HTMLElement::childrenChanged(bool changedByParser, const Handle<Node>& beforeChange, const Handle<Node>& afterChange, int childCountDelta)
{
StyledElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
@@ -844,14 +844,14 @@ TextDirection HTMLElement::directionalityIfhasDirAutoAttribute(bool& isAuto) con
return directionality();
}
-TextDirection HTMLElement::directionality(Node** strongDirectionalityTextNode) const
+TextDirection HTMLElement::directionality(Handle<Node>* strongDirectionalityTextNode) const
haraken 2013/08/06 01:32:50 Could you change Handle<Node>* to Handle<Node>& ?
{
if (isHTMLTextFormControlElement(this)) {
Handle<HTMLTextFormControlElement> textElement = toHTMLTextFormControlElement(const_cast<HTMLElement*>(this));
bool hasStrongDirectionality;
Unicode::Direction textDirection = textElement->value().defaultWritingDirection(&hasStrongDirectionality);
if (strongDirectionalityTextNode)
- *strongDirectionalityTextNode = hasStrongDirectionality ? textElement.raw() : 0;
+ *strongDirectionalityTextNode = hasStrongDirectionality ? textElement : nullptr;
return (textDirection == Unicode::LeftToRight) ? LTR : RTL;
}
@@ -878,14 +878,14 @@ TextDirection HTMLElement::directionality(Node** strongDirectionalityTextNode) c
WTF::Unicode::Direction textDirection = node->textContent(true).defaultWritingDirection(&hasStrongDirectionality);
if (hasStrongDirectionality) {
if (strongDirectionalityTextNode)
- *strongDirectionalityTextNode = node;
+ *strongDirectionalityTextNode = adoptRawResult(node);
return (textDirection == WTF::Unicode::LeftToRight) ? LTR : RTL;
}
}
node = NodeTraversal::next(node, this);
}
if (strongDirectionalityTextNode)
- *strongDirectionalityTextNode = 0;
+ *strongDirectionalityTextNode = nullptr;
return LTR;
}
@@ -903,8 +903,7 @@ void HTMLElement::dirAttributeChanged(const AtomicString& value)
void HTMLElement::adjustDirectionalityIfNeededAfterChildAttributeChanged(Element* child)
{
ASSERT(selfOrAncestorHasDirAutoAttribute());
- Node* strongDirectionalityTextNode;
- TextDirection textDirection = directionality(&strongDirectionalityTextNode);
+ TextDirection textDirection = directionality();
setHasDirAutoFlagRecursively(child, false);
if (renderer() && renderer()->style() && renderer()->style()->direction() != textDirection) {
Element* elementToAdjust = this;
@@ -919,9 +918,9 @@ void HTMLElement::adjustDirectionalityIfNeededAfterChildAttributeChanged(Element
void HTMLElement::calculateAndAdjustDirectionality()
{
- Node* strongDirectionalityTextNode;
+ Handle<Node> strongDirectionalityTextNode;
TextDirection textDirection = directionality(&strongDirectionalityTextNode);
- setHasDirAutoFlagRecursively(this, true, strongDirectionalityTextNode);
+ setHasDirAutoFlagRecursively(this, true, strongDirectionalityTextNode.raw());
if (renderer() && renderer()->style() && renderer()->style()->direction() != textDirection)
setNeedsStyleRecalc();
}
« no previous file with comments | « Source/core/html/HTMLElement.h ('k') | Source/core/html/HTMLFieldSetElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698