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

Side by Side Diff: third_party/WebKit/Source/core/editing/VisibleUnits.cpp

Issue 1922223003: Change linesBoundingBox to return LayoutRect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 2141 matching lines...) Expand 10 before | Expand all | Expand 10 after
2152 LayoutRect localCaretRectOfPosition(const PositionWithAffinity& position, Layout Object*& layoutObject) 2152 LayoutRect localCaretRectOfPosition(const PositionWithAffinity& position, Layout Object*& layoutObject)
2153 { 2153 {
2154 return localCaretRectOfPositionTemplate<EditingStrategy>(position, layoutObj ect); 2154 return localCaretRectOfPositionTemplate<EditingStrategy>(position, layoutObj ect);
2155 } 2155 }
2156 2156
2157 LayoutRect localCaretRectOfPosition(const PositionInFlatTreeWithAffinity& positi on, LayoutObject*& layoutObject) 2157 LayoutRect localCaretRectOfPosition(const PositionInFlatTreeWithAffinity& positi on, LayoutObject*& layoutObject)
2158 { 2158 {
2159 return localCaretRectOfPositionTemplate<EditingInFlatTreeStrategy>(position, layoutObject); 2159 return localCaretRectOfPositionTemplate<EditingInFlatTreeStrategy>(position, layoutObject);
2160 } 2160 }
2161 2161
2162 static int boundingBoxLogicalHeight(LayoutObject *o, const IntRect &rect) 2162 static LayoutUnit boundingBoxLogicalHeight(LayoutObject *o, const LayoutRect& re ct)
2163 { 2163 {
2164 return o->style()->isHorizontalWritingMode() ? rect.height() : rect.width(); 2164 return o->style()->isHorizontalWritingMode() ? rect.height() : rect.width();
2165 } 2165 }
2166 2166
2167 bool hasRenderedNonAnonymousDescendantsWithHeight(LayoutObject* layoutObject) 2167 bool hasRenderedNonAnonymousDescendantsWithHeight(LayoutObject* layoutObject)
2168 { 2168 {
2169 LayoutObject* stop = layoutObject->nextInPreOrderAfterChildren(); 2169 LayoutObject* stop = layoutObject->nextInPreOrderAfterChildren();
2170 for (LayoutObject *o = layoutObject->slowFirstChild(); o && o != stop; o = o ->nextInPreOrder()) { 2170 for (LayoutObject *o = layoutObject->slowFirstChild(); o && o != stop; o = o ->nextInPreOrder()) {
2171 if (o->nonPseudoNode()) { 2171 if (o->nonPseudoNode()) {
2172 if ((o->isText() && boundingBoxLogicalHeight(o, toLayoutText(o)->lin esBoundingBox())) 2172 if ((o->isText() && boundingBoxLogicalHeight(o, toLayoutText(o)->lin esBoundingBox()))
(...skipping 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after
3258 { 3258 {
3259 return previousPositionOfAlgorithm<EditingStrategy>(visiblePosition, rule); 3259 return previousPositionOfAlgorithm<EditingStrategy>(visiblePosition, rule);
3260 } 3260 }
3261 3261
3262 VisiblePositionInFlatTree previousPositionOf(const VisiblePositionInFlatTree& vi siblePosition, EditingBoundaryCrossingRule rule) 3262 VisiblePositionInFlatTree previousPositionOf(const VisiblePositionInFlatTree& vi siblePosition, EditingBoundaryCrossingRule rule)
3263 { 3263 {
3264 return previousPositionOfAlgorithm<EditingInFlatTreeStrategy>(visiblePositio n, rule); 3264 return previousPositionOfAlgorithm<EditingInFlatTreeStrategy>(visiblePositio n, rule);
3265 } 3265 }
3266 3266
3267 } // namespace blink 3267 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/ContainerNode.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutInline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698