| OLD | NEW |
| 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 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 | 737 |
| 738 if (continuesOnNextLine) | 738 if (continuesOnNextLine) |
| 739 return currentPos; | 739 return currentPos; |
| 740 } | 740 } |
| 741 } | 741 } |
| 742 } | 742 } |
| 743 | 743 |
| 744 return lastVisible; | 744 return lastVisible; |
| 745 } | 745 } |
| 746 | 746 |
| 747 static int boundingBoxLogicalHeight(RenderObject *o, const IntRect &rect) | |
| 748 { | |
| 749 return o->style()->isHorizontalWritingMode() ? rect.height() : rect.width(); | |
| 750 } | |
| 751 | |
| 752 bool Position::hasRenderedNonAnonymousDescendantsWithHeight(RenderObject* render
er) | 747 bool Position::hasRenderedNonAnonymousDescendantsWithHeight(RenderObject* render
er) |
| 753 { | 748 { |
| 754 RenderObject* stop = renderer->nextInPreOrderAfterChildren(); | 749 RenderObject* stop = renderer->nextInPreOrderAfterChildren(); |
| 755 for (RenderObject *o = renderer->slowFirstChild(); o && o != stop; o = o->ne
xtInPreOrder()) | 750 for (RenderObject *o = renderer->slowFirstChild(); o && o != stop; o = o->ne
xtInPreOrder()) |
| 756 if (o->nonPseudoNode()) { | 751 if (o->nonPseudoNode()) { |
| 757 if ((o->isText() && boundingBoxLogicalHeight(o, toRenderText(o)->lin
esBoundingBox())) | 752 if ((o->isText() && toRenderText(o)->linesBoundingBox().height()) |
| 758 || (o->isBox() && toRenderBox(o)->pixelSnappedLogicalHeight()) | 753 || (o->isBox() && toRenderBox(o)->pixelSnappedLogicalHeight()) |
| 759 || (o->isRenderInline() && isEmptyInline(o) && boundingBoxLogica
lHeight(o, toRenderInline(o)->linesBoundingBox()))) | 754 || (o->isRenderInline() && isEmptyInline(o) && toRenderInline(o)
->linesBoundingBox().height())) |
| 760 return true; | 755 return true; |
| 761 } | 756 } |
| 762 return false; | 757 return false; |
| 763 } | 758 } |
| 764 | 759 |
| 765 bool Position::nodeIsUserSelectNone(Node* node) | 760 bool Position::nodeIsUserSelectNone(Node* node) |
| 766 { | 761 { |
| 767 return node && node->renderer() && !node->renderer()->isSelectable(); | 762 return node && node->renderer() && !node->renderer()->isSelectable(); |
| 768 } | 763 } |
| 769 | 764 |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1245 pos.showTreeForThis(); | 1240 pos.showTreeForThis(); |
| 1246 } | 1241 } |
| 1247 | 1242 |
| 1248 void showTree(const blink::Position* pos) | 1243 void showTree(const blink::Position* pos) |
| 1249 { | 1244 { |
| 1250 if (pos) | 1245 if (pos) |
| 1251 pos->showTreeForThis(); | 1246 pos->showTreeForThis(); |
| 1252 } | 1247 } |
| 1253 | 1248 |
| 1254 #endif | 1249 #endif |
| OLD | NEW |