diff options
author | Andy Shaw <qt-info@nokia.com> | 2010-06-21 12:21:52 (GMT) |
---|---|---|
committer | Andy Shaw <qt-info@nokia.com> | 2010-06-21 12:21:52 (GMT) |
commit | e18632ed9ef6eeda767cf405de491f6ee00b0692 (patch) | |
tree | 325719c3a451cc7f82197540f6c4bab2a91e6ea4 | |
parent | 41e284f14ff0c8f9a0e0ca55c4b547dec0d9c09a (diff) | |
parent | 52f0076380d653dad74c02f3c8a3415fd1f6429e (diff) | |
download | Qt-e18632ed9ef6eeda767cf405de491f6ee00b0692.zip Qt-e18632ed9ef6eeda767cf405de491f6ee00b0692.tar.gz Qt-e18632ed9ef6eeda767cf405de491f6ee00b0692.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.6
23 files changed, 410 insertions, 115 deletions
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-dump.c b/src/3rdparty/harfbuzz/src/harfbuzz-dump.c index a1ef6b6..54d42e9 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-dump.c +++ b/src/3rdparty/harfbuzz/src/harfbuzz-dump.c @@ -519,13 +519,13 @@ Dump_ValueRecord (HB_ValueRecord *ValueRecord, FILE *stream, int indent, HB_Type if (value_format & HB_GPOS_FORMAT_HAVE_Y_ADVANCE) DUMP_FINT (ValueRecord, XAdvance); if (value_format & HB_GPOS_FORMAT_HAVE_X_PLACEMENT_DEVICE) - RECURSE (Device, Device, &*ValueRecord->XPlacementDevice); + RECURSE (Device, Device, &*ValueRecord->DeviceTables[VR_X_PLACEMENT_DEVICE]); if (value_format & HB_GPOS_FORMAT_HAVE_Y_PLACEMENT_DEVICE) - RECURSE (Device, Device, &*ValueRecord->YPlacementDevice); + RECURSE (Device, Device, &*ValueRecord->DeviceTables[VR_Y_PLACEMENT_DEVICE]); if (value_format & HB_GPOS_FORMAT_HAVE_X_ADVANCE_DEVICE) - RECURSE (Device, Device, &*ValueRecord->XAdvanceDevice); + RECURSE (Device, Device, &*ValueRecord->DeviceTables[VR_X_ADVANCE_DEVICE]); if (value_format & HB_GPOS_FORMAT_HAVE_Y_ADVANCE_DEVICE) - RECURSE (Device, Device, &*ValueRecord->YAdvanceDevice); + RECURSE (Device, Device, &*ValueRecord->DeviceTables[VR_Y_ADVANCE_DEVICE]); #ifdef HB_SUPPORT_MULTIPLE_MASTER if (value_format & HB_GPOS_FORMAT_HAVE_X_ID_PLACEMENT) DUMP_FUINT (ValueRecord, XIdPlacement); diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-global.h b/src/3rdparty/harfbuzz/src/harfbuzz-global.h index bccd6a2..5b2b679 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-global.h +++ b/src/3rdparty/harfbuzz/src/harfbuzz-global.h @@ -39,7 +39,7 @@ #define HB_END_HEADER /* nothing */ #endif -#if defined(__GNUC__) || defined(_MSC_VER) +#if defined(__GNUC__) || defined(__ARMCC__) || defined(__CC_ARM) || defined(_MSC_VER) #define HB_USE_PACKED_STRUCTS #endif diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-gpos-private.h b/src/3rdparty/harfbuzz/src/harfbuzz-gpos-private.h index d513c27..39f3159 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-gpos-private.h +++ b/src/3rdparty/harfbuzz/src/harfbuzz-gpos-private.h @@ -38,6 +38,11 @@ HB_BEGIN_HEADER /* shared tables */ +#define VR_X_PLACEMENT_DEVICE 0 +#define VR_Y_PLACEMENT_DEVICE 1 +#define VR_X_ADVANCE_DEVICE 2 +#define VR_Y_ADVANCE_DEVICE 3 + struct HB_ValueRecord_ { HB_Short XPlacement; /* horizontal adjustment for @@ -48,14 +53,10 @@ struct HB_ValueRecord_ advance */ HB_Short YAdvance; /* vertical adjustment for advance */ - HB_Device* XPlacementDevice; /* device table for horizontal - placement */ - HB_Device* YPlacementDevice; /* device table for vertical - placement */ - HB_Device* XAdvanceDevice; /* device table for horizontal - advance */ - HB_Device* YAdvanceDevice; /* device table for vertical - advance */ + + HB_Device** DeviceTables; /* device tables for placement + and advance */ + #ifdef HB_SUPPORT_MULTIPLE_MASTER HB_UShort XIdPlacement; /* horizontal placement metric ID */ HB_UShort YIdPlacement; /* vertical placement metric ID */ @@ -70,6 +71,8 @@ typedef struct HB_ValueRecord_ HB_ValueRecord; /* Mask values to scan the value format of the ValueRecord structure. We always expand compressed ValueRecords of the font. */ +#define HB_GPOS_FORMAT_HAVE_DEVICE_TABLES 0x00F0 + #define HB_GPOS_FORMAT_HAVE_X_PLACEMENT 0x0001 #define HB_GPOS_FORMAT_HAVE_Y_PLACEMENT 0x0002 #define HB_GPOS_FORMAT_HAVE_X_ADVANCE 0x0004 @@ -102,13 +105,14 @@ struct HB_AnchorFormat2_ typedef struct HB_AnchorFormat2_ HB_AnchorFormat2; +#define AF3_X_DEVICE_TABLE 0 +#define AF3_Y_DEVICE_TABLE 1 struct HB_AnchorFormat3_ { HB_Short XCoordinate; /* horizontal value */ HB_Short YCoordinate; /* vertical value */ - HB_Device* XDeviceTable; /* device table for X coordinate */ - HB_Device* YDeviceTable; /* device table for Y coordinate */ + HB_Device** DeviceTables; /* device tables for coordinates */ }; typedef struct HB_AnchorFormat3_ HB_AnchorFormat3; @@ -533,18 +537,18 @@ typedef struct HB_ContextPos_ HB_ContextPos; struct HB_ChainPosRule_ { + HB_UShort* Backtrack; /* array of backtrack glyph IDs */ + HB_UShort* Input; /* array of input glyph IDs */ + HB_UShort* Lookahead; /* array of lookahead glyph IDs */ + HB_PosLookupRecord* PosLookupRecord; + /* array of PosLookupRecords */ HB_UShort BacktrackGlyphCount; /* total number of backtrack glyphs */ - HB_UShort* Backtrack; /* array of backtrack glyph IDs */ HB_UShort InputGlyphCount; /* total number of input glyphs */ - HB_UShort* Input; /* array of input glyph IDs */ HB_UShort LookaheadGlyphCount; /* total number of lookahead glyphs */ - HB_UShort* Lookahead; /* array of lookahead glyph IDs */ HB_UShort PosCount; /* number of PosLookupRecords */ - HB_PosLookupRecord* PosLookupRecord; - /* array of PosLookupRecords */ }; typedef struct HB_ChainPosRule_ HB_ChainPosRule; @@ -574,20 +578,20 @@ typedef struct HB_ChainContextPosFormat1_ HB_ChainContextPosFormat1; struct HB_ChainPosClassRule_ { + HB_UShort* Backtrack; /* array of backtrack classes */ + HB_UShort* Input; /* array of context classes */ + HB_UShort* Lookahead; /* array of lookahead classes */ + HB_PosLookupRecord* PosLookupRecord; + /* array of substitution lookups */ HB_UShort BacktrackGlyphCount; /* total number of backtrack classes */ - HB_UShort* Backtrack; /* array of backtrack classes */ HB_UShort InputGlyphCount; /* total number of context classes */ - HB_UShort* Input; /* array of context classes */ HB_UShort LookaheadGlyphCount; /* total number of lookahead classes */ - HB_UShort* Lookahead; /* array of lookahead classes */ HB_UShort PosCount; /* number of PosLookupRecords */ - HB_PosLookupRecord* PosLookupRecord; - /* array of substitution lookups */ }; typedef struct HB_ChainPosClassRule_ HB_ChainPosClassRule; diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c b/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c index 61e42fd..31b9ae1 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c +++ b/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c @@ -256,6 +256,20 @@ static HB_Error Load_ValueRecord( HB_ValueRecord* vr, else vr->YAdvance = 0; + if ( format & HB_GPOS_FORMAT_HAVE_DEVICE_TABLES ) + { + if ( ALLOC_ARRAY( vr->DeviceTables, 4, HB_Device ) ) + return error; + vr->DeviceTables[VR_X_ADVANCE_DEVICE] = 0; + vr->DeviceTables[VR_Y_ADVANCE_DEVICE] = 0; + vr->DeviceTables[VR_X_PLACEMENT_DEVICE] = 0; + vr->DeviceTables[VR_Y_PLACEMENT_DEVICE] = 0; + } + else + { + vr->DeviceTables = 0; + } + if ( format & HB_GPOS_FORMAT_HAVE_X_PLACEMENT_DEVICE ) { if ( ACCESS_Frame( 2L ) ) @@ -271,18 +285,11 @@ static HB_Error Load_ValueRecord( HB_ValueRecord* vr, cur_offset = FILE_Pos(); if ( FILE_Seek( new_offset ) || - ( error = _HB_OPEN_Load_Device( &vr->XPlacementDevice, + ( error = _HB_OPEN_Load_Device( &vr->DeviceTables[VR_X_PLACEMENT_DEVICE], stream ) ) != HB_Err_Ok ) return error; (void)FILE_Seek( cur_offset ); } - else - goto empty1; - } - else - { - empty1: - vr->XPlacementDevice = 0; } if ( format & HB_GPOS_FORMAT_HAVE_Y_PLACEMENT_DEVICE ) @@ -300,18 +307,11 @@ static HB_Error Load_ValueRecord( HB_ValueRecord* vr, cur_offset = FILE_Pos(); if ( FILE_Seek( new_offset ) || - ( error = _HB_OPEN_Load_Device( &vr->YPlacementDevice, + ( error = _HB_OPEN_Load_Device( &vr->DeviceTables[VR_Y_PLACEMENT_DEVICE], stream ) ) != HB_Err_Ok ) goto Fail3; (void)FILE_Seek( cur_offset ); } - else - goto empty2; - } - else - { - empty2: - vr->YPlacementDevice = 0; } if ( format & HB_GPOS_FORMAT_HAVE_X_ADVANCE_DEVICE ) @@ -329,18 +329,11 @@ static HB_Error Load_ValueRecord( HB_ValueRecord* vr, cur_offset = FILE_Pos(); if ( FILE_Seek( new_offset ) || - ( error = _HB_OPEN_Load_Device( &vr->XAdvanceDevice, + ( error = _HB_OPEN_Load_Device( &vr->DeviceTables[VR_X_ADVANCE_DEVICE], stream ) ) != HB_Err_Ok ) goto Fail2; (void)FILE_Seek( cur_offset ); } - else - goto empty3; - } - else - { - empty3: - vr->XAdvanceDevice = 0; } if ( format & HB_GPOS_FORMAT_HAVE_Y_ADVANCE_DEVICE ) @@ -358,18 +351,11 @@ static HB_Error Load_ValueRecord( HB_ValueRecord* vr, cur_offset = FILE_Pos(); if ( FILE_Seek( new_offset ) || - ( error = _HB_OPEN_Load_Device( &vr->YAdvanceDevice, + ( error = _HB_OPEN_Load_Device( &vr->DeviceTables[VR_Y_ADVANCE_DEVICE], stream ) ) != HB_Err_Ok ) goto Fail1; (void)FILE_Seek( cur_offset ); } - else - goto empty4; - } - else - { - empty4: - vr->YAdvanceDevice = 0; } if ( format & HB_GPOS_FORMAT_HAVE_X_ID_PLACEMENT ) @@ -447,13 +433,15 @@ static HB_Error Load_ValueRecord( HB_ValueRecord* vr, return HB_Err_Ok; Fail1: - _HB_OPEN_Free_Device( &vr->YAdvanceDevice ); + _HB_OPEN_Free_Device( &vr->DeviceTables[VR_Y_ADVANCE_DEVICE] ); Fail2: - _HB_OPEN_Free_Device( &vr->XAdvanceDevice ); + _HB_OPEN_Free_Device( &vr->DeviceTables[VR_X_ADVANCE_DEVICE] ); Fail3: - _HB_OPEN_Free_Device( &vr->YPlacementDevice ); + _HB_OPEN_Free_Device( &vr->DeviceTables[VR_Y_PLACEMENT_DEVICE] ); + + FREE( vr->DeviceTables ); return error; } @@ -462,13 +450,14 @@ static void Free_ValueRecord( HB_ValueRecord* vr, HB_UShort format ) { if ( format & HB_GPOS_FORMAT_HAVE_Y_ADVANCE_DEVICE ) - _HB_OPEN_Free_Device( &vr->YAdvanceDevice ); + _HB_OPEN_Free_Device( &vr->DeviceTables[VR_Y_ADVANCE_DEVICE] ); if ( format & HB_GPOS_FORMAT_HAVE_X_ADVANCE_DEVICE ) - _HB_OPEN_Free_Device( &vr->XAdvanceDevice ); + _HB_OPEN_Free_Device( &vr->DeviceTables[VR_X_ADVANCE_DEVICE] ); if ( format & HB_GPOS_FORMAT_HAVE_Y_PLACEMENT_DEVICE ) - _HB_OPEN_Free_Device( &vr->YPlacementDevice ); + _HB_OPEN_Free_Device( &vr->DeviceTables[VR_Y_PLACEMENT_DEVICE] ); if ( format & HB_GPOS_FORMAT_HAVE_X_PLACEMENT_DEVICE ) - _HB_OPEN_Free_Device( &vr->XPlacementDevice ); + _HB_OPEN_Free_Device( &vr->DeviceTables[VR_X_PLACEMENT_DEVICE] ); + FREE( vr->DeviceTables ); } @@ -513,22 +502,22 @@ static HB_Error Get_ValueRecord( GPOS_Instance* gpi, if ( format & HB_GPOS_FORMAT_HAVE_X_PLACEMENT_DEVICE ) { - _HB_OPEN_Get_Device( &vr->XPlacementDevice, x_ppem, &pixel_value ); + _HB_OPEN_Get_Device( vr->DeviceTables[VR_X_PLACEMENT_DEVICE], x_ppem, &pixel_value ); gd->x_pos += pixel_value << 6; } if ( format & HB_GPOS_FORMAT_HAVE_Y_PLACEMENT_DEVICE ) { - _HB_OPEN_Get_Device( &vr->YPlacementDevice, y_ppem, &pixel_value ); + _HB_OPEN_Get_Device( vr->DeviceTables[VR_Y_PLACEMENT_DEVICE], y_ppem, &pixel_value ); gd->y_pos += pixel_value << 6; } if ( format & HB_GPOS_FORMAT_HAVE_X_ADVANCE_DEVICE ) { - _HB_OPEN_Get_Device( &vr->XAdvanceDevice, x_ppem, &pixel_value ); + _HB_OPEN_Get_Device( vr->DeviceTables[VR_X_ADVANCE_DEVICE], x_ppem, &pixel_value ); gd->x_advance += pixel_value << 6; } if ( format & HB_GPOS_FORMAT_HAVE_Y_ADVANCE_DEVICE ) { - _HB_OPEN_Get_Device( &vr->YAdvanceDevice, y_ppem, &pixel_value ); + _HB_OPEN_Get_Device( vr->DeviceTables[VR_Y_ADVANCE_DEVICE], y_ppem, &pixel_value ); gd->y_advance += pixel_value << 6; } } @@ -632,19 +621,21 @@ static HB_Error Load_Anchor( HB_Anchor* an, if ( new_offset ) { + if ( ALLOC_ARRAY( an->af.af3.DeviceTables, 2, HB_Device ) ) + return error; + + an->af.af3.DeviceTables[AF3_X_DEVICE_TABLE] = 0; + an->af.af3.DeviceTables[AF3_Y_DEVICE_TABLE] = 0; + new_offset += base_offset; cur_offset = FILE_Pos(); if ( FILE_Seek( new_offset ) || - ( error = _HB_OPEN_Load_Device( &an->af.af3.XDeviceTable, + ( error = _HB_OPEN_Load_Device( &an->af.af3.DeviceTables[AF3_X_DEVICE_TABLE], stream ) ) != HB_Err_Ok ) return error; (void)FILE_Seek( cur_offset ); } - else - { - an->af.af3.XDeviceTable = 0; - } if ( ACCESS_Frame( 2L ) ) goto Fail; @@ -655,19 +646,24 @@ static HB_Error Load_Anchor( HB_Anchor* an, if ( new_offset ) { + if ( !an->af.af3.DeviceTables ) + { + if ( ALLOC_ARRAY( an->af.af3.DeviceTables, 2, HB_Device ) ) + return error; + + an->af.af3.DeviceTables[AF3_X_DEVICE_TABLE] = 0; + an->af.af3.DeviceTables[AF3_Y_DEVICE_TABLE] = 0; + } + new_offset += base_offset; cur_offset = FILE_Pos(); if ( FILE_Seek( new_offset ) || - ( error = _HB_OPEN_Load_Device( &an->af.af3.YDeviceTable, + ( error = _HB_OPEN_Load_Device( &an->af.af3.DeviceTables[AF3_Y_DEVICE_TABLE], stream ) ) != HB_Err_Ok ) goto Fail; (void)FILE_Seek( cur_offset ); } - else - { - an->af.af3.YDeviceTable = 0; - } break; case 4: @@ -692,7 +688,9 @@ static HB_Error Load_Anchor( HB_Anchor* an, return HB_Err_Ok; Fail: - _HB_OPEN_Free_Device( &an->af.af3.XDeviceTable ); + _HB_OPEN_Free_Device( &an->af.af3.DeviceTables[AF3_X_DEVICE_TABLE] ); + + FREE( an->af.af3.DeviceTables ); return error; } @@ -701,8 +699,9 @@ static void Free_Anchor( HB_Anchor* an) { if ( an->PosFormat == 3 ) { - _HB_OPEN_Free_Device( &an->af.af3.YDeviceTable ); - _HB_OPEN_Free_Device( &an->af.af3.XDeviceTable ); + _HB_OPEN_Free_Device( &an->af.af3.DeviceTables[AF3_X_DEVICE_TABLE] ); + _HB_OPEN_Free_Device( &an->af.af3.DeviceTables[AF3_Y_DEVICE_TABLE] ); + FREE( an->af.af3.DeviceTables ); } } @@ -770,9 +769,9 @@ static HB_Error Get_Anchor( GPOS_Instance* gpi, case 3: if ( !gpi->dvi ) { - _HB_OPEN_Get_Device( &an->af.af3.XDeviceTable, x_ppem, &pixel_value ); + _HB_OPEN_Get_Device( an->af.af3.DeviceTables[AF3_X_DEVICE_TABLE], x_ppem, &pixel_value ); *x_value = pixel_value << 6; - _HB_OPEN_Get_Device( &an->af.af3.YDeviceTable, y_ppem, &pixel_value ); + _HB_OPEN_Get_Device( an->af.af3.DeviceTables[AF3_Y_DEVICE_TABLE], y_ppem, &pixel_value ); *y_value = pixel_value << 6; } else diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-open-private.h b/src/3rdparty/harfbuzz/src/harfbuzz-open-private.h index 1f7b353..65ca453 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-open-private.h +++ b/src/3rdparty/harfbuzz/src/harfbuzz-open-private.h @@ -93,7 +93,7 @@ _HB_OPEN_Get_Class( HB_ClassDefinition* cd, HB_UShort* klass, HB_UShort* index ); HB_INTERNAL HB_Error -_HB_OPEN_Get_Device( HB_Device** d, +_HB_OPEN_Get_Device( HB_Device* d, HB_UShort size, HB_Short* value ); diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-open.c b/src/3rdparty/harfbuzz/src/harfbuzz-open.c index 255b7e6..adc6cec 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-open.c +++ b/src/3rdparty/harfbuzz/src/harfbuzz-open.c @@ -1399,21 +1399,11 @@ _HB_OPEN_Free_Device( HB_Device** d ) mask = 0x00FF */ HB_INTERNAL HB_Error -_HB_OPEN_Get_Device( HB_Device** device, +_HB_OPEN_Get_Device( HB_Device* d, HB_UShort size, HB_Short* value ) { - HB_Device* d; HB_UShort byte, bits, mask, f, s; - HB_Error error; - - if ( ALLOC( *device, sizeof(HB_Device)) ) - { - *device = 0; - return error; - } - - d = *device; f = d->DeltaFormat; @@ -1436,8 +1426,6 @@ _HB_OPEN_Get_Device( HB_Device** device, else { *value = 0; - FREE( *device ); - *device = 0; return HB_Err_Not_Covered; } } diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h index 32f5781..ab5c07a 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h +++ b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h @@ -258,6 +258,10 @@ typedef struct HB_Font_ { void *userData; } HB_FontRec; +#ifdef HB_USE_PACKED_STRUCTS +#pragma pack(pop) +#endif + typedef struct HB_ShaperItem_ HB_ShaperItem; struct HB_ShaperItem_ { @@ -285,10 +289,6 @@ struct HB_ShaperItem_ { HB_Bool HB_ShapeItem(HB_ShaperItem *item); -#ifdef HB_USE_PACKED_STRUCTS -#pragma pack(pop) -#endif - HB_END_HEADER #endif diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index cbc163c..1b8e789 100644 --- a/src/3rdparty/webkit/VERSION +++ b/src/3rdparty/webkit/VERSION @@ -8,4 +8,4 @@ The commit imported was from the and has the sha1 checksum - aa3f786bdba4dc153620ae7f98e4b0e41770d1d1 + be1a105be93d7fcbe36d93d0827dc6e98b55de0c diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog index f01220e..8a75d6b 100644 --- a/src/3rdparty/webkit/WebCore/ChangeLog +++ b/src/3rdparty/webkit/WebCore/ChangeLog @@ -1,3 +1,48 @@ +2010-06-16 Dawit Alemayehu <adawit@kde.org> + + Reviewed by Simon Hausmann. + + [Qt] QtWebKit crashes while initializing flash plugin 10.1.53.64. + https://bugs.webkit.org/show_bug.cgi?id=40567 + + Avoid preventable crashes by ensuring gtk_init() is called in the + flash viewer plugins before calling NP_Initialize. + + * plugins/qt/PluginPackageQt.cpp: + (WebCore::PluginPackage::load): + +2010-06-10 Raine Makelainen <raine.makelainen@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + Impossible to set input method hints based HTML5 input types + https://bugs.webkit.org/show_bug.cgi?id=40107 + + Helper methods for checking "tel", "number", "email", + and "url" input element types. + + * html/HTMLInputElement.h: + (WebCore::HTMLInputElement::isTelephoneField): + (WebCore::HTMLInputElement::isNumberField): + (WebCore::HTMLInputElement::isEmailField): + (WebCore::HTMLInputElement::isUrlField): + +2010-04-22 Ray Rischpater <Raymond.Rischpater@Nokia.com> + + Reviewed by Darin Adler. + + In HTMLInputElement.cpp, shouldUseInputMethod does not return true for + some text input types (TELEPHONE, NUMBER, URL, and EMAIL). Addressed + this by changing shouldUseInputMethod to use internal methods to + check that the field is a text field that isn't a password field. + + No new tests. + + Fixes <https://bugs.webkit.org/show_bug.cgi?id=37719> + + * html/HTMLInputElement.cpp: + (WebCore::HTMLInputElement::shouldUseInputMethod): + 2010-04-06 Abhinav Mithal <abhinav.mithal@nokia.com> Reviewed by Laszlo Gombos. diff --git a/src/3rdparty/webkit/WebCore/html/HTMLInputElement.cpp b/src/3rdparty/webkit/WebCore/html/HTMLInputElement.cpp index 652bc40..5746281 100644 --- a/src/3rdparty/webkit/WebCore/html/HTMLInputElement.cpp +++ b/src/3rdparty/webkit/WebCore/html/HTMLInputElement.cpp @@ -347,7 +347,11 @@ void HTMLInputElement::aboutToUnload() bool HTMLInputElement::shouldUseInputMethod() const { - return m_type == TEXT || m_type == SEARCH || m_type == ISINDEX; + // The reason IME's are disabled for the password field is because IMEs + // can access the underlying password and display it in clear text -- + // e.g. you can use it to access the stored password for any site + // with only trivial effort. + return isTextField() && inputType() != PASSWORD; } void HTMLInputElement::handleFocusEvent() diff --git a/src/3rdparty/webkit/WebCore/html/HTMLInputElement.h b/src/3rdparty/webkit/WebCore/html/HTMLInputElement.h index 0e2da32..50e9c00 100644 --- a/src/3rdparty/webkit/WebCore/html/HTMLInputElement.h +++ b/src/3rdparty/webkit/WebCore/html/HTMLInputElement.h @@ -109,6 +109,10 @@ public: virtual bool isSearchField() const { return m_type == SEARCH; } virtual bool isInputTypeHidden() const { return m_type == HIDDEN; } virtual bool isPasswordField() const { return m_type == PASSWORD; } + bool isTelephoneField() const { return m_type == TELEPHONE; } + bool isNumberField() const { return m_type == NUMBER; } + bool isEmailField() const { return m_type == EMAIL; } + bool isUrlField() const { return m_type == URL; } bool checked() const { return m_checked; } void setChecked(bool, bool sendChangeEvent = false); diff --git a/src/3rdparty/webkit/WebCore/plugins/qt/PluginPackageQt.cpp b/src/3rdparty/webkit/WebCore/plugins/qt/PluginPackageQt.cpp index 8119924..4ff520b 100644 --- a/src/3rdparty/webkit/WebCore/plugins/qt/PluginPackageQt.cpp +++ b/src/3rdparty/webkit/WebCore/plugins/qt/PluginPackageQt.cpp @@ -35,6 +35,8 @@ namespace WebCore { +typedef void gtkInitFunc(int *argc, char ***argv); + bool PluginPackage::fetchInfo() { if (!load()) @@ -109,6 +111,7 @@ bool PluginPackage::load() NP_InitializeFuncPtr NP_Initialize; NPError npErr; + gtkInitFunc* gtkInit; NP_Initialize = (NP_InitializeFuncPtr)m_module->resolve("NP_Initialize"); m_NPP_Shutdown = (NPP_ShutdownProcPtr)m_module->resolve("NP_Shutdown"); @@ -127,6 +130,26 @@ bool PluginPackage::load() m_browserFuncs.getvalue = staticPluginQuirkRequiresGtkToolKit_NPN_GetValue; } + // WORKAROUND: Prevent gtk based plugin crashes such as BR# 40567 by + // explicitly forcing the initializing of Gtk, i.e. calling gtk_init, + // whenver the symbol is present in the plugin library loaded above. + // Note that this workaround is based on code from the NSPluginClass ctor + // in KDE's kdebase/apps/nsplugins/viewer/nsplugin.cpp file. + gtkInit = (gtkInitFunc*)m_module->resolve("gtk_init"); + if (gtkInit) { + // Prevent gtk_init() from replacing the X error handlers, since the Gtk + // handlers abort when they receive an X error, thus killing the viewer. +#ifdef Q_WS_X11 + int (*old_error_handler)(Display*, XErrorEvent*) = XSetErrorHandler(0); + int (*old_io_error_handler)(Display*) = XSetIOErrorHandler(0); +#endif + gtkInit(0, 0); +#ifdef Q_WS_X11 + XSetErrorHandler(old_error_handler); + XSetIOErrorHandler(old_io_error_handler); +#endif + } + #if defined(XP_UNIX) npErr = NP_Initialize(&m_browserFuncs, &m_pluginFuncs); #else diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog index 5d37901..cf335a1 100644 --- a/src/3rdparty/webkit/WebKit/qt/ChangeLog +++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog @@ -1,3 +1,43 @@ +2010-06-18 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Antti Koivisto. + + REGRESSION(r60958) [Qt] qwebpage::inputMethods auto-test fails + https://bugs.webkit.org/show_bug.cgi?id=40830 + + When activating a regular input method field, always set or unset the ImhHiddenText + input method hint. + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::setInputMethodState): + +2010-06-10 Raine Makelainen <raine.makelainen@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + Impossible to set input method hints based HTML5 input types + https://bugs.webkit.org/show_bug.cgi?id=40107 + + EditorClientQt to set input method hints for "number", "tel", + "email", and "url" HTML input elements. + + Tests for HTML input elements and input method hints added for + QGraphicsWebView and QWebView. + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::setInputMethodState): + * tests/qgraphicswebview/resources/input_types.html: Added. + * tests/qgraphicswebview/tst_qgraphicswebview.cpp: + (GraphicsWebView::GraphicsWebView): + (GraphicsWebView::fireMouseClick): + (tst_QGraphicsWebView::focusInputTypes): + * tests/qgraphicswebview/tst_qgraphicswebview.qrc: Added. + * tests/qwebview/resources/input_types.html: Added. + * tests/qwebview/tst_qwebview.cpp: + (WebView::fireMouseClick): + (tst_QWebView::focusInputTypes): + * tests/qwebview/tst_qwebview.qrc: + 2010-05-19 Denis Dzyubenko <denis.dzyubenko@nokia.com> Reviewed by Kenneth Rohde Christiansen. diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp index 27cc2f5..3255c8e 100644 --- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp +++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp @@ -601,20 +601,29 @@ void EditorClientQt::setInputMethodState(bool active) QWebPageClient* webPageClient = m_page->d->client; if (webPageClient) { #if QT_VERSION >= 0x040600 - bool isPasswordField = false; - if (!active) { - // Setting the Qt::WA_InputMethodEnabled attribute true and Qt::ImhHiddenText flag - // for password fields. The Qt platform is responsible for determining which widget - // will receive input method events for password fields. - Frame* frame = m_page->d->page->focusController()->focusedOrMainFrame(); - if (frame && frame->document() && frame->document()->focusedNode()) { - if (frame->document()->focusedNode()->hasTagName(HTMLNames::inputTag)) { - HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(frame->document()->focusedNode()); - active = isPasswordField = inputElement->isPasswordField(); - } + HTMLInputElement* inputElement = 0; + Frame* frame = m_page->d->page->focusController()->focusedOrMainFrame(); + if (frame && frame->document() && frame->document()->focusedNode()) + if (frame->document()->focusedNode()->hasTagName(HTMLNames::inputTag)) + inputElement = static_cast<HTMLInputElement*>(frame->document()->focusedNode()); + + if (inputElement) { + if (!active) { + // Setting the Qt::WA_InputMethodEnabled attribute true and Qt::ImhHiddenText flag + // for password fields. The Qt platform is responsible for determining which widget + // will receive input method events for password fields. + active = inputElement->isPasswordField(); + webPageClient->setInputMethodHint(Qt::ImhHiddenText, active); + } else { + // Set input method hints for "number", "tel", "email", and "url" input elements. + webPageClient->setInputMethodHint(Qt::ImhDialableCharactersOnly, inputElement->isTelephoneField()); + webPageClient->setInputMethodHint(Qt::ImhDigitsOnly, inputElement->isNumberField()); + webPageClient->setInputMethodHint(Qt::ImhEmailCharactersOnly, inputElement->isEmailField()); + webPageClient->setInputMethodHint(Qt::ImhUrlCharactersOnly, inputElement->isUrlField()); + webPageClient->setInputMethodHint(Qt::ImhHiddenText, inputElement->isPasswordField()); } } - webPageClient->setInputMethodHint(Qt::ImhHiddenText, isPasswordField); + #if defined(Q_WS_MAEMO_5) || defined(Q_OS_SYMBIAN) // disables auto-uppercase and predictive text for mobile devices webPageClient->setInputMethodHint(Qt::ImhNoAutoUppercase, true); diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/resources/input_types.html b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/resources/input_types.html new file mode 100644 index 0000000..18ab314 --- /dev/null +++ b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/resources/input_types.html @@ -0,0 +1,8 @@ +<html><body> +<input type='text' maxlength='20' style='position: absolute; left: 10px; top: 0px; height: 50px; width: 100px;'/><br> +<input type='password' style='position: absolute; left: 10px; top: 50px; height: 50px; width: 100px;'/><br> +<input type='tel' style='position: absolute; left: 10px; top: 100px; height: 50px; width: 100px;'/><br> +<input type='number' style='position: absolute; left: 10px; top: 150px; height: 50px; width: 100px;'/><br> +<input type='email' style='position: absolute; left: 10px; top: 200px; height: 50px; width: 100px;'/><br> +<input type='url' style='position: absolute; left: 10px; top: 250px; height: 50px; width: 100px;'/><br>" +</body></html>
\ No newline at end of file diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp index a52e167..5efd8a5 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp +++ b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp @@ -19,6 +19,7 @@ #include <QtTest/QtTest> +#include <QGraphicsSceneMouseEvent> #include <QGraphicsView> #include <qgraphicswebview.h> #include <qwebpage.h> @@ -54,6 +55,7 @@ class tst_QGraphicsWebView : public QObject private slots: void qgraphicswebview(); void crashOnViewlessWebPages(); + void focusInputTypes(); }; void tst_QGraphicsWebView::qgraphicswebview() @@ -97,6 +99,29 @@ private slots: } }; +class GraphicsWebView : public QGraphicsWebView +{ + Q_OBJECT + +public: + GraphicsWebView(QGraphicsItem* parent = 0): QGraphicsWebView(parent) + { + } + + void fireMouseClick(QPointF point) { + QGraphicsSceneMouseEvent presEv(QEvent::GraphicsSceneMousePress); + presEv.setPos(point); + presEv.setButton(Qt::LeftButton); + presEv.setButtons(Qt::LeftButton); + QGraphicsSceneMouseEvent relEv(QEvent::GraphicsSceneMouseRelease); + relEv.setPos(point); + relEv.setButton(Qt::LeftButton); + relEv.setButtons(Qt::LeftButton); + QGraphicsWebView::sceneEvent(&presEv); + QGraphicsWebView::sceneEvent(&relEv); + } +}; + void tst_QGraphicsWebView::crashOnViewlessWebPages() { QGraphicsScene scene; @@ -125,6 +150,56 @@ void tst_QGraphicsWebView::crashOnViewlessWebPages() QVERIFY(::waitForSignal(page, SIGNAL(loadFinished(bool)))); } +void tst_QGraphicsWebView::focusInputTypes() +{ + QWebPage* page = new QWebPage; + GraphicsWebView* webView = new GraphicsWebView; + webView->setPage( page ); + QGraphicsView* view = new QGraphicsView; + QGraphicsScene* scene = new QGraphicsScene(view); + view->setScene(scene); + scene->addItem(webView); + view->setGeometry(QRect(0,0,500,500)); + QCoreApplication::processEvents(); + QUrl url("qrc:///resources/input_types.html"); + page->mainFrame()->load(url); + page->mainFrame()->setFocus(); + + QVERIFY(waitForSignal(page, SIGNAL(loadFinished(bool)))); + + // 'text' type + webView->fireMouseClick(QPointF(20.0, 10.0)); +#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) || defined(Q_OS_SYMBIAN) + QVERIFY(webView->inputMethodHints() & Qt::ImhNoAutoUppercase); + QVERIFY(webView->inputMethodHints() & Qt::ImhNoPredictiveText); +#else + QVERIFY(webView->inputMethodHints() == Qt::ImhNone); +#endif + + // 'password' field + webView->fireMouseClick(QPointF(20.0, 60.0)); + QVERIFY(webView->inputMethodHints() & Qt::ImhHiddenText); + + // 'tel' field + webView->fireMouseClick(QPointF(20.0, 110.0)); + QVERIFY(webView->inputMethodHints() & Qt::ImhDialableCharactersOnly); + + // 'number' field + webView->fireMouseClick(QPointF(20.0, 160.0)); + QVERIFY(webView->inputMethodHints() & Qt::ImhDigitsOnly); + + // 'email' field + webView->fireMouseClick(QPointF(20.0, 210.0)); + QVERIFY(webView->inputMethodHints() & Qt::ImhEmailCharactersOnly); + + // 'url' field + webView->fireMouseClick(QPointF(20.0, 260.0)); + QVERIFY(webView->inputMethodHints() & Qt::ImhUrlCharactersOnly); + + delete webView; + delete view; +} + QTEST_MAIN(tst_QGraphicsWebView) #include "tst_qgraphicswebview.moc" diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.qrc b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.qrc new file mode 100644 index 0000000..c91bb9c --- /dev/null +++ b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.qrc @@ -0,0 +1,6 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource> + <file>resources/input_types.html</file> +</qresource> +</RCC> + diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/resources/input_types.html b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/resources/input_types.html new file mode 100644 index 0000000..18ab314 --- /dev/null +++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/resources/input_types.html @@ -0,0 +1,8 @@ +<html><body> +<input type='text' maxlength='20' style='position: absolute; left: 10px; top: 0px; height: 50px; width: 100px;'/><br> +<input type='password' style='position: absolute; left: 10px; top: 50px; height: 50px; width: 100px;'/><br> +<input type='tel' style='position: absolute; left: 10px; top: 100px; height: 50px; width: 100px;'/><br> +<input type='number' style='position: absolute; left: 10px; top: 150px; height: 50px; width: 100px;'/><br> +<input type='email' style='position: absolute; left: 10px; top: 200px; height: 50px; width: 100px;'/><br> +<input type='url' style='position: absolute; left: 10px; top: 250px; height: 50px; width: 100px;'/><br>" +</body></html>
\ No newline at end of file diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp index 27daf38..d466ab5 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp +++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp @@ -46,10 +46,25 @@ private slots: void reusePage_data(); void reusePage(); + void focusInputTypes(); void crashTests(); }; +class WebView : public QWebView +{ + Q_OBJECT + +public: + void fireMouseClick(QPoint point) { + QMouseEvent presEv(QEvent::MouseButtonPress, point, Qt::LeftButton, Qt::LeftButton, Qt::NoModifier); + QMouseEvent relEv(QEvent::MouseButtonRelease, point, Qt::LeftButton, Qt::LeftButton, Qt::NoModifier); + QWebView::mousePressEvent(&presEv); + QWebView::mousePressEvent(&relEv); + } + +}; + // This will be called before the first test function is executed. // It is only called once. void tst_QWebView::initTestCase() @@ -191,6 +206,52 @@ void tst_QWebView::crashTests() } +void tst_QWebView::focusInputTypes() +{ + QWebPage* page = new QWebPage; + WebView* webView = new WebView; + webView->setPage( page ); + + QCoreApplication::processEvents(); + QUrl url("qrc:///resources/input_types.html"); + page->mainFrame()->load(url); + page->mainFrame()->setFocus(); + + QVERIFY(waitForSignal(page, SIGNAL(loadFinished(bool)))); + + // 'text' type + webView->fireMouseClick(QPoint(20, 10)); +#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) || defined(Q_OS_SYMBIAN) + QVERIFY(webView->inputMethodHints() & Qt::ImhNoAutoUppercase); + QVERIFY(webView->inputMethodHints() & Qt::ImhNoPredictiveText); +#else + QVERIFY(webView->inputMethodHints() == Qt::ImhNone); +#endif + + // 'password' field + webView->fireMouseClick(QPoint(20, 60)); + QVERIFY(webView->inputMethodHints() & Qt::ImhHiddenText); + + // 'tel' field + webView->fireMouseClick(QPoint(20, 110)); + QVERIFY(webView->inputMethodHints() & Qt::ImhDialableCharactersOnly); + + // 'number' field + webView->fireMouseClick(QPoint(20, 160)); + QVERIFY(webView->inputMethodHints() & Qt::ImhDigitsOnly); + + // 'email' field + webView->fireMouseClick(QPoint(20, 210)); + QVERIFY(webView->inputMethodHints() & Qt::ImhEmailCharactersOnly); + + // 'url' field + webView->fireMouseClick(QPoint(20, 260)); + QVERIFY(webView->inputMethodHints() & Qt::ImhUrlCharactersOnly); + + delete webView; + +} + QTEST_MAIN(tst_QWebView) #include "tst_qwebview.moc" diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.qrc b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.qrc index ede34a9..5d71550 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.qrc +++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.qrc @@ -2,6 +2,7 @@ <qresource> <file>data/index.html</file> <file>data/frame_a.html</file> + <file>resources/input_types.html</file> </qresource> </RCC> diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index b3fc2f6..d6896c0 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -933,6 +933,9 @@ const QString qt_reg_winclass(QWidget *w) // register window class if (qt_widget_private(w)->isGLWidget) { cname = QLatin1String("QGLWidget"); style = CS_DBLCLKS; +#ifndef Q_WS_WINCE + style |= CS_OWNDC; +#endif icon = true; } else if (flags & Qt::MSWindowsOwnDC) { cname = QLatin1String("QWidgetOwnDC"); diff --git a/src/multimedia/video/qabstractvideobuffer_p.h b/src/multimedia/video/qabstractvideobuffer_p.h index c72f303..3303b36 100644 --- a/src/multimedia/video/qabstractvideobuffer_p.h +++ b/src/multimedia/video/qabstractvideobuffer_p.h @@ -65,6 +65,9 @@ public: : handleType(QAbstractVideoBuffer::NoHandle) {} + virtual ~QAbstractVideoBufferPrivate() + {} + QAbstractVideoBuffer::HandleType handleType; }; diff --git a/src/network/kernel/qhostinfo_unix.cpp b/src/network/kernel/qhostinfo_unix.cpp index df98d5d..9139816 100644 --- a/src/network/kernel/qhostinfo_unix.cpp +++ b/src/network/kernel/qhostinfo_unix.cpp @@ -208,12 +208,23 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName) #ifdef Q_ADDRCONFIG hints.ai_flags = Q_ADDRCONFIG; #endif +#ifdef Q_OS_SYMBIAN +# ifdef QHOSTINFO_DEBUG + qDebug() << "Setting flags: 'hints.ai_flags &= AI_V4MAPPED | AI_ALL'"; +# endif +#endif int result = getaddrinfo(aceHostname.constData(), 0, &hints, &res); # ifdef Q_ADDRCONFIG if (result == EAI_BADFLAGS) { // if the lookup failed with AI_ADDRCONFIG set, try again without it hints.ai_flags = 0; +#ifdef Q_OS_SYMBIAN +# ifdef QHOSTINFO_DEBUG + qDebug() << "Setting flags: 'hints.ai_flags &= AI_V4MAPPED | AI_ALL'"; +# endif + hints.ai_flags &= AI_V4MAPPED | AI_ALL; +#endif result = getaddrinfo(aceHostname.constData(), 0, &hints, &res); } # endif @@ -222,6 +233,9 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName) addrinfo *node = res; QList<QHostAddress> addresses; while (node) { +#ifdef QHOSTINFO_DEBUG + qDebug() << "getaddrinfo node: flags:" << node->ai_flags << "family:" << node->ai_family << "ai_socktype:" << node->ai_socktype << "ai_protocol:" << node->ai_protocol << "ai_addrlen:" << node->ai_addrlen; +#endif if (node->ai_family == AF_INET) { QHostAddress addr; addr.setAddress(ntohl(((sockaddr_in *) node->ai_addr)->sin_addr.s_addr)); |