Index: Source/core/dom/Position.cpp |
diff --git a/Source/core/dom/Position.cpp b/Source/core/dom/Position.cpp |
index 63fb25c95d51ace7c8bec00fa511bd12260750d0..57412cc93cbeede2e33591cd1e35d805ca413207 100644 |
--- a/Source/core/dom/Position.cpp |
+++ b/Source/core/dom/Position.cpp |
@@ -279,9 +279,9 @@ Position::AnchorType Position::anchorTypeForLegacyEditingPosition(Node* anchorNo |
Element* Position::element() const |
{ |
Node* n = anchorNode(); |
- while (n && !n->isElementNode()) |
- n = n->parentNode(); |
- return toElement(n); |
+ if (!n || n->isElementNode()) |
+ return toElement(n); |
+ return n->parentElement(); |
esprehn
2014/08/19 01:02:45
n -> node
Inactive
2014/08/19 12:51:45
Done.
|
} |
PassRefPtrWillBeRawPtr<CSSComputedStyleDeclaration> Position::computedStyle() const |