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

Side by Side Diff: third_party/WebKit/Source/core/editing/EditingUtilities.cpp

Issue 2151803003: [Editing][Regression] Contenteditable w/ "-webkit-user-select:all" should be editable for drag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update Created 4 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
OLDNEW
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 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 } 811 }
812 return nullptr; 812 return nullptr;
813 } 813 }
814 814
815 bool nodeIsUserSelectAll(const Node* node) 815 bool nodeIsUserSelectAll(const Node* node)
816 { 816 {
817 return RuntimeEnabledFeatures::userSelectAllEnabled() && node && node->layou tObject() && node->layoutObject()->style()->userSelect() == SELECT_ALL; 817 return RuntimeEnabledFeatures::userSelectAllEnabled() && node && node->layou tObject() && node->layoutObject()->style()->userSelect() == SELECT_ALL;
818 818
819 } 819 }
820 820
821 EUserSelect usedValueOfUserSelect(const Node& node)
822 {
823 if (node.isHTMLElement() && toHTMLElement(node).isTextFormControl())
824 return SELECT_TEXT;
825 if (!node.layoutObject())
826 return SELECT_NONE;
827
828 const ComputedStyle* style = node.layoutObject()->style();
829 if (style->userModify() != READ_ONLY)
830 return SELECT_TEXT;
831
832 return style->userSelect();
833 }
834
821 template <typename Strategy> 835 template <typename Strategy>
822 TextDirection directionOfEnclosingBlockAlgorithm(const PositionTemplate<Strategy >& position) 836 TextDirection directionOfEnclosingBlockAlgorithm(const PositionTemplate<Strategy >& position)
823 { 837 {
824 Element* enclosingBlockElement = enclosingBlock(PositionTemplate<Strategy>:: firstPositionInOrBeforeNode(position.computeContainerNode()), CannotCrossEditing Boundary); 838 Element* enclosingBlockElement = enclosingBlock(PositionTemplate<Strategy>:: firstPositionInOrBeforeNode(position.computeContainerNode()), CannotCrossEditing Boundary);
825 if (!enclosingBlockElement) 839 if (!enclosingBlockElement)
826 return LTR; 840 return LTR;
827 LayoutObject* layoutObject = enclosingBlockElement->layoutObject(); 841 LayoutObject* layoutObject = enclosingBlockElement->layoutObject();
828 return layoutObject ? layoutObject->style()->direction() : LTR; 842 return layoutObject ? layoutObject->style()->direction() : LTR;
829 } 843 }
830 844
(...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after
1816 { 1830 {
1817 if (!RuntimeEnabledFeatures::inputEventEnabled()) 1831 if (!RuntimeEnabledFeatures::inputEventEnabled())
1818 return DispatchEventResult::NotCanceled; 1832 return DispatchEventResult::NotCanceled;
1819 if (!target) 1833 if (!target)
1820 return DispatchEventResult::NotCanceled; 1834 return DispatchEventResult::NotCanceled;
1821 InputEvent* beforeInputEvent = InputEvent::createBeforeInput(inputType, data , InputEvent::EventCancelable::IsCancelable, InputEvent::EventIsComposing::NotCo mposing, ranges); 1835 InputEvent* beforeInputEvent = InputEvent::createBeforeInput(inputType, data , InputEvent::EventCancelable::IsCancelable, InputEvent::EventIsComposing::NotCo mposing, ranges);
1822 return target->dispatchEvent(beforeInputEvent); 1836 return target->dispatchEvent(beforeInputEvent);
1823 } 1837 }
1824 1838
1825 } // namespace blink 1839 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698