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

Unified Diff: third_party/WebKit/Source/core/editing/EditingUtilities.h

Issue 1409073004: Return EphemeralRange from Editor::findRangeOfString. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Extract text bounds collecting to a function Created 5 years, 1 month 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
Index: third_party/WebKit/Source/core/editing/EditingUtilities.h
diff --git a/third_party/WebKit/Source/core/editing/EditingUtilities.h b/third_party/WebKit/Source/core/editing/EditingUtilities.h
index c16896b51e17ce6f15be05a1de5e6b1e0b0a4f80..c478186ac81f7cbf162df12a5816f3805abd402b 100644
--- a/third_party/WebKit/Source/core/editing/EditingUtilities.h
+++ b/third_party/WebKit/Source/core/editing/EditingUtilities.h
@@ -329,6 +329,25 @@ inline bool isAmbiguousBoundaryCharacter(UChar character)
String stringWithRebalancedWhitespace(const String&, bool startIsStartOfParagraph, bool endIsEndOfParagraph);
const String& nonBreakingSpaceString();
+void collectTextBoundsInRange(
+ Node* start, int startOffset, Node* end, int endOffset, Node* firstNode, Node* stopNode, Node* (*next)(const Node&),
+ Vector<IntRect>& rects, bool useSelectionHeight = false, bool* allFixed = nullptr, bool* someFixed = nullptr);
+
+void collectTextBoundsInRange(
+ Node* start, int startOffset, Node* end, int endOffset, Node* firstNode, Node* stopNode, Node* (*next)(const Node&),
+ Vector<FloatQuad>& rects, bool useSelectionHeight = false, bool* allFixed = nullptr, bool* someFixed = nullptr);
+
+template <typename Strategy, typename BoundsType>
+void collectTextBoundsInRange(
+ const PositionTemplate<Strategy>& start, const PositionTemplate<Strategy>& end, Node* firstNode, Node* stopNode,
+ Vector<BoundsType>& bounds, bool useSelectionHeight = false, bool* allFixed = nullptr, bool* someFixed = nullptr)
+{
+ collectTextBoundsInRange(
+ start.computeContainerNode(), start.computeOffsetInContainerNode(),
+ end.computeContainerNode(), end.computeOffsetInContainerNode(), firstNode, stopNode,
+ &Strategy::next, bounds, useSelectionHeight, allFixed, someFixed);
+}
+
}
#endif

Powered by Google App Engine
This is Rietveld 408576698