Skip to content
Permalink
Browse files
Enable IOS_TEXT_AUTOSIZING on Mac and make it testable
https://bugs.webkit.org/show_bug.cgi?id=157432
rdar://problem/16406720

Reviewed by Dean Jackson.

Source/JavaScriptCore:

Enable IOS_TEXT_AUTOSIZING on Mac so it can be tested.

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

Enable IOS_TEXT_AUTOSIZING on Mac so it can be tested.

Make the setTextAutosizingEnabled() Setting work, and plumb it through WK1 and WK2
preferences for WTR and DRT. Make textAutosizingWindowSizeOverride() work, for layout tests.
These two settings are shared with TEXT_AUTOSIZING.

Add a TextAutosizing log channel, which is useful for generated -expected.html results.

Move adjustComputedFontSizesOnBlocks() and related code from RenderObject to RenderElement
without changes.

An implication of this set of changes is that the way clients enable text autosizing
has changed. Previously, they set the "MinimumZoomFontSize" preference to 0.
Settings::defaultMinimumZoomFontSize() used to do this in order to enable text autosizing
on iPhone only, not iPad.

Now the preferred technique is to leave minimumZoomFontSize alone, and to use textAutosizingEnabled()
instead. Settings::defaultTextAutosizingEnabled() now does the check for iPhone.

UIWebView calls WebKitGetMinimumZoomFontSize() to setup the default minimum font zoom size,
which will now always return 15, but had no other code that toggled this. So it's safe to just rely
on Settings::defaultTextAutosizingEnabled() doing the right thing for iPhone/iPad.

Test: fast/text-autosizing/ios/autosize-width.html

* Configurations/FeatureDefines.xcconfig:
* dom/Document.cpp:
(WebCore::Document::addAutoSizingNode):
* page/FrameView.cpp:
(WebCore::FrameView::layout):
* page/Settings.cpp:
(WebCore::Settings::Settings): Deleted.
(WebCore::Settings::setTextAutosizingEnabled): Deleted.
(WebCore::Settings::setTextAutosizingWindowSizeOverride): Deleted.
* page/Settings.h:
(WebCore::Settings::textAutosizingEnabled): Deleted.
(WebCore::Settings::textAutosizingWindowSizeOverride): Deleted.
* page/Settings.in:
* page/cocoa/SettingsCocoa.mm:
(WebCore::Settings::defaultMinimumZoomFontSize):
(WebCore::Settings::defaultTextAutosizingEnabled):
* platform/Logging.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::adjustComputedFontSizes):
* rendering/RenderElement.cpp:
(WebCore::includeNonFixedHeight):
(WebCore::RenderElement::adjustComputedFontSizesOnBlocks):
(WebCore::RenderElement::resetTextAutosizing):
* rendering/RenderElement.h:
* rendering/RenderObject.cpp:
(WebCore::includeNonFixedHeight): Deleted.
(WebCore::RenderObject::adjustComputedFontSizesOnBlocks): Deleted.
(WebCore::RenderObject::resetTextAutosizing): Deleted.
* rendering/RenderObject.h:
* rendering/TextAutoSizing.cpp:
(WebCore::TextAutoSizingValue::adjustNodeSizes):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setTextAutosizingEnabled):
(WebCore::InternalSettings::setTextAutosizingWindowSizeOverride):
* testing/InternalSettings.h:

Source/WebKit/ios:

Enable IOS_TEXT_AUTOSIZING on Mac so it can be tested.

Make the setTextAutosizingEnabled() Setting work, and plumb it through WK1 and WK2
preferences for WTR and DRT. Make textAutosizingWindowSizeOverride() work, for layout tests.
These two settings are shared with TEXT_AUTOSIZING.

Add a TextAutosizing log channel, which is useful for generated -expected.html results.

Move adjustComputedFontSizesOnBlocks() and related code from RenderObject to RenderElement
without changes.

An implication of this set of changes is that the way clients enable text autosizing
has changed. Previously, they set the "MinimumZoomFontSize" preference to 0.
Settings::defaultMinimumZoomFontSize() used to do this in order to enable text autosizing
on iPhone only, not iPad.

Now the preferred technique is to leave minimumZoomFontSize alone, and to use textAutosizingEnabled()
instead. Settings::defaultTextAutosizingEnabled() now does the check for iPhone.

