Changeset 128472 in webkit


Ignore:
Timestamp:
Sep 13, 2012 9:07:53 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[Qt][WK2] fast/forms/access-key-for-all-elements.html fails
https://bugs.webkit.org/show_bug.cgi?id=73917

Patch by Lauro Neto <lauro.neto@openbossa.org> on 2012-09-13
Reviewed by Simon Hausmann.

Access-key tests were failing due to hardcoded Mac OS X in the
Qt WK2 user agent string. This commit moves the WK1 implementation
to a shared one to be used by both versions.

Source/WebCore:

Adds the shared user agent implementation.

  • Target.pri:
  • platform/qt/UserAgentQt.cpp: Added.

(WebCore):
(WebCore::UserAgentQt::standardUserAgent):

  • platform/qt/UserAgentQt.h: Added.

(WebCore):
(UserAgentQt):

Source/WebKit/qt:

Change QWebPage to use the shared user agent implementation.

  • Api/qwebpage.cpp:

(QWebPage::userAgentForUrl):

Source/WebKit2:

Use the shared implementation instead of hardcoding the user agent.

  • UIProcess/qt/WebPageProxyQt.cpp:

(WebKit::WebPageProxy::standardUserAgent):

LayoutTests:

Unskip now passing tests.

  • platform/qt-5.0-wk2/Skipped:
