Changeset 206217 in webkit


Ignore:
Timestamp:
Sep 21, 2016 10:44:43 AM (8 years ago)
Author:
dbates@webkit.org
Message:

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.

Location:
trunk
Files:
11 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r206215 r206217  
     12016-09-21  Daniel Bates  <dabates@apple.com>
     2
     3        REGRESSION (r201090): Setting style.webkitTextSizeAdjust does not change text change on iPad
     4        https://bugs.webkit.org/show_bug.cgi?id=162227
     5        <rdar://problem/27201529>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Add tests to ensure setting the CSS property -webkit-text-size-adjust in a stylesheet or
     10        programmatically is respected on iPhone and iPad. Also added a test to ensure that this
     11        CSS property is ignored on macOS by default.
     12
     13        Note that we have existing tests that ensure that -webkit-text-size-adjust is respected
     14        on macOS when the internal setting Settings::textAutosizingEnabled() is enabled.
     15
     16        * fast/text-autosizing/ios/ipad/programmatic-text-size-adjust-expected.txt: Added.
     17        * fast/text-autosizing/ios/ipad/programmatic-text-size-adjust.html: Added.
     18        * fast/text-autosizing/ios/ipad/text-size-adjust-inline-style-expected.html: Added.
     19        * fast/text-autosizing/ios/ipad/text-size-adjust-inline-style.html: Added.
     20        * fast/text-autosizing/ios/programmatic-text-size-adjust-expected.txt: Added.
     21        * fast/text-autosizing/ios/programmatic-text-size-adjust.html: Added.
     22        * fast/text-autosizing/ios/text-size-adjust-inline-style-expected.html: Added.
     23        * fast/text-autosizing/ios/text-size-adjust-inline-style.html: Added.
     24        * fast/text-autosizing/text-size-adjust-inline-style-expected.html: Added.
     25        * fast/text-autosizing/text-size-adjust-inline-style.html: Added.
     26        * platform/mac/TestExpectations: Skip the iOS and iPad tests on Mac. Otherwise, they will fail
     27        because these tests intentionally do not call window.internal.settings.setTextAutosizingEnabled(true)
     28        so as to test the default port behavior. And on Mac automatic text size adjustment is disabled
     29        by default.
     30
    1312016-09-21  Jer Noble  <jer.noble@apple.com>
    232
  • trunk/LayoutTests/platform/mac/TestExpectations

    r206210 r206217  
    1818fast/url/user-visible [ Pass ]
    1919
     20fast/text-autosizing/ios/ipad/programmatic-text-size-adjust.html [ Skip ]
     21fast/text-autosizing/ios/ipad/text-size-adjust-inline-style.html [ Skip ]
     22fast/text-autosizing/ios/programmatic-text-size-adjust.html [ Skip ]
     23fast/text-autosizing/ios/text-size-adjust-inline-style.html [ Skip ]
    2024fast/text-autosizing [ Pass ]
    2125
  • trunk/Source/WebCore/ChangeLog

    r206213 r206217  
     12016-09-21  Daniel Bates  <dabates@apple.com>
     2
     3        REGRESSION (r201090): Setting style.webkitTextSizeAdjust does not change text change on iPad
     4        https://bugs.webkit.org/show_bug.cgi?id=162227
     5        <rdar://problem/27201529>
     6
     7        Reviewed by Simon Fraser.
     8
     9        The CSS property -webkit-text-size-adjust should be respected on all iOS devices. Following
     10        r201090 we respect it only on iPhone and in iPhone-apps run on iPad.
     11
     12        Tests: fast/text-autosizing/ios/ipad/programmatic-text-size-adjust.html
     13               fast/text-autosizing/ios/ipad/text-size-adjust-inline-style.html
     14               fast/text-autosizing/ios/programmatic-text-size-adjust.html
     15               fast/text-autosizing/ios/text-size-adjust-inline-style.html
     16               fast/text-autosizing/text-size-adjust-inline-style.html
     17
     18        * css/parser/CSSParser.cpp:
     19        (WebCore::isValidKeywordPropertyAndValue): Remove unused code to validate -webkit-text-size-adjust.
     20        This code is never used because -webkit-text-size-adjust is a value property (since it accepts a
     21        <percentage> as a value and CSSParserFastPaths::isKeywordPropertyID(CSSPropertyWebkitTextSizeAdjust)
     22        returns false). That is, it is not a keyword property.
     23        (WebCore::CSSParser::parseValue): Always enable the -webkit-text-size-adjust CSS property when
     24        building for iOS regardless of whether Settings:textAutosizingEnabled() is enabled.
     25
    1262016-09-21  Miguel Gomez  <magomez@igalia.com>
    227
  • trunk/Source/WebCore/css/parser/CSSParser.cpp

    r206196 r206217  
    10011001            return true;
    10021002        break;
    1003 #if ENABLE(IOS_TEXT_AUTOSIZING)
    1004     case CSSPropertyWebkitTextSizeAdjust:
    1005         if (!parserContext.textAutosizingEnabled)
    1006             return false;
    1007 
    1008         if (valueID == CSSValueAuto || valueID == CSSValueNone)
    1009             return true;
    1010         break;
    1011 #endif
    10121003#if PLATFORM(IOS)
    10131004    // Apple specific property. These will never be standardized and is purely to
     
    27892780#if ENABLE(IOS_TEXT_AUTOSIZING)
    27902781    case CSSPropertyWebkitTextSizeAdjust:
     2782        // FIXME: Support toggling the validation of this property via a runtime setting that is independent of
     2783        // whether isTextAutosizingEnabled() is true. We want to enable this property on iOS, when simulating
     2784        // a iOS device in Safari's responsive design mode and when optionally enabled in DRT/WTR. Otherwise,
     2785        // this property should be disabled by default.
     2786#if !PLATFORM(IOS)
    27912787        if (!isTextAutosizingEnabled())
    27922788            return false;
     2789#endif
    27932790
    27942791        if (id == CSSValueAuto || id == CSSValueNone)
Note: See TracChangeset for help on using the changeset viewer.