UIWebView calls WebKitGetMinimumZoomFontSize() to setup the default minimum font zoom size,
which will now always return 15, but had no other code that toggled this. So it's safe to just rely
on Settings::defaultTextAutosizingEnabled() doing the right thing for iPhone/iPad.

* Misc/WebUIKitSupport.mm:
(WebKitGetMinimumZoomFontSize):

Source/WebKit/mac:

Enable IOS_TEXT_AUTOSIZING on Mac so it can be tested.

Make the setTextAutosizingEnabled() Setting work, and plumb it through WK1 and WK2
preferences for WTR and DRT. Make textAutosizingWindowSizeOverride() work, for layout tests.
These two settings are shared with TEXT_AUTOSIZING.

Add a TextAutosizing log channel, which is useful for generated -expected.html results.

Move adjustComputedFontSizesOnBlocks() and related code from RenderObject to RenderElement
without changes.

An implication of this set of changes is that the way clients enable text autosizing
has changed. Previously, they set the "MinimumZoomFontSize" preference to 0.
Settings::defaultMinimumZoomFontSize() used to do this in order to enable text autosizing
on iPhone only, not iPad.

Now the preferred technique is to leave minimumZoomFontSize alone, and to use textAutosizingEnabled()
instead. Settings::defaultTextAutosizingEnabled() now does the check for iPhone.

UIWebView calls WebKitGetMinimumZoomFontSize() to setup the default minimum font zoom size,
which will now always return 15, but had no other code that toggled this. So it's safe to just rely
on Settings::defaultTextAutosizingEnabled() doing the right thing for iPhone/iPad.

* Configurations/FeatureDefines.xcconfig:
* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences _setTextAutosizingEnabled:]):
(-[WebPreferences _textAutosizingEnabled]):
* WebView/WebPreferencesPrivate.h:

Source/WebKit2:

Enable IOS_TEXT_AUTOSIZING on Mac so it can be tested.

Make the setTextAutosizingEnabled() Setting work, and plumb it through WK1 and WK2
preferences for WTR and DRT. Make textAutosizingWindowSizeOverride() work, for layout tests.
These two settings are shared with TEXT_AUTOSIZING.

Add a TextAutosizing log channel, which is useful for generated -expected.html results.

Move adjustComputedFontSizesOnBlocks() and related code from RenderObject to RenderElement
without changes.

An implication of this set of changes is that the way clients enable text autosizing
has changed. Previously, they set the "MinimumZoomFontSize" preference to 0.
Settings::defaultMinimumZoomFontSize() used to do this in order to enable text autosizing
on iPhone only, not iPad.

Now the preferred technique is to leave minimumZoomFontSize alone, and to use textAutosizingEnabled()
instead. Settings::defaultTextAutosizingEnabled() now does the check for iPhone.

UIWebView calls WebKitGetMinimumZoomFontSize() to setup the default minimum font zoom size,
which will now always return 15, but had no other code that toggled this. So it's safe to just rely
on Settings::defaultTextAutosizingEnabled() doing the right thing for iPhone/iPad.

* Configurations/FeatureDefines.xcconfig:
* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _textAutosizingEnabled]):
(-[WKPreferences _setTextAutosizingEnabled:]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Tools:

Enable IOS_TEXT_AUTOSIZING on Mac so it can be tested.

Make the setTextAutosizingEnabled() Setting work, and plumb it through WK1 and WK2
preferences for WTR and DRT. Make textAutosizingWindowSizeOverride() work, for layout tests.
These two settings are shared with TEXT_AUTOSIZING.

Add a TextAutosizing log channel, which is useful for generated -expected.html results.

Move adjustComputedFontSizesOnBlocks() and related code from RenderObject to RenderElement
without changes.

An implication of this set of changes is that the way clients enable text autosizing
has changed. Previously, they set the "MinimumZoomFontSize" preference to 0.
Settings::defaultMinimumZoomFontSize() used to do this in order to enable text autosizing
on iPhone only, not iPad.

Now the preferred technique is to leave minimumZoomFontSize alone, and to use textAutosizingEnabled()
instead. Settings::defaultTextAutosizingEnabled() now does the check for iPhone.

UIWebView calls WebKitGetMinimumZoomFontSize() to setup the default minimum font zoom size,
which will now always return 15, but had no other code that toggled this. So it's safe to just rely
on Settings::defaultTextAutosizingEnabled() doing the right thing for iPhone/iPad.

* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebPreferencesToConsistentValues):
* DumpRenderTree/mac/TestRunnerMac.mm:
(TestRunner::setTextAutosizingEnabled):
* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:
* WebKitTestRunner/ios/TestControllerIOS.mm:
(WTR::TestController::platformResetPreferencesToConsistentValues):

LayoutTests:

Enable fast/text-autosizing/ios/ on Mac and iOS

* fast/text-autosizing/ios/autosize-width-expected.html: Added.
* fast/text-autosizing/ios/autosize-width.html: Added.
* platform/ios-simulator/TestExpectations:
* platform/mac-wk2/TestExpectations:
* platform/mac/TestExpectations:

Canonical link: https://commits.webkit.org/175565@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200534 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
smfr committed May 7, 2016
1 parent e401022 commit 199b990d36b2a0b271ba541cabd1a877f43efb94
Showing with 588 additions and 160 deletions.
  1. +16 −0 LayoutTests/ChangeLog
  2. +57 −0 LayoutTests/fast/text-autosizing/ios/autosize-width-expected.html
  3. +55 −0 LayoutTests/fast/text-autosizing/ios/autosize-width.html
  4. 0 LayoutTests/fast/{css → text-autosizing/ios}/line-height-text-autosizing-expected.txt
  5. +8 −2 LayoutTests/fast/{css → text-autosizing/ios}/line-height-text-autosizing.html
  6. +1 −1 LayoutTests/platform/ios-simulator-wk1/TestExpectations
  7. +1 −1 LayoutTests/platform/ios-simulator-wk2/TestExpectations
  8. +6 −1 LayoutTests/platform/ios-simulator/TestExpectations
  9. +2 −0 LayoutTests/platform/mac-wk2/TestExpectations
  10. +2 −0 LayoutTests/platform/mac/TestExpectations
  11. BIN LayoutTests/platform/mac/fast/text-autosizing/ios/line-height-text-autosizing-expected.png
  12. +29 −0 LayoutTests/platform/mac/fast/text-autosizing/ios/line-height-text-autosizing-expected.txt
  13. +12 −0 Source/JavaScriptCore/ChangeLog
  14. +1 −1 Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig
  15. +71 −0 Source/WebCore/ChangeLog
  16. +1 −1 Source/WebCore/Configurations/FeatureDefines.xcconfig
  17. +3 −0 Source/WebCore/dom/Document.cpp
  18. +9 −3 Source/WebCore/page/FrameView.cpp
  19. +11 −26 Source/WebCore/page/Settings.cpp
  20. +3 −13 Source/WebCore/page/Settings.h
  21. +7 −1 Source/WebCore/page/Settings.in
  22. +3 −5 Source/WebCore/page/cocoa/SettingsCocoa.mm
  23. +1 −0 Source/WebCore/platform/Logging.h
  24. +3 −0 Source/WebCore/rendering/RenderBlockFlow.cpp
  25. +73 −0 Source/WebCore/rendering/RenderElement.cpp
  26. +5 −0 Source/WebCore/rendering/RenderElement.h
  27. +0 −72 Source/WebCore/rendering/RenderObject.cpp
  28. +0 −3 Source/WebCore/rendering/RenderObject.h
  29. +4 −1 Source/WebCore/rendering/TextAutoSizing.cpp
  30. +8 −4 Source/WebCore/testing/InternalSettings.cpp
  31. +5 −1 Source/WebCore/testing/InternalSettings.h
  32. +34 −0 Source/WebKit/ios/ChangeLog
  33. +1 −1 Source/WebKit/ios/Misc/WebUIKitSupport.mm
  34. +39 −0 Source/WebKit/mac/ChangeLog
  35. +1 −1 Source/WebKit/mac/Configurations/FeatureDefines.xcconfig
  36. +1 −0 Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
  37. +11 −0 Source/WebKit/mac/WebView/WebPreferences.mm
  38. +3 −0 Source/WebKit/mac/WebView/WebPreferencesPrivate.h
  39. +40 −0 Source/WebKit2/ChangeLog
  40. +1 −1 Source/WebKit2/Configurations/FeatureDefines.xcconfig
  41. +2 −4 Source/WebKit2/Shared/WebPreferencesDefinitions.h
  42. +10 −0 Source/WebKit2/UIProcess/API/Cocoa/WKPreferences.mm
  43. +1 −0 Source/WebKit2/UIProcess/API/Cocoa/WKPreferencesPrivate.h
  44. +4 −5 Source/WebKit2/WebProcess/WebPage/WebPage.cpp
  45. +39 −0 Tools/ChangeLog
  46. +1 −7 Tools/DumpRenderTree/mac/DumpRenderTree.mm
  47. +1 −2 Tools/DumpRenderTree/mac/TestRunnerMac.mm
  48. +1 −1 Tools/TestWebKitAPI/Configurations/FeatureDefines.xcconfig
  49. +1 −2 Tools/WebKitTestRunner/ios/TestControllerIOS.mm
