Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Web Automation: suppress automatic text correction in pages controlle…
…d by automation

https://bugs.webkit.org/show_bug.cgi?id=156599
<rdar://problem/25712646>

Reviewed by Timothy Hatcher.

If the page is controlled by automation, then automatic text corrections will
cause unexpected behaviors by nondeterministically modifying text inserted by
a test. Just pretend these behaviors are disabled if controlled by automation.

* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
(WebKit::WebEditorClient::isAutomaticQuoteSubstitutionEnabled):
(WebKit::WebEditorClient::isAutomaticDashSubstitutionEnabled):
(WebKit::WebEditorClient::isAutomaticTextReplacementEnabled):
(WebKit::WebEditorClient::isAutomaticSpellingCorrectionEnabled):


Canonical link: https://commits.webkit.org/174705@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199565 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
burg committed Apr 14, 2016
1 parent 98723cf commit dcc58dc
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Source/WebKit2/ChangeLog
@@ -1,3 +1,21 @@
2016-04-14 Brian Burg <bburg@apple.com>

Web Automation: suppress automatic text correction in pages controlled by automation
https://bugs.webkit.org/show_bug.cgi?id=156599
<rdar://problem/25712646>

Reviewed by Timothy Hatcher.

If the page is controlled by automation, then automatic text corrections will
cause unexpected behaviors by nondeterministically modifying text inserted by
a test. Just pretend these behaviors are disabled if controlled by automation.

* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
(WebKit::WebEditorClient::isAutomaticQuoteSubstitutionEnabled):
(WebKit::WebEditorClient::isAutomaticDashSubstitutionEnabled):
(WebKit::WebEditorClient::isAutomaticTextReplacementEnabled):
(WebKit::WebEditorClient::isAutomaticSpellingCorrectionEnabled):

2016-04-14 Anders Carlsson <andersca@apple.com>

Try to fix the Yosemite build.
Expand Down
12 changes: 12 additions & 0 deletions Source/WebKit2/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm
Expand Up @@ -185,6 +185,9 @@ static void changeWordCase(WebPage* page, SEL selector)

bool WebEditorClient::isAutomaticQuoteSubstitutionEnabled()
{
if (m_page->isControlledByAutomation())
return false;

return WebProcess::singleton().textCheckerState().isAutomaticQuoteSubstitutionEnabled;
}

Expand All @@ -207,6 +210,9 @@ static void changeWordCase(WebPage* page, SEL selector)

bool WebEditorClient::isAutomaticDashSubstitutionEnabled()
{
if (m_page->isControlledByAutomation())
return false;

return WebProcess::singleton().textCheckerState().isAutomaticDashSubstitutionEnabled;
}

Expand All @@ -218,6 +224,9 @@ static void changeWordCase(WebPage* page, SEL selector)

bool WebEditorClient::isAutomaticTextReplacementEnabled()
{
if (m_page->isControlledByAutomation())
return false;

return WebProcess::singleton().textCheckerState().isAutomaticTextReplacementEnabled;
}

Expand All @@ -229,6 +238,9 @@ static void changeWordCase(WebPage* page, SEL selector)

bool WebEditorClient::isAutomaticSpellingCorrectionEnabled()
{
if (m_page->isControlledByAutomation())
return false;

return WebProcess::singleton().textCheckerState().isAutomaticSpellingCorrectionEnabled;
}

Expand Down

0 comments on commit dcc58dc

Please sign in to comment.