Bug 132893

Summary: REGRESSION(WK2): Many pages have very wrong text size after rotating
Product: WebKit Reporter: Enrica Casucci <enrica>
Component: WebKit2Assignee: Enrica Casucci <enrica>
Status: RESOLVED FIXED    
Severity: Normal Keywords: InRadar
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch benjamin: review+

Description Enrica Casucci 2014-05-13 17:23:01 PDT
Text autosizing seems to break most pages on rotation.

<rdar://problem/16806958>
Comment 1 Enrica Casucci 2014-05-13 17:27:32 PDT
Created attachment 231423 [details]
Patch
Comment 2 Benjamin Poulain 2014-05-13 17:30:40 PDT
Comment on attachment 231423 [details]
Patch

lgtm
Comment 3 Darin Adler 2014-05-13 22:43:13 PDT
Comment on attachment 231423 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=231423&action=review

Sure would be nice to have some kind of bottleneck function rather than having a width check in three different places.

> Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:1910
> +    for (Frame* frame = &m_page->mainFrame(); frame; frame = frame->tree().traverseNext(&m_page->mainFrame())) {

This should just call traverseNext() with no arguments. There’s no reason to pass the main frame explicitly since there are no additional frames outside the main frame.
Comment 4 Enrica Casucci 2014-05-14 10:58:44 PDT
Thanks for the feedback.
I've removed the parameter to traverseNext and changed resetTextAutosizingBeforeLayout to resetTextAutosizingBeforeLayoutIfNeeded which takes p;d and new size.
This way the width check is inside the new method.
Comment 5 Enrica Casucci 2014-05-14 11:03:38 PDT
Committed revision 168848.