Changeset 246226 in webkit
- Timestamp:
- Jun 7, 2019, 5:48:42 PM (7 years ago)
- Location:
- trunk/Source
- Files:
-
- 10 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/page/Quirks.cpp (modified) (2 diffs)
-
WebCore/page/Quirks.h (modified) (1 diff)
-
WebKit/ChangeLog (modified) (1 diff)
-
WebKit/Shared/FocusedElementInformation.cpp (modified) (2 diffs)
-
WebKit/Shared/FocusedElementInformation.h (modified) (1 diff)
-
WebKit/Shared/SyntheticEditingCommandType.h (modified) (2 diffs)
-
WebKit/UIProcess/ios/WKContentView.mm (modified) (1 diff)
-
WebKit/UIProcess/ios/WKContentViewInteraction.mm (modified) (5 diffs)
-
WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r246225 r246226 1 2019-06-07 Megan Gardner <megan_gardner@apple.com> 2 3 Extend quirks to emulate bold/italic/underline in hidden editable areas 4 https://bugs.webkit.org/show_bug.cgi?id=198681 5 6 Reviewed by Wenson Hsieh. 7 8 Rename only. 9 10 Rename quirks to be more accurate for new extended use. 11 12 * page/Quirks.cpp: 13 (WebCore::shouldEmulateEditingButtonsAndGesturesInHiddenEditableAreasForHost): 14 (WebCore::Quirks::shouldEmulateEditingButtonsAndGesturesInHiddenEditableAreas const): 15 (WebCore::shouldEmulateUndoRedoInHiddenEditableAreasForHost): Deleted. 16 (WebCore::Quirks::shouldEmulateUndoRedoInHiddenEditableAreas const): Deleted. 17 * page/Quirks.h: 18 1 19 2019-06-07 Truitt Savell <tsavell@apple.com> 2 20 -
trunk/Source/WebCore/page/Quirks.cpp
r246216 r246226 239 239 } 240 240 241 static bool shouldEmulate UndoRedoInHiddenEditableAreasForHost(const StringView& host)241 static bool shouldEmulateEditingButtonsAndGesturesInHiddenEditableAreasForHost(const StringView& host) 242 242 { 243 243 #if PLATFORM(IOS_FAMILY) … … 267 267 } 268 268 269 bool Quirks::shouldEmulate UndoRedoInHiddenEditableAreas() const270 { 271 if (!needsQuirks()) 272 return false; 273 274 return shouldEmulate UndoRedoInHiddenEditableAreasForHost(m_document->topDocument().url().host());269 bool Quirks::shouldEmulateEditingButtonsAndGesturesInHiddenEditableAreas() const 270 { 271 if (!needsQuirks()) 272 return false; 273 274 return shouldEmulateEditingButtonsAndGesturesInHiddenEditableAreasForHost(m_document->topDocument().url().host()); 275 275 } 276 276 -
trunk/Source/WebCore/page/Quirks.h
r246216 r246226 59 59 WEBCORE_EXPORT bool shouldDispatchSyntheticMouseEventsWhenModifyingSelection() const; 60 60 WEBCORE_EXPORT bool shouldSuppressAutocorrectionAndAutocaptializationInHiddenEditableAreas() const; 61 WEBCORE_EXPORT bool shouldEmulate UndoRedoInHiddenEditableAreas() const;61 WEBCORE_EXPORT bool shouldEmulateEditingButtonsAndGesturesInHiddenEditableAreas() const; 62 62 WEBCORE_EXPORT bool isTouchBarUpdateSupressedForHiddenContentEditable() const; 63 63 WEBCORE_EXPORT bool isNeverRichlyEditableForTouchBar() const; -
trunk/Source/WebKit/ChangeLog
r246224 r246226 1 2019-06-07 Megan Gardner <megan_gardner@apple.com> 2 3 Extend quirks to emulate bold/italic/underline in hidden editable areas 4 https://bugs.webkit.org/show_bug.cgi?id=198681 5 6 Reviewed by Wenson Hsieh. 7 8 * Shared/FocusedElementInformation.cpp: 9 (WebKit::FocusedElementInformation::encode const): 10 (WebKit::FocusedElementInformation::decode): 11 * Shared/FocusedElementInformation.h: 12 * Shared/SyntheticEditingCommandType.h: 13 * UIProcess/ios/WKContentView.mm: 14 (-[WKContentView undoManager]): 15 * UIProcess/ios/WKContentViewInteraction.mm: 16 (shouldSynthezieKeyEvents): 17 (-[WKContentView toggleBoldfaceForWebView:]): 18 (-[WKContentView toggleItalicsForWebView:]): 19 (-[WKContentView toggleUnderlineForWebView:]): 20 (-[WKContentView _elementDidBlur]): 21 * WebProcess/WebPage/ios/WebPageIOS.mm: 22 (WebKit::WebPage::generateSyntheticEditingCommand): 23 (WebKit::WebPage::getFocusedElementInformation): 24 1 25 2019-06-05 Alex Christensen <achristensen@webkit.org> 2 26 -
trunk/Source/WebKit/Shared/FocusedElementInformation.cpp
r245079 r246226 105 105 #endif 106 106 #endif 107 encoder << shouldSynthesizeKeyEventsFor UndoAndRedo;107 encoder << shouldSynthesizeKeyEventsForEditing; 108 108 } 109 109 … … 224 224 #endif 225 225 #endif 226 if (!decoder.decode(result.shouldSynthesizeKeyEventsFor UndoAndRedo))226 if (!decoder.decode(result.shouldSynthesizeKeyEventsForEditing)) 227 227 return false; 228 228 -
trunk/Source/WebKit/Shared/FocusedElementInformation.h
r245079 r246226 137 137 #endif 138 138 #endif 139 bool shouldSynthesizeKeyEventsFor UndoAndRedo{ false };139 bool shouldSynthesizeKeyEventsForEditing { false }; 140 140 141 141 FocusedElementIdentifier focusedElementIdentifier { 0 }; -
trunk/Source/WebKit/Shared/SyntheticEditingCommandType.h
r245079 r246226 30 30 enum class SyntheticEditingCommandType : uint8_t { 31 31 Undo, 32 Redo 32 Redo, 33 ToggleBoldface, 34 ToggleItalic, 35 ToggleUnderline 33 36 }; 34 37 … … 41 44 WebKit::SyntheticEditingCommandType, 42 45 WebKit::SyntheticEditingCommandType::Undo, 43 WebKit::SyntheticEditingCommandType::Redo 46 WebKit::SyntheticEditingCommandType::Redo, 47 WebKit::SyntheticEditingCommandType::ToggleBoldface, 48 WebKit::SyntheticEditingCommandType::ToggleItalic, 49 WebKit::SyntheticEditingCommandType::ToggleUnderline 44 50 >; 45 51 }; -
trunk/Source/WebKit/UIProcess/ios/WKContentView.mm
r245787 r246226 444 444 - (NSUndoManager *)undoManager 445 445 { 446 if (self.focusedElementInformation.shouldSynthesizeKeyEventsFor UndoAndRedo&& self.hasHiddenContentEditable) {446 if (self.focusedElementInformation.shouldSynthesizeKeyEventsForEditing && self.hasHiddenContentEditable) { 447 447 if (!_quirkyUndoManager) 448 448 _quirkyUndoManager = adoptNS([[WKQuirkyNSUndoManager alloc] initWithContentView:self]); -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r246224 r246226 3119 3119 } 3120 3120 3121 - (BOOL)shouldSynthesizeKeyEvents 3122 { 3123 if (_focusedElementInformation.shouldSynthesizeKeyEventsForEditing && self.hasHiddenContentEditable) 3124 return true; 3125 return false; 3126 } 3127 3121 3128 - (void)toggleBoldfaceForWebView:(id)sender 3122 3129 { … … 3125 3132 3126 3133 [self executeEditCommandWithCallback:@"toggleBold"]; 3134 3135 if (self.shouldSynthesizeKeyEvents) 3136 _page->generateSyntheticEditingCommand(WebKit::SyntheticEditingCommandType::ToggleBoldface); 3127 3137 } 3128 3138 … … 3133 3143 3134 3144 [self executeEditCommandWithCallback:@"toggleItalic"]; 3145 3146 if (self.shouldSynthesizeKeyEvents) 3147 _page->generateSyntheticEditingCommand(WebKit::SyntheticEditingCommandType::ToggleItalic); 3135 3148 } 3136 3149 … … 3141 3154 3142 3155 [self executeEditCommandWithCallback:@"toggleUnderline"]; 3156 3157 if (self.shouldSynthesizeKeyEvents) 3158 _page->generateSyntheticEditingCommand(WebKit::SyntheticEditingCommandType::ToggleUnderline); 3143 3159 } 3144 3160 … … 5225 5241 5226 5242 _focusedElementInformation.elementType = WebKit::InputType::None; 5227 _focusedElementInformation.shouldSynthesizeKeyEventsFor UndoAndRedo= false;5243 _focusedElementInformation.shouldSynthesizeKeyEventsForEditing = false; 5228 5244 _inputPeripheral = nil; 5229 5245 _focusRequiresStrongPasswordAssistance = NO; -
trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
r246116 r246226 616 616 @"U+0059", 89, false, false, false, modifiers, WallTime::now()); 617 617 break; 618 case SyntheticEditingCommandType::ToggleBoldface: 619 keyEvent = PlatformKeyboardEvent(PlatformEvent::KeyDown, "b", "b", 620 #if ENABLE(KEYBOARD_KEY_ATTRIBUTE) 621 "b", 622 #endif 623 #if ENABLE(KEYBOARD_CODE_ATTRIBUTE) 624 "KeyB"_s, 625 #endif 626 @"U+0042", 66, false, false, false, modifiers, WallTime::now()); 627 break; 628 case SyntheticEditingCommandType::ToggleItalic: 629 keyEvent = PlatformKeyboardEvent(PlatformEvent::KeyDown, "i", "i", 630 #if ENABLE(KEYBOARD_KEY_ATTRIBUTE) 631 "i", 632 #endif 633 #if ENABLE(KEYBOARD_CODE_ATTRIBUTE) 634 "KeyI"_s, 635 #endif 636 @"U+0049", 73, false, false, false, modifiers, WallTime::now()); 637 break; 638 case SyntheticEditingCommandType::ToggleUnderline: 639 keyEvent = PlatformKeyboardEvent(PlatformEvent::KeyDown, "u", "u", 640 #if ENABLE(KEYBOARD_KEY_ATTRIBUTE) 641 "u", 642 #endif 643 #if ENABLE(KEYBOARD_CODE_ATTRIBUTE) 644 "KeyU"_s, 645 #endif 646 @"U+0055", 85, false, false, false, modifiers, WallTime::now()); 647 break; 618 648 default: 619 649 break; … … 2878 2908 information.autocapitalizeType = focusedElement.autocapitalizeType(); 2879 2909 information.inputMode = focusedElement.canonicalInputMode(); 2880 information.shouldSynthesizeKeyEventsFor UndoAndRedo = focusedElement.document().quirks().shouldEmulateUndoRedoInHiddenEditableAreas();2910 information.shouldSynthesizeKeyEventsForEditing = focusedElement.document().quirks().shouldEmulateEditingButtonsAndGesturesInHiddenEditableAreas(); 2881 2911 } else { 2882 2912 information.isAutocorrect = true;
Note:
See TracChangeset
for help on using the changeset viewer.