Location:
trunk
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r128467 r128472  
     12012-09-13  Lauro Neto  <lauro.neto@openbossa.org>
     2
     3        [Qt][WK2] fast/forms/access-key-for-all-elements.html fails
     4        https://bugs.webkit.org/show_bug.cgi?id=73917
     5
     6        Reviewed by Simon Hausmann.
     7
     8        Access-key tests were failing due to hardcoded Mac OS X in the
     9        Qt WK2 user agent string. This commit moves the WK1 implementation
     10        to a shared one to be used by both versions.
     11
     12        Unskip now passing tests.
     13
     14        * platform/qt-5.0-wk2/Skipped:
     15
    1162012-09-13  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
    217
  • trunk/LayoutTests/platform/qt-5.0-wk2/Skipped

    r128445 r128472  
    4747fast/dynamic/layer-hit-test-crash.html
    4848fast/encoding/mailto-always-utf-8.html
    49 fast/events/access-key-self-destruct.html
    5049fast/events/context-no-deselect.html
    5150fast/events/context-onmousedown-event.html
     
    6362fast/events/wheelevent-in-horizontal-scrollbar-in-rtl.html
    6463fast/events/wheelevent-in-vertical-scrollbar-in-rtl.html
    65 fast/forms/access-key.html
    6664fast/forms/focus-change-on-keypress.html
    67 fast/forms/focus-selection-textarea.html
    6865fast/forms/interactive-validation-attach-assertion.html
    6966fast/forms/legend-access-key.html
    70 fast/forms/select-accesskey.html
    7167fast/loader/policy-delegate-action-hit-test-zoomed.html
    7268
     
    212208fast/transforms/scrollIntoView-transformed.html
    213209
    214 # [Qt][WK2] fast/forms/access-key-for-all-elements.html fails
    215 # https://bugs.webkit.org/show_bug.cgi?id=73917
    216 fast/forms/access-key-for-all-elements.html
    217 
    218210# [Qt][WK2] css3/unicode-bidi-isolate-aharon-failing.html fails
    219211# https://bugs.webkit.org/show_bug.cgi?id=74505
     
    236228editing/selection/click-in-margins-inside-editable-div.html
    237229fast/block/basic/020.html
    238 fast/dom/access-key-iframe.html
    239230fast/history/visited-link-background-color.html
    240231fast/layers/layer-visibility-sublayer.html
  • trunk/Source/WebCore/ChangeLog

    r128469 r128472  
     12012-09-13  Lauro Neto  <lauro.neto@openbossa.org>
     2
     3        [Qt][WK2] fast/forms/access-key-for-all-elements.html fails
     4        https://bugs.webkit.org/show_bug.cgi?id=73917
     5
     6        Reviewed by Simon Hausmann.
     7
     8        Access-key tests were failing due to hardcoded Mac OS X in the
     9        Qt WK2 user agent string. This commit moves the WK1 implementation
     10        to a shared one to be used by both versions.
     11
     12        Adds the shared user agent implementation.
     13
     14        * Target.pri:
     15        * platform/qt/UserAgentQt.cpp: Added.
     16        (WebCore):
     17        (WebCore::UserAgentQt::standardUserAgent):
     18        * platform/qt/UserAgentQt.h: Added.
     19        (WebCore):
     20        (UserAgentQt):
     21
    1222012-09-13  Kenneth Rohde Christiansen  <kenneth@webkit.org>
    223
  • trunk/Source/WebCore/Target.pri

    r128451 r128472  
    22282228    platform/qt/RenderThemeQt.h \
    22292229    platform/qt/RenderThemeQtMobile.h \
     2230    platform/qt/UserAgentQt.h \
    22302231    platform/ScrollableArea.h \
    22312232    platform/ScrollAnimator.h \
     
    27862787    platform/qt/SharedBufferQt.cpp \
    27872788    platform/qt/ThirdPartyCookiesQt.cpp \
     2789    platform/qt/UserAgentQt.cpp \
    27882790    platform/graphics/qt/FontCacheQt.cpp \
    27892791    platform/graphics/qt/FontCustomPlatformDataQt.cpp \
  • trunk/Source/WebKit/qt/Api/qwebpage.cpp

    r128403 r128472  
    11/*
    2     Copyright (C) 2008, 2009 Nokia Corporation and/or its subsidiary(-ies)
     2    Copyright (C) 2008, 2009, 2012 Nokia Corporation and/or its subsidiary(-ies)
    33    Copyright (C) 2007 Staikos Computing Services Inc.
    44    Copyright (C) 2007 Apple Inc.
     
    114114#endif // Q_OS_WIN32
    115115#include "TextIterator.h"
     116#include "UserAgentQt.h"
    116117#include "WebEventConversion.h"
     118#include "WebKitVersion.h"
    117119#include "WindowFeatures.h"
    118120#include "WorkerThread.h"
     
    37853787QString QWebPage::userAgentForUrl(const QUrl&) const
    37863788{
    3787     // splitting the string in three and user QStringBuilder is better than using QString::arg()
    3788     static QString firstPart;
    3789     static QString secondPart;
    3790     static QString thirdPart;
    3791 
    3792     if (firstPart.isNull() || secondPart.isNull() || thirdPart.isNull()) {
    3793         QString firstPartTemp;
    3794         firstPartTemp.reserve(150);
    3795         firstPartTemp += QString::fromLatin1("Mozilla/5.0 ("
    3796 
    3797     // Platform
    3798 #ifdef Q_WS_MAC
    3799         "Macintosh; "
    3800 #elif defined Q_WS_QWS
    3801         "QtEmbedded; "
    3802 #elif defined Q_WS_WIN
    3803         // Nothing
    3804 #elif defined Q_WS_X11
    3805         "X11; "
    3806 #else
    3807         "Unknown; "
    3808 #endif
    3809     );
    3810 
    3811 #if defined(QT_NO_OPENSSL)
    3812         // No SSL support
    3813         firstPartTemp += QString::fromLatin1("N; ");
    3814 #endif
    3815 
    3816         // Operating system
    3817 #ifdef Q_OS_AIX
    3818         firstPartTemp += QString::fromLatin1("AIX");
    3819 #elif defined Q_OS_WIN32
    3820         firstPartTemp += windowsVersionForUAString();
    3821 #elif defined Q_OS_DARWIN
    3822 #ifdef __i386__ || __x86_64__
    3823         firstPartTemp += QString::fromLatin1("Intel Mac OS X");
    3824 #else
    3825         firstPartTemp += QString::fromLatin1("PPC Mac OS X");
    3826 #endif
    3827 
    3828 #elif defined Q_OS_BSDI
    3829         firstPartTemp += QString::fromLatin1("BSD");
    3830 #elif defined Q_OS_BSD4
    3831         firstPartTemp += QString::fromLatin1("BSD Four");
    3832 #elif defined Q_OS_CYGWIN
    3833         firstPartTemp += QString::fromLatin1("Cygwin");
    3834 #elif defined Q_OS_DGUX
    3835         firstPartTemp += QString::fromLatin1("DG/UX");
    3836 #elif defined Q_OS_DYNIX
    3837         firstPartTemp += QString::fromLatin1("DYNIX/ptx");
    3838 #elif defined Q_OS_FREEBSD
    3839         firstPartTemp += QString::fromLatin1("FreeBSD");
    3840 #elif defined Q_OS_HPUX
    3841         firstPartTemp += QString::fromLatin1("HP-UX");
    3842 #elif defined Q_OS_HURD
    3843         firstPartTemp += QString::fromLatin1("GNU Hurd");
    3844 #elif defined Q_OS_IRIX
    3845         firstPartTemp += QString::fromLatin1("SGI Irix");
    3846 #elif defined Q_OS_LINUX
    3847 
    3848 #if defined(__x86_64__)
    3849         firstPartTemp += QString::fromLatin1("Linux x86_64");
    3850 #elif defined(__i386__)
    3851         firstPartTemp += QString::fromLatin1("Linux i686");
    3852 #else
    3853         firstPartTemp += QString::fromLatin1("Linux");
    3854 #endif
    3855 
    3856 #elif defined Q_OS_LYNX
    3857         firstPartTemp += QString::fromLatin1("LynxOS");
    3858 #elif defined Q_OS_NETBSD
    3859         firstPartTemp += QString::fromLatin1("NetBSD");
    3860 #elif defined Q_OS_OS2
    3861         firstPartTemp += QString::fromLatin1("OS/2");
    3862 #elif defined Q_OS_OPENBSD
    3863         firstPartTemp += QString::fromLatin1("OpenBSD");
    3864 #elif defined Q_OS_OS2EMX
    3865         firstPartTemp += QString::fromLatin1("OS/2");
    3866 #elif defined Q_OS_OSF
    3867         firstPartTemp += QString::fromLatin1("HP Tru64 UNIX");
    3868 #elif defined Q_OS_QNX6
    3869         firstPartTemp += QString::fromLatin1("QNX RTP Six");
    3870 #elif defined Q_OS_QNX
    3871         firstPartTemp += QString::fromLatin1("QNX");
    3872 #elif defined Q_OS_RELIANT
    3873         firstPartTemp += QString::fromLatin1("Reliant UNIX");
    3874 #elif defined Q_OS_SCO
    3875         firstPartTemp += QString::fromLatin1("SCO OpenServer");
    3876 #elif defined Q_OS_SOLARIS
    3877         firstPartTemp += QString::fromLatin1("Sun Solaris");
    3878 #elif defined Q_OS_ULTRIX
    3879         firstPartTemp += QString::fromLatin1("DEC Ultrix");
    3880 #elif defined Q_OS_UNIX
    3881         firstPartTemp += QString::fromLatin1("UNIX BSD/SYSV system");
    3882 #elif defined Q_OS_UNIXWARE
    3883         firstPartTemp += QString::fromLatin1("UnixWare Seven, Open UNIX Eight");
    3884 #else
    3885         firstPartTemp += QString::fromLatin1("Unknown");
    3886 #endif
    3887 
    3888 #if USE(QT_MOBILITY_SYSTEMINFO)
    3889         // adding Model Number
    3890         QtMobility::QSystemDeviceInfo systemDeviceInfo;
    3891 
    3892         QString model = systemDeviceInfo.model();
    3893         if (!model.isEmpty()) {
    3894             if (!firstPartTemp.endsWith("; "))
    3895                 firstPartTemp += QString::fromLatin1("; ");
    3896             firstPartTemp += systemDeviceInfo.model();
    3897         }
    3898 #endif
    3899         firstPartTemp.squeeze();
    3900         firstPart = firstPartTemp;
    3901 
    3902         QString secondPartTemp;
    3903         secondPartTemp.reserve(150);
    3904         secondPartTemp += QString::fromLatin1(") ");
    3905 
    3906         // webkit/qt version
    3907         secondPartTemp += QString::fromLatin1("AppleWebKit/");
    3908         secondPartTemp += qWebKitVersion();
    3909         secondPartTemp += QString::fromLatin1(" (KHTML, like Gecko) ");
    3910 
    3911 
    3912         // Application name split the third part
    3913         secondPartTemp.squeeze();
    3914         secondPart = secondPartTemp;
    3915 
    3916         QString thirdPartTemp;
    3917         thirdPartTemp.reserve(150);
    3918         thirdPartTemp += QLatin1String(" Safari/");
    3919         thirdPartTemp += qWebKitVersion();
    3920         thirdPartTemp.squeeze();
    3921         thirdPart = thirdPartTemp;
    3922         Q_ASSERT(!firstPart.isNull());
    3923         Q_ASSERT(!secondPart.isNull());
    3924         Q_ASSERT(!thirdPart.isNull());
    3925     }
    3926 
    3927     // Application name/version
    3928     QString appName = QCoreApplication::applicationName();
    3929     if (!appName.isEmpty()) {
    3930         QString appVer = QCoreApplication::applicationVersion();
    3931         if (!appVer.isEmpty())
    3932             appName.append(QLatin1Char('/') + appVer);
    3933     } else {
    3934         // Qt version
    3935         appName = QString::fromLatin1("Qt/") + QString::fromLatin1(qVersion());
    3936     }
    3937 
    3938     return firstPart + secondPart + appName + thirdPart;
     3789    return UserAgentQt::standardUserAgent("", WEBKIT_MAJOR_VERSION, WEBKIT_MINOR_VERSION);
    39393790}
    39403791
  • trunk/Source/WebKit/qt/ChangeLog

    r128440 r128472  
     12012-09-13  Lauro Neto  <lauro.neto@openbossa.org>
     2
     3        [Qt][WK2] fast/forms/access-key-for-all-elements.html fails
     4        https://bugs.webkit.org/show_bug.cgi?id=73917
     5
     6        Reviewed by Simon Hausmann.
     7
     8        Access-key tests were failing due to hardcoded Mac OS X in the
     9        Qt WK2 user agent string. This commit moves the WK1 implementation
     10        to a shared one to be used by both versions.
     11
     12        Change QWebPage to use the shared user agent implementation.
     13
     14        * Api/qwebpage.cpp:
     15        (QWebPage::userAgentForUrl):
     16
    1172012-09-13  Oswald Buddenhagen  <oswald.buddenhagen@nokia.com>
    218
  • trunk/Source/WebKit2/ChangeLog

    r128459 r128472  
     12012-09-13  Lauro Neto  <lauro.neto@openbossa.org>
     2
     3        [Qt][WK2] fast/forms/access-key-for-all-elements.html fails
     4        https://bugs.webkit.org/show_bug.cgi?id=73917
     5
     6        Reviewed by Simon Hausmann.
     7
     8        Access-key tests were failing due to hardcoded Mac OS X in the
     9        Qt WK2 user agent string. This commit moves the WK1 implementation
     10        to a shared one to be used by both versions.
     11
     12        Use the shared implementation instead of hardcoding the user agent.
     13
     14        * UIProcess/qt/WebPageProxyQt.cpp:
     15        (WebKit::WebPageProxy::standardUserAgent):
     16
    1172012-09-13  Simon Hausmann  <simon.hausmann@nokia.com>
    218
  • trunk/Source/WebKit2/UIProcess/qt/WebPageProxyQt.cpp

    r124889 r128472  
    11/*
     2 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
    23 * Copyright (C) 2010 Apple Inc. All rights reserved.
    34 *
     
    2829
    2930#include "PageClient.h"
     31#include "UserAgentQt.h"
     32#include "WebKitVersion.h"
    3033#include "WebPageMessages.h"
    3134#include "WebProcessProxy.h"
     
    4548String WebPageProxy::standardUserAgent(const String& applicationNameForUserAgent)
    4649{
    47     // FIXME: This should not be hard coded.
    48     return "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6) AppleWebKit/531.4 (KHTML, like Gecko) Version/4.0.3 Safari/531.4";
     50    return UserAgentQt::standardUserAgent(applicationNameForUserAgent, WEBKIT_MAJOR_VERSION, WEBKIT_MINOR_VERSION);
    4951}
    5052
Note: See TracChangeset for help on using the changeset viewer.