Skip to content

Commit

Permalink
7.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoine Turmel committed Feb 1, 2019
1 parent b472309 commit 91fadbe
Show file tree
Hide file tree
Showing 427 changed files with 34,351 additions and 62,049 deletions.
4 changes: 2 additions & 2 deletions WKC/WebCore/platform/graphics/WKC/FontWKC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ FontCascade::getGlyphsAndAdvancesForComplexText(const TextRun& run, int from, in
if (!sfont.platformData().font()) return 0.f;
void* font = sfont.platformData().font()->font();
if (!font) return 0.f;
const float scale = 0.f;
const float scale = sfont.platformData().font()->scale();

UChar* str;
if (run.is8Bit()) {
Expand Down Expand Up @@ -1030,7 +1030,7 @@ FontCascade::drawEmphasisMarksForComplexText(GraphicsContext* context, const Tex
bool
FontCascade::canExpandAroundIdeographsInComplexText()
{
return false;
return true;
}
bool FontCascade::canReturnFallbackFontsForComplexText()
{
Expand Down
5 changes: 3 additions & 2 deletions WKC/WebCore/platform/graphics/WKC/GraphicsContextWKCCairo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -916,8 +916,9 @@ FloatRect GraphicsContext::roundToDevicePixels(const FloatRect& frect, RoundingM
double y = frect.y();
cairo_t* cr = platformContext()->cr();
cairo_user_to_device(cr, &x, &y);
x = std::round(x);
y = std::round(y);
// round half up
x = floor(x + 0.5);
y = floor(y + 0.5);
cairo_device_to_user(cr, &x, &y);
result.setX(narrowPrecisionToFloat(x));
result.setY(narrowPrecisionToFloat(y));
Expand Down
6 changes: 5 additions & 1 deletion WKC/WebCore/platform/graphics/WKC/SourceBufferPrivateWKC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ class MediaSampleWKC : public MediaSample {

virtual size_t sizeInBytes() const { return 0; }
virtual FloatSize presentationSize() const { return { 0, 0 }; }
virtual void offsetTimestampsBy(const MediaTime&) { }
virtual void offsetTimestampsBy(const MediaTime& timestampOffset)
{
m_presentationTime += timestampOffset;
m_decodeTime += timestampOffset;
}
virtual void dump(PrintStream&) const { }

protected:
Expand Down
29 changes: 29 additions & 0 deletions WKC/WebCore/platform/network/WKC/ResourceHandleManagerWKC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1981,6 +1981,29 @@ void ResourceHandleManager::doClearCookies()
nxLog_out("");
}

static WKC::ConnectionFilteringProc gConnectionFilteringProc;

void
ResourceHandleManager::setConnectionFilteringCallback(WKC::ConnectionFilteringProc proc)
{
gConnectionFilteringProc = proc;
}

// DNS resolution has been done before this is called
bool ResourceHandleManager::filter_callback(CURL *easy, const struct sockaddr_in *resolved_address)
{
if (resolved_address->sin_family != AF_INET) {
// only IPv4 is supported
return true;
}

if (gConnectionFilteringProc) {
return gConnectionFilteringProc(static_cast<wkc_uint32>(resolved_address->sin_addr.s_addr));
}

return true;
}

static int _serverPushCallback(CURL *parent, CURL *easy, size_t num_headers, struct curl_pushheaders *headers, void *userp)
{
nxLog_in("(%d, %p, %p)", num_headers, parent, easy);
Expand Down Expand Up @@ -3061,6 +3084,8 @@ void ResourceHandleManager::initializeHandle(ResourceHandle* job)
// cookie
curl_easy_setopt(d->m_handle, CURLOPT_COOKIEFUNCTIONDATA, job);
curl_easy_setopt(d->m_handle, CURLOPT_COOKIEFUNCTION, cookie_callback);
// filtering
curl_easy_setopt(d->m_handle, CURLOPT_CONNECT_FILTERING_FUNCTION, filter_callback);
// redirect
if (!m_redirectInWKC) {
curl_easy_setopt(d->m_handle, CURLOPT_FOLLOWLOCATION, 1);
Expand Down Expand Up @@ -4009,6 +4034,10 @@ int ResourceHandleManager::contentComposition(ResourceHandle* job)
return WKC::EOtherContentComposition;
}
#endif

if (job->firstRequest().requester() == ResourceRequest::Requester::XHR)
return WKC::EInclusionContentComposition;

Page* page = frame->page();
if (page && frame==&page->mainFrame()) {
if (documentloader->isLoadingSubresources())
Expand Down
4 changes: 4 additions & 0 deletions WKC/WebCore/platform/network/WKC/ResourceHandleManagerWKC.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ WTF_MAKE_FAST_ALLOCATED;
void setCanCacheToDiskCallback(WKC::CanCacheToDiskProc proc);
#endif

void setConnectionFilteringCallback(WKC::ConnectionFilteringProc proc);
bool isMatchProxyFilter(const String& host);

// WebSocket's socket reserver
Expand All @@ -199,6 +200,9 @@ WTF_MAKE_FAST_ALLOCATED;
// HTTP/2 server push
int serverPushCallback(CURL *parent, CURL *easy, size_t num_headers, struct curl_pushheaders *headers);

// filtering
static bool filter_callback(CURL *easy, const struct sockaddr_in *addr);

private:
ResourceHandleManager();
~ResourceHandleManager();
Expand Down
5 changes: 4 additions & 1 deletion WKC/WebCore/platform/network/WKC/SocketStreamHandleWKC.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright (C) 2009 Brent Fulgham. All rights reserved.
* Copyright (C) 2009 Google Inc. All rights reserved.
* Copyright (c) 2012-2017 ACCESS CO., LTD. All rights reserved.
* Copyright (c) 2012-2018 ACCESS CO., LTD. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
Expand Down Expand Up @@ -273,6 +273,9 @@ void SocketStreamHandle::construct(void)
curl_easy_setopt(handle, CURLOPT_OPENSOCKETFUNCTION, opensocketcallback);
curl_easy_setopt(handle, CURLOPT_OPENSOCKETDATA , (void*)this);

// filtering
curl_easy_setopt(handle, CURLOPT_CONNECT_FILTERING_FUNCTION, ResourceHandleManager::filter_callback);

// add handle
curl_multi_add_handle(multiHandle, handle);

Expand Down
4 changes: 2 additions & 2 deletions WKC/WebKit/WKC/WebCoreSupport/FrameLoaderClientWKC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1001,9 +1001,9 @@ FrameLoaderClientWKC::didDisplayInsecureContent()
}

void
FrameLoaderClientWKC::didRunInsecureContent(WebCore::SecurityOrigin* origin, const WebCore::URL& uri)
FrameLoaderClientWKC::didRunInsecureContent(WebCore::SecurityOrigin& origin, const WebCore::URL& uri)
{
SecurityOriginPrivate o(origin);
SecurityOriginPrivate o(&origin);
m_appClient->didRunInsecureContent(&o.wkc(), uri);
}

Expand Down
2 changes: 1 addition & 1 deletion WKC/WebKit/WKC/WebCoreSupport/FrameLoaderClientWKC.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class FrameLoaderClientWKC : public WebCore::FrameLoaderClient {
// The indicated security origin has run active content (such as a
// script) from an insecure source. Note that the insecure content can
// spread to other frames in the same origin.
virtual void didRunInsecureContent(WebCore::SecurityOrigin*, const WebCore::URL&) override;
virtual void didRunInsecureContent(WebCore::SecurityOrigin&, const WebCore::URL&) override;
virtual void didDetectXSS(const WebCore::URL&, bool didBlockEntirePage) override;

virtual WebCore::ResourceError cancelledError(const WebCore::ResourceRequest&) override;
Expand Down
1 change: 1 addition & 0 deletions WKC/WebKit/WKC/helpers/FrameLoaderClientIf.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#define WKCFrameLoaderClient_h

#include <wkc/wkcbase.h>
#include "WKCEnums.h"
#include "WKCHelpersEnums.h"

#ifdef WKC_ENABLE_CUSTOMJS
Expand Down
4 changes: 3 additions & 1 deletion WKC/WebKit/WKC/helpers/WKCAtomicString.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011-2016 ACCESS CO., LTD. All rights reserved.
* Copyright (c) 2011-2018 ACCESS CO., LTD. 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
Expand All @@ -20,6 +20,8 @@
#ifndef _WKC_HELPERS_WKC_ATOMICSTRING_H_
#define _WKC_HELPERS_WKC_ATOMICSTRING_H_

#include <WKC/wkcconfig.h>

namespace WKC {
class String;
class AtomicString;
Expand Down
4 changes: 3 additions & 1 deletion WKC/WebKit/WKC/helpers/WKCFileChooser.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
* Copyright (c) 2010-2015 ACCESS CO., LTD. All rights reserved.
* Copyright (c) 2010-2018 ACCESS CO., LTD. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -30,6 +30,8 @@

#ifndef _WKC_HELPER_WKC_FILECHOOSER_H_
#define _WKC_HELPER_WKC_FILECHOOSER_H_

#include <WKC/wkcconfig.h>

namespace WKC {
class String;
Expand Down
6 changes: 3 additions & 3 deletions WKC/WebKit/WKC/helpers/privates/WKCFrameSelection.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011-2017 ACCESS CO., LTD. All rights reserved.
* Copyright (c) 2011-2018 ACCESS CO., LTD. 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
Expand Down Expand Up @@ -39,8 +39,8 @@ FrameSelectionPrivate::~FrameSelectionPrivate()
WKCRect
FrameSelectionPrivate::absoluteCaretBounds()
{
WebCore::IntRect r = m_webcore->absoluteCaretBounds();
return (WKCRect)r;
m_webcore->setCaretRectNeedsUpdate();
return (WKCRect)m_webcore->absoluteCaretBounds();
}

bool
Expand Down
1 change: 1 addition & 0 deletions WKC/WebKit/WKC/webkit/WKCMemoryInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
// Note: This file must be synchronized with FastMallocWKC.h

#include <time.h>
#include <WKC/wkcconfig.h>

#ifdef MAX_PATH
#undef MAX_PATH
Expand Down
14 changes: 13 additions & 1 deletion WKC/WebKit/WKC/webkit/WKCPrefs.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* WKCPrefs.cpp
*
* Copyright (c) 2011-2017 ACCESS CO., LTD. All rights reserved.
* Copyright (c) 2011-2018 ACCESS CO., LTD. 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
Expand Down Expand Up @@ -534,6 +534,18 @@ activateWebGL()
#endif
}

void
setProhibitsScrollingEnabled(bool enabled)
{
WebCore::Element::setProhibitsScrollingEnabled(enabled);
}

void
setUseDollarVM(bool enabled)
{
JSC::Options::useDollarVM() = enabled;
}

void
forceTerminate()
{
Expand Down
5 changes: 4 additions & 1 deletion WKC/WebKit/WKC/webkit/WKCPrefs.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* WKCPrefs.h
*
* Copyright (c) 2011-2017 ACCESS CO., LTD. All rights reserved.
* Copyright (c) 2011-2018 ACCESS CO., LTD. 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
Expand Down Expand Up @@ -599,6 +599,9 @@ namespace WKCPrefs {
*/
WKC_API void activateWebGL();

WKC_API void setProhibitsScrollingEnabled(bool enabled);

WKC_API void setUseDollarVM(bool enabled);
/*@}*/

} // namespace
Expand Down
2 changes: 1 addition & 1 deletion WKC/WebKit/WKC/webkit/WKCVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#define WKC_VERSION_CHECK(major, minor, micro) \
(((major)*10000) + ((minor)*100) + (micro)) >= ((WKC_VERSION_MAJOR*10000) + (WKC_VERSION_MINOR*100) + (WKC_VERSION_MICRO))

#define WKC_CUSTOMER_RELEASE_VERSION "0.10.14"
#define WKC_CUSTOMER_RELEASE_VERSION "0.11.6"

#define WKC_WEBKIT_VERSION "601.6"

Expand Down
19 changes: 14 additions & 5 deletions WKC/WebKit/WKC/webkit/WKCWebFrame.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* WKCWebFrame.cpp
*
* Copyright (c) 2010-2017 ACCESS CO., LTD. All rights reserved.
* Copyright (c) 2010-2018 ACCESS CO., LTD. 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
Expand Down Expand Up @@ -513,30 +513,39 @@ WKCWebFrame::parent()
return kit(coreFrame->tree().parent());
}

void
bool
WKCWebFrame::loadURI(const char* uri, const char* referrer)
{
WebCore::Frame* coreFrame = m_private->core();
if (!coreFrame) {
return;
return false;
}

auto utf8Uri(WTF::String::fromUTF8(uri));
if (!utf8Uri) {
return false;
}

if (referrer) {
WTF::String refStr = WTF::String::fromUTF8(referrer);
if (!refStr) {
return false;
}
WebCore::URL refUrl = WebCore::URL(WebCore::URL(), refStr);
if (refUrl.isValid()) {
// Use normalized referrer URL if it is valid
refStr = refUrl.string();
}
WebCore::FrameLoadRequest req(coreFrame, WebCore::ResourceRequest(WebCore::URL(WebCore::URL(), WTF::String::fromUTF8(uri)), refStr), WebCore::ShouldOpenExternalURLsPolicy::ShouldNotAllow);
WebCore::FrameLoadRequest req(coreFrame, WebCore::ResourceRequest(WebCore::URL(WebCore::URL(), utf8Uri), refStr), WebCore::ShouldOpenExternalURLsPolicy::ShouldNotAllow);
coreFrame->loader().load(req);
} else {
WebCore::ResourceRequest rr(WebCore::URL(WebCore::URL(), WTF::String::fromUTF8(uri)));
WebCore::ResourceRequest rr(WebCore::URL(WebCore::URL(), utf8Uri));
rr.setMainResource();
rr.setTargetType(WebCore::ResourceRequest::TargetIsMainFrame);
const WebCore::FrameLoadRequest req(coreFrame, rr, WebCore::ShouldOpenExternalURLsPolicy::ShouldNotAllow);
coreFrame->loader().load(req);
}
return true;
}

#ifdef __MINGW32__
Expand Down
7 changes: 4 additions & 3 deletions WKC/WebKit/WKC/webkit/WKCWebFrame.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* WKCWebFrame.h
*
* Copyright (c) 2010-2017 ACCESS CO., LTD. All rights reserved.
* Copyright (c) 2010-2018 ACCESS CO., LTD. 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
Expand Down Expand Up @@ -139,9 +139,10 @@ class WKC_API WKCWebFrame
@brief Starts loading page
@param uri Pointer to URI string
@param referrer Referer
@return None
@retval "!= false" Succeeded
@retval "== false" Failed
*/
void loadURI(const char* uri, const char* referrer = 0);
bool loadURI(const char* uri, const char* referrer = 0);
/**
@brief Displays content string
@param content Pointer to content string
Expand Down
Loading

0 comments on commit 91fadbe

Please sign in to comment.