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

Side by Side Diff: sky/engine/core/dom/Position.cpp

Issue 688213002: First pass at removing dead vertical writing mode code. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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 unified diff | Download patch
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 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « sky/engine/core/css/resolver/FontBuilder.cpp ('k') | sky/engine/core/editing/VisiblePosition.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698