Changeset 248966 in webkit


Ignore:
Timestamp:
Aug 21, 2019 3:03:02 PM (5 years ago)
Author:
achristensen@apple.com
Message:

Disabling text autosizing should prevent text autosizing
https://bugs.webkit.org/show_bug.cgi?id=200955
<rdar://problem/48095374>

Reviewed by Simon Fraser.

Source/WebCore:

Before this change there was no way to reliably change the text size on iOS when a -webkit-text-size-adjust:none style was applied
because it would ignore the WKPreferences value for _textAutosizingEnabled. Now that value has the desired effect when laying out.

  • css/StyleResolver.cpp:

(WebCore::StyleResolver::checkForTextSizeAdjust):

Tools:

  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
  • TestWebKitAPI/Tests/WebKitCocoa/TextSize.mm: Added.

(TEST):

LayoutTests:

  • fast/text-autosizing/ios/text-size-adjust-inline-style.html:

The comment was incorrect because we call WKPreferencesSetTextAutosizingEnabled(preferences, false) in TestController::platformResetPreferencesToConsistentValues.
In order to test the effect of text autosizing in this test, we need to explicitly turn it on. The disabling of text autosizing didn't do anything before this
patch, so it wasn't needed before now.

Location:
trunk
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r248964 r248966  
     12019-08-21  Alex Christensen  <achristensen@webkit.org>
     2
     3        Disabling text autosizing should prevent text autosizing
     4        https://bugs.webkit.org/show_bug.cgi?id=200955
     5        <rdar://problem/48095374>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * fast/text-autosizing/ios/text-size-adjust-inline-style.html:
     10        The comment was incorrect because we call WKPreferencesSetTextAutosizingEnabled(preferences, false) in TestController::platformResetPreferencesToConsistentValues.
     11        In order to test the effect of text autosizing in this test, we need to explicitly turn it on.  The disabling of text autosizing didn't do anything before this
     12        patch, so it wasn't needed before now.
     13
    1142019-08-21  Ryan Haddad  <ryanhaddad@apple.com>
    215
  • trunk/LayoutTests/fast/text-autosizing/ios/text-size-adjust-inline-style.html

    r206217 r248966  
    22<html>
    33<head>
    4 <!-- We intentionally do not call window.internal.settings.setTextAutosizingEnabled(true) to test the default port behavior. -->
     4<script>internals.settings.setTextAutosizingEnabled(true)</script>
    55<style>
    66@font-face {
  • trunk/Source/WebCore/ChangeLog

    r248962 r248966  
     12019-08-21  Alex Christensen  <achristensen@webkit.org>
     2
     3        Disabling text autosizing should prevent text autosizing
     4        https://bugs.webkit.org/show_bug.cgi?id=200955
     5        <rdar://problem/48095374>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Before this change there was no way to reliably change the text size on iOS when a -webkit-text-size-adjust:none style was applied
     10        because it would ignore the WKPreferences value for _textAutosizingEnabled.  Now that value has the desired effect when laying out.
     11
     12        * css/StyleResolver.cpp:
     13        (WebCore::StyleResolver::checkForTextSizeAdjust):
     14
    1152019-08-21  Jer Noble  <jer.noble@apple.com>
    216
  • trunk/Source/WebCore/css/StyleResolver.cpp

    r248846 r248966  
    18841884void StyleResolver::checkForTextSizeAdjust(RenderStyle& style)
    18851885{
    1886     if (style.textSizeAdjust().isAuto() || (settings().textAutosizingUsesIdempotentMode() && !style.textSizeAdjust().isNone()))
     1886    if (style.textSizeAdjust().isAuto()
     1887        || !settings().textAutosizingEnabled()
     1888        || (settings().textAutosizingUsesIdempotentMode() && !style.textSizeAdjust().isNone()))
    18871889        return;
    18881890
  • trunk/Tools/ChangeLog

    r248965 r248966  
     12019-08-21  Alex Christensen  <achristensen@webkit.org>
     2
     3        Disabling text autosizing should prevent text autosizing
     4        https://bugs.webkit.org/show_bug.cgi?id=200955
     5        <rdar://problem/48095374>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
     10        * TestWebKitAPI/Tests/WebKitCocoa/TextSize.mm: Added.
     11        (TEST):
     12
    1132019-08-21  Adrian Perez de Castro  <aperez@igalia.com>
    214
  • trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj

    r248823 r248966  
    345345                5C0BF8941DD599C900B00328 /* MenuTypesForMouseEvents.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7A99D9931AD4A29D00373141 /* MenuTypesForMouseEvents.mm */; };
    346346                5C0BF8951DD599CD00B00328 /* NavigatorLanguage.mm in Sources */ = {isa = PBXBuildFile; fileRef = E19DB9781B32137C00DB38D4 /* NavigatorLanguage.mm */; };
     347                5C16F8FC230C94370074C4A8 /* TextSize.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C16F8FB230C942B0074C4A8 /* TextSize.mm */; };
    347348                5C19A5241FD0F60100EEA323 /* CookiePrivateBrowsing.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C19A5231FD0F32600EEA323 /* CookiePrivateBrowsing.mm */; };
    348349                5C23DF0B2246015800F454B6 /* Challenge.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C23DF0A2245C9D700F454B6 /* Challenge.mm */; };
     
    18391840                5C0BF88C1DD5957400B00328 /* MemoryPressureHandler.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MemoryPressureHandler.mm; sourceTree = "<group>"; };
    18401841                5C0BF88F1DD5999B00B00328 /* WebViewCanPasteZeroPng.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebViewCanPasteZeroPng.mm; sourceTree = "<group>"; };
     1842                5C16F8FB230C942B0074C4A8 /* TextSize.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TextSize.mm; sourceTree = "<group>"; };
    18411843                5C19A5231FD0F32600EEA323 /* CookiePrivateBrowsing.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CookiePrivateBrowsing.mm; sourceTree = "<group>"; };
    18421844                5C23DF0A2245C9D700F454B6 /* Challenge.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Challenge.mm; sourceTree = "<group>"; };
     
    28572859                                F4CD74C720FDB49600DE3794 /* TestURLSchemeHandler.h */,
    28582860                                F4CD74C820FDB49600DE3794 /* TestURLSchemeHandler.mm */,
     2861                                5C16F8FB230C942B0074C4A8 /* TextSize.mm */,
    28592862                                C22FA32A228F8708009D7988 /* TextWidth.mm */,
    28602863                                5CB40B4D1F4B98BE007DC7B9 /* UIDelegate.mm */,
     
    47134716                                93E6193B1F931B3A00AF245E /* TextCodec.cpp in Sources */,
    47144717                                CE3524F91B1441C40028A7C5 /* TextFieldDidBeginAndEndEditing.cpp in Sources */,
     4718                                5C16F8FC230C94370074C4A8 /* TextSize.mm in Sources */,
    47154719                                C22FA32B228F8708009D7988 /* TextWidth.mm in Sources */,
    47164720                                7CCE7EDD1A411A9200447C4C /* TimeRanges.cpp in Sources */,
Note: See TracChangeset for help on using the changeset viewer.