From 44349923bc43665de3f3adefe817cbfd85ebd04d Mon Sep 17 00:00:00 2001
From: Simon Hausmann <simon.hausmann@nokia.com>
Date: Fri, 18 Jun 2010 11:33:59 +0200
Subject: Updated WebKit from /home/shausman/src/webkit/trunk to
 qtwebkit/qtwebkit-4.6 ( 85a48bdb52a81a9d18477a347fba5f6c930af416 )

Backported:

* https://bugs.webkit.org/show_bug.cgi?id=37719 -- Some HTML5 Input tags not treated as needing an input method.
* https://bugs.webkit.org/show_bug.cgi?id=40107 -- Impossible to set input method hints based HTML5 input types
---
 src/3rdparty/webkit/VERSION                        |  2 +-
 src/3rdparty/webkit/WebCore/ChangeLog              | 32 +++++++++
 .../webkit/WebCore/html/HTMLInputElement.cpp       |  6 +-
 .../webkit/WebCore/html/HTMLInputElement.h         |  4 ++
 src/3rdparty/webkit/WebKit/qt/ChangeLog            | 27 ++++++++
 .../WebKit/qt/WebCoreSupport/EditorClientQt.cpp    | 32 +++++----
 .../qgraphicswebview/resources/input_types.html    |  8 +++
 .../qgraphicswebview/tst_qgraphicswebview.cpp      | 75 ++++++++++++++++++++++
 .../qgraphicswebview/tst_qgraphicswebview.qrc      |  6 ++
 .../qt/tests/qwebview/resources/input_types.html   |  8 +++
 .../WebKit/qt/tests/qwebview/tst_qwebview.cpp      | 61 ++++++++++++++++++
 .../WebKit/qt/tests/qwebview/tst_qwebview.qrc      |  1 +
 12 files changed, 248 insertions(+), 14 deletions(-)
 create mode 100644 src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/resources/input_types.html
 create mode 100644 src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.qrc
 create mode 100644 src/3rdparty/webkit/WebKit/qt/tests/qwebview/resources/input_types.html

diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION
index cbc163c..3595474 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
+        85a48bdb52a81a9d18477a347fba5f6c930af416
diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog
index f01220e..63af196 100644
--- a/src/3rdparty/webkit/WebCore/ChangeLog
+++ b/src/3rdparty/webkit/WebCore/ChangeLog
@@ -1,3 +1,35 @@
+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/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog
index 5d37901..4d3b4d1 100644
--- a/src/3rdparty/webkit/WebKit/qt/ChangeLog
+++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog
@@ -1,3 +1,30 @@
+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..f2bfc50 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
@@ -601,20 +601,28 @@ 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, 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>
 
-- 
cgit v0.12


From c0071441a1274796c8e1a3d2f9880dad6148a681 Mon Sep 17 00:00:00 2001
From: Simon Hausmann <simon.hausmann@nokia.com>
Date: Fri, 18 Jun 2010 12:25:57 +0200
Subject: Re-enable data structure packing in Harfbuzz for RVCT

Re-ordered some gpos structures and removed the packing from HB_ShaperItem
as it's not worth it.

Reviewed-by: Andreas Kling
---
 src/3rdparty/harfbuzz/src/harfbuzz-global.h       |  2 +-
 src/3rdparty/harfbuzz/src/harfbuzz-gpos-private.h | 20 ++++++++++----------
 src/3rdparty/harfbuzz/src/harfbuzz-shaper.h       |  8 ++++----
 3 files changed, 15 insertions(+), 15 deletions(-)

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..10d7bfa 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-gpos-private.h
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-gpos-private.h
@@ -533,18 +533,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 +574,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-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
-- 
cgit v0.12


From cb5cd5e8300ee0f845d9df7c912ba384fb7b96a0 Mon Sep 17 00:00:00 2001
From: Simon Hausmann <simon.hausmann@nokia.com>
Date: Fri, 18 Jun 2010 12:46:46 +0200
Subject: Updated Harfbuzz from git+ssh://git.freedesktop.org/git/harfbuzz to
 508b02a252b524d34f3ed970eef3bdb6350a2b77

