| 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 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1211 VisiblePosition visiblePositionAfterNode(Node& node) { | 1211 VisiblePosition visiblePositionAfterNode(Node& node) { |
| 1212 DCHECK(!needsLayoutTreeUpdate(node)); | 1212 DCHECK(!needsLayoutTreeUpdate(node)); |
| 1213 if (node.hasChildren()) | 1213 if (node.hasChildren()) |
| 1214 return createVisiblePosition(lastPositionInOrAfterNode(&node)); | 1214 return createVisiblePosition(lastPositionInOrAfterNode(&node)); |
| 1215 DCHECK(node.parentNode()) << node.parentNode(); | 1215 DCHECK(node.parentNode()) << node.parentNode(); |
| 1216 DCHECK(!node.parentNode()->isShadowRoot()) << node.parentNode(); | 1216 DCHECK(!node.parentNode()->isShadowRoot()) << node.parentNode(); |
| 1217 return VisiblePosition::inParentAfterNode(node); | 1217 return VisiblePosition::inParentAfterNode(node); |
| 1218 } | 1218 } |
| 1219 | 1219 |
| 1220 bool isHTMLListElement(Node* n) { | 1220 bool isHTMLListElement(Node* n) { |
| 1221 return (n && (isHTMLUListElement(*n) || isHTMLOListElement(*n) || | 1221 return (n && |
| 1222 isHTMLDListElement(*n))); | 1222 (isHTMLUListElement(*n) || isHTMLOListElement(*n) || |
| 1223 isHTMLDListElement(*n))); |
| 1223 } | 1224 } |
| 1224 | 1225 |
| 1225 bool isListItem(const Node* n) { | 1226 bool isListItem(const Node* n) { |
| 1226 return n && n->layoutObject() && n->layoutObject()->isListItem(); | 1227 return n && n->layoutObject() && n->layoutObject()->isListItem(); |
| 1227 } | 1228 } |
| 1228 | 1229 |
| 1229 bool isPresentationalHTMLElement(const Node* node) { | 1230 bool isPresentationalHTMLElement(const Node* node) { |
| 1230 if (!node->isHTMLElement()) | 1231 if (!node->isHTMLElement()) |
| 1231 return false; | 1232 return false; |
| 1232 | 1233 |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1462 DCHECK(!needsLayoutTreeUpdate(*firstList)); | 1463 DCHECK(!needsLayoutTreeUpdate(*firstList)); |
| 1463 DCHECK(!needsLayoutTreeUpdate(*secondList)); | 1464 DCHECK(!needsLayoutTreeUpdate(*secondList)); |
| 1464 return firstList->hasTagName( | 1465 return firstList->hasTagName( |
| 1465 secondList | 1466 secondList |
| 1466 ->tagQName()) // make sure the list types match (ol vs. ul) | 1467 ->tagQName()) // make sure the list types match (ol vs. ul) |
| 1467 && hasEditableStyle(*firstList) && | 1468 && hasEditableStyle(*firstList) && |
| 1468 hasEditableStyle(*secondList) // both lists are editable | 1469 hasEditableStyle(*secondList) // both lists are editable |
| 1469 && | 1470 && |
| 1470 rootEditableElement(*firstList) == | 1471 rootEditableElement(*firstList) == |
| 1471 rootEditableElement(*secondList) // don't cross editing boundaries | 1472 rootEditableElement(*secondList) // don't cross editing boundaries |
| 1472 && isVisiblyAdjacent(Position::inParentAfterNode(*firstList), | 1473 && |
| 1473 Position::inParentBeforeNode(*secondList)); | 1474 isVisiblyAdjacent(Position::inParentAfterNode(*firstList), |
| 1475 Position::inParentBeforeNode(*secondList)); |
| 1474 // Make sure there is no visible content between this li and the previous list | 1476 // Make sure there is no visible content between this li and the previous list |
| 1475 } | 1477 } |
| 1476 | 1478 |
| 1477 bool isDisplayInsideTable(const Node* node) { | 1479 bool isDisplayInsideTable(const Node* node) { |
| 1478 if (!node || !node->isElementNode()) | 1480 if (!node || !node->isElementNode()) |
| 1479 return false; | 1481 return false; |
| 1480 | 1482 |
| 1481 LayoutObject* layoutObject = node->layoutObject(); | 1483 LayoutObject* layoutObject = node->layoutObject(); |
| 1482 return (layoutObject && layoutObject->isTable()); | 1484 return (layoutObject && layoutObject->isTable()); |
| 1483 } | 1485 } |
| (...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2129 return InputType::DeleteWordBackward; | 2131 return InputType::DeleteWordBackward; |
| 2130 if (granularity == LineBoundary) | 2132 if (granularity == LineBoundary) |
| 2131 return InputType::DeleteLineBackward; | 2133 return InputType::DeleteLineBackward; |
| 2132 return InputType::DeleteContentBackward; | 2134 return InputType::DeleteContentBackward; |
| 2133 default: | 2135 default: |
| 2134 return InputType::None; | 2136 return InputType::None; |
| 2135 } | 2137 } |
| 2136 } | 2138 } |
| 2137 | 2139 |
| 2138 } // namespace blink | 2140 } // namespace blink |
| OLD | NEW |