Changeset 207244 in webkit
- Timestamp:
- Oct 12, 2016 2:49:10 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r207239 r207244 1 2016-10-12 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Add experimental support for the "formatForeColor" inputType 4 https://bugs.webkit.org/show_bug.cgi?id=163348 5 <rdar://problem/28739334> 6 7 Reviewed by Ryosuke Niwa. 8 9 Adds a new test verifying that input events with inputType "formatForeColor" are dispatched when changing 10 foreground color, and that their data attributes are as expected. 11 12 * fast/events/input-events-forecolor-data-expected.txt: Added. 13 * fast/events/input-events-forecolor-data.html: Added. 14 * platform/ios-simulator/TestExpectations: 15 1 16 2016-10-12 Yusuke Suzuki <utatane.tea@gmail.com> 2 17 -
trunk/LayoutTests/platform/ios-simulator/TestExpectations
r207180 r207244 1209 1209 fast/events/input-events-paste-data.html [ Failure ] 1210 1210 fast/events/input-events-typing-data.html [ Failure ] 1211 fast/events/input-events-forecolor-data.html [ Failure ] 1211 1212 fast/events/before-input-events-prevent-default.html [ Failure ] 1212 1213 fast/events/before-input-events-prevent-default-in-textfield.html [ Failure ] -
trunk/Source/WebCore/ChangeLog
r207243 r207244 1 2016-10-12 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Add experimental support for the "formatForeColor" inputType 4 https://bugs.webkit.org/show_bug.cgi?id=163348 5 <rdar://problem/28739334> 6 7 Reviewed by Ryosuke Niwa. 8 9 Adds support for the "formatForeColor" attribute. This patch introduces a simple hook in Editor.cpp to extract 10 data for an input event from an EditingStyle when performing an editing action. 11 12 Test: fast/events/input-events-forecolor-data.html 13 14 * editing/EditCommand.cpp: 15 (WebCore::inputTypeNameForEditingAction): 16 * editing/Editor.cpp: 17 (WebCore::inputEventDataForEditingStyleAndAction): 18 19 Added a new static helper to compute the data attribute of an InputEvent when handling a style change. 20 21 (WebCore::Editor::computeAndSetTypingStyle): 22 1 23 2016-10-12 Chris Dumez <cdumez@apple.com> 2 24 -
trunk/Source/WebCore/editing/EditCommand.cpp
r207010 r207244 57 57 case EditActionUnderline: 58 58 return ASCIILiteral("formatUnderline"); 59 case EditActionSetColor: 60 return ASCIILiteral("formatForeColor"); 59 61 case EditActionDrag: 60 62 return ASCIILiteral("deleteByDrag"); -
trunk/Source/WebCore/editing/Editor.cpp
r207010 r207244 133 133 } 134 134 135 static String inputEventDataForEditingStyleAndAction(EditingStyle& style, EditAction action) 136 { 137 auto* properties = style.style(); 138 if (!properties) 139 return { }; 140 141 switch (action) { 142 case EditActionSetColor: 143 return properties->getPropertyValue(CSSPropertyColor); 144 default: 145 return { }; 146 } 147 } 148 135 149 class ClearTextCommand : public DeleteSelectionCommand { 136 150 public: … … 3108 3122 3109 3123 String inputTypeName = inputTypeNameForEditingAction(editingAction); 3124 String inputEventData = inputEventDataForEditingStyleAndAction(style, editingAction); 3110 3125 auto* element = m_frame.selection().selection().rootEditableElement(); 3111 if (element && !dispatchBeforeInputEvent(*element, inputTypeName ))3126 if (element && !dispatchBeforeInputEvent(*element, inputTypeName, inputEventData)) 3112 3127 return; 3113 3128 … … 3126 3141 3127 3142 if (element) 3128 dispatchInputEvent(*element, inputTypeName );3143 dispatchInputEvent(*element, inputTypeName, inputEventData); 3129 3144 3130 3145 // Set the remaining style as the typing style.
Note: See TracChangeset
for help on using the changeset viewer.