Bug 91990 - [Qt] Default sizes for input-text and text-area are different when running DRT/WTR
Summary: [Qt] Default sizes for input-text and text-area are different when running DR...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Luciano Wolf
URL:
Keywords: Qt, QtTriaged
Depends on: 91504 91570 91621 92186
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-23 06:38 PDT by Caio Marcelo de Oliveira Filho
Modified: 2012-08-07 05:49 PDT (History)
7 users (show)

See Also:


Attachments
Use correct fonts from testfonts directory (5.31 KB, patch)
2012-08-06 07:12 PDT, Luciano Wolf
no flags Details | Formatted Diff | Diff
Macro has been renamed (5.27 KB, patch)
2012-08-06 10:01 PDT, Luciano Wolf
no flags Details | Formatted Diff | Diff
Patch for landing (5.29 KB, patch)
2012-08-06 12:41 PDT, Luciano Wolf
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Caio Marcelo de Oliveira Filho 2012-07-23 06:38:58 PDT
For testing we use the same fonts and the same RenderTheme for WK1 and WK2. I think the default sizes for forms should be the same as well, so we can keep the same expected results for both WK1 and WK2.

I identified this problem while rebaselining editing/inserting for the new fonts. Two tests failing in WK2 because of this are:

editing/inserting/4960120-1.html
editing/inserting/before-after-input-element.html
Comment 1 Caio Marcelo de Oliveira Filho 2012-07-23 11:59:49 PDT
tables/mozilla_expected_failures/bugs/bug92647-1.html
Comment 2 Caio Marcelo de Oliveira Filho 2012-07-23 16:06:01 PDT
css3/selectors3/html/css3-modsel-23.html
css3/selectors3/html/css3-modsel-24.html
css3/selectors3/html/css3-modsel-68.html
css3/selectors3/html/css3-modsel-69.html
css3/selectors3/xhtml/css3-modsel-23.xml
css3/selectors3/xhtml/css3-modsel-24.xml
css3/selectors3/xhtml/css3-modsel-68.xml
css3/selectors3/xhtml/css3-modsel-69.xml
css3/selectors3/xml/css3-modsel-23.xml
css3/selectors3/xml/css3-modsel-24.xml
css3/selectors3/xml/css3-modsel-68.xml
css3/selectors3/xml/css3-modsel-69.xml
Comment 3 Bruno Abinader (history only) 2012-07-26 04:41:27 PDT
editing/selection/3690703-2.html
editing/selection/3690703.html
editing/selection/3690719.html

(and more to come from previous rebaselines)
Comment 4 Bruno Abinader (history only) 2012-07-26 05:02:09 PDT
editing/selection/4895428-3.html
editing/selection/4975120.html
editing/selection/drag-select-1.html
Comment 5 Bruno Abinader (history only) 2012-07-26 06:19:03 PDT
fast/forms/basic-inputs.html
fast/forms/basic-textareas-quirks.html
fast/forms/control-restrict-line-height.html
fast/forms/encoding-test.html
fast/forms/fieldset-align.html
fast/forms/input-appearance-bkcolor.html
fast/forms/input-appearance-default-bkcolor.html
fast/forms/input-appearance-disabled.html
fast/forms/input-appearance-focus.html
fast/forms/input-appearance-preventDefault.html
fast/forms/input-appearance-readonly.html
fast/forms/input-appearance-selection.html
fast/forms/input-appearance-visibility.html
fast/forms/input-baseline.html
fast/forms/input-double-click-selection-gap-bug.html
fast/forms/input-placeholder-visibility-1.html
fast/forms/input-placeholder-visibility-3.html
fast/forms/input-readonly-dimmed.html
fast/forms/input-readonly-empty.html
fast/forms/input-spaces.html
fast/forms/input-text-click-inside.html
fast/forms/input-text-double-click.html
fast/forms/input-text-option-delete.html
fast/forms/input-text-self-emptying-click.html
fast/forms/input-text-word-wrap.html
fast/forms/input-width.html
fast/forms/placeholder-position.html
fast/forms/search-cancel-button-style-sharing.html
fast/forms/search-display-none-cancel-button.html
fast/forms/search-rtl.html
fast/forms/search-vertical-alignment.html
fast/forms/text-style-color.html
fast/forms/textarea-placeholder-pseudo-style.html
fast/forms/textarea-placeholder-visibility-1.html
fast/forms/textarea-placeholder-visibility-2.html
fast/forms/textfield-focus-ring.html
fast/forms/textfield-outline.html
fast/forms/textfield-overflow.html
Comment 6 Bruno Abinader (history only) 2012-07-26 09:28:12 PDT
fast/text/international/unicode-bidi-plaintext-in-textarea.html
fast/text/textIteratorNilRenderer.html
Comment 7 Bruno Abinader (history only) 2012-07-26 09:50:20 PDT
fast/table/colspanMinWidth.html
fast/table/spanOverlapRepaint.html
fast/table/text-field-baseline.html
Comment 8 Csaba Osztrogonác 2012-07-30 08:33:29 PDT
tables/mozilla/bugs/bug1188.html
tables/mozilla/bugs/bug18359.html
tables/mozilla/bugs/bug24200.html
tables/mozilla/bugs/bug2479-3.html
tables/mozilla/bugs/bug28928.html
tables/mozilla/bugs/bug30559.html
tables/mozilla/bugs/bug4382.html
tables/mozilla/bugs/bug4527.html
tables/mozilla/bugs/bug46368-1.html
tables/mozilla/bugs/bug46368-2.html
tables/mozilla/bugs/bug51037.html
tables/mozilla/bugs/bug55545.html
tables/mozilla/bugs/bug59354.html
tables/mozilla/bugs/bug96334.html
tables/mozilla/dom/tableDom.html
tables/mozilla/other/move_row.html
Comment 9 Csaba Osztrogonác 2012-07-30 08:51:47 PDT
There are only 83 tests related to this bug. I think we can simple check in qt-5.0-wk2 specific results to have better test coverage until find a proper fix this bug. ( or feauture? :) )
Comment 10 Caio Marcelo de Oliveira Filho 2012-07-30 10:04:51 PDT
(In reply to comment #9)
> There are only 83 tests related to this bug. I think we can simple check in qt-5.0-wk2 specific results to have better test coverage until find a proper fix this bug. ( or feauture? :) )