@@ -1,3 +1,19 @@
2016-05-06 Simon Fraser <simon.fraser@apple.com>

Enable IOS_TEXT_AUTOSIZING on Mac and make it testable
https://bugs.webkit.org/show_bug.cgi?id=157432
rdar://problem/16406720

Reviewed by Dean Jackson.

Enable fast/text-autosizing/ios/ on Mac and iOS

* fast/text-autosizing/ios/autosize-width-expected.html: Added.
* fast/text-autosizing/ios/autosize-width.html: Added.
* platform/ios-simulator/TestExpectations:
* platform/mac-wk2/TestExpectations:
* platform/mac/TestExpectations:

2016-05-06 Joseph Pecoraro <pecoraro@apple.com>

Web Inspector: Console: Variables defined with let/const aren't accessible outside of console's scope
@@ -0,0 +1,57 @@
<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
<html>
<head>
<meta name="viewport" content="width=1024">
<style>
html {
-webkit-text-size-adjust: none;
}
div {
margin-top: 10px;
}
</style>

<script>
if (window.internals) {
window.internals.settings.setTextAutosizingEnabled(false);
window.internals.settings.setTextAutosizingWindowSizeOverride(320, 480);
}
</script>

</head>
<body>

<div class="name" style="width: 319px">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</div>

<div class="name" style="width: 320px">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</div>

<div class="name" style="width: 321px">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</div>

<div class="name" style="width: 360px;">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</div>

<div class="name" style="width: 400px; font-size: 23px;">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</div>

<div class="name" style="width: 600px; font-size: 23px;">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</div>

<div class="name" style="width: 980px; font-size: 23px;">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</div>

<div class="name" style="width: 1024px; font-size: 23px;">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</div>

</body>
</html>
@@ -0,0 +1,55 @@
<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
<html>
<head>
<meta name="viewport" content="width=1024">
<style>
div {
margin-top: 10px;
font-size: 12pt;
}
</style>

<script>
if (window.internals) {
window.internals.settings.setTextAutosizingEnabled(true);
window.internals.settings.setTextAutosizingWindowSizeOverride(320, 480);
}
</script>

</head>
<body>

<div class="name" style="width: 319px">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</div>

<div class="name" style="width: 320px">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</div>

<div class="name" style="width: 321px">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</div>

<div class="name" style="width: 340px">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</div>

<div class="name" style="width: 400px">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</div>

<div class="name" style="width: 650px">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</div>

<div class="name" style="width: 980px">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</div>

<div class="name" style="width: 1024px">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</div>

