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

Side by Side Diff: Source/core/editing/Position.cpp

Issue 1289423005: Move a static member function hasRenderedNonAnonymousDescendantsWithHeight() out from PositionAlgori (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-19T23:25:33 Rebase Created 5 years, 4 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
« no previous file with comments | « Source/core/editing/Position.h ('k') | Source/core/editing/commands/CompositeEditCommand.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
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 789 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 } 800 }
801 801
802 return lastVisible.deprecatedComputePosition(); 802 return lastVisible.deprecatedComputePosition();
803 } 803 }
804 804
805 static int boundingBoxLogicalHeight(LayoutObject *o, const IntRect &rect) 805 static int boundingBoxLogicalHeight(LayoutObject *o, const IntRect &rect)
806 { 806 {
807 return o->style()->isHorizontalWritingMode() ? rect.height() : rect.width(); 807 return o->style()->isHorizontalWritingMode() ? rect.height() : rect.width();
808 } 808 }
809 809
810 template <typename Strategy> 810 // TODO(yosin) We should move |hasRenderedNonAnonymousDescendantsWithHeight|
811 bool PositionAlgorithm<Strategy>::hasRenderedNonAnonymousDescendantsWithHeight(L ayoutObject* layoutObject) 811 // to "VisibleUnits.cpp" to reduce |LayoutObject| dependency in "Position.cpp"
812 bool hasRenderedNonAnonymousDescendantsWithHeight(LayoutObject* layoutObject)
812 { 813 {
813 LayoutObject* stop = layoutObject->nextInPreOrderAfterChildren(); 814 LayoutObject* stop = layoutObject->nextInPreOrderAfterChildren();
814 for (LayoutObject *o = layoutObject->slowFirstChild(); o && o != stop; o = o ->nextInPreOrder()) { 815 for (LayoutObject *o = layoutObject->slowFirstChild(); o && o != stop; o = o ->nextInPreOrder()) {
815 if (o->nonPseudoNode()) { 816 if (o->nonPseudoNode()) {
816 if ((o->isText() && boundingBoxLogicalHeight(o, toLayoutText(o)->lin esBoundingBox())) 817 if ((o->isText() && boundingBoxLogicalHeight(o, toLayoutText(o)->lin esBoundingBox()))
817 || (o->isBox() && toLayoutBox(o)->pixelSnappedLogicalHeight()) 818 || (o->isBox() && toLayoutBox(o)->pixelSnappedLogicalHeight())
818 || (o->isLayoutInline() && isEmptyInline(LineLayoutItem(o)) && b oundingBoxLogicalHeight(o, toLayoutInline(o)->linesBoundingBox()))) 819 || (o->isLayoutInline() && isEmptyInline(LineLayoutItem(o)) && b oundingBoxLogicalHeight(o, toLayoutInline(o)->linesBoundingBox())))
819 return true; 820 return true;
820 } 821 }
821 } 822 }
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
1349 1350
1350 void showTree(const blink::Position* pos) 1351 void showTree(const blink::Position* pos)
1351 { 1352 {
1352 if (pos) 1353 if (pos)
1353 pos->showTreeForThis(); 1354 pos->showTreeForThis();
1354 else 1355 else
1355 fprintf(stderr, "Cannot showTree for (nil)\n"); 1356 fprintf(stderr, "Cannot showTree for (nil)\n");
1356 } 1357 }
1357 1358
1358 #endif 1359 #endif
OLDNEW
« no previous file with comments | « Source/core/editing/Position.h ('k') | Source/core/editing/commands/CompositeEditCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698