| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007 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 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 911 bool isEnclosingBlock(const Node* node) { | 911 bool isEnclosingBlock(const Node* node) { |
| 912 return node && node->layoutObject() && !node->layoutObject()->isInline() && | 912 return node && node->layoutObject() && !node->layoutObject()->isInline() && |
| 913 !node->layoutObject()->isRubyText(); | 913 !node->layoutObject()->isRubyText(); |
| 914 } | 914 } |
| 915 | 915 |
| 916 bool isInline(const Node* node) { | 916 bool isInline(const Node* node) { |
| 917 if (!node) | 917 if (!node) |
| 918 return false; | 918 return false; |
| 919 | 919 |
| 920 const ComputedStyle* style = node->computedStyle(); | 920 const ComputedStyle* style = node->computedStyle(); |
| 921 return style && style->display() == EDisplay::Inline; | 921 return style && style->display() == EDisplay::kInline; |
| 922 } | 922 } |
| 923 | 923 |
| 924 // TODO(yosin) Deploy this in all of the places where |enclosingBlockFlow()| and | 924 // TODO(yosin) Deploy this in all of the places where |enclosingBlockFlow()| and |
| 925 // |enclosingBlockFlowOrTableElement()| are used. | 925 // |enclosingBlockFlowOrTableElement()| are used. |
| 926 // TODO(yosin) Callers of |Node| version of |enclosingBlock()| should use | 926 // TODO(yosin) Callers of |Node| version of |enclosingBlock()| should use |
| 927 // |Position| version The enclosing block of [table, x] for example, should be | 927 // |Position| version The enclosing block of [table, x] for example, should be |
| 928 // the block that contains the table and not the table, and this function should | 928 // the block that contains the table and not the table, and this function should |
| 929 // be the only one responsible for knowing about these kinds of special cases. | 929 // be the only one responsible for knowing about these kinds of special cases. |
| 930 Element* enclosingBlock(Node* node, EditingBoundaryCrossingRule rule) { | 930 Element* enclosingBlock(Node* node, EditingBoundaryCrossingRule rule) { |
| 931 return enclosingBlock(firstPositionInOrBeforeNode(node), rule); | 931 return enclosingBlock(firstPositionInOrBeforeNode(node), rule); |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1059 if (!n.isHTMLElement()) | 1059 if (!n.isHTMLElement()) |
| 1060 return false; | 1060 return false; |
| 1061 | 1061 |
| 1062 if (n.isLink()) | 1062 if (n.isLink()) |
| 1063 return true; | 1063 return true; |
| 1064 | 1064 |
| 1065 LayoutObject* layoutObject = n.layoutObject(); | 1065 LayoutObject* layoutObject = n.layoutObject(); |
| 1066 if (!layoutObject) | 1066 if (!layoutObject) |
| 1067 return false; | 1067 return false; |
| 1068 | 1068 |
| 1069 if (layoutObject->style()->display() == EDisplay::Table || | 1069 if (layoutObject->style()->display() == EDisplay::kTable || |
| 1070 layoutObject->style()->display() == EDisplay::InlineTable) | 1070 layoutObject->style()->display() == EDisplay::kInlineTable) |
| 1071 return true; | 1071 return true; |
| 1072 | 1072 |
| 1073 if (layoutObject->style()->isFloating()) | 1073 if (layoutObject->style()->isFloating()) |
| 1074 return true; | 1074 return true; |
| 1075 | 1075 |
| 1076 return false; | 1076 return false; |
| 1077 } | 1077 } |
| 1078 | 1078 |
| 1079 static HTMLElement* firstInSpecialElement(const Position& pos) { | 1079 static HTMLElement* firstInSpecialElement(const Position& pos) { |
| 1080 DCHECK(!needsLayoutTreeUpdate(pos)); | 1080 DCHECK(!needsLayoutTreeUpdate(pos)); |
| (...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2177 return InputType::DeleteWordBackward; | 2177 return InputType::DeleteWordBackward; |
| 2178 if (granularity == LineBoundary) | 2178 if (granularity == LineBoundary) |
| 2179 return InputType::DeleteLineBackward; | 2179 return InputType::DeleteLineBackward; |
| 2180 return InputType::DeleteContentBackward; | 2180 return InputType::DeleteContentBackward; |
| 2181 default: | 2181 default: |
| 2182 return InputType::None; | 2182 return InputType::None; |
| 2183 } | 2183 } |
| 2184 } | 2184 } |
| 2185 | 2185 |
| 2186 } // namespace blink | 2186 } // namespace blink |
| OLD | NEW |