</body>
</html>
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
<script src="../../../resources/js-test-pre.js"></script>
<style>
#testDivAdjust {
-webkit-text-size-adjust: 150%;
@@ -11,6 +11,12 @@
font-size: 20px;
}
</style>
<script>
if (window.internals) {
window.internals.settings.setTextAutosizingEnabled(true);
window.internals.settings.setTextAutosizingWindowSizeOverride(320, 480);
}
</script>
</head>
<boby>
<div id="testDivNoAdjust">Test</div>
@@ -53,6 +59,6 @@
shouldBeEqualToString("window.getComputedStyle(testDivAdjust).getPropertyValue('line-height')", "18px");
}
</script>
<script src="../../resources/js-test-post.js"></script>
<script src="../../../resources/js-test-post.js"></script>
</body>
</html>
@@ -793,7 +793,7 @@ svg/stroke/animated-non-scaling-stroke.html [ ImageOnlyFailure ]
# LayoutTests/fast tests that fail:
fast/block/min-max-height-percent-height-child.html [ Failure ]
fast/borders/hidpi-border-clipping-right-after-move.html [ ImageOnlyFailure ]
fast/css/line-height-text-autosizing.html [ Failure ]
fast/text-autosizing/ios/line-height-text-autosizing.html [ Failure ]
fast/css/nested-rounded-corners.html [ Failure ]
fast/css/relative-positioned-block-crash.html [ Failure ]
fast/css/sticky/sticky-overflowing.html [ ImageOnlyFailure ]
@@ -545,7 +545,7 @@ fast/css/hover-affects-child.html [ Failure ]
fast/css/hover-display-block-inline.html [ Failure ]
fast/css/hover-display-block-none.html [ Failure ]
fast/css/hover-display-block.html [ Failure ]
fast/css/line-height-text-autosizing.html [ Failure ]
fast/text-autosizing/ios/line-height-text-autosizing.html [ Failure ]
fast/css/nested-layers-with-hover.html [ Failure ]
fast/dom/HTMLDocument/hasFocus.html [ Failure ]
fast/dom/Window/Plug-ins.html [ Failure ]
@@ -11,6 +11,8 @@ displaylists [ Pass ]
quicklook [ Pass ]
http/tests/quicklook [ Pass ]

fast/text-autosizing/ios [ Pass ]

# <rdar://problem/22898927> Crashes in iWorkImport.framework
quicklook/pages.html [ Pass Crash ]

@@ -2210,6 +2212,8 @@ fast/table/table-row-style-not-updated.html [ Failure ]
fast/table/table-style-not-updated.html [ Failure ]
fast/table/wide-colspan.html [ Failure ]
fast/table/wide-column.html [ Failure ]

# Tests designed for TEXT_AUTOSIZING, not IOS_TEXT_AUTOSIZING behavior.
fast/text-autosizing/cluster-inline-block-or-table.html [ ImageOnlyFailure ]
fast/text-autosizing/cluster-inline-grid-flex-box.html [ ImageOnlyFailure ]
fast/text-autosizing/cluster-list-item.html [ ImageOnlyFailure ]
@@ -2257,6 +2261,7 @@ fast/text-autosizing/wide-block.html [ ImageOnlyFailure ]
fast/text-autosizing/wide-child.html [ ImageOnlyFailure ]
fast/text-autosizing/wide-iframe.html [ ImageOnlyFailure ]
fast/text-autosizing/wide-in-narrow-overflow-scroll.html [ ImageOnlyFailure ]