* Andreas' compression for HB_ValueRecord
---
 src/3rdparty/harfbuzz/src/harfbuzz-dump.c         |  8 +--
 src/3rdparty/harfbuzz/src/harfbuzz-gpos-private.h | 19 ++---
 src/3rdparty/harfbuzz/src/harfbuzz-gpos.c         | 85 +++++++++++------------
 3 files changed, 57 insertions(+), 55 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-gpos-private.h b/src/3rdparty/harfbuzz/src/harfbuzz-gpos-private.h
index 10d7bfa..3a4952b 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
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c b/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c
index 61e42fd..1933f3d 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 );
 }
 
 
@@ -511,24 +500,34 @@ static HB_Error  Get_ValueRecord( GPOS_Instance*    gpi,
   {
     /* pixel -> fractional pixel */
 
+    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;
+    }
+
     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;
     }
   }
-- 
cgit v0.12


From 3c221e33eec651dc83aaf5219565816169fd2a93 Mon Sep 17 00:00:00 2001
From: Simon Hausmann <simon.hausmann@nokia.com>
Date: Fri, 18 Jun 2010 14:27:07 +0200
Subject: Updated WebKit from /home/shausman/src/webkit/trunk to
 qtwebkit/qtwebkit-4.6 ( a13977ce2aba31808a046cddc082a84dc316d78b )

Changes in WebKit/qt since the last update:

++ b/WebKit/qt/ChangeLog
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):
---
 src/3rdparty/webkit/VERSION                                 |  2 +-
 src/3rdparty/webkit/WebKit/qt/ChangeLog                     | 13 +++++++++++++
 .../webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp      |  1 +
 3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION
index 3595474..482982d 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
 
-        85a48bdb52a81a9d18477a347fba5f6c930af416
+        a13977ce2aba31808a046cddc082a84dc316d78b
diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog
index 4d3b4d1..cf335a1 100644
--- a/src/3rdparty/webkit/WebKit/qt/ChangeLog
+++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog
@@ -1,3 +1,16 @@
+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.
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
index f2bfc50..3255c8e 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
@@ -620,6 +620,7 @@ void EditorClientQt::setInputMethodState(bool active)
                 webPageClient->setInputMethodHint(Qt::ImhDigitsOnly, inputElement->isNumberField());
                 webPageClient->setInputMethodHint(Qt::ImhEmailCharactersOnly, inputElement->isEmailField());
                 webPageClient->setInputMethodHint(Qt::ImhUrlCharactersOnly, inputElement->isUrlField());
+                webPageClient->setInputMethodHint(Qt::ImhHiddenText, inputElement->isPasswordField());
             }
         }
 
-- 
cgit v0.12


From 2694a7b2b2b8293cf55ac9861b97bec1fc6650dd Mon Sep 17 00:00:00 2001
From: Simon Hausmann <simon.hausmann@nokia.com>
Date: Fri, 18 Jun 2010 16:21:36 +0200
Subject: Updated Harfbuzz from git+ssh://git.freedesktop.org/git/harfbuzz to
 5699175f55acbdfa4ac95ab6c727ebd4a201f3a2

Author: Andreas Kling <andreas.kling@nokia.com>
Date:   Fri Jun 18 16:10:31 2010 +0200

    Make HB_AnchorFormat3's Device tables a pointer array

    Saves sizeof(pointer) * 1 when the font doesn't have these tables.
    Cuts resident memory consumption by 40kB when loading qt.nokia.com
    in QtWebKit.

    Signed-off-by: Simon Hausmann <simon.hausmann@nokia.com>
---
 src/3rdparty/harfbuzz/src/harfbuzz-gpos-private.h |  5 +--
 src/3rdparty/harfbuzz/src/harfbuzz-gpos.c         | 43 +++++++++++++++--------
 2 files changed, 31 insertions(+), 17 deletions(-)

diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-gpos-private.h b/src/3rdparty/harfbuzz/src/harfbuzz-gpos-private.h
index 3a4952b..39f3159 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-gpos-private.h
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-gpos-private.h
@@ -105,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;
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c b/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c
index 1933f3d..d71a85e 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c
@@ -631,19 +631,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;
@@ -654,19 +656,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:
@@ -691,7 +698,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;
 }
 
@@ -700,8 +709,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 );
   }
 }
 
@@ -769,9 +779,12 @@ 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 );
+      if ( ALLOC_ARRAY( an->af.af3.DeviceTables, 2, HB_Device ) )
+        return error;
+
+      _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
-- 
cgit v0.12