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

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

Issue 1302713002: Move computeInlineBoxPosition() out from VisiblePosition (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-19T13:39:17 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/VisiblePosition.h ('k') | no next file » | 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, 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 955 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 if (!node) 966 if (!node)
967 return VisiblePosition(); 967 return VisiblePosition();
968 968
969 node->document().updateLayoutIgnorePendingStylesheets(); 969 node->document().updateLayoutIgnorePendingStylesheets();
970 970
971 LayoutObject* layoutObject = node->layoutObject(); 971 LayoutObject* layoutObject = node->layoutObject();
972 if (!layoutObject) 972 if (!layoutObject)
973 return VisiblePosition(); 973 return VisiblePosition();
974 974
975 RootInlineBox* root = 0; 975 RootInlineBox* root = 0;
976 InlineBox* box = visiblePosition.computeInlineBoxPosition().inlineBox; 976 InlineBox* box = computeInlineBoxPosition(visiblePosition).inlineBox;
977 if (box) { 977 if (box) {
978 root = box->root().prevRootBox(); 978 root = box->root().prevRootBox();
979 // We want to skip zero height boxes. 979 // We want to skip zero height boxes.
980 // This could happen in case it is a TrailingFloatsRootInlineBox. 980 // This could happen in case it is a TrailingFloatsRootInlineBox.
981 if (!root || !root->logicalHeight() || !root->firstLeafChild()) 981 if (!root || !root->logicalHeight() || !root->firstLeafChild())
982 root = 0; 982 root = 0;
983 } 983 }
984 984
985 if (!root) { 985 if (!root) {
986 Position position = previousRootInlineBoxCandidatePosition(node, visible Position, editableType); 986 Position position = previousRootInlineBoxCandidatePosition(node, visible Position, editableType);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
1019 if (!node) 1019 if (!node)
1020 return VisiblePosition(); 1020 return VisiblePosition();
1021 1021
1022 node->document().updateLayoutIgnorePendingStylesheets(); 1022 node->document().updateLayoutIgnorePendingStylesheets();
1023 1023
1024 LayoutObject* layoutObject = node->layoutObject(); 1024 LayoutObject* layoutObject = node->layoutObject();
1025 if (!layoutObject) 1025 if (!layoutObject)
1026 return VisiblePosition(); 1026 return VisiblePosition();
1027 1027
1028 RootInlineBox* root = 0; 1028 RootInlineBox* root = 0;
1029 InlineBox* box = visiblePosition.computeInlineBoxPosition().inlineBox; 1029 InlineBox* box = computeInlineBoxPosition(visiblePosition).inlineBox;
1030 if (box) { 1030 if (box) {
1031 root = box->root().nextRootBox(); 1031 root = box->root().nextRootBox();
1032 // We want to skip zero height boxes. 1032 // We want to skip zero height boxes.
1033 // This could happen in case it is a TrailingFloatsRootInlineBox. 1033 // This could happen in case it is a TrailingFloatsRootInlineBox.
1034 if (!root || !root->logicalHeight() || !root->firstLeafChild()) 1034 if (!root || !root->logicalHeight() || !root->firstLeafChild())
1035 root = 0; 1035 root = 0;
1036 } 1036 }
1037 1037
1038 if (!root) { 1038 if (!root) {
1039 // FIXME: We need do the same in previousLinePosition. 1039 // FIXME: We need do the same in previousLinePosition.
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
1595 1595
1596 if (previousRenderedEditable(position1.anchorNode()) == position2.anchorNode () 1596 if (previousRenderedEditable(position1.anchorNode()) == position2.anchorNode ()
1597 && !renderedOffset1 && renderedOffset2 == caretMaxOffset(position2.ancho rNode())) { 1597 && !renderedOffset1 && renderedOffset2 == caretMaxOffset(position2.ancho rNode())) {
1598 return false; 1598 return false;
1599 } 1599 }
1600 1600
1601 return true; 1601 return true;
1602 } 1602 }
1603 1603
1604 } 1604 }
OLDNEW
« no previous file with comments | « Source/core/editing/VisiblePosition.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698