fast/text/decorations-transformed.html [ Failure ]
fast/text/emphasis-avoid-ruby.html [ Failure ]
fast/text/emphasis-overlap.html [ Failure ]
@@ -2559,7 +2564,7 @@ webkit.org/b/104954 http/tests/canvas/canvas-slow-font-loading.html [ ImageOnlyF
###
# Mark as passing specific tests in folders that were skipped temporarily above.
##
webkit.org/b/138970 fast/css/line-height-text-autosizing.html [ Pass ]
webkit.org/b/138970 fast/text-autosizing/ios/line-height-text-autosizing.html [ Pass ]

# Skipped for mac as well:
webkit.org/b/129758 js/dom/create-lots-of-workers.html [ Skip ]
@@ -8,6 +8,8 @@
tiled-drawing [ Pass ]
swipe [ Pass ]

fast/text-autosizing/ios [ Pass ]

fast/events/cancelled-force-click-link-navigation.html [ Pass ]
fast/events/force-click-link-selection-behavior.html [ Pass ]
fast/events/force-click-on-link-navigation.html [ Pass ]
@@ -16,6 +16,8 @@ fast/forms/search/search-results-hidden-crash.html [ Pass ]

fast/url/user-visible [ Pass ]

fast/text-autosizing/ios [ Pass ]

#//////////////////////////////////////////////////////////////////////////////////////////
# End platform-specific directories.
#//////////////////////////////////////////////////////////////////////////////////////////
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,29 @@
Test the 'line-height' property interaction with '-webkit-text-size-adjust'.

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".


Case without text size adjust.
PASS window.getComputedStyle(testDivNoAdjust).getPropertyValue('line-height') is "23px"
PASS window.getComputedStyle(testDivNoAdjust).getPropertyValue('font-size') is "20px"
testDivNoAdjust.style['line-height'] = '1.6'
PASS window.getComputedStyle(testDivNoAdjust).getPropertyValue('line-height') is "32px"
testDivNoAdjust.style['line-height'] = '80%'
PASS window.getComputedStyle(testDivNoAdjust).getPropertyValue('line-height') is "16px"
testDivNoAdjust.style['line-height'] = '12px'
PASS window.getComputedStyle(testDivNoAdjust).getPropertyValue('line-height') is "12px"
Case with text size adjust.
Platform supports -webkit-text-size-adjust
FAIL window.getComputedStyle(testDivAdjust).getPropertyValue('line-height') should be normal. Was 36px.
PASS window.getComputedStyle(testDivAdjust).getPropertyValue('font-size') is "30px"
testDivAdjust.style['line-height'] = '1.6'
PASS window.getComputedStyle(testDivAdjust).getPropertyValue('line-height') is "48px"
testDivAdjust.style['line-height'] = '80%'
PASS window.getComputedStyle(testDivAdjust).getPropertyValue('line-height') is "24px"
testDivAdjust.style['line-height'] = '12px'
PASS window.getComputedStyle(testDivAdjust).getPropertyValue('line-height') is "18px"
PASS successfullyParsed is true

TEST COMPLETE
Test
Test
@@ -1,3 +1,15 @@
2016-05-06 Simon Fraser <simon.fraser@apple.com>

Enable IOS_TEXT_AUTOSIZING on Mac and make it testable
https://bugs.webkit.org/show_bug.cgi?id=157432
rdar://problem/16406720

Reviewed by Dean Jackson.

Enable IOS_TEXT_AUTOSIZING on Mac so it can be tested.

* Configurations/FeatureDefines.xcconfig:

2016-05-06 Joseph Pecoraro <pecoraro@apple.com>

Web Inspector: Console: Variables defined with let/const aren't accessible outside of console's scope
@@ -107,7 +107,7 @@ ENABLE_MAC_GESTURE_EVENTS = ;
ENABLE_MAC_GESTURE_EVENTS[sdk=macosx*] = $(ENABLE_MAC_GESTURE_EVENTS_macosx_WITH_INTERNAL_SDK_$(USE_INTERNAL_SDK));
ENABLE_MAC_GESTURE_EVENTS_macosx_WITH_INTERNAL_SDK_YES = ENABLE_MAC_GESTURE_EVENTS;

ENABLE_IOS_TEXT_AUTOSIZING[sdk=iphone*] = ENABLE_IOS_TEXT_AUTOSIZING;
ENABLE_IOS_TEXT_AUTOSIZING = ENABLE_IOS_TEXT_AUTOSIZING;
ENABLE_DATA_DETECTION = ENABLE_DATA_DETECTION;

ENABLE_IOS_TOUCH_EVENTS[sdk=iphone*] = $(ENABLE_IOS_TOUCH_EVENTS_ios_WITH_INTERNAL_SDK_$(USE_INTERNAL_SDK));
@@ -1,3 +1,74 @@
2016-05-06 Simon Fraser <simon.fraser@apple.com>

Enable IOS_TEXT_AUTOSIZING on Mac and make it testable
https://bugs.webkit.org/show_bug.cgi?id=157432
rdar://problem/16406720

Reviewed by Dean Jackson.

Enable IOS_TEXT_AUTOSIZING on Mac so it can be tested.

Make the setTextAutosizingEnabled() Setting work, and plumb it through WK1 and WK2
preferences for WTR and DRT. Make textAutosizingWindowSizeOverride() work, for layout tests.
These two settings are shared with TEXT_AUTOSIZING.

Add a TextAutosizing log channel, which is useful for generated -expected.html results.

Move adjustComputedFontSizesOnBlocks() and related code from RenderObject to RenderElement
without changes.

An implication of this set of changes is that the way clients enable text autosizing
has changed. Previously, they set the "MinimumZoomFontSize" preference to 0.
Settings::defaultMinimumZoomFontSize() used to do this in order to enable text autosizing
on iPhone only, not iPad.

Now the preferred technique is to leave minimumZoomFontSize alone, and to use textAutosizingEnabled()
instead. Settings::defaultTextAutosizingEnabled() now does the check for iPhone.

UIWebView calls WebKitGetMinimumZoomFontSize() to setup the default minimum font zoom size,
which will now always return 15, but had no other code that toggled this. So it's safe to just rely
on Settings::defaultTextAutosizingEnabled() doing the right thing for iPhone/iPad.

Test: fast/text-autosizing/ios/autosize-width.html

* Configurations/FeatureDefines.xcconfig:
* dom/Document.cpp:
(WebCore::Document::addAutoSizingNode):
* page/FrameView.cpp:
(WebCore::FrameView::layout):
* page/Settings.cpp:
(WebCore::Settings::Settings): Deleted.
(WebCore::Settings::setTextAutosizingEnabled): Deleted.
(WebCore::Settings::setTextAutosizingWindowSizeOverride): Deleted.
* page/Settings.h:
(WebCore::Settings::textAutosizingEnabled): Deleted.
(WebCore::Settings::textAutosizingWindowSizeOverride): Deleted.
* page/Settings.in:
* page/cocoa/SettingsCocoa.mm:
(WebCore::Settings::defaultMinimumZoomFontSize):
(WebCore::Settings::defaultTextAutosizingEnabled):
* platform/Logging.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::adjustComputedFontSizes):
* rendering/RenderElement.cpp:
(WebCore::includeNonFixedHeight):
(WebCore::RenderElement::adjustComputedFontSizesOnBlocks):
(WebCore::RenderElement::resetTextAutosizing):
* rendering/RenderElement.h:
* rendering/RenderObject.cpp:
(WebCore::includeNonFixedHeight): Deleted.
(WebCore::RenderObject::adjustComputedFontSizesOnBlocks): Deleted.
(WebCore::RenderObject::resetTextAutosizing): Deleted.
* rendering/RenderObject.h:
* rendering/TextAutoSizing.cpp:
(WebCore::TextAutoSizingValue::adjustNodeSizes):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setTextAutosizingEnabled):
(WebCore::InternalSettings::setTextAutosizingWindowSizeOverride):
* testing/InternalSettings.h:

