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

Unified Diff: third_party/WebKit/WebCore/rendering/RenderText.cpp

Issue 10670: Do another merge using nifty new merge script (CL for that coming soon). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 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/WebCore/rendering/RenderText.cpp
===================================================================
--- third_party/WebKit/WebCore/rendering/RenderText.cpp (revision 5296)
+++ third_party/WebKit/WebCore/rendering/RenderText.cpp (working copy)
@@ -241,6 +241,49 @@
}
}
+void RenderText::absoluteQuads(Vector<FloatQuad>& quads, bool topLevel)
+{
+ for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox())
+ quads.append(localToAbsoluteQuad(FloatRect(box->xPos(), box->yPos(), box->width(), box->height())));
+}
+
+void RenderText::collectAbsoluteLineBoxQuads(Vector<FloatQuad>& quads, unsigned start, unsigned end, bool useSelectionHeight)
+{
+ // Work around signed/unsigned issues. This function takes unsigneds, and is often passed UINT_MAX
+ // to mean "all the way to the end". InlineTextBox coordinates are unsigneds, so changing this
+ // function to take ints causes various internal mismatches. But selectionRect takes ints, and
+ // passing UINT_MAX to it causes trouble. Ideally we'd change selectionRect to take unsigneds, but
+ // that would cause many ripple effects, so for now we'll just clamp our unsigned parameters to INT_MAX.
+ ASSERT(end == UINT_MAX || end <= INT_MAX);
+ ASSERT(start <= INT_MAX);
+ start = min(start, static_cast<unsigned>(INT_MAX));
+ end = min(end, static_cast<unsigned>(INT_MAX));
+
+ for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) {
+ // Note: box->end() returns the index of the last character, not the index past it
+ if (start <= box->start() && box->end() < end) {
+ IntRect r = IntRect(box->xPos(), box->yPos(), box->width(), box->height());
+ if (useSelectionHeight) {
+ IntRect selectionRect = box->selectionRect(0, 0, start, end);
+ r.setHeight(selectionRect.height());
+ r.setY(selectionRect.y());
+ }
+ quads.append(localToAbsoluteQuad(FloatRect(r)));
+ } else {
+ unsigned realEnd = min(box->end() + 1, end);
+ IntRect r = box->selectionRect(0, 0, start, realEnd);
+ if (!r.isEmpty()) {
+ if (!useSelectionHeight) {
+ // change the height and y position because selectionRect uses selection-specific values
+ r.setHeight(box->height());
+ r.setY(box->yPos());
+ }
+ quads.append(localToAbsoluteQuad(FloatRect(r)));
+ }
+ }
+ }
+}
+
InlineTextBox* RenderText::findNextInlineTextBox(int offset, int& pos) const
{
// The text runs point to parts of the RenderText's m_text
« no previous file with comments | « third_party/WebKit/WebCore/rendering/RenderText.h ('k') | third_party/WebKit/WebCore/rendering/RenderView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698