RESOLVED FIXED 197250
[iOS] Implement idempotent mode for text autosizing
https://bugs.webkit.org/show_bug.cgi?id=197250
Summary [iOS] Implement idempotent mode for text autosizing
Myles C. Maxfield
Reported 2019-04-24 15:22:09 PDT
[iOS] Implement idempotent mode for text autosizing
Attachments
WIP (17.50 KB, patch)
2019-04-24 15:24 PDT, Myles C. Maxfield
no flags
Patch (22.78 KB, patch)
2019-04-24 17:17 PDT, Myles C. Maxfield
no flags
Patch (23.87 KB, patch)
2019-04-25 14:55 PDT, Myles C. Maxfield
no flags
Patch (23.78 KB, patch)
2019-04-25 15:03 PDT, Myles C. Maxfield
no flags
Patch (28.08 KB, patch)
2019-04-25 16:00 PDT, Myles C. Maxfield
no flags
Patch (28.63 KB, patch)
2019-04-25 16:06 PDT, Myles C. Maxfield
no flags
Archive of layout-test-results from ews124 for ios-simulator-wk2 (3.11 MB, application/zip)
2019-04-25 19:10 PDT, EWS Watchlist
no flags
Patch for committing (28.74 KB, patch)
2019-04-25 22:35 PDT, Myles C. Maxfield
no flags
Patch for committing (28.50 KB, patch)
2019-04-25 22:55 PDT, Myles C. Maxfield
no flags
Myles C. Maxfield
Comment 1 2019-04-24 15:24:05 PDT
Myles C. Maxfield
Comment 2 2019-04-24 17:17:44 PDT
Simon Fraser (smfr)
Comment 3 2019-04-24 17:22:56 PDT
Comment on attachment 368202 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=368202&action=review > Source/WebCore/rendering/RenderElement.h:201 > + static bool idempotentMode(); Is this used?
Myles C. Maxfield
Comment 4 2019-04-24 17:38:57 PDT
Comment on attachment 368202 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=368202&action=review >> Source/WebCore/rendering/RenderElement.h:201 >> + static bool idempotentMode(); > > Is this used? Good catch! Nope.
Radar WebKit Bug Importer
Comment 5 2019-04-25 10:54:09 PDT
Myles C. Maxfield
Comment 6 2019-04-25 14:55:16 PDT
Myles C. Maxfield
Comment 7 2019-04-25 15:03:24 PDT
Simon Fraser (smfr)
Comment 8 2019-04-25 15:34:04 PDT
Comment on attachment 368273 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=368273&action=review > Source/WebCore/rendering/RenderBlockFlow.cpp:3738 > + pageScale = std::min(std::max(pageScale, 0.5f), 1.0f); > + for (auto& point : points) { > + float fraction = 3.0f - 3.0f * pageScale; > + point.setY(point.x() + (point.y() - point.x()) * fraction); > + } You do this work on every request to adjust text size, and then you skip points[i].x() < specifiedSize, so you only really need to scale two points, right? > Source/WebCore/rendering/RenderElement.cpp:2127 > + if (SettingsBase::textAutosizingUsesIdempotentMode() && style.maxHeight().type() == Fixed && is<RenderBlock>(renderer) && style.maxHeight().value() <= downcast<RenderBlock>(renderer).layoutOverflowRect().maxY()) > + return RenderObject::FixedHeight; Is this logic covered in your test(s)? > Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:3033 > + double initialScale = m_viewportConfiguration.initialScale(); > + m_page->setInitialScale(initialScale); Kinda stupid that m_viewportConfiguration isn't on Page in WebCore.
Myles C. Maxfield
Comment 9 2019-04-25 16:00:39 PDT
Myles C. Maxfield
Comment 10 2019-04-25 16:06:03 PDT
EWS Watchlist
Comment 11 2019-04-25 19:10:08 PDT
Comment on attachment 368283 [details] Patch Attachment 368283 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: https://webkit-queues.webkit.org/results/12000513 New failing tests: fast/text-autosizing/ios/idempotent-autosizing-identity.html fast/text-autosizing/ios/idempotent-autosizing.html
EWS Watchlist
Comment 12 2019-04-25 19:10:09 PDT
Created attachment 368296 [details] Archive of layout-test-results from ews124 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews124 Port: ios-simulator-wk2 Platform: Mac OS X 10.13.6
Jon Lee
Comment 13 2019-04-25 20:52:07 PDT
Comment on attachment 368283 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=368283&action=review > LayoutTests/fast/text-autosizing/ios/idempotent-autosizing-identity.html:11 > +<script src="../../../../resources/js-test-pre.js"></script> three .. instead of four ..?
Jon Lee
Comment 14 2019-04-25 20:58:14 PDT
(In reply to Simon Fraser (smfr) from comment #8) > Comment on attachment 368273 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=368273&action=review > > > Source/WebCore/rendering/RenderBlockFlow.cpp:3738 > > + pageScale = std::min(std::max(pageScale, 0.5f), 1.0f); > > + for (auto& point : points) { > > + float fraction = 3.0f - 3.0f * pageScale; > > + point.setY(point.x() + (point.y() - point.x()) * fraction); > > + } > > You do this work on every request to adjust text size, and then you skip > points[i].x() < specifiedSize, so you only really need to scale two points, > right? > > > Source/WebCore/rendering/RenderElement.cpp:2127 > > + if (SettingsBase::textAutosizingUsesIdempotentMode() && style.maxHeight().type() == Fixed && is<RenderBlock>(renderer) && style.maxHeight().value() <= downcast<RenderBlock>(renderer).layoutOverflowRect().maxY()) > > + return RenderObject::FixedHeight; > > Is this logic covered in your test(s)? > > > Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:3033 > > + double initialScale = m_viewportConfiguration.initialScale(); > > + m_page->setInitialScale(initialScale); > > Kinda stupid that m_viewportConfiguration isn't on Page in WebCore. Can we address these issues in a follow up?
Tim Horton
Comment 15 2019-04-25 21:23:40 PDT
(In reply to Jon Lee from comment #14) > (In reply to Simon Fraser (smfr) from comment #8) > > Comment on attachment 368273 [details] > > Patch > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=368273&action=review > > > > > Source/WebCore/rendering/RenderBlockFlow.cpp:3738 > > > + pageScale = std::min(std::max(pageScale, 0.5f), 1.0f); > > > + for (auto& point : points) { > > > + float fraction = 3.0f - 3.0f * pageScale; > > > + point.setY(point.x() + (point.y() - point.x()) * fraction); > > > + } > > > > You do this work on every request to adjust text size, and then you skip > > points[i].x() < specifiedSize, so you only really need to scale two points, > > right? > > > > > Source/WebCore/rendering/RenderElement.cpp:2127 > > > + if (SettingsBase::textAutosizingUsesIdempotentMode() && style.maxHeight().type() == Fixed && is<RenderBlock>(renderer) && style.maxHeight().value() <= downcast<RenderBlock>(renderer).layoutOverflowRect().maxY()) > > > + return RenderObject::FixedHeight; > > > > Is this logic covered in your test(s)? > > > > > Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:3033 > > > + double initialScale = m_viewportConfiguration.initialScale(); > > > + m_page->setInitialScale(initialScale); > > > > Kinda stupid that m_viewportConfiguration isn't on Page in WebCore. > > Can we address these issues in a follow up? I won't speak for the others, but the last one is definitely not something to fix in this patch :P
Myles C. Maxfield
Comment 16 2019-04-25 22:26:58 PDT
Comment on attachment 368273 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=368273&action=review >> Source/WebCore/rendering/RenderElement.cpp:2127 >> + return RenderObject::FixedHeight; > > Is this logic covered in your test(s)? Nope. I don't think we want to test these details yet, as they are likely to change soon.
Myles C. Maxfield
Comment 17 2019-04-25 22:35:51 PDT
Created attachment 368302 [details] Patch for committing
Myles C. Maxfield
Comment 18 2019-04-25 22:55:16 PDT
Created attachment 368303 [details] Patch for committing
Myles C. Maxfield
Comment 19 2019-04-25 23:34:05 PDT
Note You need to log in before you can comment on or make changes to this bug.