Title: [90073] trunk/Source/WebCore
- Revision
- 90073
- Author
- [email protected]
- Date
- 2011-06-29 17:30:49 -0700 (Wed, 29 Jun 2011)
Log Message
2011-06-29 Justin Garcia <[email protected]>
Reviewed by Enrica Casucci.
I forgot to include these (reviewed) style fix-ups in my previous check-in.
* editing/htmlediting.cpp:
(WebCore::indexForVisiblePosition):
(WebCore::visiblePositionForIndex):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (90072 => 90073)
--- trunk/Source/WebCore/ChangeLog 2011-06-30 00:10:53 UTC (rev 90072)
+++ trunk/Source/WebCore/ChangeLog 2011-06-30 00:30:49 UTC (rev 90073)
@@ -1,7 +1,17 @@
2011-06-29 Justin Garcia <[email protected]>
Reviewed by Enrica Casucci.
+
+ I forgot to include these (reviewed) style fix-ups in my previous check-in.
+ * editing/htmlediting.cpp:
+ (WebCore::indexForVisiblePosition):
+ (WebCore::visiblePositionForIndex):
+
+2011-06-29 Justin Garcia <[email protected]>
+
+ Reviewed by Enrica Casucci.
+
https://bugs.webkit.org/show_bug.cgi?id=62922
indexForVisiblePosition(const VisiblePosition& visiblePosition) does not consider shadow content
Modified: trunk/Source/WebCore/editing/htmlediting.cpp (90072 => 90073)
--- trunk/Source/WebCore/editing/htmlediting.cpp 2011-06-30 00:10:53 UTC (rev 90072)
+++ trunk/Source/WebCore/editing/htmlediting.cpp 2011-06-30 00:30:49 UTC (rev 90073)
@@ -1030,7 +1030,7 @@
if (shadowRoot) {
// Use the shadow root for form elements, since TextIterators will not enter shadow content.
ASSERT(shadowRoot->isElementNode());
- root = static_cast<Element *>(shadowRoot);
+ root = static_cast<Element*>(shadowRoot);
} else
root = document->documentElement();
@@ -1039,9 +1039,7 @@
*scope = root;
}
- RefPtr<Range> range = Range::create(document,
- firstPositionInNode(root),
- p.parentAnchoredEquivalent());
+ RefPtr<Range> range = Range::create(document, firstPositionInNode(root), p.parentAnchoredEquivalent());
return TextIterator::rangeLength(range.get(), true);
}
@@ -1049,7 +1047,8 @@
VisiblePosition visiblePositionForIndex(int index, Element *scope)
{
RefPtr<Range> range = TextIterator::rangeFromLocationAndLength(scope, index, 0, true);
- // indexForVisiblePosition can create a
+ // Check for an invalid index. Certain editing operations invalidate indices because
+ // of problems with TextIteratorEmitsCharactersBetweenAllVisiblePositions.
if (!range)
return VisiblePosition();
return VisiblePosition(range->startPosition());
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes