Fix remaining issues with mingw-w64-qt5-webkit
This commit is contained in:
parent
f1493f7647
commit
9acfc44ecb
|
@ -1,7 +1,7 @@
|
|||
From 27c479ef693e765326b22d2f4cd1424593711f18 Mon Sep 17 00:00:00 2001
|
||||
From: Martchus <martchus@gmx.net>
|
||||
Date: Sun, 25 Sep 2016 21:53:59 +0200
|
||||
Subject: [PATCH 01/11] Use correct ICU libs
|
||||
Subject: [PATCH 1/9] Use correct ICU libs
|
||||
|
||||
The ICU libraries used for cross-compilation are named
|
||||
exactly the same as their native Linux counterpart
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From f879e4f9efd0cca7acd1f09953bc645107a42d21 Mon Sep 17 00:00:00 2001
|
||||
From: Martchus <martchus@gmx.net>
|
||||
Date: Sun, 25 Sep 2016 21:56:42 +0200
|
||||
Subject: [PATCH 02/11] Use pkg-config
|
||||
Subject: [PATCH 2/9] Use pkg-config
|
||||
|
||||
---
|
||||
Tools/qmake/mkspecs/features/win32/default_pre.prf | 2 ++
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From b22f0368b4d4d167fcc342bffb602c9c41578233 Mon Sep 17 00:00:00 2001
|
||||
From: Martchus <martchus@gmx.net>
|
||||
Date: Sat, 5 Nov 2016 12:14:01 +0100
|
||||
Subject: [PATCH 03/11] Use system ANGLE rather than bundled version
|
||||
Subject: [PATCH 3/9] Use system ANGLE rather than bundled version
|
||||
|
||||
---
|
||||
Source/api.pri | 1 -
|
||||
|
|
|
@ -1,273 +0,0 @@
|
|||
From 0babda7ee8ffc48773162224eed9e2d0aa83b9ea Mon Sep 17 00:00:00 2001
|
||||
From: Martchus <martchus@gmx.net>
|
||||
Date: Sun, 25 Sep 2016 21:59:39 +0200
|
||||
Subject: [PATCH 04/11] Don't require qt5-base to be built with ICU support
|
||||
|
||||
---
|
||||
Source/WTF/wtf/Platform.h | 4 +
|
||||
Source/WebCore/platform/ThreadGlobalData.cpp | 2 +
|
||||
Source/WebCore/platform/text/TextAllInOne.cpp | 8 +
|
||||
.../WebCore/platform/text/TextBreakIteratorQt.cpp | 175 +++++++++++++++++++++
|
||||
Tools/qmake/mkspecs/features/configure.prf | 6 +-
|
||||
5 files changed, 192 insertions(+), 3 deletions(-)
|
||||
create mode 100644 Source/WebCore/platform/text/TextBreakIteratorQt.cpp
|
||||
|
||||
diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h
|
||||
index 562840c..8b93148 100644
|
||||
--- a/Source/WTF/wtf/Platform.h
|
||||
+++ b/Source/WTF/wtf/Platform.h
|
||||
@@ -580,9 +580,13 @@
|
||||
# define WTF_USE_WCHAR_UNICODE 1
|
||||
#endif
|
||||
|
||||
+#if OS(WINDOWS) && PLATFORM(QT)
|
||||
+#define WTF_USE_QT4_UNICODE 1
|
||||
+#else
|
||||
#if !USE(WCHAR_UNICODE)
|
||||
#define WTF_USE_ICU_UNICODE 1
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
#if PLATFORM(MAC) && !PLATFORM(IOS)
|
||||
#if CPU(X86_64)
|
||||
diff --git a/Source/WebCore/platform/ThreadGlobalData.cpp b/Source/WebCore/platform/ThreadGlobalData.cpp
|
||||
index 698ec6e..e77f46f 100644
|
||||
--- a/Source/WebCore/platform/ThreadGlobalData.cpp
|
||||
+++ b/Source/WebCore/platform/ThreadGlobalData.cpp
|
||||
@@ -38,6 +38,8 @@
|
||||
|
||||
#if USE(ICU_UNICODE)
|
||||
#include "TextCodecICU.h"
|
||||
+#elif USE(QT4_UNICODE)
|
||||
+#include "qt/TextCodecQt.h"
|
||||
#endif
|
||||
|
||||
#if PLATFORM(MAC)
|
||||
diff --git a/Source/WebCore/platform/text/TextAllInOne.cpp b/Source/WebCore/platform/text/TextAllInOne.cpp
|
||||
index 31c37f7..86fdff9 100644
|
||||
--- a/Source/WebCore/platform/text/TextAllInOne.cpp
|
||||
+++ b/Source/WebCore/platform/text/TextAllInOne.cpp
|
||||
@@ -27,7 +27,11 @@
|
||||
|
||||
#include "TextBoundaries.cpp"
|
||||
#include "TextBreakIterator.cpp"
|
||||
+#if USE(QT4_UNICODE)
|
||||
+#include "TextBreakIteratorQt.cpp"
|
||||
+#else
|
||||
#include "TextBreakIteratorICU.cpp"
|
||||
+#endif
|
||||
#include "TextCodec.cpp"
|
||||
#include "TextCodecICU.cpp"
|
||||
#include "TextCodecLatin1.cpp"
|
||||
@@ -35,6 +39,10 @@
|
||||
#include "TextCodecUTF8.cpp"
|
||||
#include "TextCodecUserDefined.cpp"
|
||||
#include "TextEncoding.cpp"
|
||||
+#if USE(QT4_UNICODE)
|
||||
+#include "TextEncodingDetectorNone.cpp"
|
||||
+#else
|
||||
#include "TextEncodingDetectorICU.cpp"
|
||||
+#endif
|
||||
#include "TextEncodingRegistry.cpp"
|
||||
#include "TextStream.cpp"
|
||||
diff --git a/Source/WebCore/platform/text/TextBreakIteratorQt.cpp b/Source/WebCore/platform/text/TextBreakIteratorQt.cpp
|
||||
new file mode 100644
|
||||
index 0000000..f74a681
|
||||
--- /dev/null
|
||||
+++ b/Source/WebCore/platform/text/TextBreakIteratorQt.cpp
|
||||
@@ -0,0 +1,175 @@
|
||||
+/*
|
||||
+ * Copyright (C) 2006 Lars Knoll <lars@trolltech.com>
|
||||
+ *
|
||||
+ * This library is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU Library General Public
|
||||
+ * License as published by the Free Software Foundation; either
|
||||
+ * version 2 of the License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This library is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ * Library General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU Library General Public License
|
||||
+ * along with this library; see the file COPYING.LIB. If not, write to
|
||||
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
+ * Boston, MA 02110-1301, USA.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#include "config.h"
|
||||
+#include "TextBreakIterator.h"
|
||||
+
|
||||
+#include <QtCore/qtextboundaryfinder.h>
|
||||
+#include <algorithm>
|
||||
+#include <qdebug.h>
|
||||
+#include <wtf/Atomics.h>
|
||||
+
|
||||
+// #define DEBUG_TEXT_ITERATORS
|
||||
+#ifdef DEBUG_TEXT_ITERATORS
|
||||
+#define DEBUG qDebug
|
||||
+#else
|
||||
+#define DEBUG if (1) {} else qDebug
|
||||
+#endif
|
||||
+
|
||||
+using namespace WTF;
|
||||
+using namespace std;
|
||||
+
|
||||
+namespace WebCore {
|
||||
+
|
||||
+ class TextBreakIterator : public QTextBoundaryFinder {
|
||||
+ public:
|
||||
+ TextBreakIterator(QTextBoundaryFinder::BoundaryType type, const QString& string)
|
||||
+ : QTextBoundaryFinder(type, string)
|
||||
+ { }
|
||||
+ TextBreakIterator()
|
||||
+ : QTextBoundaryFinder()
|
||||
+ { }
|
||||
+ };
|
||||
+
|
||||
+ TextBreakIterator* setUpIterator(TextBreakIterator& iterator, QTextBoundaryFinder::BoundaryType type, const UChar* characters, int length)
|
||||
+ {
|
||||
+ if (!characters || !length)
|
||||
+ return 0;
|
||||
+
|
||||
+ if (iterator.isValid() && type == iterator.type() && iterator.string() == QString::fromRawData(reinterpret_cast<const QChar*>(characters), length)) {
|
||||
+ iterator.toStart();
|
||||
+ return &iterator;
|
||||
+ }
|
||||
+
|
||||
+ iterator = TextBreakIterator(type, QString(reinterpret_cast<const QChar*>(characters), length));
|
||||
+ return &iterator;
|
||||
+ }
|
||||
+
|
||||
+ TextBreakIterator* wordBreakIterator(const UChar* string, int length)
|
||||
+ {
|
||||
+ static TextBreakIterator staticWordBreakIterator;
|
||||
+ return setUpIterator(staticWordBreakIterator, QTextBoundaryFinder::Word, string, length);
|
||||
+ }
|
||||
+
|
||||
+ static TextBreakIterator* nonSharedCharacterBreakIterator;
|
||||
+
|
||||
+ NonSharedCharacterBreakIterator::NonSharedCharacterBreakIterator(const UChar* buffer, int length)
|
||||
+ {
|
||||
+ m_iterator = nonSharedCharacterBreakIterator;
|
||||
+ bool createdIterator = m_iterator && weakCompareAndSwap(reinterpret_cast<void**>(&nonSharedCharacterBreakIterator), m_iterator, 0);
|
||||
+ if (!createdIterator)
|
||||
+ m_iterator = new TextBreakIterator();
|
||||
+ if (!setUpIterator(*m_iterator, QTextBoundaryFinder::Grapheme, buffer, length)) {
|
||||
+ delete m_iterator;
|
||||
+ m_iterator = 0;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ NonSharedCharacterBreakIterator::~NonSharedCharacterBreakIterator()
|
||||
+ {
|
||||
+ if (!weakCompareAndSwap(reinterpret_cast<void**>(&nonSharedCharacterBreakIterator), 0, m_iterator))
|
||||
+ delete m_iterator;
|
||||
+ }
|
||||
+
|
||||
+ TextBreakIterator* cursorMovementIterator(const UChar* string, int length)
|
||||
+ {
|
||||
+ static TextBreakIterator staticCursorMovementIterator;
|
||||
+ return setUpIterator(staticCursorMovementIterator, QTextBoundaryFinder::Grapheme, string, length);
|
||||
+ }
|
||||
+
|
||||
+ static TextBreakIterator* staticLineBreakIterator;
|
||||
+
|
||||
+ TextBreakIterator* acquireLineBreakIterator(const UChar* string, int length, const AtomicString&, const UChar* priorContext, unsigned priorContextLength)
|
||||
+ {
|
||||
+ TextBreakIterator* lineBreakIterator = 0;
|
||||
+ if (staticLineBreakIterator) {
|
||||
+ setUpIterator(*staticLineBreakIterator, QTextBoundaryFinder::Line, string, length);
|
||||
+ std::swap(staticLineBreakIterator, lineBreakIterator);
|
||||
+ }
|
||||
+
|
||||
+ if (!lineBreakIterator && string && length)
|
||||
+ lineBreakIterator = new TextBreakIterator(QTextBoundaryFinder::Line, QString(reinterpret_cast<const QChar*>(string), length));
|
||||
+
|
||||
+ return lineBreakIterator;
|
||||
+ }
|
||||
+
|
||||
+ void releaseLineBreakIterator(TextBreakIterator* iterator)
|
||||
+ {
|
||||
+ ASSERT(iterator);
|
||||
+
|
||||
+ if (!staticLineBreakIterator)
|
||||
+ staticLineBreakIterator = iterator;
|
||||
+ else
|
||||
+ delete iterator;
|
||||
+ }
|
||||
+
|
||||
+ TextBreakIterator* sentenceBreakIterator(const UChar* string, int length)
|
||||
+ {
|
||||
+ static TextBreakIterator staticSentenceBreakIterator;
|
||||
+ return setUpIterator(staticSentenceBreakIterator, QTextBoundaryFinder::Sentence, string, length);
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ int textBreakFirst(TextBreakIterator* bi)
|
||||
+ {
|
||||
+ bi->toStart();
|
||||
+ DEBUG() << "textBreakFirst" << bi->position();
|
||||
+ return bi->position();
|
||||
+ }
|
||||
+
|
||||
+ int textBreakNext(TextBreakIterator* bi)
|
||||
+ {
|
||||
+ int pos = bi->toNextBoundary();
|
||||
+ DEBUG() << "textBreakNext" << pos;
|
||||
+ return pos;
|
||||
+ }
|
||||
+
|
||||
+ int textBreakPreceding(TextBreakIterator* bi, int pos)
|
||||
+ {
|
||||
+ bi->setPosition(pos);
|
||||
+ int newpos = bi->toPreviousBoundary();
|
||||
+ DEBUG() << "textBreakPreceding" << pos << newpos;
|
||||
+ return newpos;
|
||||
+ }
|
||||
+
|
||||
+ int textBreakFollowing(TextBreakIterator* bi, int pos)
|
||||
+ {
|
||||
+ bi->setPosition(pos);
|
||||
+ int newpos = bi->toNextBoundary();
|
||||
+ DEBUG() << "textBreakFollowing" << pos << newpos;
|
||||
+ return newpos;
|
||||
+ }
|
||||
+
|
||||
+ int textBreakCurrent(TextBreakIterator* bi)
|
||||
+ {
|
||||
+ return bi->position();
|
||||
+ }
|
||||
+
|
||||
+ bool isTextBreak(TextBreakIterator*, int)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ bool isWordTextBreak(TextBreakIterator*)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
diff --git a/Tools/qmake/mkspecs/features/configure.prf b/Tools/qmake/mkspecs/features/configure.prf
|
||||
index b5fb2ae..7da388a 100644
|
||||
--- a/Tools/qmake/mkspecs/features/configure.prf
|
||||
+++ b/Tools/qmake/mkspecs/features/configure.prf
|
||||
@@ -120,9 +120,9 @@ defineTest(finalizeConfigure) {
|
||||
}
|
||||
|
||||
# Sanity checks that would prevent us from building the whole project altogether.
|
||||
- !config_icu:!osx:!use?(wchar_unicode) {
|
||||
- addReasonForSkippingBuild("ICU is required.")
|
||||
- }
|
||||
+# !config_icu:!osx:!use?(wchar_unicode) {
|
||||
+# addReasonForSkippingBuild("ICU is required.")
|
||||
+# }
|
||||
production_build:blackberry {
|
||||
addReasonForSkippingBuild("Build not supported on BB10.")
|
||||
}
|
||||
--
|
||||
2.10.2
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
From abf76e8a2f6174832420bbbd981947c928a67e13 Mon Sep 17 00:00:00 2001
|
||||
From 516214945fcf3aa7a04845eafa5f9fa9531024b3 Mon Sep 17 00:00:00 2001
|
||||
From: Martchus <martchus@gmx.net>
|
||||
Date: Sun, 25 Sep 2016 22:08:26 +0200
|
||||
Subject: [PATCH 06/11] Prevent symbols not being exported in Qt5WebKit.dll
|
||||
Subject: [PATCH 4/9] Prevent symbols not being exported in Qt5WebKit.dll
|
||||
|
||||
WebKit svn commit 136242 implemented a split into QtWebKit and QtWebKitWidgets.
|
||||
Due to this change a static library named WebKit1.a is created first.
|
|
@ -1,7 +1,7 @@
|
|||
From 421b2295a77918f111814e34ca54ba983dd1a87d Mon Sep 17 00:00:00 2001
|
||||
From 24d4206f6cd79ae3f6ed70897fbf327aed0730bb Mon Sep 17 00:00:00 2001
|
||||
From: Martchus <martchus@gmx.net>
|
||||
Date: Sun, 25 Sep 2016 22:13:44 +0200
|
||||
Subject: [PATCH 07/11] Build with smaller debug info
|
||||
Subject: [PATCH 5/9] Build with smaller debug info
|
||||
|
||||
Avoid exceeding 4 GB size limit
|
||||
---
|
|
@ -1,767 +0,0 @@
|
|||
From c3df414bd2bb18c21d8ff8ab1109d7a6463bf14f Mon Sep 17 00:00:00 2001
|
||||
From: Martchus <martchus@gmx.net>
|
||||
Date: Sun, 25 Sep 2016 22:03:05 +0200
|
||||
Subject: [PATCH 05/11] Revert removal of QT4_UNICODE and related code paths
|
||||
|
||||
---
|
||||
Source/WTF/WTF.pro | 1 +
|
||||
Source/WTF/wtf/unicode/Unicode.h | 2 +
|
||||
Source/WTF/wtf/unicode/qt4/UnicodeQt4.h | 377 +++++++++++++++++++++
|
||||
Source/WebCore/Target.pri | 2 +
|
||||
Source/WebCore/platform/KURL.cpp | 5 +
|
||||
.../graphics/SurrogatePairAwareTextIterator.cpp | 5 +
|
||||
Source/WebCore/platform/text/TextEncoding.cpp | 6 +
|
||||
.../WebCore/platform/text/TextEncodingRegistry.cpp | 8 +
|
||||
Source/WebCore/platform/text/qt/TextCodecQt.cpp | 160 +++++++++
|
||||
Source/WebCore/platform/text/qt/TextCodecQt.h | 54 +++
|
||||
10 files changed, 620 insertions(+)
|
||||
create mode 100644 Source/WTF/wtf/unicode/qt4/UnicodeQt4.h
|
||||
create mode 100644 Source/WebCore/platform/text/qt/TextCodecQt.cpp
|
||||
create mode 100644 Source/WebCore/platform/text/qt/TextCodecQt.h
|
||||
|
||||
diff --git a/Source/WTF/WTF.pro b/Source/WTF/WTF.pro
|
||||
index 2976d00..a73b2ba 100644
|
||||
--- a/Source/WTF/WTF.pro
|
||||
+++ b/Source/WTF/WTF.pro
|
||||
@@ -170,6 +170,7 @@ HEADERS += \
|
||||
unicode/CharacterNames.h \
|
||||
unicode/Collator.h \
|
||||
unicode/icu/UnicodeIcu.h \
|
||||
+ unicode/qt4/UnicodeQt4.h \
|
||||
unicode/ScriptCodesFromICU.h \
|
||||
unicode/Unicode.h \
|
||||
unicode/UnicodeMacrosFromICU.h \
|
||||
diff --git a/Source/WTF/wtf/unicode/Unicode.h b/Source/WTF/wtf/unicode/Unicode.h
|
||||
index c764184..1039507 100644
|
||||
--- a/Source/WTF/wtf/unicode/Unicode.h
|
||||
+++ b/Source/WTF/wtf/unicode/Unicode.h
|
||||
@@ -30,6 +30,8 @@ typedef unsigned char LChar;
|
||||
|
||||
#if USE(ICU_UNICODE)
|
||||
#include <wtf/unicode/icu/UnicodeIcu.h>
|
||||
+#elif USE(QT4_UNICODE)
|
||||
+#include "qt4/UnicodeQt4.h"
|
||||
#elif USE(WCHAR_UNICODE)
|
||||
#include <wtf/unicode/wchar/UnicodeWchar.h>
|
||||
#else
|
||||
diff --git a/Source/WTF/wtf/unicode/qt4/UnicodeQt4.h b/Source/WTF/wtf/unicode/qt4/UnicodeQt4.h
|
||||
new file mode 100644
|
||||
index 0000000..a2d1ad4
|
||||
--- /dev/null
|
||||
+++ b/Source/WTF/wtf/unicode/qt4/UnicodeQt4.h
|
||||
@@ -0,0 +1,377 @@
|
||||
+/*
|
||||
+ * Copyright (C) 2006 George Staikos <staikos@kde.org>
|
||||
+ * Copyright (C) 2006 Alexey Proskuryakov <ap@nypop.com>
|
||||
+ * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
|
||||
+ *
|
||||
+ * This library is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU Library General Public
|
||||
+ * License as published by the Free Software Foundation; either
|
||||
+ * version 2 of the License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This library is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ * Library General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU Library General Public License
|
||||
+ * along with this library; see the file COPYING.LIB. If not, write to
|
||||
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
+ * Boston, MA 02110-1301, USA.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#ifndef WTF_UNICODE_QT4_H
|
||||
+#define WTF_UNICODE_QT4_H
|
||||
+
|
||||
+#include <wtf/unicode/ScriptCodesFromICU.h>
|
||||
+#include <wtf/unicode/UnicodeMacrosFromICU.h>
|
||||
+
|
||||
+#include <QChar>
|
||||
+#include <QString>
|
||||
+
|
||||
+#include <config.h>
|
||||
+
|
||||
+#include <stdint.h>
|
||||
+#if USE(ICU_UNICODE)
|
||||
+#include <unicode/ubrk.h>
|
||||
+#endif
|
||||
+
|
||||
+QT_BEGIN_NAMESPACE
|
||||
+namespace QUnicodeTables {
|
||||
+ struct Properties {
|
||||
+ ushort category : 8;
|
||||
+ ushort line_break_class : 8;
|
||||
+ ushort direction : 8;
|
||||
+ ushort combiningClass :8;
|
||||
+ ushort joining : 2;
|
||||
+ signed short digitValue : 6; /* 5 needed */
|
||||
+ ushort unicodeVersion : 4;
|
||||
+ ushort lowerCaseSpecial : 1;
|
||||
+ ushort upperCaseSpecial : 1;
|
||||
+ ushort titleCaseSpecial : 1;
|
||||
+ ushort caseFoldSpecial : 1; /* currently unused */
|
||||
+ signed short mirrorDiff : 16;
|
||||
+ signed short lowerCaseDiff : 16;
|
||||
+ signed short upperCaseDiff : 16;
|
||||
+ signed short titleCaseDiff : 16;
|
||||
+ signed short caseFoldDiff : 16;
|
||||
+ };
|
||||
+ Q_CORE_EXPORT const Properties * QT_FASTCALL properties(uint ucs4);
|
||||
+ Q_CORE_EXPORT const Properties * QT_FASTCALL properties(ushort ucs2);
|
||||
+}
|
||||
+QT_END_NAMESPACE
|
||||
+
|
||||
+// ugly hack to make UChar compatible with JSChar in API/JSStringRef.h
|
||||
+#if defined(Q_OS_WIN) || (COMPILER(RVCT) && !OS(LINUX))
|
||||
+typedef wchar_t UChar;
|
||||
+#else
|
||||
+typedef uint16_t UChar;
|
||||
+#endif
|
||||
+
|
||||
+#if !USE(ICU_UNICODE)
|
||||
+typedef uint32_t UChar32;
|
||||
+#endif
|
||||
+
|
||||
+namespace WTF {
|
||||
+namespace Unicode {
|
||||
+
|
||||
+enum Direction {
|
||||
+ LeftToRight = QChar::DirL,
|
||||
+ RightToLeft = QChar::DirR,
|
||||
+ EuropeanNumber = QChar::DirEN,
|
||||
+ EuropeanNumberSeparator = QChar::DirES,
|
||||
+ EuropeanNumberTerminator = QChar::DirET,
|
||||
+ ArabicNumber = QChar::DirAN,
|
||||
+ CommonNumberSeparator = QChar::DirCS,
|
||||
+ BlockSeparator = QChar::DirB,
|
||||
+ SegmentSeparator = QChar::DirS,
|
||||
+ WhiteSpaceNeutral = QChar::DirWS,
|
||||
+ OtherNeutral = QChar::DirON,
|
||||
+ LeftToRightEmbedding = QChar::DirLRE,
|
||||
+ LeftToRightOverride = QChar::DirLRO,
|
||||
+ RightToLeftArabic = QChar::DirAL,
|
||||
+ RightToLeftEmbedding = QChar::DirRLE,
|
||||
+ RightToLeftOverride = QChar::DirRLO,
|
||||
+ PopDirectionalFormat = QChar::DirPDF,
|
||||
+ NonSpacingMark = QChar::DirNSM,
|
||||
+ BoundaryNeutral = QChar::DirBN
|
||||
+};
|
||||
+
|
||||
+enum DecompositionType {
|
||||
+ DecompositionNone = QChar::NoDecomposition,
|
||||
+ DecompositionCanonical = QChar::Canonical,
|
||||
+ DecompositionCompat = QChar::Compat,
|
||||
+ DecompositionCircle = QChar::Circle,
|
||||
+ DecompositionFinal = QChar::Final,
|
||||
+ DecompositionFont = QChar::Font,
|
||||
+ DecompositionFraction = QChar::Fraction,
|
||||
+ DecompositionInitial = QChar::Initial,
|
||||
+ DecompositionIsolated = QChar::Isolated,
|
||||
+ DecompositionMedial = QChar::Medial,
|
||||
+ DecompositionNarrow = QChar::Narrow,
|
||||
+ DecompositionNoBreak = QChar::NoBreak,
|
||||
+ DecompositionSmall = QChar::Small,
|
||||
+ DecompositionSquare = QChar::Square,
|
||||
+ DecompositionSub = QChar::Sub,
|
||||
+ DecompositionSuper = QChar::Super,
|
||||
+ DecompositionVertical = QChar::Vertical,
|
||||
+ DecompositionWide = QChar::Wide
|
||||
+};
|
||||
+
|
||||
+enum CharCategory {
|
||||
+ NoCategory = 0,
|
||||
+ Mark_NonSpacing = U_MASK(QChar::Mark_NonSpacing),
|
||||
+ Mark_SpacingCombining = U_MASK(QChar::Mark_SpacingCombining),
|
||||
+ Mark_Enclosing = U_MASK(QChar::Mark_Enclosing),
|
||||
+ Number_DecimalDigit = U_MASK(QChar::Number_DecimalDigit),
|
||||
+ Number_Letter = U_MASK(QChar::Number_Letter),
|
||||
+ Number_Other = U_MASK(QChar::Number_Other),
|
||||
+ Separator_Space = U_MASK(QChar::Separator_Space),
|
||||
+ Separator_Line = U_MASK(QChar::Separator_Line),
|
||||
+ Separator_Paragraph = U_MASK(QChar::Separator_Paragraph),
|
||||
+ Other_Control = U_MASK(QChar::Other_Control),
|
||||
+ Other_Format = U_MASK(QChar::Other_Format),
|
||||
+ Other_Surrogate = U_MASK(QChar::Other_Surrogate),
|
||||
+ Other_PrivateUse = U_MASK(QChar::Other_PrivateUse),
|
||||
+ Other_NotAssigned = U_MASK(QChar::Other_NotAssigned),
|
||||
+ Letter_Uppercase = U_MASK(QChar::Letter_Uppercase),
|
||||
+ Letter_Lowercase = U_MASK(QChar::Letter_Lowercase),
|
||||
+ Letter_Titlecase = U_MASK(QChar::Letter_Titlecase),
|
||||
+ Letter_Modifier = U_MASK(QChar::Letter_Modifier),
|
||||
+ Letter_Other = U_MASK(QChar::Letter_Other),
|
||||
+ Punctuation_Connector = U_MASK(QChar::Punctuation_Connector),
|
||||
+ Punctuation_Dash = U_MASK(QChar::Punctuation_Dash),
|
||||
+ Punctuation_Open = U_MASK(QChar::Punctuation_Open),
|
||||
+ Punctuation_Close = U_MASK(QChar::Punctuation_Close),
|
||||
+ Punctuation_InitialQuote = U_MASK(QChar::Punctuation_InitialQuote),
|
||||
+ Punctuation_FinalQuote = U_MASK(QChar::Punctuation_FinalQuote),
|
||||
+ Punctuation_Other = U_MASK(QChar::Punctuation_Other),
|
||||
+ Symbol_Math = U_MASK(QChar::Symbol_Math),
|
||||
+ Symbol_Currency = U_MASK(QChar::Symbol_Currency),
|
||||
+ Symbol_Modifier = U_MASK(QChar::Symbol_Modifier),
|
||||
+ Symbol_Other = U_MASK(QChar::Symbol_Other)
|
||||
+};
|
||||
+
|
||||
+
|
||||
+// FIXME: handle surrogates correctly in all methods
|
||||
+
|
||||
+inline UChar32 toLower(UChar32 ch)
|
||||
+{
|
||||
+ return QChar::toLower(uint32_t(ch));
|
||||
+}
|
||||
+
|
||||
+inline int toLower(UChar* result, int resultLength, const UChar* src, int srcLength, bool* error)
|
||||
+{
|
||||
+ const UChar *e = src + srcLength;
|
||||
+ const UChar *s = src;
|
||||
+ UChar *r = result;
|
||||
+ uint rindex = 0;
|
||||
+
|
||||
+ // this avoids one out of bounds check in the loop
|
||||
+ if (s < e && QChar(*s).isLowSurrogate()) {
|
||||
+ if (r)
|
||||
+ r[rindex] = *s++;
|
||||
+ ++rindex;
|
||||
+ }
|
||||
+
|
||||
+ int needed = 0;
|
||||
+ while (s < e && (rindex < uint(resultLength) || !r)) {
|
||||
+ uint c = *s;
|
||||
+ if (QChar(c).isLowSurrogate() && QChar(*(s - 1)).isHighSurrogate())
|
||||
+ c = QChar::surrogateToUcs4(*(s - 1), c);
|
||||
+ const QUnicodeTables::Properties *prop = QUnicodeTables::properties(c);
|
||||
+ if (prop->lowerCaseSpecial) {
|
||||
+ QString qstring;
|
||||
+ if (c < 0x10000) {
|
||||
+ qstring += QChar(c);
|
||||
+ } else {
|
||||
+ qstring += QChar(*(s-1));
|
||||
+ qstring += QChar(*s);
|
||||
+ }
|
||||
+ qstring = qstring.toLower();
|
||||
+ for (int i = 0; i < qstring.length(); ++i) {
|
||||
+ if (rindex >= uint(resultLength)) {
|
||||
+ needed += qstring.length() - i;
|
||||
+ break;
|
||||
+ }
|
||||
+ if (r)
|
||||
+ r[rindex] = qstring.at(i).unicode();
|
||||
+ ++rindex;
|
||||
+ }
|
||||
+ } else {
|
||||
+ if (r)
|
||||
+ r[rindex] = *s + prop->lowerCaseDiff;
|
||||
+ ++rindex;
|
||||
+ }
|
||||
+ ++s;
|
||||
+ }
|
||||
+ if (s < e)
|
||||
+ needed += e - s;
|
||||
+ *error = (needed != 0);
|
||||
+ if (rindex < uint(resultLength))
|
||||
+ r[rindex] = 0;
|
||||
+ return rindex + needed;
|
||||
+}
|
||||
+
|
||||
+inline UChar32 toUpper(UChar32 c)
|
||||
+{
|
||||
+ return QChar::toUpper(uint32_t(c));
|
||||
+}
|
||||
+
|
||||
+inline int toUpper(UChar* result, int resultLength, const UChar* src, int srcLength, bool* error)
|
||||
+{
|
||||
+ const UChar *e = src + srcLength;
|
||||
+ const UChar *s = src;
|
||||
+ UChar *r = result;
|
||||
+ int rindex = 0;
|
||||
+
|
||||
+ // this avoids one out of bounds check in the loop
|
||||
+ if (s < e && QChar(*s).isLowSurrogate()) {
|
||||
+ if (r)
|
||||
+ r[rindex] = *s++;
|
||||
+ ++rindex;
|
||||
+ }
|
||||
+
|
||||
+ int needed = 0;
|
||||
+ while (s < e && (rindex < resultLength || !r)) {
|
||||
+ uint c = *s;
|
||||
+ if (QChar(c).isLowSurrogate() && QChar(*(s - 1)).isHighSurrogate())
|
||||
+ c = QChar::surrogateToUcs4(*(s - 1), c);
|
||||
+ const QUnicodeTables::Properties *prop = QUnicodeTables::properties(c);
|
||||
+ if (prop->upperCaseSpecial) {
|
||||
+ QString qstring;
|
||||
+ if (c < 0x10000) {
|
||||
+ qstring += QChar(c);
|
||||
+ } else {
|
||||
+ qstring += QChar(*(s-1));
|
||||
+ qstring += QChar(*s);
|
||||
+ }
|
||||
+ qstring = qstring.toUpper();
|
||||
+ for (int i = 0; i < qstring.length(); ++i) {
|
||||
+ if (rindex >= resultLength) {
|
||||
+ needed += qstring.length() - i;
|
||||
+ break;
|
||||
+ }
|
||||
+ if (r)
|
||||
+ r[rindex] = qstring.at(i).unicode();
|
||||
+ ++rindex;
|
||||
+ }
|
||||
+ } else {
|
||||
+ if (r)
|
||||
+ r[rindex] = *s + prop->upperCaseDiff;
|
||||
+ ++rindex;
|
||||
+ }
|
||||
+ ++s;
|
||||
+ }
|
||||
+ if (s < e)
|
||||
+ needed += e - s;
|
||||
+ *error = (needed != 0);
|
||||
+ if (rindex < resultLength)
|
||||
+ r[rindex] = 0;
|
||||
+ return rindex + needed;
|
||||
+}
|
||||
+
|
||||
+inline int toTitleCase(UChar32 c)
|
||||
+{
|
||||
+ return QChar::toTitleCase(uint32_t(c));
|
||||
+}
|
||||
+
|
||||
+inline UChar32 foldCase(UChar32 c)
|
||||
+{
|
||||
+ return QChar::toCaseFolded(uint32_t(c));
|
||||
+}
|
||||
+
|
||||
+inline int foldCase(UChar* result, int resultLength, const UChar* src, int srcLength, bool* error)
|
||||
+{
|
||||
+ // FIXME: handle special casing. Easiest with some low level API in Qt
|
||||
+ *error = false;
|
||||
+ if (resultLength < srcLength) {
|
||||
+ *error = true;
|
||||
+ return srcLength;
|
||||
+ }
|
||||
+ for (int i = 0; i < srcLength; ++i)
|
||||
+ result[i] = QChar::toCaseFolded(ushort(src[i]));
|
||||
+ return srcLength;
|
||||
+}
|
||||
+
|
||||
+inline bool isArabicChar(UChar32 c)
|
||||
+{
|
||||
+ return c >= 0x0600 && c <= 0x06FF;
|
||||
+}
|
||||
+
|
||||
+inline bool isPrintableChar(UChar32 c)
|
||||
+{
|
||||
+ const uint test = U_MASK(QChar::Other_Control) |
|
||||
+ U_MASK(QChar::Other_NotAssigned);
|
||||
+ return !(U_MASK(QChar::category(uint32_t(c))) & test);
|
||||
+}
|
||||
+
|
||||
+inline bool isSeparatorSpace(UChar32 c)
|
||||
+{
|
||||
+ return QChar::category(uint32_t(c)) == QChar::Separator_Space;
|
||||
+}
|
||||
+
|
||||
+inline bool isPunct(UChar32 c)
|
||||
+{
|
||||
+ const uint test = U_MASK(QChar::Punctuation_Connector) |
|
||||
+ U_MASK(QChar::Punctuation_Dash) |
|
||||
+ U_MASK(QChar::Punctuation_Open) |
|
||||
+ U_MASK(QChar::Punctuation_Close) |
|
||||
+ U_MASK(QChar::Punctuation_InitialQuote) |
|
||||
+ U_MASK(QChar::Punctuation_FinalQuote) |
|
||||
+ U_MASK(QChar::Punctuation_Other);
|
||||
+ return U_MASK(QChar::category(uint32_t(c))) & test;
|
||||
+}
|
||||
+
|
||||
+inline bool isLower(UChar32 c)
|
||||
+{
|
||||
+ return QChar::category(uint32_t(c)) == QChar::Letter_Lowercase;
|
||||
+}
|
||||
+
|
||||
+inline bool hasLineBreakingPropertyComplexContext(UChar32)
|
||||
+{
|
||||
+ // FIXME: Implement this to return whether the character has line breaking property SA (Complex Context).
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
+inline UChar32 mirroredChar(UChar32 c)
|
||||
+{
|
||||
+ return QChar::mirroredChar(uint32_t(c));
|
||||
+}
|
||||
+
|
||||
+inline uint8_t combiningClass(UChar32 c)
|
||||
+{
|
||||
+ return QChar::combiningClass(uint32_t(c));
|
||||
+}
|
||||
+
|
||||
+inline DecompositionType decompositionType(UChar32 c)
|
||||
+{
|
||||
+ return (DecompositionType)QChar::decompositionTag(c);
|
||||
+}
|
||||
+
|
||||
+inline int umemcasecmp(const UChar* a, const UChar* b, int len)
|
||||
+{
|
||||
+ // handle surrogates correctly
|
||||
+ for (int i = 0; i < len; ++i) {
|
||||
+ uint c1 = QChar::toCaseFolded(ushort(a[i]));
|
||||
+ uint c2 = QChar::toCaseFolded(ushort(b[i]));
|
||||
+ if (c1 != c2)
|
||||
+ return c1 - c2;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+inline Direction direction(UChar32 c)
|
||||
+{
|
||||
+ return (Direction)QChar::direction(uint32_t(c));
|
||||
+}
|
||||
+
|
||||
+inline CharCategory category(UChar32 c)
|
||||
+{
|
||||
+ return (CharCategory) U_MASK(QChar::category(uint32_t(c)));
|
||||
+}
|
||||
+
|
||||
+} // namespace Unicode
|
||||
+} // namespace WTF
|
||||
+
|
||||
+#endif // WTF_UNICODE_QT4_H
|
||||
diff --git a/Source/WebCore/Target.pri b/Source/WebCore/Target.pri
|
||||
index e525aa1..5d64b46 100644
|
||||
--- a/Source/WebCore/Target.pri
|
||||
+++ b/Source/WebCore/Target.pri
|
||||
@@ -2358,6 +2358,7 @@ HEADERS += \
|
||||
platform/text/DecodeEscapeSequences.h \
|
||||
platform/text/Hyphenation.h \
|
||||
platform/text/QuotedPrintable.h \
|
||||
+ platform/text/qt/TextCodecQt.h \
|
||||
platform/text/RegularExpression.h \
|
||||
platform/text/SegmentedString.h \
|
||||
platform/text/TextBoundaries.h \
|
||||
@@ -2946,6 +2947,7 @@ SOURCES += \
|
||||
platform/qt/TemporaryLinkStubsQt.cpp \
|
||||
platform/text/qt/TextBoundariesQt.cpp \
|
||||
platform/text/qt/TextBreakIteratorInternalICUQt.cpp \
|
||||
+ platform/text/qt/TextCodecQt.cpp \
|
||||
platform/qt/WidgetQt.cpp
|
||||
|
||||
use?(LIBXML2) {
|
||||
diff --git a/Source/WebCore/platform/KURL.cpp b/Source/WebCore/platform/KURL.cpp
|
||||
index 91c7d04..a00e871 100644
|
||||
--- a/Source/WebCore/platform/KURL.cpp
|
||||
+++ b/Source/WebCore/platform/KURL.cpp
|
||||
@@ -40,6 +40,8 @@
|
||||
|
||||
#if USE(ICU_UNICODE)
|
||||
#include <unicode/uidna.h>
|
||||
+#elif USE(QT4_UNICODE)
|
||||
+#include <QUrl>
|
||||
#endif
|
||||
|
||||
// FIXME: This file makes too much use of the + operator on String.
|
||||
@@ -1496,6 +1498,9 @@ static void appendEncodedHostname(UCharBuffer& buffer, const UChar* str, unsigne
|
||||
hostnameBufferLength, UIDNA_ALLOW_UNASSIGNED, 0, &error);
|
||||
if (error == U_ZERO_ERROR)
|
||||
buffer.append(hostnameBuffer, numCharactersConverted);
|
||||
+#elif USE(QT4_UNICODE)
|
||||
+ QByteArray result = QUrl::toAce(String(str, strLen));
|
||||
+ buffer.append(result.constData(), result.length());
|
||||
#endif
|
||||
}
|
||||
|
||||
diff --git a/Source/WebCore/platform/graphics/SurrogatePairAwareTextIterator.cpp b/Source/WebCore/platform/graphics/SurrogatePairAwareTextIterator.cpp
|
||||
index e7eb43b..11da4b9 100644
|
||||
--- a/Source/WebCore/platform/graphics/SurrogatePairAwareTextIterator.cpp
|
||||
+++ b/Source/WebCore/platform/graphics/SurrogatePairAwareTextIterator.cpp
|
||||
@@ -90,6 +90,11 @@ UChar32 SurrogatePairAwareTextIterator::normalizeVoicingMarks()
|
||||
int32_t resultLength = unorm_normalize(m_characters, 2, UNORM_NFC, UNORM_UNICODE_3_2, &normalizedCharacters[0], 2, &uStatus);
|
||||
if (resultLength == 1 && !uStatus)
|
||||
return normalizedCharacters[0];
|
||||
+#elif USE(QT4_UNICODE)
|
||||
+ QString tmp(reinterpret_cast<const QChar*>(m_characters), 2);
|
||||
+ QString res = tmp.normalized(QString::NormalizationForm_C, QChar::Unicode_3_2);
|
||||
+ if (res.length() == 1)
|
||||
+ return res.at(0).unicode();
|
||||
#endif
|
||||
}
|
||||
|
||||
diff --git a/Source/WebCore/platform/text/TextEncoding.cpp b/Source/WebCore/platform/text/TextEncoding.cpp
|
||||
index f457b16..a099c3e 100644
|
||||
--- a/Source/WebCore/platform/text/TextEncoding.cpp
|
||||
+++ b/Source/WebCore/platform/text/TextEncoding.cpp
|
||||
@@ -37,6 +37,8 @@
|
||||
|
||||
#if USE(ICU_UNICODE)
|
||||
#include <unicode/unorm.h>
|
||||
+#elif USE(QT4_UNICODE)
|
||||
+#include <QString>
|
||||
#endif
|
||||
|
||||
namespace WebCore {
|
||||
@@ -101,6 +103,10 @@ CString TextEncoding::encode(const UChar* characters, size_t length, Unencodable
|
||||
sourceLength = normalizedLength;
|
||||
}
|
||||
return newTextCodec(*this)->encode(source, sourceLength, handling);
|
||||
+#elif USE(QT4_UNICODE)
|
||||
+ QString str(reinterpret_cast<const QChar*>(characters), length);
|
||||
+ str = str.normalized(QString::NormalizationForm_C);
|
||||
+ return newTextCodec(*this)->encode(reinterpret_cast<const UChar *>(str.utf16()), str.length(), handling);
|
||||
#elif OS(WINDOWS) && USE(WCHAR_UNICODE)
|
||||
// normalization will be done by Windows CE API
|
||||
OwnPtr<TextCodec> textCodec = newTextCodec(*this);
|
||||
diff --git a/Source/WebCore/platform/text/TextEncodingRegistry.cpp b/Source/WebCore/platform/text/TextEncodingRegistry.cpp
|
||||
index d2cf038..afa5a93 100644
|
||||
--- a/Source/WebCore/platform/text/TextEncodingRegistry.cpp
|
||||
+++ b/Source/WebCore/platform/text/TextEncodingRegistry.cpp
|
||||
@@ -42,6 +42,9 @@
|
||||
#if USE(ICU_UNICODE)
|
||||
#include "TextCodecICU.h"
|
||||
#endif
|
||||
+#if USE(QT4_UNICODE)
|
||||
+#include "qt/TextCodecQt.h"
|
||||
+#endif
|
||||
#if PLATFORM(MAC)
|
||||
#include "TextCodecMac.h"
|
||||
#endif
|
||||
@@ -293,6 +296,11 @@ static void extendTextCodecMaps()
|
||||
TextCodecICU::registerCodecs(addToTextCodecMap);
|
||||
#endif
|
||||
|
||||
+#if USE(QT4_UNICODE)
|
||||
+ TextCodecQt::registerEncodingNames(addToTextEncodingNameMap);
|
||||
+ TextCodecQt::registerCodecs(addToTextCodecMap);
|
||||
+#endif
|
||||
+
|
||||
#if PLATFORM(MAC)
|
||||
TextCodecMac::registerEncodingNames(addToTextEncodingNameMap);
|
||||
TextCodecMac::registerCodecs(addToTextCodecMap);
|
||||
diff --git a/Source/WebCore/platform/text/qt/TextCodecQt.cpp b/Source/WebCore/platform/text/qt/TextCodecQt.cpp
|
||||
new file mode 100644
|
||||
index 0000000..6a36e1a
|
||||
--- /dev/null
|
||||
+++ b/Source/WebCore/platform/text/qt/TextCodecQt.cpp
|
||||
@@ -0,0 +1,160 @@
|
||||
+/*
|
||||
+ * Copyright (C) 2006 Lars Knoll <lars@trolltech.com>
|
||||
+ * Copyright (C) 2008 Holger Hans Peter Freyther
|
||||
+ *
|
||||
+ * Redistribution and use in source and binary forms, with or without
|
||||
+ * modification, are permitted provided that the following conditions
|
||||
+ * are met:
|
||||
+ * 1. Redistributions of source code must retain the above copyright
|
||||
+ * notice, this list of conditions and the following disclaimer.
|
||||
+ * 2. Redistributions in binary form must reproduce the above copyright
|
||||
+ * notice, this list of conditions and the following disclaimer in the
|
||||
+ * documentation and/or other materials provided with the distribution.
|
||||
+ *
|
||||
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
|
||||
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
|
||||
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
+ */
|
||||
+
|
||||
+#include "config.h"
|
||||
+#if USE(QT4_UNICODE)
|
||||
+#include "TextCodecQt.h"
|
||||
+
|
||||
+#include <qset.h>
|
||||
+#include <wtf/text/CString.h>
|
||||
+#include <wtf/text/WTFString.h>
|
||||
+
|
||||
+namespace WebCore {
|
||||
+
|
||||
+static QSet<QByteArray> *unique_names = 0;
|
||||
+
|
||||
+static const char *getAtomicName(const QByteArray &name)
|
||||
+{
|
||||
+ if (!unique_names)
|
||||
+ unique_names = new QSet<QByteArray>;
|
||||
+
|
||||
+ unique_names->insert(name);
|
||||
+ return unique_names->find(name)->constData();
|
||||
+}
|
||||
+
|
||||
+void TextCodecQt::registerEncodingNames(EncodingNameRegistrar registrar)
|
||||
+{
|
||||
+ QList<int> mibs = QTextCodec::availableMibs();
|
||||
+
|
||||
+ for (int i = 0; i < mibs.size(); ++i) {
|
||||
+ QTextCodec *c = QTextCodec::codecForMib(mibs.at(i));
|
||||
+ const char *name = getAtomicName(c->name());
|
||||
+ registrar(name, name);
|
||||
+ QList<QByteArray> aliases = c->aliases();
|
||||
+ for (int i = 0; i < aliases.size(); ++i) {
|
||||
+ const char *a = getAtomicName(aliases.at(i));
|
||||
+ registrar(a, name);
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static PassOwnPtr<TextCodec> newTextCodecQt(const TextEncoding& encoding, const void*)
|
||||
+{
|
||||
+ return adoptPtr(new TextCodecQt(encoding));
|
||||
+}
|
||||
+
|
||||
+void TextCodecQt::registerCodecs(TextCodecRegistrar registrar)
|
||||
+{
|
||||
+ QList<int> mibs = QTextCodec::availableMibs();
|
||||
+
|
||||
+ for (int i = 0; i < mibs.size(); ++i) {
|
||||
+ QTextCodec *c = QTextCodec::codecForMib(mibs.at(i));
|
||||
+ const char *name = getAtomicName(c->name());
|
||||
+ registrar(name, newTextCodecQt, 0);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+TextCodecQt::TextCodecQt(const TextEncoding& encoding)
|
||||
+ : m_encoding(encoding)
|
||||
+{
|
||||
+ m_codec = QTextCodec::codecForName(m_encoding.name());
|
||||
+}
|
||||
+
|
||||
+TextCodecQt::~TextCodecQt()
|
||||
+{
|
||||
+}
|
||||
+
|
||||
+
|
||||
+String TextCodecQt::decode(const char* bytes, size_t length, bool flush, bool /*stopOnError*/, bool& sawError)
|
||||
+{
|
||||
+ // We chop input buffer to smaller buffers to avoid excessive memory consumption
|
||||
+ // when the input buffer is big. This helps reduce peak memory consumption in
|
||||
+ // mobile devices where system RAM is limited.
|
||||
+ static const int MaxInputChunkSize = 1024 * 1024;
|
||||
+ const char* buf = bytes;
|
||||
+ const char* end = buf + length;
|
||||
+ String unicode(""); // a non-null string is expected
|
||||
+
|
||||
+ while (buf < end) {
|
||||
+ int size = end - buf;
|
||||
+ size = qMin(size, MaxInputChunkSize);
|
||||
+ QString decoded = m_codec->toUnicode(buf, size, &m_state);
|
||||
+ unicode.append(reinterpret_cast_ptr<const UChar*>(decoded.unicode()), decoded.length());
|
||||
+ buf += size;
|
||||
+ }
|
||||
+
|
||||
+ sawError = m_state.invalidChars != 0;
|
||||
+
|
||||
+ if (flush) {
|
||||
+ m_state.flags = QTextCodec::DefaultConversion;
|
||||
+ m_state.remainingChars = 0;
|
||||
+ m_state.invalidChars = 0;
|
||||
+ }
|
||||
+
|
||||
+ return unicode;
|
||||
+}
|
||||
+
|
||||
+CString TextCodecQt::encode(const UChar* characters, size_t length, UnencodableHandling handling)
|
||||
+{
|
||||
+ QTextCodec::ConverterState state;
|
||||
+ state.flags = QTextCodec::ConversionFlags(QTextCodec::ConvertInvalidToNull | QTextCodec::IgnoreHeader);
|
||||
+
|
||||
+ if (!length)
|
||||
+ return "";
|
||||
+
|
||||
+ QByteArray ba = m_codec->fromUnicode(reinterpret_cast<const QChar*>(characters), length, &state);
|
||||
+
|
||||
+ // If some <b> characters </b> are unencodable, escape them as specified by <b> handling </b>
|
||||
+ // We append one valid encoded chunk to a QByteArray at a time. When we encounter an unencodable chunk we
|
||||
+ // escape it with getUnencodableReplacement, append it, then move to the next chunk.
|
||||
+ if (state.invalidChars) {
|
||||
+ state.invalidChars = 0;
|
||||
+ state.remainingChars = 0;
|
||||
+ int len = 0;
|
||||
+ ba.clear();
|
||||
+ for (size_t pos = 0; pos < length; ++pos) {
|
||||
+ QByteArray tba = m_codec->fromUnicode(reinterpret_cast<const QChar*>(characters), ++len, &state);
|
||||
+ if (state.remainingChars)
|
||||
+ continue;
|
||||
+ if (state.invalidChars) {
|
||||
+ UnencodableReplacementArray replacement;
|
||||
+ getUnencodableReplacement(characters[0], handling, replacement);
|
||||
+ tba.replace('\0', replacement);
|
||||
+ state.invalidChars = 0;
|
||||
+ }
|
||||
+ ba.append(tba);
|
||||
+ characters += len;
|
||||
+ len = 0;
|
||||
+ state.remainingChars = 0;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return CString(ba.constData(), ba.length());
|
||||
+}
|
||||
+
|
||||
+
|
||||
+} // namespace WebCore
|
||||
+#endif
|
||||
diff --git a/Source/WebCore/platform/text/qt/TextCodecQt.h b/Source/WebCore/platform/text/qt/TextCodecQt.h
|
||||
new file mode 100644
|
||||
index 0000000..f28f0bb
|
||||
--- /dev/null
|
||||
+++ b/Source/WebCore/platform/text/qt/TextCodecQt.h
|
||||
@@ -0,0 +1,54 @@
|
||||
+/*
|
||||
+ * Copyright (C) 2006 Lars Knoll <lars@trolltech.com>
|
||||
+ *
|
||||
+ * Redistribution and use in source and binary forms, with or without
|
||||
+ * modification, are permitted provided that the following conditions
|
||||
+ * are met:
|
||||
+ * 1. Redistributions of source code must retain the above copyright
|
||||
+ * notice, this list of conditions and the following disclaimer.
|
||||
+ * 2. Redistributions in binary form must reproduce the above copyright
|
||||
+ * notice, this list of conditions and the following disclaimer in the
|
||||
+ * documentation and/or other materials provided with the distribution.
|
||||
+ *
|
||||
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
|
||||
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
|
||||
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
+ */
|
||||
+
|
||||
+#ifndef TextCodecQt_h
|
||||
+#define TextCodecQt_h
|
||||
+
|
||||
+#include "TextCodec.h"
|
||||
+#include "TextEncoding.h"
|
||||
+#include <QTextCodec>
|
||||
+
|
||||
+namespace WebCore {
|
||||
+
|
||||
+ class TextCodecQt : public TextCodec {
|
||||
+ public:
|
||||
+ static void registerEncodingNames(EncodingNameRegistrar);
|
||||
+ static void registerCodecs(TextCodecRegistrar);
|
||||
+
|
||||
+ TextCodecQt(const TextEncoding&);
|
||||
+ virtual ~TextCodecQt();
|
||||
+
|
||||
+ virtual String decode(const char*, size_t length, bool flush, bool stopOnError, bool& sawError);
|
||||
+ virtual CString encode(const UChar*, size_t length, UnencodableHandling);
|
||||
+
|
||||
+ private:
|
||||
+ TextEncoding m_encoding;
|
||||
+ QTextCodec *m_codec;
|
||||
+ QTextCodec::ConverterState m_state;
|
||||
+ };
|
||||
+
|
||||
+} // namespace WebCore
|
||||
+
|
||||
+#endif // TextCodecICU_h
|
||||
--
|
||||
2.10.2
|
||||
|
|
@ -1,13 +1,16 @@
|
|||
From ec2f7c510e98db427adef02879330a06daa7f3f7 Mon Sep 17 00:00:00 2001
|
||||
From 967f96d827bc9af129fd1431b97de0dc9a076bef Mon Sep 17 00:00:00 2001
|
||||
From: Martchus <martchus@gmx.net>
|
||||
Date: Sun, 25 Sep 2016 22:19:57 +0200
|
||||
Subject: [PATCH 09/11] Establish compatibility with latest ANGLE
|
||||
Subject: [PATCH 6/9] Establish compatibility with latest ANGLE
|
||||
|
||||
---
|
||||
.../platform/graphics/ANGLEWebKitBridge.cpp | 126 ++++-----------------
|
||||
.../WebCore/platform/graphics/ANGLEWebKitBridge.h | 15 +--
|
||||
.../graphics/opengl/Extensions3DOpenGLCommon.cpp | 2 +-
|
||||
3 files changed, 28 insertions(+), 115 deletions(-)
|
||||
.../WebCore/platform/graphics/ANGLEWebKitBridge.h | 17 +--
|
||||
.../graphics/cairo/GraphicsContext3DCairo.cpp | 2 +-
|
||||
.../platform/graphics/efl/GraphicsContext3DEfl.cpp | 2 +-
|
||||
.../graphics/opengl/Extensions3DOpenGLCommon.cpp | 4 +-
|
||||
.../platform/graphics/qt/GraphicsContext3DQt.cpp | 2 +-
|
||||
6 files changed, 33 insertions(+), 120 deletions(-)
|
||||
|
||||
diff --git a/Source/WebCore/platform/graphics/ANGLEWebKitBridge.cpp b/Source/WebCore/platform/graphics/ANGLEWebKitBridge.cpp
|
||||
index 9876c9f..84d3a2f 100644
|
||||
|
@ -180,7 +183,7 @@ index 9876c9f..84d3a2f 100644
|
|||
|
||||
return true;
|
||||
diff --git a/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h b/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h
|
||||
index 83c2e00..9540cc0 100644
|
||||
index 83c2e00..825c2d0 100644
|
||||
--- a/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h
|
||||
+++ b/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h
|
||||
@@ -35,13 +35,14 @@
|
||||
|
@ -200,7 +203,7 @@ index 83c2e00..9540cc0 100644
|
|||
};
|
||||
|
||||
enum ANGLEShaderSymbolType {
|
||||
@@ -53,17 +54,17 @@ struct ANGLEShaderSymbol {
|
||||
@@ -53,24 +54,24 @@ struct ANGLEShaderSymbol {
|
||||
ANGLEShaderSymbolType symbolType;
|
||||
String name;
|
||||
String mappedName;
|
||||
|
@ -223,11 +226,45 @@ index 83c2e00..9540cc0 100644
|
|||
}
|
||||
};
|
||||
|
||||
class ANGLEWebKitBridge {
|
||||
public:
|
||||
|
||||
- ANGLEWebKitBridge(ShShaderOutput = SH_GLSL_OUTPUT, ShShaderSpec = SH_WEBGL_SPEC);
|
||||
+ ANGLEWebKitBridge(ShShaderOutput = SH_GLSL_COMPATIBILITY_OUTPUT, ShShaderSpec = SH_WEBGL_SPEC);
|
||||
~ANGLEWebKitBridge();
|
||||
|
||||
ShBuiltInResources getResources() { return m_resources; }
|
||||
diff --git a/Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp b/Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp
|
||||
index d31adf3..3b99ad9 100644
|
||||
--- a/Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp
|
||||
+++ b/Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp
|
||||
@@ -80,7 +80,7 @@ PassRefPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attri
|
||||
GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attributes, HostWindow*, GraphicsContext3D::RenderStyle renderStyle)
|
||||
: m_currentWidth(0)
|
||||
, m_currentHeight(0)
|
||||
- , m_compiler(isGLES2Compliant() ? SH_ESSL_OUTPUT : SH_GLSL_OUTPUT)
|
||||
+ , m_compiler(isGLES2Compliant() ? SH_ESSL_OUTPUT : SH_GLSL_COMPATIBILITY_OUTPUT)
|
||||
, m_attrs(attributes)
|
||||
, m_texture(0)
|
||||
, m_fbo(0)
|
||||
diff --git a/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp b/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp
|
||||
index ea25e43..a28c55f 100644
|
||||
--- a/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp
|
||||
+++ b/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp
|
||||
@@ -41,7 +41,7 @@ PassRefPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attri
|
||||
GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle)
|
||||
: m_currentWidth(0)
|
||||
, m_currentHeight(0)
|
||||
- , m_compiler(isGLES2Compliant() ? SH_ESSL_OUTPUT : SH_GLSL_OUTPUT)
|
||||
+ , m_compiler(isGLES2Compliant() ? SH_ESSL_OUTPUT : SH_GLSL_COMPATIBILITY_OUTPUT)
|
||||
, m_attrs(attrs)
|
||||
, m_renderStyle(renderStyle)
|
||||
, m_texture(0)
|
||||
diff --git a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp
|
||||
index 29a13c8..9069957 100644
|
||||
index 29a13c8..11f88f1 100644
|
||||
--- a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp
|
||||
+++ b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp
|
||||
@@ -172,7 +172,7 @@ String Extensions3DOpenGLCommon::getTranslatedShaderSourceANGLE(Platform3DObject
|
||||
@@ -172,10 +172,10 @@ String Extensions3DOpenGLCommon::getTranslatedShaderSourceANGLE(Platform3DObject
|
||||
|
||||
String translatedShaderSource;
|
||||
String shaderInfoLog;
|
||||
|
@ -235,7 +272,24 @@ index 29a13c8..9069957 100644
|
|||
+ int extraCompileOptions = SH_CLAMP_INDIRECT_ARRAY_BOUNDS;
|
||||
|
||||
if (m_requiresBuiltInFunctionEmulation)
|
||||
extraCompileOptions |= SH_EMULATE_BUILT_IN_FUNCTIONS;
|
||||
- extraCompileOptions |= SH_EMULATE_BUILT_IN_FUNCTIONS;
|
||||
+ extraCompileOptions |= SH_EMULATE_ABS_INT_FUNCTION;
|
||||
|
||||
Vector<ANGLEShaderSymbol> symbols;
|
||||
bool isValid = compiler.compileShaderSource(entry.source.utf8().data(), shaderType, translatedShaderSource, shaderInfoLog, symbols, extraCompileOptions);
|
||||
diff --git a/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp b/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
|
||||
index 43b546d..73b61e2 100644
|
||||
--- a/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
|
||||
+++ b/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
|
||||
@@ -428,7 +428,7 @@ GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWi
|
||||
, m_multisampleColorBuffer(0)
|
||||
, m_functions(0)
|
||||
, m_private(adoptPtr(new GraphicsContext3DPrivate(this, hostWindow, renderStyle)))
|
||||
- , m_compiler(isGLES2Compliant() ? SH_ESSL_OUTPUT : SH_GLSL_OUTPUT)
|
||||
+ , m_compiler(isGLES2Compliant() ? SH_ESSL_OUTPUT : SH_GLSL_COMPATIBILITY_OUTPUT)
|
||||
{
|
||||
if (!m_private->m_surface || !m_private->m_platformContext) {
|
||||
LOG_ERROR("GraphicsContext3D: GL context creation failed.");
|
||||
--
|
||||
2.10.2
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
From bfcd0b75a13d6ff4b277382ab4264919b27a08e5 Mon Sep 17 00:00:00 2001
|
||||
From 24eda987a27f9b8b66acacce9a31cfc34b480154 Mon Sep 17 00:00:00 2001
|
||||
From: Martchus <martchus@gmx.net>
|
||||
Date: Sun, 25 Sep 2016 22:21:54 +0200
|
||||
Subject: [PATCH 10/11] Include intrin.h for declaration of _mm_mfence
|
||||
Subject: [PATCH 7/9] Include intrin.h for declaration of _mm_mfence
|
||||
|
||||
---
|
||||
Source/WTF/wtf/Atomics.h | 2 ++
|
|
@ -1,62 +0,0 @@
|
|||
From ec65846e33b689741f896b63884b0f9eed0d413d Mon Sep 17 00:00:00 2001
|
||||
From: Martchus <martchus@gmx.net>
|
||||
Date: Sun, 25 Sep 2016 22:17:41 +0200
|
||||
Subject: [PATCH 08/11] Fix build failure due to building without ICU
|
||||
|
||||
Revert commit 151422
|
||||
---
|
||||
Source/WebCore/rendering/RenderText.cpp | 15 +++++++--------
|
||||
1 file changed, 7 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/Source/WebCore/rendering/RenderText.cpp b/Source/WebCore/rendering/RenderText.cpp
|
||||
index cc7607f..eef4363 100644
|
||||
--- a/Source/WebCore/rendering/RenderText.cpp
|
||||
+++ b/Source/WebCore/rendering/RenderText.cpp
|
||||
@@ -100,7 +100,7 @@ static void makeCapitalized(String* string, UChar previous)
|
||||
return;
|
||||
|
||||
unsigned length = string->length();
|
||||
- const StringImpl& stringImpl = *string->impl();
|
||||
+ const UChar* characters = string->characters();
|
||||
|
||||
if (length >= numeric_limits<unsigned>::max())
|
||||
CRASH();
|
||||
@@ -109,29 +109,28 @@ static void makeCapitalized(String* string, UChar previous)
|
||||
stringWithPrevious[0] = previous == noBreakSpace ? ' ' : previous;
|
||||
for (unsigned i = 1; i < length + 1; i++) {
|
||||
// Replace   with a real space since ICU no longer treats   as a word separator.
|
||||
- if (stringImpl[i - 1] == noBreakSpace)
|
||||
+ if (characters[i - 1] == noBreakSpace)
|
||||
stringWithPrevious[i] = ' ';
|
||||
else
|
||||
- stringWithPrevious[i] = stringImpl[i - 1];
|
||||
+ stringWithPrevious[i] = characters[i - 1];
|
||||
}
|
||||
|
||||
TextBreakIterator* boundary = wordBreakIterator(stringWithPrevious.characters(), length + 1);
|
||||
if (!boundary)
|
||||
return;
|
||||
|
||||
- StringBuilder result;
|
||||
- result.reserveCapacity(length);
|
||||
+ StringBuffer<UChar> data(length);
|
||||
|
||||
int32_t endOfWord;
|
||||
int32_t startOfWord = textBreakFirst(boundary);
|
||||
for (endOfWord = textBreakNext(boundary); endOfWord != TextBreakDone; startOfWord = endOfWord, endOfWord = textBreakNext(boundary)) {
|
||||
if (startOfWord) // Ignore first char of previous string
|
||||
- result.append(stringImpl[startOfWord - 1] == noBreakSpace ? noBreakSpace : toTitleCase(stringWithPrevious[startOfWord]));
|
||||
+ data[startOfWord - 1] = characters[startOfWord - 1] == noBreakSpace ? noBreakSpace : toTitleCase(stringWithPrevious[startOfWord]);
|
||||
for (int i = startOfWord + 1; i < endOfWord; i++)
|
||||
- result.append(stringImpl[i - 1]);
|
||||
+ data[i - 1] = characters[i - 1];
|
||||
}
|
||||
|
||||
- *string = result.toString();
|
||||
+ *string = String::adopt(data);
|
||||
}
|
||||
|
||||
RenderText::RenderText(Node* node, PassRefPtr<StringImpl> str)
|
||||
--
|
||||
2.10.2
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
From 4ab08227b87a186d18f9e1806a2405099ac109ed Mon Sep 17 00:00:00 2001
|
||||
From: Martchus <martchus@gmx.net>
|
||||
Date: Sat, 5 Nov 2016 12:46:27 +0100
|
||||
Subject: [PATCH 8/9] Link against ANGLE even if Qt is configured not to
|
||||
|
||||
---
|
||||
Source/WebCore/WebCore.pri | 12 ++++--------
|
||||
1 file changed, 4 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/Source/WebCore/WebCore.pri b/Source/WebCore/WebCore.pri
|
||||
index ddad897..f69e224 100644
|
||||
--- a/Source/WebCore/WebCore.pri
|
||||
+++ b/Source/WebCore/WebCore.pri
|
||||
@@ -215,15 +215,11 @@ enable?(WEB_AUDIO) {
|
||||
use?(3D_GRAPHICS) {
|
||||
win32: {
|
||||
mingw: {
|
||||
- # Make sure OpenGL libs are after the webcore lib so MinGW can resolve symbols
|
||||
- contains(QT_CONFIG, opengles2) {
|
||||
- CONFIG(debug, debug|release):contains(QT_CONFIG, angle) {
|
||||
- LIBS += $$QMAKE_LIBS_OPENGL_ES2_DEBUG
|
||||
- } else {
|
||||
- LIBS += $$QMAKE_LIBS_OPENGL_ES2
|
||||
- }
|
||||
+ # Always link against ANGLE
|
||||
+ CONFIG(debug, debug|release):contains(QT_CONFIG, angle) {
|
||||
+ LIBS += $$QMAKE_LIBS_OPENGL_ES2_DEBUG
|
||||
} else {
|
||||
- LIBS += $$QMAKE_LIBS_OPENGL
|
||||
+ LIBS += $$QMAKE_LIBS_OPENGL_ES2
|
||||
}
|
||||
}
|
||||
} else {
|
||||
--
|
||||
2.10.2
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
From e60cb272ada8e08297c85e22039d6b9a4c9d575c Mon Sep 17 00:00:00 2001
|
||||
From: Konstantin Tokarev <annulen@yandex.ru>
|
||||
Date: Fri, 4 Nov 2016 00:44:49 +0300
|
||||
Subject: [PATCH 9/9] Fixed crash (probably miscompilation) with MinGW-w64
|
||||
5.3.0
|
||||
|
||||
Change-Id: Iac1c5fe1879abfaa299ec909e5928912c2354126
|
||||
---
|
||||
Source/WebKit/qt/WidgetApi/qwebframe.cpp | 10 ----------
|
||||
Source/WebKit/qt/WidgetApi/qwebframe_p.h | 4 ++--
|
||||
2 files changed, 2 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/Source/WebKit/qt/WidgetApi/qwebframe.cpp b/Source/WebKit/qt/WidgetApi/qwebframe.cpp
|
||||
index dd08725..1cec124 100644
|
||||
--- a/Source/WebKit/qt/WidgetApi/qwebframe.cpp
|
||||
+++ b/Source/WebKit/qt/WidgetApi/qwebframe.cpp
|
||||
@@ -119,16 +119,6 @@ QWebFrameAdapter* QWebFramePrivate::createChildFrame(QWebFrameData* frameData)
|
||||
return newFrame->d;
|
||||
}
|
||||
|
||||
-QWebFrame *QWebFramePrivate::apiHandle()
|
||||
-{
|
||||
- return q;
|
||||
-}
|
||||
-
|
||||
-QObject *QWebFramePrivate::handle()
|
||||
-{
|
||||
- return q;
|
||||
-}
|
||||
-
|
||||
void QWebFramePrivate::contentsSizeDidChange(const QSize &size)
|
||||
{
|
||||
emit q->contentsSizeChanged(size);
|
||||
diff --git a/Source/WebKit/qt/WidgetApi/qwebframe_p.h b/Source/WebKit/qt/WidgetApi/qwebframe_p.h
|
||||
index 2a1c202..25fbdc3 100644
|
||||
--- a/Source/WebKit/qt/WidgetApi/qwebframe_p.h
|
||||
+++ b/Source/WebKit/qt/WidgetApi/qwebframe_p.h
|
||||
@@ -49,8 +49,8 @@ public:
|
||||
static QWebFrame* kit(const QWebFrameAdapter*);
|
||||
|
||||
// Adapter implementation
|
||||
- virtual QWebFrame* apiHandle() OVERRIDE;
|
||||
- virtual QObject* handle() OVERRIDE;
|
||||
+ virtual QWebFrame* apiHandle() OVERRIDE { return q; }
|
||||
+ virtual QObject* handle() OVERRIDE { return q; }
|
||||
virtual void contentsSizeDidChange(const QSize &) OVERRIDE;
|
||||
virtual int scrollBarPolicy(Qt::Orientation) const OVERRIDE;
|
||||
virtual void emitUrlChanged() OVERRIDE;
|
||||
--
|
||||
2.10.2
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
From 8a3eff09ffc9f1c29abed87a36afffdf9d483345 Mon Sep 17 00:00:00 2001
|
||||
From: Martchus <martchus@gmx.net>
|
||||
Date: Sat, 5 Nov 2016 12:46:27 +0100
|
||||
Subject: [PATCH 11/11] Link against ANGLE even if Qt is configured for dynamic
|
||||
OpenGL
|
||||
|
||||
---
|
||||
Source/WebCore/WebCore.pri | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Source/WebCore/WebCore.pri b/Source/WebCore/WebCore.pri
|
||||
index ddad897..998a914 100644
|
||||
--- a/Source/WebCore/WebCore.pri
|
||||
+++ b/Source/WebCore/WebCore.pri
|
||||
@@ -216,7 +216,7 @@ use?(3D_GRAPHICS) {
|
||||
win32: {
|
||||
mingw: {
|
||||
# Make sure OpenGL libs are after the webcore lib so MinGW can resolve symbols
|
||||
- contains(QT_CONFIG, opengles2) {
|
||||
+ contains(QT_CONFIG, opengles2)|contains(QT_CONFIG, dynamicgl) {
|
||||
CONFIG(debug, debug|release):contains(QT_CONFIG, angle) {
|
||||
LIBS += $$QMAKE_LIBS_OPENGL_ES2_DEBUG
|
||||
} else {
|
||||
--
|
||||
2.10.2
|
||||
|
|
@ -43,29 +43,25 @@ url="https://www.qt.io/"
|
|||
_pkgfqn="${_qt_module}-opensource-src-${pkgver}"
|
||||
groups=(mingw-w64-qt mingw-w64-qt5)
|
||||
source=("https://download.qt.io/community_releases/${pkgver:0:3}/${pkgver}/${_pkgfqn}.tar.xz"
|
||||
'0001-Use-correct-ICU-libs.patch'
|
||||
'0002-Use-pkg-config.patch'
|
||||
'0003-Use-system-ANGLE-rather-than-bundled-version.patch'
|
||||
'0004-Don-t-require-qt5-base-to-be-built-with-ICU-support.patch'
|
||||
'0005-Revert-removal-of-QT4_UNICODE-and-related-code-paths.patch'
|
||||
'0006-Prevent-symbols-not-being-exported-in-Qt5WebKit.dll.patch'
|
||||
'0007-Build-with-smaller-debug-info.patch'
|
||||
'0008-Fix-build-failure-due-to-building-without-ICU.patch'
|
||||
'0009-Establish-compatibility-with-latest-ANGLE.patch'
|
||||
'0010-Include-intrin.h-for-declaration-of-_mm_mfence.patch'
|
||||
'0011-Link-against-ANGLE-even-if-Qt-is-configured-for-dyna.patch')
|
||||
md5sums=('9379b8829639645c184fa63532035098'
|
||||
'f6ddbf0e11d0eee39b50229a8afbd880'
|
||||
'9305257168e259e7f94cd58393b9680c'
|
||||
'41db74a7707fdd0aa9b7a61cf2bd2d96'
|
||||
'ca2377c17a1f70ba89c8ae76ebf78627'
|
||||
'4427d61a4703048b11119f36d58738a8'
|
||||
'd6aeffcfc72397d85191bc19f464eb28'
|
||||
'cab7dbd33ff8a89b794275187e9e3ada'
|
||||
'f68edefadc250765c8f2b28b9e400e77'
|
||||
'6216d2024eb88b5780d7a50793dfa996'
|
||||
'5165c996fa761a5dc6de69e27246865c'
|
||||
'09f63193a742155fa6747f1978d2a3a6')
|
||||
'0001-Use-correct-ICU-libs.patch'
|
||||
'0002-Use-pkg-config.patch'
|
||||
'0003-Use-system-ANGLE-rather-than-bundled-version.patch'
|
||||
'0004-Prevent-symbols-not-being-exported-in-Qt5WebKit.dll.patch'
|
||||
'0005-Build-with-smaller-debug-info.patch'
|
||||
'0006-Establish-compatibility-with-latest-ANGLE.patch'
|
||||
'0007-Include-intrin.h-for-declaration-of-_mm_mfence.patch'
|
||||
'0008-Link-against-ANGLE-even-if-Qt-is-configured-not-to.patch'
|
||||
'0009-Fixed-crash-probably-miscompilation-with-MinGW-w64-5.patch')
|
||||
sha256sums=('c7a3253cbf8e6035c54c3b08d8a9457bd82efbce71d4b363c8f753fd07bd34df'
|
||||
'922c12e3726cfcecd99d773a3135ea05a36bd325c24cf07463d21f8778d5c5a0'
|
||||
'2f7887173f777c6fb5ff49a37e1015b8e1d8f22f692917b0b0a24e22ad3022c5'
|
||||
'8c0dc51d02814577c4ac557493a2b7d7b74311649bf3c91072e798fd7b2d7a98'
|
||||
'3e9893be250bcadf2a3437f2fd1cc0d454211e315071939d9ebf27f00d600253'
|
||||
'cc0c239676f747b9c30fe1b774a5208fde5650f02f8388379d164d9ccaccab17'
|
||||
'b87eaa3c18764347f04a8d5fcae322052a194508ea0ba6eb2cd69db6385633c1'
|
||||
'4da5c29a054a8a087b95f4a7788aee83a1a4388efa948150f8cf4e233ec426bc'
|
||||
'79587af527bbb80d7954de6fb23c279493166e88c0f44e3aaa956964b04fbd3e'
|
||||
'8302e606050da917b01fa3af8388c0d7ae6ff999129b8eb2ed27bcf5d4d37dd9')
|
||||
|
||||
_architectures='i686-w64-mingw32 x86_64-w64-mingw32'
|
||||
|
||||
|
@ -94,20 +90,16 @@ prepare() {
|
|||
build() {
|
||||
cd "${srcdir}/${_pkgfqn}"
|
||||
unset PKG_CONFIG_PATH
|
||||
local default_cpath="$CPATH"
|
||||
for _arch in ${_architectures}; do
|
||||
for _config in "${_configurations[@]}"; do
|
||||
msg2 "Building ${_config##*=} version for ${_arch}"
|
||||
mkdir -p build-${_arch}-${_config##*=} && pushd build-${_arch}-${_config##*=}
|
||||
# Since Source/ThirdParty/ANGLE has been removed ensure files
|
||||
# from system ANGLE can be included (patches from Fedora don't help
|
||||
# here because Fedora uses other paths)
|
||||
export CPATH="$CPATH:/usr/$_arch/include:/usr/$_arch/include/GLSLANG"
|
||||
# Since Source/ThirdParty/ANGLE has been removed ensure files from system ANGLE can be included
|
||||
export CPATH="${default_cpath}:/usr/$_arch/include:/usr/$_arch/include/GLSLANG"
|
||||
|
||||
# SH_GLSL_OUTPUT has been renamed to SH_GLSL_COMPATIBILITY_OUTPUT
|
||||
# in the latest ANGLE version so I just add a definition for backward compatibility
|
||||
${_arch}-qmake-qt5 \
|
||||
"QMAKE_CXXFLAGS+=-Wno-c++0x-compat" \
|
||||
"DEFINES+=SH_GLSL_OUTPUT=SH_GLSL_COMPATIBILITY_OUTPUT" \
|
||||
../WebKit.pro
|
||||
make
|
||||
popd
|
||||
|
@ -136,3 +128,4 @@ package() {
|
|||
done
|
||||
done
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue