@@ -0,0 +1,155 @@ | |||
From b4bc7aae23505bee1f2879c44f2fb727e76c36c0 Mon Sep 17 00:00:00 2001 | |||
From: anonymous <anonymous@example.com> | |||
Date: Sat, 21 Jan 2017 02:15:20 +0200 | |||
Subject: [PATCH] TWEAK_LOGDOC_LOAD_IMAGES_FROM_PARSER turned into two | |||
preferences | |||
--- | |||
modules/logdoc/module.tweaks | 22 ++++++++++++++++++---- | |||
modules/logdoc/src/htm_elm.cpp | 13 ++++++++----- | |||
modules/logdoc/src/htm_ldoc.cpp | 23 +++++++++++++++++------ | |||
modules/prefs/prefsmanager/collections/pc_doc.txt | 16 ++++++++++++++++ | |||
4 files changed, 59 insertions(+), 15 deletions(-) | |||
diff --git a/modules/logdoc/module.tweaks b/modules/logdoc/module.tweaks | |||
index b4a7738..03d6158 100644 | |||
--- a/modules/logdoc/module.tweaks | |||
+++ b/modules/logdoc/module.tweaks | |||
@@ -349,7 +349,7 @@ TWEAK_LOGDOC_IGNORE_SCHEMES_WITH_TABS_OR_NEW_LINES pstanek | |||
Enabled for : minimal | |||
Disabled for : smartphone, desktop, tv, mini | |||
-TWEAK_LOGDOC_LOAD_IMAGES_FROM_PARSER pstanek | |||
+TWEAK_LOGDOC_LOAD_IMAGES_FROM_PARSER_DEFAULT anonymous | |||
Moves images loading from the layout to the parser. | |||
This may cause more images will be loaded (even the ones which are hidden) | |||
@@ -357,9 +357,23 @@ TWEAK_LOGDOC_LOAD_IMAGES_FROM_PARSER pstanek | |||
May have also impact on loading performace. | |||
Category : performance | |||
- Define : LOGDOC_LOAD_IMAGES_FROM_PARSER | |||
- Enabled for : desktop, tv, mini | |||
- Disabled for: smartphone, minimal | |||
+ Define : DEFAULT_LOGDOC_LOAD_IMAGES_FROM_PARSER | |||
+ Value : FALSE | |||
+ Value for desktop, tv, smartphone, minimal: FALSE | |||
+ Value for mini: TRUE | |||
+ | |||
+TWEAK_LOGDOC_LOAD_IMAGES_FROM_PARSER_FOR_CANVAS_DEFAULT anonymous | |||
+ | |||
+ Moves images loading from the layout to the parser if canvas support is | |||
+ turned on. This may cause more images will be loaded (even the ones which | |||
+ are hidden) but will reduce page compatibility problems. | |||
+ May have also impact on loading performace. | |||
+ | |||
+ Category : performance | |||
+ Define : DEFAULT_LOGDOC_LOAD_IMAGES_FROM_PARSER_FOR_CANVAS | |||
+ Value : FALSE | |||
+ Value for desktop, tv, smartphone, minimal: FALSE | |||
+ Value for mini: TRUE | |||
TWEAK_LOGDOC_INCREASE_FONTSIZE_QUIRK deprecated | |||
diff --git a/modules/logdoc/src/htm_elm.cpp b/modules/logdoc/src/htm_elm.cpp | |||
index 59c3783..59aa720 100644 | |||
--- a/modules/logdoc/src/htm_elm.cpp | |||
+++ b/modules/logdoc/src/htm_elm.cpp | |||
@@ -17138,14 +17138,17 @@ HTML_Element::GetUrlAttr(short attr, int ns_idx/*=NS_IDX_HTML*/, LogicalDocument | |||
} | |||
#endif // WEB_TURBO_MODE | |||
-#if defined LOGDOC_LOAD_IMAGES_FROM_PARSER && defined _WML_SUPPORT_ | |||
+#if defined _WML_SUPPORT_ | |||
/* In WML images may have attribute set to some variable. Moreover variable value may be set later than during parsing - e.g. by the timer - so | |||
* in such a case, if URL can not be resolved, do not cache it. | |||
*/ | |||
- if (logdoc && Type() == HE_IMG && ret_url.IsEmpty() && logdoc->GetHLDocProfile()->IsWml() && logdoc->GetHLDocProfile()->HasWmlContent() && | |||
- logdoc->GetHLDocProfile()->WMLGetContext()->NeedSubstitution(url_str, uni_strlen(url_str))) | |||
- return NULL; | |||
-#endif // LOGDOC_LOAD_IMAGES_FROM_PARSER && _WML_SUPPORT_ | |||
+ if (g_pcdoc->GetIntegerPref(PrefsCollectionDoc::LoadImagesFromParser)) | |||
+ { | |||
+ if (logdoc && Type() == HE_IMG && ret_url.IsEmpty() && logdoc->GetHLDocProfile()->IsWml() && logdoc->GetHLDocProfile()->HasWmlContent() && | |||
+ logdoc->GetHLDocProfile()->WMLGetContext()->NeedSubstitution(url_str, uni_strlen(url_str))) | |||
+ return NULL; | |||
+ } | |||
+#endif // _WML_SUPPORT_ | |||
if (OpStatus::IsMemoryError(url_attr->SetResolvedUrl(ret_url))) | |||
return NULL; | |||
diff --git a/modules/logdoc/src/htm_ldoc.cpp b/modules/logdoc/src/htm_ldoc.cpp | |||
index 9563159..c6985e8 100644 | |||
--- a/modules/logdoc/src/htm_ldoc.cpp | |||
+++ b/modules/logdoc/src/htm_ldoc.cpp | |||
@@ -2270,8 +2270,7 @@ HLDocProfile::InsertElementInternal(HTML_Element *parent, HTML_Element *new_elm, | |||
SetIsOutOfMemory(TRUE); | |||
} | |||
-#ifdef LOGDOC_LOAD_IMAGES_FROM_PARSER | |||
- else if (new_elm->GetInputType() == INPUT_IMAGE) | |||
+ else if (g_pcdoc->GetIntegerPref(PrefsCollectionDoc::LoadImagesFromParser) && new_elm->GetInputType() == INPUT_IMAGE) | |||
{ | |||
URL inline_url = new_elm->GetImageURL(FALSE, GetLogicalDocument()); | |||
@@ -2282,7 +2281,6 @@ HLDocProfile::InsertElementInternal(HTML_Element *parent, HTML_Element *new_elm, | |||
SetIsOutOfMemory(TRUE); | |||
} | |||
} | |||
-#endif // LOGDOC_LOAD_IMAGES_FROM_PARSER | |||
SetElementNumberWithinForm(this, new_elm); | |||
SetElementFormNumber(this, new_elm); | |||
@@ -2336,9 +2334,22 @@ HLDocProfile::InsertElementInternal(HTML_Element *parent, HTML_Element *new_elm, | |||
case HE_IMG: | |||
{ | |||
SetElementFormNumber(this, new_elm); | |||
-#if !defined(LOGDOC_LOAD_IMAGES_FROM_PARSER) && !defined(CANVAS_SUPPORT) | |||
- if ((new_elm->HasAttr(ATTR_ONLOAD) || new_elm->HasAttr(ATTR_ONERROR)) && !new_elm->GetHEListElmForInline(IMAGE_INLINE)) | |||
-#endif // !LOGDOC_LOAD_IMAGES_FROM_PARSER && !CANVAS_SUPPORT | |||
+ bool doLoadImgNow = false; | |||
+#if defined(CANVAS_SUPPORT) | |||
+ doLoadImgNow = g_pcdoc->GetIntegerPref(PrefsCollectionDoc::AlwaysLoadImagesFromParserForCanvas); | |||
+#endif | |||
+ if (!g_pcdoc->GetIntegerPref(PrefsCollectionDoc::LoadImagesFromParser)) | |||
+ { | |||
+ doLoadImgNow = doLoadImgNow || ((new_elm->HasAttr(ATTR_ONLOAD) || new_elm->HasAttr(ATTR_ONERROR)) && !new_elm->GetHEListElmForInline(IMAGE_INLINE)); | |||
+ } | |||
+ else | |||
+ { | |||
+ doLoadImgNow = true; | |||
+ } | |||
+//#if !defined(LOGDOC_LOAD_IMAGES_FROM_PARSER) && !defined(CANVAS_SUPPORT) | |||
+// if ((new_elm->HasAttr(ATTR_ONLOAD) || new_elm->HasAttr(ATTR_ONERROR)) && !new_elm->GetHEListElmForInline(IMAGE_INLINE)) | |||
+//#endif // !LOGDOC_LOAD_IMAGES_FROM_PARSER && !CANVAS_SUPPORT | |||
+ if (doLoadImgNow) | |||
{ | |||
/* There are three reasons we might choose to load the image now. | |||
1. The tweak to load images from the parser is enabled. | |||
diff --git a/modules/prefs/prefsmanager/collections/pc_doc.txt b/modules/prefs/prefsmanager/collections/pc_doc.txt | |||
index f7e41e7..2d47a6b 100644 | |||
--- a/modules/prefs/prefsmanager/collections/pc_doc.txt | |||
+++ b/modules/prefs/prefsmanager/collections/pc_doc.txt | |||
@@ -508,4 +508,20 @@ Type: boolean | |||
Description: Draw images instantly | |||
Default: DEFAULT_TURBO_MODE | |||
+Preference: LoadImagesFromParser | |||
+Depends on: | |||
+Section: Performance | |||
+Key: Load Images From Parser | |||
+Type: boolean | |||
+Description: Load images from parser. Turning this on speeds up page loading, but Opera may fetch some hidden images. | |||
+Default: DEFAULT_LOGDOC_LOAD_IMAGES_FROM_PARSER | |||
+ | |||
+Preference: AlwaysLoadImagesFromParserForCanvas | |||
+Depends on: | |||
+Section: Performance | |||
+Key: Always Load Images From Parser For Canvas | |||
+Type: boolean | |||
+Description: Always load images from parser if canvas support is turned on. Turning this off speeds up page loading, but may break web. | |||
+Default: DEFAULT_LOGDOC_LOAD_IMAGES_FROM_PARSER_FOR_CANVAS | |||
+ | |||
.eof | |||
-- | |||
2.9.2 |
@@ -0,0 +1,100 @@ | |||
diff --git a/adjunct/bittorrent/bt-upload.cpp b/adjunct/bittorrent/bt-upload.cpp | |||
index b748be6..c1587ae 100644 | |||
--- a/adjunct/bittorrent/bt-upload.cpp | |||
+++ b/adjunct/bittorrent/bt-upload.cpp | |||
@@ -517,14 +517,14 @@ OpByteBuffer *UploadTransferBT::OnRequest(BTPacket* packet) | |||
DEBUGTRACE_UP(UNI_L("ILLEGAL length: %d\n"), length); | |||
// error, too large request | |||
Close(); | |||
- return FALSE; | |||
+ return NULL; | |||
} | |||
if(offset + length > m_filesize ) | |||
{ | |||
DEBUGTRACE_UP(UNI_L("ILLEGAL size: %d\n"), offset + length); | |||
// error, size larger than file | |||
Close(); | |||
- return FALSE; | |||
+ return NULL; | |||
} | |||
for(P2PFilePart* fragment = m_requested ; fragment != NULL; fragment = fragment->m_next ) | |||
diff --git a/adjunct/bittorrent/connection.cpp b/adjunct/bittorrent/connection.cpp | |||
index f79bf93..a0a9523 100644 | |||
--- a/adjunct/bittorrent/connection.cpp | |||
+++ b/adjunct/bittorrent/connection.cpp | |||
@@ -1551,7 +1551,7 @@ BTClientConnector *BTServerConnector::VerifyHandshake(OpByteBuffer& buffer, P2PS | |||
if(buffer.DataSize() < 7) | |||
{ | |||
- return FALSE; | |||
+ return NULL; | |||
} | |||
// Check for BitTorrent handshake | |||
diff --git a/modules/liblcms/src/cmstypes.c b/modules/liblcms/src/cmstypes.c | |||
index c2d6f94..0e9d4e0 100644 | |||
--- a/modules/liblcms/src/cmstypes.c | |||
+++ b/modules/liblcms/src/cmstypes.c | |||
@@ -2368,9 +2368,9 @@ cmsStage* ReadSetOfCurves(struct _cms_typehandler_struct* self, cmsIOHANDLER* io | |||
cmsUInt32Number i; | |||
cmsStage* Lin = NULL; | |||
- if (nCurves > cmsMAXCHANNELS) return FALSE; | |||
+ if (nCurves > cmsMAXCHANNELS) return NULL; | |||
- if (!io -> Seek(io, Offset)) return FALSE; | |||
+ if (!io -> Seek(io, Offset)) return NULL; | |||
for (i=0; i < nCurves; i++) | |||
Curves[i] = NULL; | |||
@@ -5082,7 +5082,7 @@ void *Type_Dictionary_Read(struct _cms_typehandler_struct* self, cmsIOHANDLER* i | |||
if (DisplayNameMLU != NULL) cmsMLUfree(DisplayNameMLU); | |||
if (DisplayValueMLU != NULL) cmsMLUfree(DisplayValueMLU); | |||
- if (!rc) return FALSE; | |||
+ if (!rc) return NULL; | |||
} | |||
FreeArray(&a); | |||
diff --git a/platforms/quix/module.build/autoupdatechecker.conf.py b/platforms/quix/module.build/autoupdatechecker.conf.py | |||
index 340e0e6..b6d9b9b 100644 | |||
--- a/platforms/quix/module.build/autoupdatechecker.conf.py | |||
+++ b/platforms/quix/module.build/autoupdatechecker.conf.py | |||
@@ -9,7 +9,7 @@ def libraries(binary='opera'): | |||
if binary == 'opera_autoupdatechecker': | |||
# Use system libs | |||
libs.append(util.PkgConfig('sqlite3')) | |||
- libs.append(util.PkgConfig('tinyxml', static=True)) | |||
+ libs.append(util.PkgConfig('tinyxml')) | |||
libs.append(util.PkgConfig('libcurl')) | |||
return libs | |||
diff --git a/platforms/unix/base/x11/x11_globals.h b/platforms/unix/base/x11/x11_globals.h | |||
index 7511001..933d72b 100644 | |||
--- a/platforms/unix/base/x11/x11_globals.h | |||
+++ b/platforms/unix/base/x11/x11_globals.h | |||
@@ -33,7 +33,7 @@ public: | |||
:visual(0) | |||
,id(None) | |||
,colormap(None) | |||
- ,fbconfig(None) | |||
+ ,fbconfig(NULL) | |||
,depth(0) | |||
,image_bpp(0) | |||
,r_mask(0) | |||
diff --git a/platforms/unix/base/x11/x11_mdebuffer.cpp b/platforms/unix/base/x11/x11_mdebuffer.cpp | |||
index 5c13ea0..67e5da8 100644 | |||
--- a/platforms/unix/base/x11/x11_mdebuffer.cpp | |||
+++ b/platforms/unix/base/x11/x11_mdebuffer.cpp | |||
@@ -46,8 +46,8 @@ X11MdeBuffer::X11MdeBuffer(X11Types::Display *display, | |||
,m_window(window) | |||
,m_widget(g_x11->GetWidgetList()->FindWidget(window)) | |||
,m_visual(visual) | |||
- ,m_gc(None) | |||
- ,m_plugin_gc(None) | |||
+ ,m_gc(NULL) | |||
+ ,m_plugin_gc(NULL) | |||
{ | |||
} | |||
@@ -0,0 +1,11 @@ | |||
up. Sooo... I've succesfully built this shit for raspberry pi (because why not) | |||
Deps: libfontconfig1-dev libtinyxml-dev libxrender-dev libgstreamer-plugins-base0.10-dev libgtk2.0-dev libcups2-dev libfreetype6-dev libsqlite3-dev libxml-twig-perl zip | |||
Patches: | |||
Build patch (was mentioned before): https://paste.fedoraproject.org/527758/03599148 | |||
Arm patch: https://paste.fedoraproject.org/527759/45036061 | |||
Build command: | |||
./flower -v -j 1 --without-kde4 --without-gtk3 --without-plugins --without-dual-plugin-wrapper --no-debug-symbols --optimize --without-autoupdatechecker --no-package-devel --release --package=tar | |||
You'll also need 1-2 GB swap if building on real hardware, or build will fail. |
@@ -0,0 +1,36 @@ | |||
# OpenOpera Patches | |||
A collection of patches for the Opera 12.15 source code, feel free to make a pull request if you have anything to add or fix. | |||
If you have any issues with Opera 12.15 please make a report on the [openopera-issues project](https://github.com/PrestoXen/openopera-issues/issues), or if you have problems with a patch please visit [the issue tracker here](https://github.com/PrestoXen/openopera-patches/issues). | |||
You're also welcome to join the OpenOpera IRC: http://site.anonnet.org/webirc/openopera | |||
Or join #openopera on crowley.anonnet.org:6697 | |||
## Contents | |||
### General patches | |||
- **FalseNullFix.patch**: patch to fix some FALSE->NULL errors | |||
- **VP9Fix.patch**: VP9 support patch (requires libvpx-1.3.0 (exactly)), no Windows support atm. | |||
- **DisableClickToActivate.patch**: disables "Click to activate" on Flash applets | |||
- **LoadImagesParser.patch**: TWEAK_LOGDOC_LOAD_IMAGES_FROM_PARSER turned into two preferences | |||
### Linux/FreeBSD patches | |||
- **LinuxBuildFix.patch**: fixes some build issues on Linux | |||
- **LinuxReleaseFix.patch**: makes Linux release builds more stable | |||
- **JSExecutionFix.patch**: patch to fix javascript execution errors when building with modern compilers (g++ 5.x+) | |||
- **PiInstructions.txt**: instructions on building for Raspberry Pi | |||
- **PiFixes.patch**: patches for building on Raspberry Pi | |||
- **ArmFixes.patch**: patches for building for ARM platform (needed for Pi) | |||
- **freebsd-11-gcc6.patch**: FreeBSD compiling patch by kandeshvari, [source](https://gist.github.com/kandeshvari/6e69327fb017ea95bced85c6f297a29f) | |||
- **FixFreeType.patch**: Fix building against system version of libfreetype with newer versions of the FreeType API | |||
### Windows patches | |||
- **VSInstructions.md**: guide for building with VS2010 and VS2015 (you should also read the alt version below) | |||
- **VSInstructionsAlt.txt**: translated instructions provided by RedCatX, [source](https://geektimes.ru/post/284588/) | |||
- **VS2015Fix.patch**: patch for building on VS2015 | |||
### Gstreamer (Opera patched edition) | |||
- **gst-opera_instructions.txt**: guide for cloning the broken gst-opera repo into a working state | |||
- **gst-opera_clone.bat**: batch script to clone the broken gst-opera repo (requires wget & git for Windows) | |||
- **gst-opera_clone.sh**: shell script to clone the broken gst-opera repo (requires wget & git) | |||
- **[gst-opera_opensource.opera.com.zip](http://www22.zippyshare.com/v/Wp1PrPRW/file.html)**: all the gst-opera repos, already cloned and zipped, with small edits for VS2015 support (external download) |
@@ -0,0 +1,36 @@ | |||
@echo off | |||
git clone http://sourcecode.opera.com/gstreamer/gst-opera.git | |||
cd gst-opera | |||
rem clone sub-modules manually | |||
git clone http://sourcecode.opera.com/gstreamer/libogg.git | |||
git clone http://sourcecode.opera.com/gstreamer/libvorbis.git | |||
git clone http://sourcecode.opera.com/gstreamer/libtheora.git | |||
git clone http://sourcecode.opera.com/gstreamer/glib.git | |||
git clone http://sourcecode.opera.com/gstreamer/gstreamer.git | |||
git clone http://sourcecode.opera.com/gstreamer/gst-plugins-base.git | |||
git clone http://sourcecode.opera.com/gstreamer/gst-plugins-good.git | |||
rem gst-plugins-bad is borked, need to clone it a different way | |||
rem YOU NEED WGET INSTALLED FOR THIS TO WORK | |||
wget -r http://sourcecode.opera.com/gstreamer/gst-plugins-bad.git -P gst-opera-bad1.git | |||
git clone gst-opera-bad1.git/sourcecode.opera.com/gstreamer/gst-plugins-bad.git | |||
rem setup each sub-module repo to have correct code | |||
cd glib | |||
git checkout remotes/origin/2.20.5+OPERA | |||
cd ../gst-plugins-bad | |||
git checkout remotes/origin/RELEASE-0.10.19+OPERA | |||
cd ../gst-plugins-base | |||
git checkout remotes/origin/RELEASE-0.10.29+OPERA | |||
cd ../gst-plugins-good | |||
git checkout remotes/origin/RELEASE-0.10.23+OPERA | |||
cd ../gstreamer | |||
git checkout remotes/origin/RELEASE-0.10.29+OPERA | |||
rem done! | |||
echo gst-opera clone finished! |