https://bugs.webkit.org/show_bug.cgi?id=129408
Reviewed by Ryosuke Niwa.
When WebKit clients (such as Mail) call WKWebArchiveCreateFromRange() with a range,
that range is not necessarily canonicalized. Therefore, comparing it for equality
with a canonicalized range might return a false negative. Instead, we should compare
canonicalized ranges.
No new tests because this codepath will only be reached via SPI.
* editing/markup.cpp:
(WebCore::createMarkupInternal):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@164763
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-02-26 Myles C. Maxfield <mmaxfield@apple.com>
+
+ Ranges given to createMarkupInternal might not be canonicalized
+ https://bugs.webkit.org/show_bug.cgi?id=129408
+
+ Reviewed by Ryosuke Niwa.
+
+ When WebKit clients (such as Mail) call WKWebArchiveCreateFromRange() with a range,
+ that range is not necessarily canonicalized. Therefore, comparing it for equality
+ with a canonicalized range might return a false negative. Instead, we should compare
+ canonicalized ranges.
+
+ No new tests because this codepath will only be reached via SPI.
+
+ * editing/markup.cpp:
+ (WebCore::createMarkupInternal):
+
2014-02-26 Enrica Casucci <enrica@apple.com>
[iOS WebKit2] Form controls handling: implement date and time controls.
Node* body = enclosingNodeWithTag(firstPositionInNode(commonAncestor), bodyTag);
Node* fullySelectedRoot = 0;
// FIXME: Do this for all fully selected blocks, not just the body.
- if (body && areRangesEqual(VisibleSelection::selectionFromContentsOfNode(body).toNormalizedRange().get(), &range))
+ if (body && VisiblePosition(firstPositionInNode(body)) == VisiblePosition(range.startPosition())
+ && VisiblePosition(lastPositionInNode(body)) == VisiblePosition(range.endPosition()))
fullySelectedRoot = body;
Node* specialCommonAncestor = highestAncestorToWrapMarkup(&updatedRange, shouldAnnotate);