2016-05-06 Joseph Pecoraro <pecoraro@apple.com>

Web Inspector: Console: Variables defined with let/const aren't accessible outside of console's scope
@@ -107,7 +107,7 @@ ENABLE_MAC_GESTURE_EVENTS = ;
ENABLE_MAC_GESTURE_EVENTS[sdk=macosx*] = $(ENABLE_MAC_GESTURE_EVENTS_macosx_WITH_INTERNAL_SDK_$(USE_INTERNAL_SDK));
ENABLE_MAC_GESTURE_EVENTS_macosx_WITH_INTERNAL_SDK_YES = ENABLE_MAC_GESTURE_EVENTS;

ENABLE_IOS_TEXT_AUTOSIZING[sdk=iphone*] = ENABLE_IOS_TEXT_AUTOSIZING;
ENABLE_IOS_TEXT_AUTOSIZING = ENABLE_IOS_TEXT_AUTOSIZING;
ENABLE_DATA_DETECTION = ENABLE_DATA_DETECTION;

ENABLE_IOS_TOUCH_EVENTS[sdk=iphone*] = $(ENABLE_IOS_TOUCH_EVENTS_ios_WITH_INTERNAL_SDK_$(USE_INTERNAL_SDK));
@@ -5280,8 +5280,11 @@ HTMLCanvasElement* Document::getCSSCanvasElement(const String& name)
}

#if ENABLE(IOS_TEXT_AUTOSIZING)

void Document::addAutoSizingNode(Node* node, float candidateSize)
{
LOG(TextAutosizing, " addAutoSizingNode %p candidateSize=%f", node, candidateSize);

TextAutoSizingKey key(&node->renderer()->style());
auto addResult = m_textAutoSizedNodes.ensure(WTFMove(key), [] {
return TextAutoSizingValue::create();

0 comments on commit 199b990

Please sign in to comment.