Changeset 206261 in webkit
- Timestamp:
- Sep 22, 2016 10:39:51 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 38 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r206260 r206261 1 2016-09-22 Jonathan Bedard <jbedard@apple.com> 2 3 Automatic Text Replacement Testing in WebKit2 4 https://bugs.webkit.org/show_bug.cgi?id=161919 5 6 Reviewed by Ryosuke Niwa. 7 8 Implemented test hooks for text replacement for WebKit2. 9 Note that spell checking has not been implemented, so most tests which use text replacement still fail. 10 11 * editing/inserting/smart-link-when-caret-is-moved-before-URL.html: Use internals instead of TestRunner. 12 * editing/inserting/typing-space-to-trigger-smart-link.html: Ditto. 13 * platform/efl/TestExpectations: Added port specific tests. 14 * platform/gtk/TestExpectations: Added port specific tests. 15 * platform/ios-simulator/TestExpectations: Added port specific tests. 16 * platform/ios-simulator-wk1/TestExpectations: Moved skipped tests to ios-simulator. 17 * platform/ios-simulator-wk2/TestExpectations: Moved skipped tests to ios-simulator. 18 * platform/mac-wk2/TestExpectations: Removed passing test. 19 * platform/win/TestExpectations: Added port specific tests. 20 * platform/wk2/TestExpectations: Added better explanation for failing test. 21 1 22 2016-09-22 Youenn Fablet <youenn@apple.com> 2 23 -
trunk/LayoutTests/editing/inserting/smart-link-when-caret-is-moved-before-URL.html
r155276 r206261 7 7 <script> 8 8 9 if (window.testRunner) {9 if (window.testRunner) 10 10 testRunner.dumpAsText(); 11 testRunner.setAutomaticLinkDetectionEnabled(true); 12 } 11 if (window.internals) 12 internals.setAutomaticLinkDetectionEnabled(true); 13 13 14 14 description('This test demonstrates that smart link doesn\'t erroneously trigger when the user moves the caret immediately before an URL.'); -
trunk/LayoutTests/editing/inserting/typing-space-to-trigger-smart-link.html
r149322 r206261 5 5 function runTest() 6 6 { 7 if (window.testRunner) {7 if (window.testRunner) 8 8 testRunner.dumpAsText(); 9 testRunner.setAutomaticLinkDetectionEnabled(true);10 }9 if (window.internals) 10 internals.setAutomaticLinkDetectionEnabled(true); 11 11 12 12 var testTypeSpaceDiv = document.getElementById('testTypeSpace'); … … 41 41 document.getElementById('log').textContent += "Failed: the expected content was '" + expectedContents + "', but the actual result was '" + testTypeLinkDiv.innerHTML + "'." 42 42 43 if (window. testRunner)44 testRunner.setAutomaticLinkDetectionEnabled(false);43 if (window.internals) 44 internals.setAutomaticLinkDetectionEnabled(false); 45 45 } 46 46 -
trunk/LayoutTests/platform/efl/TestExpectations
r206119 r206261 1667 1667 1668 1668 # EFL's LayoutTestController does not implement setAutomaticLinkDetectionEnabled 1669 webkit.org/b/85463 editing/inserting/typing-space-to-trigger-smart-link.html 1670 webkit.org/b/85463 editing/inserting/smart-link-when-caret-is-moved-before-URL.html 1671 editing/inserting/smart-quote-with-all-configurations.html 1669 editing/inserting/typing-space-to-trigger-smart-link.html [ Skip ] 1670 editing/inserting/smart-link-when-caret-is-moved-before-URL.html [ Skip ] 1671 editing/inserting/smart-quote-with-all-configurations.html [ Skip ] 1672 1672 1673 1673 # Failing after r119268 on GTK and EFL -
trunk/LayoutTests/platform/gtk/TestExpectations
r206119 r206261 389 389 webkit.org/b/133320 crypto/subtle/hmac-sign-verify-empty-key.html [ Pass ] 390 390 webkit.org/b/133320 crypto/subtle/hmac-sign-verify.html [ Pass ] 391 392 # GTK does not implement setAutomaticLinkDetectionEnabled 393 editing/inserting/typing-space-to-trigger-smart-link.html [ Skip ] 394 editing/inserting/smart-link-when-caret-is-moved-before-URL.html [ Skip ] 395 editing/inserting/smart-quote-with-all-configurations.html [ Skip ] 391 396 392 397 # QuickTime plug-in not relevant to this port … … 2597 2602 webkit.org/b/161589 css3/masking/mask-repeat-space-padding.html [ ImageOnlyFailure ] 2598 2603 2599 webkit.org/b/161590 editing/inserting/typing-space-to-trigger-smart-link.html [ Failure ]2600 2601 2604 #//////////////////////////////////////////////////////////////////////////////////////// 2602 2605 # End of non-crashing, non-flaky tests failing -
trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations
r206248 r206261 248 248 editing/inserting/insert-character-in-first-letter-crash.html [ Failure ] 249 249 editing/inserting/insert-tab-001.html [ Failure ] 250 editing/inserting/smart-quote-with-all-configurations.html [ Failure ]251 editing/inserting/typing-space-to-trigger-smart-link.html [ Failure ]252 250 editing/secure-input/password-input-changed-type.html [ Failure ] 253 251 editing/secure-input/password-input-focusing-to-different-frame.html [ Failure ] -
trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations
r206119 r206261 983 983 editing/inserting/insert-tab-004.html [ Failure ] 984 984 editing/inserting/paragraph-outside-nested-divs.html [ Failure ] 985 editing/inserting/smart-link-when-caret-is-moved-before-URL.html [ Failure ]986 editing/inserting/smart-quote-with-all-configurations.html [ Failure ]987 985 editing/inserting/typing-001.html [ Failure ] 988 986 editing/inserting/typing-003.html [ Failure ] 989 987 editing/inserting/typing-around-br-001.html [ Failure ] 990 988 editing/inserting/typing-around-image-001.html [ Failure ] 991 editing/inserting/typing-space-to-trigger-smart-link.html [ Failure ]992 989 editing/inserting/typing-tab-designmode-forms.html [ Failure ] 993 990 editing/inserting/typing-tab-designmode.html [ Failure ] -
trunk/LayoutTests/platform/ios-simulator/TestExpectations
r206248 r206261 308 308 http/tests/security/history-username-password.html [ Skip ] 309 309 fast/selectors/hover-invalidation-descendant-dynamic.html [ Skip ] 310 311 # IOS does not implement setAutomaticLinkDetectionEnabled 312 editing/inserting/typing-space-to-trigger-smart-link.html [ Skip ] 313 editing/inserting/smart-link-when-caret-is-moved-before-URL.html [ Skip ] 314 editing/inserting/smart-quote-with-all-configurations.html [ Skip ] 310 315 311 316 webkit.org/b/148695 fast/shadow-dom [ Pass ] -
trunk/LayoutTests/platform/mac-wk2/TestExpectations
r206155 r206261 132 132 webkit.org/b/105616 editing/spelling/editing-word-with-marker-2.html 133 133 webkit.org/b/105616 editing/spelling/move-cursor-around-misspelled-word.html 134 webkit.org/b/105616 editing/inserting/inserting-slash-inside-url-with-smart-link.html135 134 webkit.org/b/105616 editing/spelling/spelling-changed-text.html 136 135 webkit.org/b/105616 editing/spelling/spelling-backspace-between-lines.html … … 539 538 webkit.org/b/161148 gamepad/gamepad-timestamp.html [ Pass Failure ] 540 539 541 webkit.org/b/161366 editing/pasteboard/5478250.html [ Pass Failure ]542 webkit.org/b/161366 [ Debug ] editing/mac/spelling/accept-misspelled-candidate.html [ Pass Failure ]543 webkit.org/b/161366 [ Debug ] editing/mac/spelling/autocorrection-contraction.html [ Pass Failure ]544 545 540 webkit.org/b/161633 [ Debug ] storage/indexeddb/objectstore-cursor.html [ Pass Timeout ] 546 541 … … 553 548 webkit.org/b/161549 fast/scrolling/arrow-key-scroll-in-rtl-document.html [ Pass Failure ] 554 549 550 webkit.org/b/162081 editing/inserting/typing-space-to-trigger-smart-link.html [ Failure ] 551 webkit.org/b/162081 editing/inserting/smart-quote-with-all-configurations.html [ Failure ] 552 555 553 webkit.org/b/160017 [ Debug ] js/regress-139548.html [ Pass Timeout ] -
trunk/LayoutTests/platform/win/TestExpectations
r206119 r206261 1242 1242 1243 1243 ###### Inserting 1244 # TODO testRunner::setAutomaticLinkDetectionEnabled isn't implemented1244 # Windows does not implement setAutomaticLinkDetectionEnabled 1245 1245 editing/inserting/typing-space-to-trigger-smart-link.html [ Skip ] 1246 1246 editing/inserting/smart-link-when-caret-is-moved-before-URL.html [ Skip ] -
trunk/LayoutTests/platform/wk2/TestExpectations
r206131 r206261 237 237 fast/block/lineboxcontain/block-glyphs.html 238 238 fast/block/lineboxcontain/font.html 239 240 # Strange error in “Internals”241 editing/inserting/smart-quote-with-all-configurations.html242 239 243 240 # https://bugs.webkit.org/show_bug.cgi?id=115203 -
trunk/Source/WebCore/ChangeLog
r206259 r206261 1 2016-09-22 Jonathan Bedard <jbedard@apple.com> 2 3 Automatic Text Replacement Testing in WebKit2 4 https://bugs.webkit.org/show_bug.cgi?id=161919 5 6 Reviewed by Ryosuke Niwa. 7 8 Fixing existing tests: 9 editing/inserting/smart-link-when-caret-is-moved-before-URL.html 10 editing/inserting/typing-space-to-trigger-smart-link.html 11 12 Implemented test hooks for text replacement for WebKit2. 13 Note that spell checking has not been implemented, so most tests which use text replacement still fail. 14 15 * testing/Internals.cpp: 16 (WebCore::Internals::Internals): Reset TextChecker. 17 (WebCore::Internals::setContinuousSpellCheckingEnabled): Converted exception to an assert. 18 (WebCore::Internals::setAutomaticQuoteSubstitutionEnabled): Converted exception to an assert. 19 (WebCore::Internals::setAutomaticLinkDetectionEnabled): Converted exception to an assert. 20 (WebCore::Internals::setAutomaticDashSubstitutionEnabled): Converted exception to an assert. 21 (WebCore::Internals::setAutomaticTextReplacementEnabled): Converted exception to an assert. 22 (WebCore::Internals::setAutomaticSpellingCorrectionEnabled): Converted exception to an assert. 23 * testing/Internals.h: Removed exception argument for TextChecker setters. 24 * testing/Internals.idl: Ditto. 25 1 26 2016-09-22 Nan Wang <n_wang@apple.com> 2 27 -
trunk/Source/WebCore/testing/Internals.cpp
r205765 r206261 434 434 #endif 435 435 RuntimeEnabledFeatures::sharedFeatures().reset(); 436 437 if (contextDocument() && contextDocument()->frame()) { 438 setAutomaticSpellingCorrectionEnabled(true); 439 setAutomaticQuoteSubstitutionEnabled(false); 440 setAutomaticDashSubstitutionEnabled(false); 441 setAutomaticLinkDetectionEnabled(false); 442 setAutomaticTextReplacementEnabled(true); 443 } 436 444 } 437 445 … … 1611 1619 } 1612 1620 1613 void Internals::setContinuousSpellCheckingEnabled(bool enabled , ExceptionCode&)1621 void Internals::setContinuousSpellCheckingEnabled(bool enabled) 1614 1622 { 1615 1623 if (!contextDocument() || !contextDocument()->frame()) … … 1620 1628 } 1621 1629 1622 void Internals::setAutomaticQuoteSubstitutionEnabled(bool enabled , ExceptionCode&)1630 void Internals::setAutomaticQuoteSubstitutionEnabled(bool enabled) 1623 1631 { 1624 1632 if (!contextDocument() || !contextDocument()->frame()) … … 1633 1641 } 1634 1642 1635 void Internals::setAutomaticLinkDetectionEnabled(bool enabled , ExceptionCode&)1643 void Internals::setAutomaticLinkDetectionEnabled(bool enabled) 1636 1644 { 1637 1645 if (!contextDocument() || !contextDocument()->frame()) … … 1646 1654 } 1647 1655 1648 void Internals::setAutomaticDashSubstitutionEnabled(bool enabled , ExceptionCode&)1656 void Internals::setAutomaticDashSubstitutionEnabled(bool enabled) 1649 1657 { 1650 1658 if (!contextDocument() || !contextDocument()->frame()) … … 1659 1667 } 1660 1668 1661 void Internals::setAutomaticTextReplacementEnabled(bool enabled , ExceptionCode&)1669 void Internals::setAutomaticTextReplacementEnabled(bool enabled) 1662 1670 { 1663 1671 if (!contextDocument() || !contextDocument()->frame()) … … 1672 1680 } 1673 1681 1674 void Internals::setAutomaticSpellingCorrectionEnabled(bool enabled , ExceptionCode&)1682 void Internals::setAutomaticSpellingCorrectionEnabled(bool enabled) 1675 1683 { 1676 1684 if (!contextDocument() || !contextDocument()->frame()) -
trunk/Source/WebCore/testing/Internals.h
r205765 r206261 212 212 bool hasGrammarMarker(int from, int length, ExceptionCode&); 213 213 bool hasAutocorrectedMarker(int from, int length, ExceptionCode&); 214 void setContinuousSpellCheckingEnabled(bool enabled, ExceptionCode&);215 void setAutomaticQuoteSubstitutionEnabled(bool enabled, ExceptionCode&);216 void setAutomaticLinkDetectionEnabled(bool enabled, ExceptionCode&);217 void setAutomaticDashSubstitutionEnabled(bool enabled, ExceptionCode&);218 void setAutomaticTextReplacementEnabled(bool enabled, ExceptionCode&);219 void setAutomaticSpellingCorrectionEnabled(bool enabled, ExceptionCode&);214 void setContinuousSpellCheckingEnabled(bool); 215 void setAutomaticQuoteSubstitutionEnabled(bool); 216 void setAutomaticLinkDetectionEnabled(bool); 217 void setAutomaticDashSubstitutionEnabled(bool); 218 void setAutomaticTextReplacementEnabled(bool); 219 void setAutomaticSpellingCorrectionEnabled(bool); 220 220 221 221 void handleAcceptedCandidate(const String& candidate, unsigned location, unsigned length, ExceptionCode&); -
trunk/Source/WebCore/testing/Internals.idl
r205765 r206261 208 208 [RaisesException] boolean hasGrammarMarker(long from, long length); 209 209 [RaisesException] boolean hasAutocorrectedMarker(long from, long length); 210 [RaisesException]void setContinuousSpellCheckingEnabled(boolean enabled);211 [RaisesException]void setAutomaticQuoteSubstitutionEnabled(boolean enabled);212 [RaisesException]void setAutomaticLinkDetectionEnabled(boolean enabled);213 [RaisesException]void setAutomaticDashSubstitutionEnabled(boolean enabled);214 [RaisesException]void setAutomaticTextReplacementEnabled(boolean enabled);215 [RaisesException]void setAutomaticSpellingCorrectionEnabled(boolean enabled);210 void setContinuousSpellCheckingEnabled(boolean enabled); 211 void setAutomaticQuoteSubstitutionEnabled(boolean enabled); 212 void setAutomaticLinkDetectionEnabled(boolean enabled); 213 void setAutomaticDashSubstitutionEnabled(boolean enabled); 214 void setAutomaticTextReplacementEnabled(boolean enabled); 215 void setAutomaticSpellingCorrectionEnabled(boolean enabled); 216 216 217 217 [RaisesException] void handleAcceptedCandidate(DOMString candidate, unsigned long location, unsigned long length); -
trunk/Source/WebKit2/ChangeLog
r206256 r206261 1 2016-09-22 Jonathan Bedard <jbedard@apple.com> 2 3 Automatic Text Replacement Testing in WebKit2 4 https://bugs.webkit.org/show_bug.cgi?id=161919 5 6 Reviewed by Ryosuke Niwa. 7 8 Implemented test hooks for text replacement for WebKit2. 9 Note that spell checking has not been implemented, so most tests which use text replacement still fail. 10 11 * UIProcess/API/C/WKTextChecker.cpp: Added #ifdefs to include file for iOS and Mac. 12 (WKTextCheckerSetTestingMode): Added. 13 * UIProcess/API/C/WKTextChecker.h: Added #ifdefs to include file for iOS and Mac. 14 * UIProcess/TextChecker.h: Added hooks to bypass writing to NSUserDefaults. 15 * UIProcess/WebPageProxy.cpp: 16 (WebKit::WebPageProxy::toggleSmartInsertDelete): New message to toggle TextChecker flag. 17 (WebKit::WebPageProxy::toggleAutomaticQuoteSubstitution): Ditto. 18 (WebKit::WebPageProxy::toggleAutomaticLinkDetection): Ditto. 19 (WebKit::WebPageProxy::toggleAutomaticDashSubstitution): Ditto. 20 (WebKit::WebPageProxy::toggleAutomaticTextReplacement): Ditto. 21 * UIProcess/WebPageProxy.h: Added messages to toggle TextChecker flags. 22 * UIProcess/WebPageProxy.messages.in: Ditto. 23 * UIProcess/efl/TextCheckerEfl.cpp: Implemented new TextChecker hooks for non-Cocoa platforms. 24 * UIProcess/gtk/TextCheckerGtk.cpp: Ditto. 25 (WebKit::TextChecker::mutableState): Ditto. 26 * UIProcess/ios/TextCheckerIOS.mm: Implemented new TextChecker hooks. 27 (WebKit::TextChecker::mutableState): Allow modification of text checker without writing to NSUserDefaults. 28 (WebKit::TextChecker::state): Call mutableState. 29 (WebKit::TextChecker::accessSmartInsertDeleteEnabled): Dummy function. 30 * UIProcess/mac/TextCheckerMac.mm: 31 (WebKit::refresh): Reload TextChecker configuration from NSUserDefaults. 32 (WebKit::TextChecker::mutableState): Allow modification of text checker without writing to NSUserDefaults. 33 (WebKit::TextChecker::state): Call mutableState(). 34 (WebKit::TextChecker::accessSmartInsertDeleteEnabled): Allow toggling of smartInsertDeleteEnabled without writing to NSUserDefaults. 35 (WebKit::initializeState): Deleted. 36 * WebProcess/InjectedBundle/API/c/WKBundle.cpp: 37 (WKBundleSetAutomaticLinkDetectionEnabled): Deleted. 38 * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: Removed WKBundleSetAutomaticLinkDetectionEnabled. 39 * WebProcess/InjectedBundle/InjectedBundle.cpp: 40 (WebKit::InjectedBundle::setAutomaticLinkDetectionEnabled): Deleted. 41 * WebKit2.xcodeproj/project.pbxproj: Added WKTextChecker to Mac and iOS. 42 * WebProcess/InjectedBundle/InjectedBundle.h: Remove setAutomaticLinkDetectionEnabled. 43 * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm: 44 (WebKit::WebEditorClient::toggleSmartInsertDelete): Send message to UI process to toggle TextChecker. 45 (WebKit::WebEditorClient::toggleAutomaticQuoteSubstitution): Ditto. 46 (WebKit::WebEditorClient::toggleAutomaticLinkDetection): Ditto. 47 (WebKit::WebEditorClient::toggleAutomaticDashSubstitution): Ditto. 48 (WebKit::WebEditorClient::toggleAutomaticTextReplacement): Ditto. 49 1 50 2016-09-22 Carlos Garcia Campos <cgarcia@igalia.com> 2 51 -
trunk/Source/WebKit2/UIProcess/API/C/WKTextChecker.cpp
r179409 r206261 26 26 #include "config.h" 27 27 #include "WKTextChecker.h" 28 #include "TextChecker.h" 28 29 30 #if !defined(__APPLE__) 29 31 #include "WKAPICast.h" 30 32 #include "WebPageProxy.h" 31 33 #include "WebTextChecker.h" 34 #endif 32 35 33 36 using namespace WebKit; 37 38 void WKTextCheckerSetTestingMode(bool enabled) 39 { 40 TextChecker::setTestingMode(enabled); 41 } 42 43 #if !defined(__APPLE__) 34 44 35 45 void WKTextCheckerSetClient(const WKTextCheckerClientBase* wkClient) … … 59 69 WebTextChecker::singleton()->changeSpellingToWord(toImpl(page), toWTFString(word)); 60 70 } 71 72 #endif -
trunk/Source/WebKit2/UIProcess/API/C/WKTextChecker.h
r168961 r206261 32 32 extern "C" { 33 33 #endif 34 35 WK_EXPORT void WKTextCheckerSetTestingMode(bool enabled); 36 37 #if !defined(__APPLE__) 34 38 35 39 // TextChecker Client … … 85 89 WK_EXPORT void WKTextCheckerChangeSpellingToWord(WKPageRef page, WKStringRef word); 86 90 91 #endif 92 87 93 #ifdef __cplusplus 88 94 } -
trunk/Source/WebKit2/UIProcess/TextChecker.h
r202185 r206261 43 43 static void setContinuousSpellCheckingEnabled(bool); 44 44 static void setGrammarCheckingEnabled(bool); 45 46 static void setTestingMode(bool); 47 static bool isTestingMode(); 45 48 46 49 #if PLATFORM(COCOA) -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r206256 r206261 5977 5977 } 5978 5978 5979 #if USE(AUTOMATIC_TEXT_REPLACEMENT) 5980 5981 void WebPageProxy::toggleSmartInsertDelete() 5982 { 5983 if (TextChecker::isTestingMode()) 5984 TextChecker::setSmartInsertDeleteEnabled(!TextChecker::isSmartInsertDeleteEnabled()); 5985 } 5986 5987 void WebPageProxy::toggleAutomaticQuoteSubstitution() 5988 { 5989 if (TextChecker::isTestingMode()) 5990 TextChecker::setAutomaticQuoteSubstitutionEnabled(!TextChecker::state().isAutomaticQuoteSubstitutionEnabled); 5991 } 5992 5993 void WebPageProxy::toggleAutomaticLinkDetection() 5994 { 5995 if (TextChecker::isTestingMode()) 5996 TextChecker::setAutomaticLinkDetectionEnabled(!TextChecker::state().isAutomaticLinkDetectionEnabled); 5997 } 5998 5999 void WebPageProxy::toggleAutomaticDashSubstitution() 6000 { 6001 if (TextChecker::isTestingMode()) 6002 TextChecker::setAutomaticDashSubstitutionEnabled(!TextChecker::state().isAutomaticDashSubstitutionEnabled); 6003 } 6004 6005 void WebPageProxy::toggleAutomaticTextReplacement() 6006 { 6007 if (TextChecker::isTestingMode()) 6008 TextChecker::setAutomaticTextReplacementEnabled(!TextChecker::state().isAutomaticTextReplacementEnabled); 6009 } 6010 6011 #endif 6012 5979 6013 #if PLATFORM(MAC) 5980 6014 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r206256 r206261 1424 1424 bool maybeInitializeSandboxExtensionHandle(const WebCore::URL&, SandboxExtension::Handle&); 1425 1425 1426 #if USE(AUTOMATIC_TEXT_REPLACEMENT) 1427 void toggleSmartInsertDelete(); 1428 void toggleAutomaticQuoteSubstitution(); 1429 void toggleAutomaticLinkDetection(); 1430 void toggleAutomaticDashSubstitution(); 1431 void toggleAutomaticTextReplacement(); 1432 #endif 1433 1426 1434 #if PLATFORM(MAC) 1427 1435 void substitutionsPanelIsShowing(bool&); -
trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in
r206256 r206261 342 342 SubstitutionsPanelIsShowing() -> (bool isShowing) 343 343 #endif 344 #if USE(AUTOMATIC_TEXT_REPLACEMENT) 345 toggleSmartInsertDelete() 346 toggleAutomaticQuoteSubstitution() 347 toggleAutomaticLinkDetection() 348 toggleAutomaticDashSubstitution() 349 toggleAutomaticTextReplacement() 350 #endif 344 351 #if PLATFORM(MAC) 345 352 # Autocorrection messages -
trunk/Source/WebKit2/UIProcess/efl/TextCheckerEfl.cpp
r203038 r206261 57 57 return textCheckerState; 58 58 } 59 60 static bool testingModeEnabled = false; 61 62 void TextChecker::setTestingMode(bool enabled) 63 { 64 testingModeEnabled = enabled; 65 } 66 67 bool TextChecker::isTestingMode() 68 { 69 return testingModeEnabled; 70 } 59 71 60 72 bool TextChecker::isContinuousSpellCheckingAllowed() -
trunk/Source/WebKit2/UIProcess/gtk/TextCheckerGtk.cpp
r203038 r206261 64 64 return checkerState(); 65 65 } 66 67 static bool testingModeEnabled = false; 68 69 void TextChecker::setTestingMode(bool enabled) 70 { 71 testingModeEnabled = enabled; 72 } 73 74 bool TextChecker::isTestingMode() 75 { 76 return testingModeEnabled; 77 } 66 78 67 79 #if ENABLE(SPELLCHECK) -
trunk/Source/WebKit2/UIProcess/ios/TextCheckerIOS.mm
r202185 r206261 85 85 notImplemented(); 86 86 } 87 88 static bool testingModeEnabled = false; 89 90 void TextChecker::setTestingMode(bool enabled) 91 { 92 testingModeEnabled = enabled; 93 } 94 95 bool TextChecker::isTestingMode() 96 { 97 return testingModeEnabled; 98 } 99 87 100 88 101 static bool smartInsertDeleteEnabled; -
trunk/Source/WebKit2/UIProcess/mac/TextCheckerMac.mm
r203724 r206261 116 116 return textCheckerState; 117 117 } 118 119 static bool testingModeEnabled = false; 120 121 void TextChecker::setTestingMode(bool enabled) 122 { 123 if (enabled && !testingModeEnabled) { 124 [[NSUserDefaults standardUserDefaults] setBool:textCheckerState.isContinuousSpellCheckingEnabled forKey:WebContinuousSpellCheckingEnabled]; 125 [[NSUserDefaults standardUserDefaults] setBool:textCheckerState.isGrammarCheckingEnabled forKey:WebGrammarCheckingEnabled]; 126 [[NSUserDefaults standardUserDefaults] setBool:textCheckerState.isAutomaticSpellingCorrectionEnabled forKey:WebAutomaticSpellingCorrectionEnabled]; 127 [[NSUserDefaults standardUserDefaults] setBool:textCheckerState.isAutomaticQuoteSubstitutionEnabled forKey:WebAutomaticQuoteSubstitutionEnabled]; 128 [[NSUserDefaults standardUserDefaults] setBool:textCheckerState.isAutomaticDashSubstitutionEnabled forKey:WebAutomaticDashSubstitutionEnabled]; 129 [[NSUserDefaults standardUserDefaults] setBool:textCheckerState.isAutomaticLinkDetectionEnabled forKey:WebAutomaticLinkDetectionEnabled]; 130 [[NSUserDefaults standardUserDefaults] setBool:textCheckerState.isAutomaticTextReplacementEnabled forKey:WebAutomaticTextReplacementEnabled]; 131 [[NSUserDefaults standardUserDefaults] setBool:isSmartInsertDeleteEnabled() forKey:WebSmartInsertDeleteEnabled]; 132 } 133 testingModeEnabled = enabled; 134 } 135 136 bool TextChecker::isTestingMode() 137 { 138 return testingModeEnabled; 139 } 118 140 119 141 bool TextChecker::isContinuousSpellCheckingAllowed() … … 138 160 139 161 textCheckerState.isContinuousSpellCheckingEnabled = isContinuousSpellCheckingEnabled; 140 [[NSUserDefaults standardUserDefaults] setBool:isContinuousSpellCheckingEnabled forKey:WebContinuousSpellCheckingEnabled]; 162 if (!testingModeEnabled) 163 [[NSUserDefaults standardUserDefaults] setBool:isContinuousSpellCheckingEnabled forKey:WebContinuousSpellCheckingEnabled]; 141 164 142 165 // FIXME: preflight the spell checker. … … 149 172 150 173 textCheckerState.isGrammarCheckingEnabled = isGrammarCheckingEnabled; 151 [[NSUserDefaults standardUserDefaults] setBool:isGrammarCheckingEnabled forKey:WebGrammarCheckingEnabled]; 174 if (!testingModeEnabled) 175 [[NSUserDefaults standardUserDefaults] setBool:isGrammarCheckingEnabled forKey:WebGrammarCheckingEnabled]; 152 176 [[NSSpellChecker sharedSpellChecker] updatePanels]; 153 177 … … 162 186 163 187 textCheckerState.isAutomaticSpellingCorrectionEnabled = isAutomaticSpellingCorrectionEnabled; 164 [[NSUserDefaults standardUserDefaults] setBool:isAutomaticSpellingCorrectionEnabled forKey:WebAutomaticSpellingCorrectionEnabled]; 188 if (!testingModeEnabled) 189 [[NSUserDefaults standardUserDefaults] setBool:isAutomaticSpellingCorrectionEnabled forKey:WebAutomaticSpellingCorrectionEnabled]; 165 190 166 191 [[NSSpellChecker sharedSpellChecker] updatePanels]; … … 173 198 174 199 textCheckerState.isAutomaticQuoteSubstitutionEnabled = isAutomaticQuoteSubstitutionEnabled; 175 [[NSUserDefaults standardUserDefaults] setBool:isAutomaticQuoteSubstitutionEnabled forKey:WebAutomaticQuoteSubstitutionEnabled]; 200 if (!testingModeEnabled) 201 [[NSUserDefaults standardUserDefaults] setBool:isAutomaticQuoteSubstitutionEnabled forKey:WebAutomaticQuoteSubstitutionEnabled]; 176 202 177 203 [[NSSpellChecker sharedSpellChecker] updatePanels]; … … 184 210 185 211 textCheckerState.isAutomaticDashSubstitutionEnabled = isAutomaticDashSubstitutionEnabled; 186 [[NSUserDefaults standardUserDefaults] setBool:isAutomaticDashSubstitutionEnabled forKey:WebAutomaticDashSubstitutionEnabled]; 212 if (!testingModeEnabled) 213 [[NSUserDefaults standardUserDefaults] setBool:isAutomaticDashSubstitutionEnabled forKey:WebAutomaticDashSubstitutionEnabled]; 187 214 188 215 [[NSSpellChecker sharedSpellChecker] updatePanels]; … … 195 222 196 223 textCheckerState.isAutomaticLinkDetectionEnabled = isAutomaticLinkDetectionEnabled; 197 [[NSUserDefaults standardUserDefaults] setBool:isAutomaticLinkDetectionEnabled forKey:WebAutomaticLinkDetectionEnabled]; 224 if (!testingModeEnabled) 225 [[NSUserDefaults standardUserDefaults] setBool:isAutomaticLinkDetectionEnabled forKey:WebAutomaticLinkDetectionEnabled]; 198 226 199 227 [[NSSpellChecker sharedSpellChecker] updatePanels]; … … 206 234 207 235 textCheckerState.isAutomaticTextReplacementEnabled = isAutomaticTextReplacementEnabled; 208 [[NSUserDefaults standardUserDefaults] setBool:isAutomaticTextReplacementEnabled forKey:WebAutomaticTextReplacementEnabled]; 236 if (!testingModeEnabled) 237 [[NSUserDefaults standardUserDefaults] setBool:isAutomaticTextReplacementEnabled forKey:WebAutomaticTextReplacementEnabled]; 209 238 210 239 [[NSSpellChecker sharedSpellChecker] updatePanels]; … … 233 262 smartInsertDeleteEnabled = flag; 234 263 235 [[NSUserDefaults standardUserDefaults] setBool:flag forKey:WebSmartInsertDeleteEnabled]; 264 if (!testingModeEnabled) 265 [[NSUserDefaults standardUserDefaults] setBool:flag forKey:WebSmartInsertDeleteEnabled]; 236 266 } 237 267 -
trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
r205459 r206261 750 750 31D5929E166E060000E6BF02 /* WebPlugInClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31D5929C166E05FF00E6BF02 /* WebPlugInClient.cpp */; }; 751 751 31D5929F166E060000E6BF02 /* WebPlugInClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 31D5929D166E060000E6BF02 /* WebPlugInClient.h */; }; 752 31D755C11D91B81500843BD1 /* WKTextChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = 314888FF1D91B11D00377042 /* WKTextChecker.h */; settings = {ATTRIBUTES = (Private, ); }; }; 753 31D755C21D91B81B00843BD1 /* WKTextChecker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 314888FE1D91B11D00377042 /* WKTextChecker.cpp */; }; 752 754 31EA25D2134F78C0005B1452 /* NativeWebMouseEventMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 31EA25D0134F78B2005B1452 /* NativeWebMouseEventMac.mm */; }; 753 755 330934471315B9220097A7BC /* WebCookieManagerMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 330934431315B9220097A7BC /* WebCookieManagerMessageReceiver.cpp */; }; … … 2770 2772 3131261C148FF82B00BA2A39 /* WebNotificationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNotificationManager.h; sourceTree = "<group>"; }; 2771 2773 3131261D148FF82C00BA2A39 /* WebNotificationManager.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebNotificationManager.messages.in; sourceTree = "<group>"; }; 2774 314888FE1D91B11D00377042 /* WKTextChecker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKTextChecker.cpp; sourceTree = "<group>"; }; 2775 314888FF1D91B11D00377042 /* WKTextChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKTextChecker.h; sourceTree = "<group>"; }; 2772 2776 31607F3819627002009B87DA /* LegacySessionStateCoding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacySessionStateCoding.h; sourceTree = "<group>"; }; 2773 2777 317FE7C11C487A6600A0CA89 /* APIExperimentalFeature.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = APIExperimentalFeature.cpp; sourceTree = "<group>"; }; … … 6277 6281 isa = PBXGroup; 6278 6282 children = ( 6283 314888FE1D91B11D00377042 /* WKTextChecker.cpp */, 6284 314888FF1D91B11D00377042 /* WKTextChecker.h */, 6279 6285 5123CF18133D25E60056F800 /* cg */, 6280 6286 6EE849C41368D9040038D481 /* mac */, … … 7566 7572 1AAF0C4A12B16334008E49E2 /* ArgumentCodersCF.h in Headers */, 7567 7573 E179FD9C134D38060015B883 /* ArgumentCodersMac.h in Headers */, 7574 31D755C11D91B81500843BD1 /* WKTextChecker.h in Headers */, 7568 7575 CE1A0BD21A48E6C60054EF74 /* AssertionServicesSPI.h in Headers */, 7569 7576 C59C4A5918B81174007BDCB6 /* AssistedNodeInformation.h in Headers */, … … 9339 9346 2DA944AD1884E9BA00ED86DB /* TextCheckerIOS.mm in Sources */, 9340 9347 1AA417EF12C00D87002BE67B /* TextCheckerMac.mm in Sources */, 9348 31D755C21D91B81B00843BD1 /* WKTextChecker.cpp in Sources */, 9341 9349 1AAF263814687C39004A1E8A /* TiledCoreAnimationDrawingArea.mm in Sources */, 9342 9350 1AF05D8614688348008B1E81 /* TiledCoreAnimationDrawingAreaProxy.mm in Sources */, -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp
r205379 r206261 156 156 } 157 157 158 void WKBundleSetAutomaticLinkDetectionEnabled(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, bool enabled)159 {160 toImpl(bundleRef)->setAutomaticLinkDetectionEnabled(toImpl(pageGroupRef), enabled);161 }162 163 158 void WKBundleSetPrivateBrowsingEnabled(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, bool enabled) 164 159 { -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h
r205379 r206261 50 50 WK_EXPORT void WKBundleSetPluginsEnabled(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled); 51 51 WK_EXPORT void WKBundleSetJavaScriptCanAccessClipboard(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled); 52 WK_EXPORT void WKBundleSetAutomaticLinkDetectionEnabled(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, bool enabled);53 52 WK_EXPORT void WKBundleSetPrivateBrowsingEnabled(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled); 54 53 WK_EXPORT void WKBundleSetUseDashboardCompatibilityMode(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled); -
trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
r205379 r206261 32 32 #include "NotificationPermissionRequestManager.h" 33 33 #include "SessionTracker.h" 34 #include "TextChecker.h"35 34 #include "UserData.h" 36 35 #include "WKAPICast.h" … … 305 304 } 306 305 307 void InjectedBundle::setAutomaticLinkDetectionEnabled(WebPageGroupProxy* pageGroup, bool enabled)308 {309 #if USE(APPKIT)310 if (enabled == TextChecker::state().isAutomaticLinkDetectionEnabled)311 return;312 TextChecker::setAutomaticLinkDetectionEnabled(enabled);313 WebProcess::singleton().setTextCheckerState(TextChecker::state());314 #endif315 }316 317 306 void InjectedBundle::setPrivateBrowsingEnabled(WebPageGroupProxy* pageGroup, bool enabled) 318 307 { -
trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h
r205379 r206261 107 107 void setPluginsEnabled(WebPageGroupProxy*, bool); 108 108 void setJavaScriptCanAccessClipboard(WebPageGroupProxy*, bool); 109 void setAutomaticLinkDetectionEnabled(WebPageGroupProxy*, bool enabled);110 109 void setPrivateBrowsingEnabled(WebPageGroupProxy*, bool); 111 110 void setUseDashboardCompatibilityMode(WebPageGroupProxy*, bool); -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm
r204508 r206261 125 125 void WebEditorClient::toggleSmartInsertDelete() 126 126 { 127 // This is handled in the UI process. 128 ASSERT_NOT_REACHED(); 127 m_page->send(Messages::WebPageProxy::toggleSmartInsertDelete()); 129 128 } 130 129 … … 139 138 void WebEditorClient::toggleAutomaticQuoteSubstitution() 140 139 { 141 // This is handled in the UI process. 142 ASSERT_NOT_REACHED(); 140 m_page->send(Messages::WebPageProxy::toggleAutomaticQuoteSubstitution()); 143 141 } 144 142 … … 150 148 void WebEditorClient::toggleAutomaticLinkDetection() 151 149 { 152 // This is handled in the UI process. 153 ASSERT_NOT_REACHED(); 150 m_page->send(Messages::WebPageProxy::toggleAutomaticLinkDetection()); 154 151 } 155 152 … … 164 161 void WebEditorClient::toggleAutomaticDashSubstitution() 165 162 { 166 // This is handled in the UI process. 167 ASSERT_NOT_REACHED(); 163 m_page->send(Messages::WebPageProxy::toggleAutomaticDashSubstitution()); 168 164 } 169 165 … … 178 174 void WebEditorClient::toggleAutomaticTextReplacement() 179 175 { 180 // This is handled in the UI process. 181 ASSERT_NOT_REACHED(); 176 m_page->send(Messages::WebPageProxy::toggleAutomaticTextReplacement()); 182 177 } 183 178 -
trunk/Tools/ChangeLog
r206247 r206261 1 2016-09-22 Jonathan Bedard <jbedard@apple.com> 2 3 Automatic Text Replacement Testing in WebKit2 4 https://bugs.webkit.org/show_bug.cgi?id=161919 5 6 Reviewed by Ryosuke Niwa. 7 8 Implemented test hooks for text replacement for WebKit2. 9 Note that spell checking has not been implemented, so most tests which use text replacement still fail. 10 11 * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: Removed setAutomaticLinkDetectionEnabled from TestRunner, moved to Internals. 12 * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: Ditto. 13 (WTR::InjectedBundle::beginTesting): Ditto. 14 * WebKitTestRunner/InjectedBundle/TestRunner.cpp: Ditto. 15 * WebKitTestRunner/InjectedBundle/TestRunner.h: Ditto. 16 * WebKitTestRunner/TestController.cpp: 17 (WTR::TestController::runTest): Place TextChecker into testing mode. 18 1 19 2016-09-21 Dan Bernstein <mitz@apple.com> 2 20 -
trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
r205379 r206261 63 63 void setPluginsEnabled(boolean value); 64 64 void setJavaScriptCanAccessClipboard(boolean value); 65 void setAutomaticLinkDetectionEnabled(boolean value);66 65 void setPrivateBrowsingEnabled(boolean value); 67 66 void setUseDashboardCompatibilityMode(boolean value); -
trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
r205379 r206261 295 295 WKBundleSetAllowUniversalAccessFromFileURLs(m_bundle, m_pageGroup, true); 296 296 WKBundleSetJavaScriptCanAccessClipboard(m_bundle, m_pageGroup, true); 297 WKBundleSetAutomaticLinkDetectionEnabled(m_bundle, m_pageGroup, false);298 297 WKBundleSetPrivateBrowsingEnabled(m_bundle, m_pageGroup, false); 299 298 WKBundleSetUseDashboardCompatibilityMode(m_bundle, m_pageGroup, false); -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
r205379 r206261 412 412 } 413 413 414 void TestRunner::setAutomaticLinkDetectionEnabled(bool enabled)415 {416 auto& injectedBundle = InjectedBundle::singleton();417 WKBundleSetAutomaticLinkDetectionEnabled(injectedBundle.bundle(), injectedBundle.pageGroup(), enabled);418 }419 420 414 void TestRunner::setPrivateBrowsingEnabled(bool enabled) 421 415 { -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
r205379 r206261 110 110 void setPluginsEnabled(bool); 111 111 void setJavaScriptCanAccessClipboard(bool); 112 void setAutomaticLinkDetectionEnabled(bool);113 112 void setPrivateBrowsingEnabled(bool); 114 113 void setUseDashboardCompatibilityMode(bool); -
trunk/Tools/WebKitTestRunner/TestController.cpp
r204853 r206261 58 58 #include <WebKit/WKRetainPtr.h> 59 59 #include <WebKit/WKSecurityOriginRef.h> 60 #include <WebKit/WKTextChecker.h> 60 61 #include <WebKit/WKUserMediaPermissionCheck.h> 61 62 #include <algorithm> … … 79 80 #include <WebKit/WKContextPrivateMac.h> 80 81 #include <WebKit/WKPagePrivateMac.h> 81 #endif82 83 #if !PLATFORM(COCOA)84 #include <WebKit/WKTextChecker.h>85 82 #endif 86 83 … … 1084 1081 bool TestController::runTest(const char* inputLine) 1085 1082 { 1083 WKTextCheckerSetTestingMode(true); 1086 1084 TestCommand command = parseInputLine(std::string(inputLine)); 1087 1085
Note: See TracChangeset
for help on using the changeset viewer.