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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 return highestEditableRoot(toPositionInDOMTree(position)); | 372 return highestEditableRoot(toPositionInDOMTree(position)); |
373 } | 373 } |
374 | 374 |
375 bool isEditablePosition(const Position& position) { | 375 bool isEditablePosition(const Position& position) { |
376 Node* node = position.parentAnchoredEquivalent().anchorNode(); | 376 Node* node = position.parentAnchoredEquivalent().anchorNode(); |
377 if (!node) | 377 if (!node) |
378 return false; | 378 return false; |
379 DCHECK(node->document().isActive()); | 379 DCHECK(node->document().isActive()); |
380 if (node->document().lifecycle().state() >= | 380 if (node->document().lifecycle().state() >= |
381 DocumentLifecycle::InStyleRecalc) { | 381 DocumentLifecycle::InStyleRecalc) { |
382 // TODO(yosin): Once we change |LayoutObject::adjustStyleDifference()| | 382 // TODO(yosin): Update the condition and DCHECK here given that |
383 // not to call |FrameSelection::hasCaret()|, we should not assume | 383 // https://codereview.chromium.org/2665823002/ avoided this function from |
384 // calling |isEditablePosition()| in |InStyleRecalc| is safe. | 384 // being called during InStyleRecalc. |
385 } else { | 385 } else { |
386 DCHECK(!needsLayoutTreeUpdate(position)) << position; | 386 DCHECK(!needsLayoutTreeUpdate(position)) << position; |
387 } | 387 } |
388 | 388 |
389 if (isDisplayInsideTable(node)) | 389 if (isDisplayInsideTable(node)) |
390 node = node->parentNode(); | 390 node = node->parentNode(); |
391 | 391 |
392 if (node->isDocumentNode()) | 392 if (node->isDocumentNode()) |
393 return false; | 393 return false; |
394 return hasEditableStyle(*node); | 394 return hasEditableStyle(*node); |
(...skipping 1725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2120 return InputType::DeleteWordBackward; | 2120 return InputType::DeleteWordBackward; |
2121 if (granularity == LineBoundary) | 2121 if (granularity == LineBoundary) |
2122 return InputType::DeleteLineBackward; | 2122 return InputType::DeleteLineBackward; |
2123 return InputType::DeleteContentBackward; | 2123 return InputType::DeleteContentBackward; |
2124 default: | 2124 default: |
2125 return InputType::None; | 2125 return InputType::None; |
2126 } | 2126 } |
2127 } | 2127 } |
2128 | 2128 |
2129 } // namespace blink | 2129 } // namespace blink |
OLD | NEW |