I don't think it's a good idea, given that the Luciano is already working on a fix for this and there's no essential reason to WK2 behave differently than WK1 in those cases.

In general I think having WK2 specific results should be seen as the last option, only have them if we have a very good reason.
Comment 11 Csaba Osztrogonác 2012-07-31 03:48:55 PDT
I didn't notice if Luciano is working on it. Of course having same results 
for WK1 and WK2 is the best solution. :) But if we don't find the proper
solution for a long time, we should commit WK2 specific expected results 
too not to lose test coverage for these tests. The results for WK2 aren't
wrong, only a little bit different.
Comment 12 Luciano Wolf 2012-07-31 07:23:45 PDT
I'm investigating and one of my findings is that DRT and WTR use different fonts (Liberation Serif / Times). Now I'm trying to implement the functions inside webkit/Source/WebKit2/UIProcess/qt/WebPreferencesQt.cpp to make it use the same font as DRT. The current implementation uses default values from webkit/Source/WebKit2/Shared/WebPreferencesStore.h. I hope to close this bug till this weekend.
Comment 13 Luciano Wolf 2012-08-06 07:12:38 PDT
Created attachment 156686 [details]
Use correct fonts from testfonts directory
Comment 14 Balazs Kelemen 2012-08-06 07:48:33 PDT
Comment on attachment 156686 [details]
Use correct fonts from testfonts directory

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

Here are my informal complaining comments :)

> Source/WebKit2/UIProcess/qt/WebPreferencesQt.cpp:56
> +#define INITIALIZE_PREFERENCE_FROM_NSUSERDEFAULTS(KeyUpper, KeyLower, TypeName, Type, DefaultValue) \
> +    set##TypeName##ValueIfInUserDefaults(WebPreferencesKey::KeyLower##Key(), m_store, qFontHint);

This is a crasy name for this macro :)

> Tools/WebKitTestRunner/qt/main.cpp:124
> +    WebKit::initializeTestFonts();
> +    QCoreApplication::setAttribute(Qt::AA_Use96Dpi, true);
> +

Does that mean that we draw input-tet and text-area on the UI side? Otherwise it's not clear to me why this is necessary.
Comment 15 Luciano Wolf 2012-08-06 09:04:32 PDT
(In reply to comment #14)
> (From update of attachment 156686 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=156686&action=review
> 
> Here are my informal complaining comments :)
> 
> > Source/WebKit2/UIProcess/qt/WebPreferencesQt.cpp:56
> > +#define INITIALIZE_PREFERENCE_FROM_NSUSERDEFAULTS(KeyUpper, KeyLower, TypeName, Type, DefaultValue) \
> > +    set##TypeName##ValueIfInUserDefaults(WebPreferencesKey::KeyLower##Key(), m_store, qFontHint);
> 
> This is a crasy name for this macro :)

I took it from Mac implementation :) I'll rename it to something better.

> 
> > Tools/WebKitTestRunner/qt/main.cpp:124
> > +    WebKit::initializeTestFonts();
> > +    QCoreApplication::setAttribute(Qt::AA_Use96Dpi, true);
> > +
> 
> Does that mean that we draw input-tet and text-area on the UI side? Otherwise it's not clear to me why this is necessary.

If we don't initialize fontconfig stuff before reaching that macro QFont.defaultFamily returns different (Dejavu font type) results. The way I found to fix this behaviour was to initialize here - as DumpRenderTree does.
Comment 16 Luciano Wolf 2012-08-06 10:01:44 PDT
Created attachment 156717 [details]
Macro has been renamed
Comment 17 Luciano Wolf 2012-08-06 12:41:50 PDT
Created attachment 156746 [details]
Patch for landing
Comment 18 WebKit Review Bot 2012-08-06 16:05:31 PDT
Comment on attachment 156746 [details]
Patch for landing

Clearing flags on attachment: 156746

Committed r124808: <http://trac.webkit.org/changeset/124808>
Comment 19 WebKit Review Bot 2012-08-06 16:05:37 PDT
All reviewed patches have been landed.  Closing bug.
Comment 20 Csaba Osztrogonác 2012-08-07 03:13:29 PDT
(In reply to comment #18)
> (From update of attachment 156746 [details])
> Clearing flags on attachment: 156746
> 
> Committed r124808: <http://trac.webkit.org/changeset/124808>

You forgot to unskip tests and remove unnecessary qt-5.0-wk2 expected files.
I did it - https://trac.webkit.org/changeset/124873
Comment 21 Luciano Wolf 2012-08-07 05:49:13 PDT
(In reply to comment #20)
> (In reply to comment #18)
> > (From update of attachment 156746 [details] [details])
> > Clearing flags on attachment: 156746
> > 
> > Committed r124808: <http://trac.webkit.org/changeset/124808>
> 
> You forgot to unskip tests and remove unnecessary qt-5.0-wk2 expected files.
> I did it - https://trac.webkit.org/changeset/124873

oops! Thanks a lot!