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 11 matching lines...) Expand all Loading... |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #include "core/editing/EditingUtilities.h" | 26 #include "core/editing/EditingUtilities.h" |
27 | 27 |
28 #include "core/HTMLElementFactory.h" | 28 #include "core/HTMLElementFactory.h" |
29 #include "core/HTMLNames.h" | 29 #include "core/HTMLNames.h" |
30 #include "core/dom/Document.h" | 30 #include "core/dom/Document.h" |
31 #include "core/dom/ElementTraversal.h" | 31 #include "core/dom/ElementTraversal.h" |
| 32 #include "core/dom/NodeComputedStyle.h" |
32 #include "core/dom/Range.h" | 33 #include "core/dom/Range.h" |
33 #include "core/dom/Text.h" | 34 #include "core/dom/Text.h" |
34 #include "core/dom/shadow/ShadowRoot.h" | 35 #include "core/dom/shadow/ShadowRoot.h" |
35 #include "core/editing/EditingStrategy.h" | 36 #include "core/editing/EditingStrategy.h" |
36 #include "core/editing/Editor.h" | 37 #include "core/editing/Editor.h" |
37 #include "core/editing/PlainTextRange.h" | 38 #include "core/editing/PlainTextRange.h" |
38 #include "core/editing/PositionIterator.h" | 39 #include "core/editing/PositionIterator.h" |
39 #include "core/editing/VisiblePosition.h" | 40 #include "core/editing/VisiblePosition.h" |
40 #include "core/editing/VisibleSelection.h" | 41 #include "core/editing/VisibleSelection.h" |
41 #include "core/editing/VisibleUnits.h" | 42 #include "core/editing/VisibleUnits.h" |
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
757 return nextPositionOfAlgorithm<EditingInFlatTreeStrategy>(position, moveType
); | 758 return nextPositionOfAlgorithm<EditingInFlatTreeStrategy>(position, moveType
); |
758 } | 759 } |
759 | 760 |
760 bool isEnclosingBlock(const Node* node) | 761 bool isEnclosingBlock(const Node* node) |
761 { | 762 { |
762 return node && node->layoutObject() && !node->layoutObject()->isInline() &&
!node->layoutObject()->isRubyText(); | 763 return node && node->layoutObject() && !node->layoutObject()->isInline() &&
!node->layoutObject()->isRubyText(); |
763 } | 764 } |
764 | 765 |
765 bool isInline(const Node* node) | 766 bool isInline(const Node* node) |
766 { | 767 { |
767 return node && node->layoutObject() && node->layoutObject()->isInline(); | 768 return node && node->computedStyle()->display() == INLINE; |
768 } | 769 } |
769 | 770 |
770 // TODO(yosin) Deploy this in all of the places where |enclosingBlockFlow()| and | 771 // TODO(yosin) Deploy this in all of the places where |enclosingBlockFlow()| and |
771 // |enclosingBlockFlowOrTableElement()| are used. | 772 // |enclosingBlockFlowOrTableElement()| are used. |
772 // TODO(yosin) Callers of |Node| version of |enclosingBlock()| should use | 773 // TODO(yosin) Callers of |Node| version of |enclosingBlock()| should use |
773 // |Position| version The enclosing block of [table, x] for example, should be | 774 // |Position| version The enclosing block of [table, x] for example, should be |
774 // the block that contains the table and not the table, and this function should | 775 // the block that contains the table and not the table, and this function should |
775 // be the only one responsible for knowing about these kinds of special cases. | 776 // be the only one responsible for knowing about these kinds of special cases. |
776 Element* enclosingBlock(Node* node, EditingBoundaryCrossingRule rule) | 777 Element* enclosingBlock(Node* node, EditingBoundaryCrossingRule rule) |
777 { | 778 { |
(...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1811 { | 1812 { |
1812 if (!RuntimeEnabledFeatures::inputEventEnabled()) | 1813 if (!RuntimeEnabledFeatures::inputEventEnabled()) |
1813 return DispatchEventResult::NotCanceled; | 1814 return DispatchEventResult::NotCanceled; |
1814 if (!target) | 1815 if (!target) |
1815 return DispatchEventResult::NotCanceled; | 1816 return DispatchEventResult::NotCanceled; |
1816 InputEvent* beforeInputEvent = InputEvent::createBeforeInput(inputType, data
, InputEvent::EventCancelable::IsCancelable, InputEvent::EventIsComposing::NotCo
mposing, ranges); | 1817 InputEvent* beforeInputEvent = InputEvent::createBeforeInput(inputType, data
, InputEvent::EventCancelable::IsCancelable, InputEvent::EventIsComposing::NotCo
mposing, ranges); |
1817 return target->dispatchEvent(beforeInputEvent); | 1818 return target->dispatchEvent(beforeInputEvent); |
1818 } | 1819 } |
1819 | 1820 |
1820 } // namespace blink | 1821 } // namespace blink |
OLD | NEW |