REGRESSION (r201090): Setting style.webkitTextSizeAdjust does not change text change...
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Sep 2016 17:44:43 +0000 (17:44 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Sep 2016 17:44:43 +0000 (17:44 +0000)
commitdb232fb190bcd4df124034df6ba0a3a8fcd1d1ac
treeacd5360ec36a0ea70036616b3db5197023f88c51
parentb10d20c9959544d38a276a98c814931dffde31ab
REGRESSION (r201090): Setting style.webkitTextSizeAdjust does not change text change on iPad
https://bugs.webkit.org/show_bug.cgi?id=162227
<rdar://problem/27201529>

Reviewed by Simon Fraser.

Source/WebCore:

The CSS property -webkit-text-size-adjust should be respected on all iOS devices. Following
r201090 we respect it only on iPhone and in iPhone-apps run on iPad.

Tests: fast/text-autosizing/ios/ipad/programmatic-text-size-adjust.html
       fast/text-autosizing/ios/ipad/text-size-adjust-inline-style.html
       fast/text-autosizing/ios/programmatic-text-size-adjust.html
       fast/text-autosizing/ios/text-size-adjust-inline-style.html
       fast/text-autosizing/text-size-adjust-inline-style.html

* css/parser/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue): Remove unused code to validate -webkit-text-size-adjust.
This code is never used because -webkit-text-size-adjust is a value property (since it accepts a
<percentage> as a value and CSSParserFastPaths::isKeywordPropertyID(CSSPropertyWebkitTextSizeAdjust)
returns false). That is, it is not a keyword property.
(WebCore::CSSParser::parseValue): Always enable the -webkit-text-size-adjust CSS property when
building for iOS regardless of whether Settings:textAutosizingEnabled() is enabled.

LayoutTests:

Add tests to ensure setting the CSS property -webkit-text-size-adjust in a stylesheet or
programmatically is respected on iPhone and iPad. Also added a test to ensure that this
CSS property is ignored on macOS by default.

Note that we have existing tests that ensure that -webkit-text-size-adjust is respected
on macOS when the internal setting Settings::textAutosizingEnabled() is enabled.

* fast/text-autosizing/ios/ipad/programmatic-text-size-adjust-expected.txt: Added.
* fast/text-autosizing/ios/ipad/programmatic-text-size-adjust.html: Added.
* fast/text-autosizing/ios/ipad/text-size-adjust-inline-style-expected.html: Added.
* fast/text-autosizing/ios/ipad/text-size-adjust-inline-style.html: Added.
* fast/text-autosizing/ios/programmatic-text-size-adjust-expected.txt: Added.
* fast/text-autosizing/ios/programmatic-text-size-adjust.html: Added.
* fast/text-autosizing/ios/text-size-adjust-inline-style-expected.html: Added.
* fast/text-autosizing/ios/text-size-adjust-inline-style.html: Added.
* fast/text-autosizing/text-size-adjust-inline-style-expected.html: Added.
* fast/text-autosizing/text-size-adjust-inline-style.html: Added.
* platform/mac/TestExpectations: Skip the iOS and iPad tests on Mac. Otherwise, they will fail
because these tests intentionally do not call window.internal.settings.setTextAutosizingEnabled(true)
so as to test the default port behavior. And on Mac automatic text size adjustment is disabled
by default.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@206217 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/text-autosizing/ios/ipad/programmatic-text-size-adjust-expected.txt [new file with mode: 0644]
LayoutTests/fast/text-autosizing/ios/ipad/programmatic-text-size-adjust.html [new file with mode: 0644]
LayoutTests/fast/text-autosizing/ios/ipad/text-size-adjust-inline-style-expected.html [new file with mode: 0644]
LayoutTests/fast/text-autosizing/ios/ipad/text-size-adjust-inline-style.html [new file with mode: 0644]
LayoutTests/fast/text-autosizing/ios/programmatic-text-size-adjust-expected.txt [new file with mode: 0644]
LayoutTests/fast/text-autosizing/ios/programmatic-text-size-adjust.html [new file with mode: 0644]
LayoutTests/fast/text-autosizing/ios/text-size-adjust-inline-style-expected.html [new file with mode: 0644]
LayoutTests/fast/text-autosizing/ios/text-size-adjust-inline-style.html [new file with mode: 0644]
LayoutTests/fast/text-autosizing/text-size-adjust-inline-style-expected.html [new file with mode: 0644]
LayoutTests/fast/text-autosizing/text-size-adjust-inline-style.html [new file with mode: 0644]
LayoutTests/platform/mac/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/css/parser/CSSParser.cpp