Created
February 16, 2023 12:43
-
-
Save bobby285271/f3bef0aa414aa29cdecf86784fb934f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/NEWS b/NEWS | |
index b5c9a705b9e5afd39842b6243aad4c6f17a04b8c..e5ac79bf531c289b127c95b94a7575be7faee86e 100644 | |
--- a/NEWS | |
+++ b/NEWS | |
@@ -1,3 +1,15 @@ | |
+================ | |
+WebKitGTK 2.38.5 | |
+================ | |
+ | |
+What's new in WebKitGTK 2.38.5? | |
+ | |
+ - Fix large memory allocation when uploading content. | |
+ - Fix scrolling after a history navigation with PSON enabled. | |
+ - Always update the active uri of WebKitFrame. | |
+ - Fix the build on Ubuntu 20.04. | |
+ - Fix several crashes and rendering issues. | |
+ | |
================ | |
WebKitGTK 2.38.4 | |
================ | |
diff --git a/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h b/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h | |
index a10ac094af138632caf3a5dfa40387ba1ac2631e..81e32b8a5a06d431cae3d304a1d4f4b2a48c00b0 100644 | |
--- a/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h | |
+++ b/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h | |
@@ -209,7 +209,8 @@ inline ToThisResult isToThisAnIdentity(ECMAMode ecmaMode, AbstractValue& valueFo | |
} | |
} | |
- if ((ecmaMode.isStrict() || (valueForNode.m_type && !(valueForNode.m_type & ~SpecObject))) && valueForNode.m_structure.isFinite()) { | |
+ bool onlyObjects = valueForNode.m_type && !(valueForNode.m_type & ~SpecObject); | |
+ if ((ecmaMode.isStrict() || onlyObjects) && valueForNode.m_structure.isFinite()) { | |
bool allStructuresAreJSScope = !valueForNode.m_structure.isClear(); | |
bool overridesToThis = false; | |
valueForNode.m_structure.forEach([&](RegisteredStructure structure) { | |
@@ -226,9 +227,13 @@ inline ToThisResult isToThisAnIdentity(ECMAMode ecmaMode, AbstractValue& valueFo | |
// If all the structures are JSScope's ones, we know the details of JSScope::toThis() operation. | |
allStructuresAreJSScope &= structure->classInfoForCells()->methodTable.toThis == JSScope::info()->methodTable.toThis; | |
}); | |
+ | |
+ // This is correct for strict mode even if this can have non objects, since the right semantics is Identity. | |
if (!overridesToThis) | |
return ToThisResult::Identity; | |
- if (allStructuresAreJSScope) { | |
+ | |
+ // But this folding is available only if input is always an object. | |
+ if (onlyObjects && allStructuresAreJSScope) { | |
if (ecmaMode.isStrict()) | |
return ToThisResult::Undefined; | |
return ToThisResult::GlobalThis; | |
diff --git a/Source/WebCore/Modules/fetch/FetchHeaders.cpp b/Source/WebCore/Modules/fetch/FetchHeaders.cpp | |
index ead6595870619c8f7f24c843853bf9f58bc0c602..339e3a872a43c1a1892b5ac7788d3101b25017e2 100644 | |
--- a/Source/WebCore/Modules/fetch/FetchHeaders.cpp | |
+++ b/Source/WebCore/Modules/fetch/FetchHeaders.cpp | |
@@ -50,7 +50,7 @@ static ExceptionOr<bool> canWriteHeader(const String& name, const String& value, | |
return Exception { TypeError, "Headers object's guard is 'immutable'"_s }; | |
if (guard == FetchHeaders::Guard::Request && isForbiddenHeaderName(name)) | |
return false; | |
- if (guard == FetchHeaders::Guard::RequestNoCors && !combinedValue.isEmpty() && !isSimpleHeader(name, combinedValue)) | |
+ if (guard == FetchHeaders::Guard::RequestNoCors && !isSimpleHeader(name, combinedValue)) | |
return false; | |
if (guard == FetchHeaders::Guard::Response && isForbiddenResponseHeaderName(name)) | |
return false; | |
diff --git a/Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp b/Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp | |
index 7e30b785764cfb9cb29cfb392fac10b3e33b495c..94a713296f5805a7a98a5bfdc93bbbfcd2e6f474 100644 | |
--- a/Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp | |
+++ b/Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp | |
@@ -614,6 +614,7 @@ GRefPtr<GstPad> GStreamerMediaEndpoint::requestPad(unsigned mlineIndex, const GR | |
sinkPad = adoptGRef(gst_element_request_pad(m_webrtcBin.get(), padTemplate, padId.utf8().data(), caps.get())); | |
} | |
+ GST_DEBUG_OBJECT(m_pipeline.get(), "Setting msid to %s on sink pad", mediaStreamID.ascii().data()); | |
if (g_object_class_find_property(G_OBJECT_GET_CLASS(sinkPad.get()), "msid")) | |
g_object_set(sinkPad.get(), "msid", mediaStreamID.ascii().data(), nullptr); | |
@@ -777,19 +778,28 @@ void GStreamerMediaEndpoint::addRemoteStream(GstPad* pad) | |
// Look-up the mediastream ID, using the msid attribute, fall back to pad name if there is no msid. | |
const auto* media = gst_sdp_message_get_media(description->sdp, mLineIndex); | |
- GUniquePtr<gchar> name(gst_pad_get_name(pad)); | |
- auto mediaStreamId = String::fromLatin1(name.get()); | |
+ String mediaStreamId; | |
if (g_object_class_find_property(G_OBJECT_GET_CLASS(pad), "msid")) { | |
GUniqueOutPtr<char> msid; | |
g_object_get(pad, "msid", &msid.outPtr(), nullptr); | |
if (msid) | |
mediaStreamId = String::fromLatin1(msid.get()); | |
- } else if (const char* msidAttribute = gst_sdp_media_get_attribute_val(media, "msid")) { | |
- auto components = makeString(msidAttribute).split(' '); | |
- if (components.size() == 2) | |
- mediaStreamId = components[0]; | |
} | |
+ | |
+ if (!mediaStreamId) { | |
+ if (const char* msidAttribute = gst_sdp_media_get_attribute_val(media, "msid")) { | |
+ auto components = makeString(msidAttribute).split(' '); | |
+ if (components.size() == 2) | |
+ mediaStreamId = components[0]; | |
+ } | |
+ } | |
+ | |
+ if (!mediaStreamId) { | |
+ GUniquePtr<gchar> name(gst_pad_get_name(pad)); | |
+ mediaStreamId = String::fromLatin1(name.get()); | |
+ } | |
+ | |
GST_DEBUG_OBJECT(m_pipeline.get(), "msid: %s", mediaStreamId.ascii().data()); | |
GstElement* bin = nullptr; | |
diff --git a/Source/WebCore/css/calc/CSSCalcOperationNode.cpp b/Source/WebCore/css/calc/CSSCalcOperationNode.cpp | |
index 5a47347a15062e673c4fa1ca2d6d459c483d93d5..f8b41e1f5d66b54763b2ec585377b5ad1b34067b 100644 | |
--- a/Source/WebCore/css/calc/CSSCalcOperationNode.cpp | |
+++ b/Source/WebCore/css/calc/CSSCalcOperationNode.cpp | |
@@ -438,7 +438,7 @@ RefPtr<CSSCalcOperationNode> CSSCalcOperationNode::createHypot(Vector<Ref<CSSCal | |
{ | |
auto expectedCategory = commonCategory(values); | |
- if (expectedCategory == CalculationCategory::Other) { | |
+ if (!expectedCategory || expectedCategory == CalculationCategory::Other) { | |
LOG_WITH_STREAM(Calc, stream << "Failed to create hypot node because unable to determine category from " << prettyPrintNodes(values)); | |
return nullptr; | |
} | |
diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp | |
index debc5298910959cf45dba57cdb967bfe3156b85c..3dec81a456984d4602d071cba72e3b2ad8876a3a 100644 | |
--- a/Source/WebCore/dom/Document.cpp | |
+++ b/Source/WebCore/dom/Document.cpp | |
@@ -6728,7 +6728,7 @@ void Document::postTask(Task&& task) | |
callOnMainThread([documentID = identifier(), task = WTFMove(task)]() mutable { | |
ASSERT(isMainThread()); | |
- auto* document = allDocumentsMap().get(documentID); | |
+ RefPtr document = allDocumentsMap().get(documentID); | |
if (!document) | |
return; | |
@@ -6742,7 +6742,8 @@ void Document::postTask(Task&& task) | |
void Document::pendingTasksTimerFired() | |
{ | |
- Vector<Task> pendingTasks = WTFMove(m_pendingTasks); | |
+ Ref protectedThis { *this }; | |
+ auto pendingTasks = std::exchange(m_pendingTasks, Vector<Task> { }); | |
for (auto& task : pendingTasks) | |
task.performTask(*this); | |
} | |
diff --git a/Source/WebCore/html/HTMLInputElement.cpp b/Source/WebCore/html/HTMLInputElement.cpp | |
index 364b6e1b53f3815681833b00db8867bc957f1171..219e932ad86dd2ade8e2594df84ea772bad3d820 100644 | |
--- a/Source/WebCore/html/HTMLInputElement.cpp | |
+++ b/Source/WebCore/html/HTMLInputElement.cpp | |
@@ -44,6 +44,7 @@ | |
#include "Editor.h" | |
#include "ElementInlines.h" | |
#include "EventNames.h" | |
+#include "EventLoop.h" | |
#include "FileChooser.h" | |
#include "FileInputType.h" | |
#include "FileList.h" | |
diff --git a/Source/WebCore/html/HTMLSourceElement.cpp b/Source/WebCore/html/HTMLSourceElement.cpp | |
index 9eb68fa4a06423ae0ca4e8d9f1786a790ccca2fa..298158935891ed6a57e28629e1d0886bb6b7db08 100644 | |
--- a/Source/WebCore/html/HTMLSourceElement.cpp | |
+++ b/Source/WebCore/html/HTMLSourceElement.cpp | |
@@ -158,7 +158,7 @@ void HTMLSourceElement::parseAttribute(const QualifiedName& name, const AtomStri | |
if (name == mediaAttr) | |
m_cachedParsedMediaAttribute = std::nullopt; | |
RefPtr parent = parentNode(); | |
- if (m_shouldCallSourcesChanged) | |
+ if (m_shouldCallSourcesChanged && parent) | |
downcast<HTMLPictureElement>(*parent).sourcesChanged(); | |
} | |
#if ENABLE(MODEL_ELEMENT) | |
diff --git a/Source/WebCore/loader/ContentFilter.cpp b/Source/WebCore/loader/ContentFilter.cpp | |
index c4efa6e9987f0cd9dae6ddbcfbbf233685ad926f..f71d80225ef0964ad17237ec79f8c5c698c8eb91 100644 | |
--- a/Source/WebCore/loader/ContentFilter.cpp | |
+++ b/Source/WebCore/loader/ContentFilter.cpp | |
@@ -317,7 +317,7 @@ URL ContentFilter::url() | |
#endif | |
} | |
-static const URL& blockedPageURL() | |
+const URL& ContentFilter::blockedPageURL() | |
{ | |
static NeverDestroyed blockedPageURL = [] () -> URL { | |
auto webCoreBundle = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.WebCore")); | |
diff --git a/Source/WebCore/loader/ContentFilter.h b/Source/WebCore/loader/ContentFilter.h | |
index 17c443f7798d0413382b1f6d2b29cef9d9e14212..1f1383ecd0c225ebac88266f0bf6d6e9f35aa72c 100644 | |
--- a/Source/WebCore/loader/ContentFilter.h | |
+++ b/Source/WebCore/loader/ContentFilter.h | |
@@ -78,7 +78,9 @@ public: | |
void setBlockedError(const ResourceError& error) { m_blockedError = error; } | |
bool isAllowed() const { return m_state == State::Allowed; } | |
bool responseReceived() const { return m_responseReceived; } | |
- | |
+ | |
+ WEBCORE_EXPORT static const URL& blockedPageURL(); | |
+ | |
private: | |
using State = PlatformContentFilter::State; | |
diff --git a/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp b/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp | |
index 8c690511e564145919a499ff5e94f31c6debdb39..1a55a8c75f9da35ec9c1ae4dfcb6573d1ace6449 100644 | |
--- a/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp | |
+++ b/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp | |
@@ -856,9 +856,11 @@ void fillVideoInfoColorimetryFromColorSpace(GstVideoInfo* info, const PlatformVi | |
case PlatformVideoTransferCharacteristics::Bt709: | |
GST_VIDEO_INFO_COLORIMETRY(info).transfer = GST_VIDEO_TRANSFER_BT709; | |
break; | |
+#if GST_CHECK_VERSION(1, 18, 0) | |
case PlatformVideoTransferCharacteristics::Smpte170m: | |
GST_VIDEO_INFO_COLORIMETRY(info).transfer = GST_VIDEO_TRANSFER_BT601; | |
break; | |
+#endif | |
default: | |
break; | |
} | |
diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp | |
index 0fe63c6766701b8f493bbbf58dfdbba9a62a4d5e..682e1f7b9ff5d3f2d525e86c22ed0a8aa0495428 100644 | |
--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp | |
+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp | |
@@ -2169,6 +2169,9 @@ void MediaPlayerPrivateGStreamer::configureElement(GstElement* element) | |
auto elementClass = makeString(gst_element_get_metadata(element, GST_ELEMENT_METADATA_KLASS)); | |
auto classifiers = elementClass.split('/'); | |
+ if (g_str_has_prefix(elementName.get(), "urisourcebin") && isMediaSource()) | |
+ g_object_set(element, "use-buffering", FALSE, nullptr); | |
+ | |
// Collect processing time metrics for video decoders and converters. | |
if ((classifiers.contains("Converter"_s) || classifiers.contains("Decoder"_s)) && classifiers.contains("Video"_s) && !classifiers.contains("Parser"_s)) | |
webkitGstTraceProcessingTimeForElement(element); | |
diff --git a/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp b/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp | |
index 69f070a58fe42953fa93f434a5e605d1359554c8..69999fb2ed9e051b76fcbb7599a2005cb1869d99 100644 | |
--- a/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp | |
+++ b/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp | |
@@ -145,6 +145,8 @@ AppendPipeline::AppendPipeline(SourceBufferPrivateGStreamer& sourceBufferPrivate | |
if (type.endsWith("mp4"_s) || type.endsWith("aac"_s)) { | |
m_demux = makeGStreamerElement("qtdemux", nullptr); | |
m_typefind = makeGStreamerElement("identity", nullptr); | |
+ GRefPtr<GstCaps> caps = adoptGRef(gst_caps_new_simple("video/quicktime", "variant", G_TYPE_STRING, "mse-bytestream", NULL)); | |
+ gst_app_src_set_caps(GST_APP_SRC(m_appsrc.get()), caps.get()); | |
} else if (type.endsWith("webm"_s)) { | |
m_demux = makeGStreamerElement("matroskademux", nullptr); | |
m_typefind = makeGStreamerElement("identity", nullptr); | |
@@ -416,8 +418,10 @@ void AppendPipeline::appsinkNewSample(const Track& track, GRefPtr<GstSample>&& s | |
// | |
// Because a track presentation time starting at some close to zero, but not exactly zero time can cause unexpected | |
// results for applications, we extend the duration of this first sample to the left so that it starts at zero. | |
- if (mediaSample->decodeTime() == MediaTime::zeroTime() && mediaSample->presentationTime() > MediaTime::zeroTime() && mediaSample->presentationTime() <= MediaTime(1, 10)) { | |
- GST_DEBUG("Extending first sample to make it start at PTS=0"); | |
+ if (mediaSample->decodeTime() == MediaTime::zeroTime() && mediaSample->presentationTime() > MediaTime::zeroTime() | |
+ && mediaSample->presentationTime() <= MediaTime(1, 10) | |
+ && mediaSample->isSync()) { | |
+ GST_DEBUG_OBJECT(pipeline(), "Extending first sample to make it start at PTS=0"); | |
mediaSample->extendToTheBeginning(); | |
} | |
diff --git a/Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp | |
index 16a926a72d3b3e8ad058c47bfc1b24bc6ce16206..f016c6a2a6d97c5bd85abfa7aecb7c36ed57ba24 100644 | |
--- a/Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp | |
+++ b/Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp | |
@@ -237,6 +237,21 @@ static const char* streamTypeToString(TrackPrivateBaseGStreamer::TrackType type) | |
} | |
#endif // GST_DISABLE_GST_DEBUG | |
+static gboolean webKitMediaSrcQuery(GstElement* element, GstQuery* query) | |
+{ | |
+ gboolean result = GST_ELEMENT_CLASS(parent_class)->query(element, query); | |
+ | |
+ if (GST_QUERY_TYPE(query) != GST_QUERY_SCHEDULING) | |
+ return result; | |
+ | |
+ GstSchedulingFlags flags; | |
+ int minSize, maxSize, align; | |
+ | |
+ gst_query_parse_scheduling(query, &flags, &minSize, &maxSize, &align); | |
+ gst_query_set_scheduling(query, static_cast<GstSchedulingFlags>(flags | GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED), minSize, maxSize, align); | |
+ return TRUE; | |
+} | |
+ | |
static void webkit_media_src_class_init(WebKitMediaSrcClass* klass) | |
{ | |
GObjectClass* oklass = G_OBJECT_CLASS(klass); | |
@@ -249,8 +264,10 @@ static void webkit_media_src_class_init(WebKitMediaSrcClass* klass) | |
gst_element_class_set_static_metadata(eklass, "WebKit MediaSource source element", "Source/Network", "Feeds samples coming from WebKit MediaSource object", "Igalia <[email protected]>"); | |
- eklass->change_state = webKitMediaSrcChangeState; | |
- eklass->send_event = webKitMediaSrcSendEvent; | |
+ eklass->change_state = GST_DEBUG_FUNCPTR(webKitMediaSrcChangeState); | |
+ eklass->send_event = GST_DEBUG_FUNCPTR(webKitMediaSrcSendEvent); | |
+ eklass->query = GST_DEBUG_FUNCPTR(webKitMediaSrcQuery); | |
+ | |
g_object_class_install_property(oklass, | |
PROP_N_AUDIO, | |
g_param_spec_int("n-audio", "Number Audio", "Total number of audio streams", | |
diff --git a/Source/WebCore/platform/graphics/holepunch/MediaPlayerPrivateHolePunch.cpp b/Source/WebCore/platform/graphics/holepunch/MediaPlayerPrivateHolePunch.cpp | |
index 0a5529b9c54a3cfa9e09c5089a1c59615c6cbb7c..ddf048b22a92f928557cd5fb01f1e59c75577653 100644 | |
--- a/Source/WebCore/platform/graphics/holepunch/MediaPlayerPrivateHolePunch.cpp | |
+++ b/Source/WebCore/platform/graphics/holepunch/MediaPlayerPrivateHolePunch.cpp | |
@@ -110,12 +110,12 @@ static HashSet<String, ASCIICaseInsensitiveHash>& mimeTypeCache() | |
if (typeListInitialized) | |
return cache; | |
- const char* mimeTypes[] = { | |
- "video/holepunch" | |
+ const ASCIILiteral mimeTypes[] = { | |
+ "video/holepunch"_s | |
}; | |
for (unsigned i = 0; i < (sizeof(mimeTypes) / sizeof(*mimeTypes)); ++i) | |
- cache.get().add(String(mimeTypes[i])); | |
+ cache.get().add(mimeTypes[i]); | |
typeListInitialized = true; | |
diff --git a/Source/WebCore/platform/graphics/nicosia/NicosiaPaintingEngine.cpp b/Source/WebCore/platform/graphics/nicosia/NicosiaPaintingEngine.cpp | |
index 97e6b9c951b9f94156a73adf28e6a798c3b58561..6dfe59d717809f2e361dfcaa5bd7717310eab9c4 100644 | |
--- a/Source/WebCore/platform/graphics/nicosia/NicosiaPaintingEngine.cpp | |
+++ b/Source/WebCore/platform/graphics/nicosia/NicosiaPaintingEngine.cpp | |
@@ -37,7 +37,11 @@ namespace Nicosia { | |
std::unique_ptr<PaintingEngine> PaintingEngine::create() | |
{ | |
#if (ENABLE(DEVELOPER_MODE) && PLATFORM(WPE)) || USE(GTK4) | |
+#if USE(GTK4) | |
+ unsigned numThreads = 1; | |
+#else | |
unsigned numThreads = 0; | |
+#endif | |
if (const char* numThreadsEnv = getenv("WEBKIT_NICOSIA_PAINTING_THREADS")) { | |
if (sscanf(numThreadsEnv, "%u", &numThreads) == 1) { | |
if (numThreads > 8) { | |
diff --git a/Source/WebCore/platform/network/NetworkStorageSession.cpp b/Source/WebCore/platform/network/NetworkStorageSession.cpp | |
index 5baa7ba1105b6981f8bafb9c12312802520b1af5..ebae04f167f148f383a3ff9c8d0c5928c9c1dd1e 100644 | |
--- a/Source/WebCore/platform/network/NetworkStorageSession.cpp | |
+++ b/Source/WebCore/platform/network/NetworkStorageSession.cpp | |
@@ -372,8 +372,11 @@ void NetworkStorageSession::resetAppBoundDomains() | |
std::optional<Seconds> NetworkStorageSession::clientSideCookieCap(const RegistrableDomain& firstParty, std::optional<PageIdentifier> pageID) const | |
{ | |
- auto domainIterator = m_navigatedToWithLinkDecorationByPrevalentResource.find(*pageID); | |
#if ENABLE(JS_COOKIE_CHECKING) | |
+ if (!pageID) | |
+ return std::nullopt; | |
+ | |
+ auto domainIterator = m_navigatedToWithLinkDecorationByPrevalentResource.find(*pageID); | |
if (domainIterator != m_navigatedToWithLinkDecorationByPrevalentResource.end() && domainIterator->value == firstParty) | |
return m_ageCapForClientSideCookiesForLinkDecorationTargetPage; | |
@@ -382,6 +385,7 @@ std::optional<Seconds> NetworkStorageSession::clientSideCookieCap(const Registra | |
if (!m_ageCapForClientSideCookies || !pageID || m_navigatedToWithLinkDecorationByPrevalentResource.isEmpty()) | |
return m_ageCapForClientSideCookies; | |
+ auto domainIterator = m_navigatedToWithLinkDecorationByPrevalentResource.find(*pageID); | |
if (domainIterator == m_navigatedToWithLinkDecorationByPrevalentResource.end()) | |
return m_ageCapForClientSideCookies; | |
diff --git a/Source/WebCore/platform/network/soup/ResourceRequest.h b/Source/WebCore/platform/network/soup/ResourceRequest.h | |
index d37eb9e883e48e2a27e5ac5b15f1a74567d1b932..1f575f2e41570d2e4c0c2bc45265e970cbf1ca95 100644 | |
--- a/Source/WebCore/platform/network/soup/ResourceRequest.h | |
+++ b/Source/WebCore/platform/network/soup/ResourceRequest.h | |
@@ -60,7 +60,7 @@ public: | |
GRefPtr<SoupMessage> createSoupMessage(BlobRegistryImpl&) const; | |
- void updateFromDelegatePreservingOldProperties(const ResourceRequest& delegateProvidedRequest) { *this = delegateProvidedRequest; } | |
+ void updateFromDelegatePreservingOldProperties(const ResourceRequest& delegateProvidedRequest); | |
bool acceptEncoding() const { return m_acceptEncoding; } | |
void setAcceptEncoding(bool acceptEncoding) { m_acceptEncoding = acceptEncoding; } | |
@@ -99,14 +99,6 @@ template<class Encoder> | |
void ResourceRequest::encodeWithPlatformData(Encoder& encoder) const | |
{ | |
encodeBase(encoder); | |
- | |
- // FIXME: Do not encode HTTP message body. | |
- // 1. It can be large and thus costly to send across. | |
- // 2. It is misleading to provide a body with some requests, while others use body streams, which cannot be serialized at all. | |
- encoder << static_cast<bool>(m_httpBody); | |
- if (m_httpBody) | |
- encoder << m_httpBody->flattenToString(); | |
- | |
encoder << static_cast<bool>(m_acceptEncoding); | |
encoder << m_redirectCount; | |
} | |
@@ -117,16 +109,6 @@ bool ResourceRequest::decodeWithPlatformData(Decoder& decoder) | |
if (!decodeBase(decoder)) | |
return false; | |
- bool hasHTTPBody; | |
- if (!decoder.decode(hasHTTPBody)) | |
- return false; | |
- if (hasHTTPBody) { | |
- String httpBody; | |
- if (!decoder.decode(httpBody)) | |
- return false; | |
- setHTTPBody(FormData::create(httpBody.utf8())); | |
- } | |
- | |
bool acceptEncoding; | |
if (!decoder.decode(acceptEncoding)) | |
return false; | |
diff --git a/Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp b/Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp | |
index d545c9ca26508c30e0a2a37696231c472cf434fb..deb1a79763d0ad3595cadd5bfc10df3391972d07 100644 | |
--- a/Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp | |
+++ b/Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp | |
@@ -203,6 +203,27 @@ GRefPtr<GUri> ResourceRequest::createSoupURI() const | |
} | |
#endif | |
+void ResourceRequest::updateFromDelegatePreservingOldProperties(const ResourceRequest& delegateProvidedRequest) | |
+{ | |
+ // These are things we don't want willSendRequest delegate to mutate or reset. | |
+ ResourceLoadPriority oldPriority = priority(); | |
+ RefPtr<FormData> oldHTTPBody = httpBody(); | |
+ bool isHiddenFromInspector = hiddenFromInspector(); | |
+ auto oldRequester = requester(); | |
+ auto oldInitiatorIdentifier = initiatorIdentifier(); | |
+ auto oldInspectorInitiatorNodeIdentifier = inspectorInitiatorNodeIdentifier(); | |
+ | |
+ *this = delegateProvidedRequest; | |
+ | |
+ setPriority(oldPriority); | |
+ setHTTPBody(WTFMove(oldHTTPBody)); | |
+ setHiddenFromInspector(isHiddenFromInspector); | |
+ setRequester(oldRequester); | |
+ setInitiatorIdentifier(oldInitiatorIdentifier); | |
+ if (oldInspectorInitiatorNodeIdentifier) | |
+ setInspectorInitiatorNodeIdentifier(*oldInspectorInitiatorNodeIdentifier); | |
+} | |
+ | |
} // namespace WebCore | |
#endif // USE(SOUP) | |
diff --git a/Source/WebCore/platform/sql/SQLiteTransaction.h b/Source/WebCore/platform/sql/SQLiteTransaction.h | |
index b9d1f7940ccb62abf43f975f316e781a26872b73..b7b701cd955578cec60958466a9b0a1ea98b0595 100644 | |
--- a/Source/WebCore/platform/sql/SQLiteTransaction.h | |
+++ b/Source/WebCore/platform/sql/SQLiteTransaction.h | |
@@ -45,7 +45,7 @@ public: | |
void stop(); | |
bool inProgress() const { return m_inProgress; } | |
- bool wasRolledBackBySqlite() const; | |
+ WEBCORE_EXPORT bool wasRolledBackBySqlite() const; | |
SQLiteDatabase& database() const { return m_db; } | |
diff --git a/Source/WebCore/rendering/RenderLayer.cpp b/Source/WebCore/rendering/RenderLayer.cpp | |
index 0c329d8cff99dcf245e92275d88ea3cf948e03aa..32ce8680b9192236ff76c55f8486ba5be06832c0 100644 | |
--- a/Source/WebCore/rendering/RenderLayer.cpp | |
+++ b/Source/WebCore/rendering/RenderLayer.cpp | |
@@ -3262,7 +3262,7 @@ void RenderLayer::paintLayerContents(GraphicsContext& context, const LayerPainti | |
// Now walk the sorted list of children with negative z-indices. | |
if ((isPaintingScrollingContent && isPaintingOverflowContents) || (!isPaintingScrollingContent && isPaintingCompositedBackground)) | |
- paintList(negativeZOrderLayers(), currentContext, localPaintingInfo, localPaintFlags); | |
+ paintList(negativeZOrderLayers(), currentContext, paintingInfo, localPaintFlags); | |
if (isPaintingCompositedForeground) { | |
if (shouldPaintContent) { | |
@@ -3279,7 +3279,7 @@ void RenderLayer::paintLayerContents(GraphicsContext& context, const LayerPainti | |
if (isPaintingCompositedForeground) { | |
// Paint any child layers that have overflow. | |
- paintList(normalFlowLayers(), currentContext, localPaintingInfo, localPaintFlags); | |
+ paintList(normalFlowLayers(), currentContext, paintingInfo, localPaintFlags); | |
// Now walk the sorted list of children with positive z-indices. | |
paintList(positiveZOrderLayers(), currentContext, localPaintingInfo, localPaintFlags); | |
diff --git a/Source/WebKit/NetworkProcess/NetworkLoad.cpp b/Source/WebKit/NetworkProcess/NetworkLoad.cpp | |
index 36f804d0eadc5dc58255aed98884a86de92f06f4..0ca996aea6859d30a26599f0d8ec23cab45b48cc 100644 | |
--- a/Source/WebKit/NetworkProcess/NetworkLoad.cpp | |
+++ b/Source/WebKit/NetworkProcess/NetworkLoad.cpp | |
@@ -100,7 +100,6 @@ static inline void updateRequest(ResourceRequest& currentRequest, const Resource | |
#if PLATFORM(COCOA) | |
currentRequest.updateFromDelegatePreservingOldProperties(newRequest.nsURLRequest(HTTPBodyUpdatePolicy::DoNotUpdateHTTPBody)); | |
#else | |
- // FIXME: Implement ResourceRequest::updateFromDelegatePreservingOldProperties. See https://bugs.webkit.org/show_bug.cgi?id=126127. | |
currentRequest.updateFromDelegatePreservingOldProperties(newRequest); | |
#endif | |
} | |
diff --git a/Source/WebKit/NetworkProcess/NetworkProcess.cpp b/Source/WebKit/NetworkProcess/NetworkProcess.cpp | |
index bc18a61c8186016f11a039389106b86eca343fbb..52c701dccc68aed894a9a76196908ed62e21f6b2 100644 | |
--- a/Source/WebKit/NetworkProcess/NetworkProcess.cpp | |
+++ b/Source/WebKit/NetworkProcess/NetworkProcess.cpp | |
@@ -83,7 +83,7 @@ | |
#include <WebCore/SWServer.h> | |
#include <WebCore/SecurityOrigin.h> | |
#include <WebCore/SecurityOriginData.h> | |
-#include <WebCore/StorageQuotaManager.h> | |
+#include <WebCore/SecurityPolicy.h> | |
#include <WebCore/UserContentURLPattern.h> | |
#include <wtf/Algorithms.h> | |
#include <wtf/CallbackAggregator.h> | |
@@ -2762,14 +2762,19 @@ void NetworkProcess::setCORSDisablingPatterns(PageIdentifier pageIdentifier, Vec | |
parsedPatterns.reserveInitialCapacity(patterns.size()); | |
for (auto&& pattern : WTFMove(patterns)) { | |
UserContentURLPattern parsedPattern(WTFMove(pattern)); | |
- if (parsedPattern.isValid()) | |
+ if (parsedPattern.isValid()) { | |
+ WebCore::SecurityPolicy::allowAccessTo(parsedPattern); | |
parsedPatterns.uncheckedAppend(WTFMove(parsedPattern)); | |
+ } | |
} | |
+ | |
parsedPatterns.shrinkToFit(); | |
+ | |
if (parsedPatterns.isEmpty()) { | |
m_extensionCORSDisablingPatterns.remove(pageIdentifier); | |
return; | |
} | |
+ | |
m_extensionCORSDisablingPatterns.set(pageIdentifier, WTFMove(parsedPatterns)); | |
} | |
diff --git a/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp b/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp | |
index 38cb47777c83ff31d736c13202d460898d71f762..3a0844d4b393a8fee6f4acaa333fedd577ed82c6 100644 | |
--- a/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp | |
+++ b/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp | |
@@ -1887,6 +1887,7 @@ void NetworkResourceLoader::cancelMainResourceLoadForContentFilter(const WebCore | |
void NetworkResourceLoader::handleProvisionalLoadFailureFromContentFilter(const URL& blockedPageURL, WebCore::SubstituteData& substituteData) | |
{ | |
+ m_connection->networkProcess().addAllowedFirstPartyForCookies(m_connection->webProcessIdentifier(), RegistrableDomain { WebCore::ContentFilter::blockedPageURL() }, LoadedWebArchive::No, [] { }); | |
send(Messages::WebResourceLoader::ContentFilterDidBlockLoad(m_unblockHandler, m_unblockRequestDeniedScript, m_contentFilter->blockedError(), blockedPageURL, substituteData)); | |
} | |
#endif // ENABLE(CONTENT_FILTERING_IN_NETWORKING_PROCESS) | |
diff --git a/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp b/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp | |
index fb70fe2e30abc45508eac1ff7b6fa5b576c22917..1d6dd70306c1cfcd2f6070642fa56dad9391f07f 100644 | |
--- a/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp | |
+++ b/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp | |
@@ -947,6 +947,17 @@ void NetworkDataTaskSoup::continueHTTPRedirection() | |
m_networkLoadMetrics.hasCrossOriginRedirect = m_networkLoadMetrics.hasCrossOriginRedirect || !SecurityOrigin::create(m_currentRequest.url())->canRequest(request.url()); | |
+ if (m_response.httpStatusCode() == 307 || m_response.httpStatusCode() == 308) { | |
+ ASSERT(m_lastHTTPMethod == request.httpMethod()); | |
+ auto body = m_firstRequest.httpBody(); | |
+ if (body && !body->isEmpty() && !equalLettersIgnoringASCIICase(m_lastHTTPMethod, "get"_s)) | |
+ request.setHTTPBody(WTFMove(body)); | |
+ | |
+ String originalContentType = m_firstRequest.httpContentType(); | |
+ if (!originalContentType.isEmpty()) | |
+ request.setHTTPHeaderField(WebCore::HTTPHeaderName::ContentType, originalContentType); | |
+ } | |
+ | |
// Clear the user agent to ensure a new one is computed. | |
auto userAgent = request.httpUserAgent(); | |
request.clearHTTPUserAgent(); | |
diff --git a/Source/WebKit/NetworkProcess/storage/SQLiteStorageArea.cpp b/Source/WebKit/NetworkProcess/storage/SQLiteStorageArea.cpp | |
index ed29dc5dd9ed251b830c9a58fc3f37424daaf26f..b8378fd12fa2bf6eb900a4b67639015c13b0cd2b 100644 | |
--- a/Source/WebKit/NetworkProcess/storage/SQLiteStorageArea.cpp | |
+++ b/Source/WebKit/NetworkProcess/storage/SQLiteStorageArea.cpp | |
@@ -189,7 +189,7 @@ void SQLiteStorageArea::startTransactionIfNecessary() | |
{ | |
ASSERT(m_database); | |
- if (!m_transaction) | |
+ if (!m_transaction || m_transaction->wasRolledBackBySqlite()) | |
m_transaction = makeUnique<WebCore::SQLiteTransaction>(*m_database); | |
if (m_transaction->inProgress()) | |
diff --git a/Source/WebKit/Platform/IPC/ArgumentCoders.h b/Source/WebKit/Platform/IPC/ArgumentCoders.h | |
index abef629b6474bba589d97033a903c2bb3b890950..de4f9ce2e245f58d37f0986dd3c4109463fa0bc4 100644 | |
--- a/Source/WebKit/Platform/IPC/ArgumentCoders.h | |
+++ b/Source/WebKit/Platform/IPC/ArgumentCoders.h | |
@@ -589,14 +589,28 @@ template<typename T, size_t inlineCapacity, typename OverflowHandler, size_t min | |
return std::nullopt; | |
Vector<T, inlineCapacity, OverflowHandler, minCapacity> vector; | |
- vector.reserveInitialCapacity(*size); | |
+ | |
+ // Calls to reserveInitialCapacity with untrusted large sizes can cause allocator crashes. | |
+ // Limit allocations from untrusted sources to 1MB. | |
+ if (LIKELY(*size < 1024 * 1024 / sizeof(T))) { | |
+ vector.reserveInitialCapacity(*size); | |
+ for (size_t i = 0; i < *size; ++i) { | |
+ auto element = decoder.template decode<T>(); | |
+ if (!element) | |
+ return std::nullopt; | |
+ vector.uncheckedAppend(WTFMove(*element)); | |
+ } | |
+ return vector; | |
+ } | |
+ | |
for (size_t i = 0; i < *size; ++i) { | |
std::optional<T> element; | |
decoder >> element; | |
if (!element) | |
return std::nullopt; | |
- vector.uncheckedAppend(WTFMove(*element)); | |
+ vector.append(WTFMove(*element)); | |
} | |
+ vector.shrinkToFit(); | |
return vector; | |
} | |
}; | |
diff --git a/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp b/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp | |
index a6318278633a579ccb43c3c9d1dc19f852673172..5fb7f274ba16c7bc9b3cd3e76e424f5773dc0773 100644 | |
--- a/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp | |
+++ b/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp | |
@@ -299,9 +299,9 @@ void ThreadedCompositor::updateSceneWithoutRendering() | |
m_scene->updateSceneState(); | |
} | |
-RefPtr<WebCore::DisplayRefreshMonitor> ThreadedCompositor::displayRefreshMonitor(PlatformDisplayID) | |
+WebCore::DisplayRefreshMonitor& ThreadedCompositor::displayRefreshMonitor() const | |
{ | |
- return m_displayRefreshMonitor.copyRef(); | |
+ return m_displayRefreshMonitor.get(); | |
} | |
void ThreadedCompositor::frameComplete() | |
diff --git a/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h b/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h | |
index 02b5c0cbed921d60b517323d8e4c7b2f62e695e9..af4ec67aac153c8e1de1d785c5bdcb6adcfa704a 100644 | |
--- a/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h | |
+++ b/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h | |
@@ -73,7 +73,7 @@ public: | |
void forceRepaint(); | |
- RefPtr<WebCore::DisplayRefreshMonitor> displayRefreshMonitor(WebCore::PlatformDisplayID); | |
+ WebCore::DisplayRefreshMonitor& displayRefreshMonitor() const; | |
void frameComplete(); | |
void targetRefreshRateDidChange(unsigned); | |
diff --git a/Source/WebKit/WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp b/Source/WebKit/WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp | |
index d5a9b87fca8789c3ddc891a6342ff9defec404ea..0e8356a405ce964f99bab28c663fe6917350bd05 100644 | |
--- a/Source/WebKit/WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp | |
+++ b/Source/WebKit/WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp | |
@@ -27,6 +27,7 @@ | |
#include <JavaScriptCore/JSGlobalObjectInlines.h> | |
#include <JavaScriptCore/JSLock.h> | |
#include <WebCore/Frame.h> | |
+#include <WebCore/FrameLoader.h> | |
#include <WebCore/JSNode.h> | |
#include <WebCore/ScriptController.h> | |
#include <jsc/JSCContextPrivate.h> | |
@@ -59,10 +60,27 @@ static void webkit_frame_class_init(WebKitFrameClass*) | |
{ | |
} | |
+static CString getURL(WebFrame* webFrame) | |
+{ | |
+ auto* documentLoader = webFrame->coreFrame()->loader().provisionalDocumentLoader(); | |
+ if (!documentLoader) | |
+ documentLoader = webFrame->coreFrame()->loader().documentLoader(); | |
+ | |
+ ASSERT(documentLoader); | |
+ | |
+ if (!documentLoader->unreachableURL().isEmpty()) | |
+ return documentLoader->unreachableURL().string().utf8(); | |
+ | |
+ return documentLoader->url().string().utf8(); | |
+} | |
+ | |
WebKitFrame* webkitFrameCreate(WebFrame* webFrame) | |
{ | |
WebKitFrame* frame = WEBKIT_FRAME(g_object_new(WEBKIT_TYPE_FRAME, NULL)); | |
frame->priv->webFrame = webFrame; | |
+ | |
+ frame->priv->uri = getURL(webFrame); | |
+ | |
return frame; | |
} | |
@@ -71,6 +89,14 @@ WebFrame* webkitFrameGetWebFrame(WebKitFrame* frame) | |
return frame->priv->webFrame.get(); | |
} | |
+void webkitFrameSetURI(WebKitFrame* frame, const CString& uri) | |
+{ | |
+ if (frame->priv->uri == uri) | |
+ return; | |
+ | |
+ frame->priv->uri = uri; | |
+} | |
+ | |
/** | |
* webkit_frame_get_id: | |
* @frame: a #WebKitFrame | |
diff --git a/Source/WebKit/WebProcess/InjectedBundle/API/glib/WebKitFramePrivate.h b/Source/WebKit/WebProcess/InjectedBundle/API/glib/WebKitFramePrivate.h | |
index 81bc8ac406f5bca5bad85d31edf1d48feaf71438..8cb4f9d25af2c2d8b466caace92ecb4ac70bce4f 100644 | |
--- a/Source/WebKit/WebProcess/InjectedBundle/API/glib/WebKitFramePrivate.h | |
+++ b/Source/WebKit/WebProcess/InjectedBundle/API/glib/WebKitFramePrivate.h | |
@@ -25,5 +25,6 @@ | |
WebKitFrame* webkitFrameCreate(WebKit::WebFrame*); | |
WebKit::WebFrame* webkitFrameGetWebFrame(WebKitFrame*); | |
+void webkitFrameSetURI(WebKitFrame*, const CString&); | |
#endif // WebKitFramePrivate_h | |
diff --git a/Source/WebKit/WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp b/Source/WebKit/WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp | |
index 14d8b0fa33e045dece1029d5a70091fd76b6afad..94790fc96c37ac2f66cc75d695a8dce848f49d04 100644 | |
--- a/Source/WebKit/WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp | |
+++ b/Source/WebKit/WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp | |
@@ -134,15 +134,24 @@ static WebFrameMap& webFrameMap() | |
return map; | |
} | |
-static WebKitFrame* webkitFrameGetOrCreate(WebFrame* webFrame) | |
+static WebKitFrame* webkitFrameGet(WebFrame* webFrame) | |
{ | |
auto wrapperPtr = webFrameMap().get(webFrame); | |
if (wrapperPtr) | |
return wrapperPtr->webkitFrame(); | |
+ return nullptr; | |
+} | |
+ | |
+static WebKitFrame* webkitFrameGetOrCreate(WebFrame* webFrame) | |
+{ | |
+ if (auto* webKitFrame = webkitFrameGet(webFrame)) | |
+ return webKitFrame; | |
+ | |
std::unique_ptr<WebKitFrameWrapper> wrapper = makeUnique<WebKitFrameWrapper>(*webFrame); | |
- wrapperPtr = wrapper.get(); | |
+ auto wrapperPtr = wrapper.get(); | |
webFrameMap().set(webFrame, WTFMove(wrapper)); | |
+ | |
return wrapperPtr->webkitFrame(); | |
} | |
@@ -185,30 +194,62 @@ private: | |
void didStartProvisionalLoadForFrame(WebPage&, WebFrame& frame, RefPtr<API::Object>&) override | |
{ | |
- if (!frame.isMainFrame()) | |
+ auto* webKitFrame = webkitFrameGet(&frame); | |
+ if (!webKitFrame && !frame.isMainFrame()) | |
return; | |
- webkitWebPageSetURI(m_webPage, getDocumentLoaderURL(frame.coreFrame()->loader().provisionalDocumentLoader())); | |
+ | |
+ const auto uri = getDocumentLoaderURL(frame.coreFrame()->loader().provisionalDocumentLoader()); | |
+ | |
+ if (webKitFrame) | |
+ webkitFrameSetURI(webKitFrame, uri); | |
+ | |
+ if (frame.isMainFrame()) | |
+ webkitWebPageSetURI(m_webPage, uri); | |
} | |
void didReceiveServerRedirectForProvisionalLoadForFrame(WebPage&, WebFrame& frame, RefPtr<API::Object>&) override | |
{ | |
- if (!frame.isMainFrame()) | |
+ auto* webKitFrame = webkitFrameGet(&frame); | |
+ if (!webKitFrame && !frame.isMainFrame()) | |
return; | |
- webkitWebPageSetURI(m_webPage, getDocumentLoaderURL(frame.coreFrame()->loader().provisionalDocumentLoader())); | |
+ | |
+ const auto uri = getDocumentLoaderURL(frame.coreFrame()->loader().provisionalDocumentLoader()); | |
+ | |
+ if (webKitFrame) | |
+ webkitFrameSetURI(webKitFrame, uri); | |
+ | |
+ if (frame.isMainFrame()) | |
+ webkitWebPageSetURI(m_webPage, uri); | |
} | |
void didSameDocumentNavigationForFrame(WebPage&, WebFrame& frame, SameDocumentNavigationType, RefPtr<API::Object>&) override | |
{ | |
- if (!frame.isMainFrame()) | |
+ auto* webKitFrame = webkitFrameGet(&frame); | |
+ if (!webKitFrame && !frame.isMainFrame()) | |
return; | |
- webkitWebPageSetURI(m_webPage, frame.coreFrame()->document()->url().string().utf8()); | |
+ | |
+ const auto uri = frame.coreFrame()->document()->url().string().utf8(); | |
+ | |
+ if (webKitFrame) | |
+ webkitFrameSetURI(webKitFrame, uri); | |
+ | |
+ if (frame.isMainFrame()) | |
+ webkitWebPageSetURI(m_webPage, uri); | |
} | |
void didCommitLoadForFrame(WebPage&, WebFrame& frame, RefPtr<API::Object>&) override | |
{ | |
- if (!frame.isMainFrame()) | |
+ auto* webKitFrame = webkitFrameGet(&frame); | |
+ if (!webKitFrame && !frame.isMainFrame()) | |
return; | |
- webkitWebPageSetURI(m_webPage, getDocumentLoaderURL(frame.coreFrame()->loader().documentLoader())); | |
+ | |
+ const auto uri = getDocumentLoaderURL(frame.coreFrame()->loader().documentLoader()); | |
+ | |
+ if (webKitFrame) | |
+ webkitFrameSetURI(webKitFrame, uri); | |
+ | |
+ if (frame.isMainFrame()) | |
+ webkitWebPageSetURI(m_webPage, uri); | |
} | |
void didFinishDocumentLoadForFrame(WebPage&, WebFrame& frame, RefPtr<API::Object>&) override | |
diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp | |
index 6bc7442b28ed5ee475d603975bee65cf32df39f4..b6d8087c03073cb0e87ec7ff3d979a5ab978639b 100644 | |
--- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp | |
+++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp | |
@@ -633,7 +633,7 @@ void DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode(GraphicsLay | |
auto changeWindowScreen = [&] { | |
// In order to ensure that we get a unique DisplayRefreshMonitor per-DrawingArea (necessary because ThreadedDisplayRefreshMonitor | |
- // is driven by the ThreadedCompositor of the drawing area), give each page a unique DisplayID derived from WebPage's unique ID. | |
+ // is driven by the ThreadedCompositor of the drawing area), give each page a unique DisplayID derived from DrawingArea's unique ID. | |
m_webPage.windowScreenDidChange(m_layerTreeHost->displayID(), std::nullopt); | |
}; | |
diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp | |
index 60d596ec08c0b3550a328ae715e180ae3669676b..cbe83f18808f6f213812fb840f30725785e2df87 100644 | |
--- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp | |
+++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp | |
@@ -55,7 +55,6 @@ LayerTreeHost::LayerTreeHost(WebPage& webPage) | |
, m_viewportController(webPage.size()) | |
, m_layerFlushTimer(RunLoop::main(), this, &LayerTreeHost::layerFlushTimerFired) | |
, m_coordinator(webPage, *this) | |
- , m_displayID(std::numeric_limits<uint32_t>::max() - m_webPage.identifier().toUInt64()) | |
{ | |
#if USE(GLIB_EVENT_LOOP) | |
m_layerFlushTimer.setPriority(RunLoopSourcePriority::LayerFlushTimer); | |
@@ -77,6 +76,8 @@ LayerTreeHost::LayerTreeHost(WebPage& webPage) | |
if (m_surface->shouldPaintMirrored()) | |
paintFlags |= TextureMapper::PaintingMirrored; | |
+ ASSERT(m_webPage.drawingArea()); | |
+ m_displayID = std::numeric_limits<uint32_t>::max() - m_webPage.drawingArea()->identifier().toUInt64(); | |
m_compositor = ThreadedCompositor::create(m_compositorClient, m_compositorClient, m_displayID, scaledSize, scaleFactor, paintFlags); | |
m_layerTreeContext.contextID = m_surface->surfaceID(); | |
@@ -367,7 +368,8 @@ void LayerTreeHost::deviceOrPageScaleFactorChanged() | |
RefPtr<DisplayRefreshMonitor> LayerTreeHost::createDisplayRefreshMonitor(PlatformDisplayID displayID) | |
{ | |
- return m_compositor->displayRefreshMonitor(displayID); | |
+ ASSERT(m_displayID == displayID); | |
+ return Ref { m_compositor->displayRefreshMonitor() }; | |
} | |
void LayerTreeHost::didFlushRootLayer(const FloatRect& visibleContentRect) | |
diff --git a/Source/WebKit/gtk/NEWS b/Source/WebKit/gtk/NEWS | |
index b5c9a705b9e5afd39842b6243aad4c6f17a04b8c..e5ac79bf531c289b127c95b94a7575be7faee86e 100644 | |
--- a/Source/WebKit/gtk/NEWS | |
+++ b/Source/WebKit/gtk/NEWS | |
@@ -1,3 +1,15 @@ | |
+================ | |
+WebKitGTK 2.38.5 | |
+================ | |
+ | |
+What's new in WebKitGTK 2.38.5? | |
+ | |
+ - Fix large memory allocation when uploading content. | |
+ - Fix scrolling after a history navigation with PSON enabled. | |
+ - Always update the active uri of WebKitFrame. | |
+ - Fix the build on Ubuntu 20.04. | |
+ - Fix several crashes and rendering issues. | |
+ | |
================ | |
WebKitGTK 2.38.4 | |
================ | |
diff --git a/Source/bmalloc/bmalloc/DebugHeap.cpp b/Source/bmalloc/bmalloc/DebugHeap.cpp | |
index 81fb214d30140cfb5bf2e9597e60391ce666f73c..f29ba0732967f772f351d18c92fbc8e35ef24e3c 100644 | |
--- a/Source/bmalloc/bmalloc/DebugHeap.cpp | |
+++ b/Source/bmalloc/bmalloc/DebugHeap.cpp | |
@@ -122,7 +122,7 @@ void* DebugHeap::malloc(size_t size, FailureAction action) | |
void* DebugHeap::memalign(size_t alignment, size_t size, FailureAction action) | |
{ | |
- void* result; | |
+ void* result = nullptr; | |
if (posix_memalign(&result, alignment, size)) | |
RELEASE_BASSERT(action == FailureAction::ReturnNull || result); | |
return result; | |
diff --git a/Source/cmake/OptionsGTK.cmake b/Source/cmake/OptionsGTK.cmake | |
index e2fc90204441293b5683091d941e7f2b69db2cb4..2bcb6a0c53d2d9c0b591869dc72a774ae61dfc47 100644 | |
--- a/Source/cmake/OptionsGTK.cmake | |
+++ b/Source/cmake/OptionsGTK.cmake | |
@@ -3,7 +3,7 @@ include(VersioningUtils) | |
WEBKIT_OPTION_BEGIN() | |
-SET_PROJECT_VERSION(2 38 4) | |
+SET_PROJECT_VERSION(2 38 5) | |
# This is required because we use the DEPFILE argument to add_custom_command(). | |
# Remove after upgrading cmake_minimum_required() to 3.20. | |
@@ -226,11 +226,11 @@ else () | |
endif () | |
if (WEBKITGTK_API_VERSION VERSION_EQUAL "4.0") | |
- CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE(WEBKIT 94 7 57) | |
- CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE(JAVASCRIPTCORE 39 7 21) | |
+ CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE(WEBKIT 94 8 57) | |
+ CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE(JAVASCRIPTCORE 39 8 21) | |
elseif (WEBKITGTK_API_VERSION VERSION_EQUAL "4.1") | |
- CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE(WEBKIT 2 7 2) | |
- CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE(JAVASCRIPTCORE 2 7 2) | |
+ CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE(WEBKIT 2 8 2) | |
+ CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE(JAVASCRIPTCORE 2 8 2) | |
elseif (WEBKITGTK_API_VERSION VERSION_EQUAL "5.0") | |
CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE(WEBKIT 0 0 0) | |
CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE(JAVASCRIPTCORE 0 0 0) | |
diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/WebExtensionTest.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/WebExtensionTest.cpp | |
index 2d9720bca3c1852a07aad63c694c6cc44b8bed57..985c1a9982a22f8382df5aaebc1e5d0dbd32fa93 100644 | |
--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/WebExtensionTest.cpp | |
+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/WebExtensionTest.cpp | |
@@ -189,6 +189,11 @@ static void emitURIChanged(GDBusConnection* connection, const char* uri) | |
static void uriChangedCallback(WebKitWebPage* webPage, GParamSpec* pspec, WebKitWebExtension* extension) | |
{ | |
+ WebKitFrame* frame = webkit_web_page_get_main_frame(webPage); | |
+ g_assert_true(WEBKIT_IS_FRAME(frame)); | |
+ g_assert_true(webkit_frame_is_main_frame(frame)); | |
+ g_assert_cmpstr(webkit_web_page_get_uri(webPage), ==, webkit_frame_get_uri(frame)); | |
+ | |
gpointer data = g_object_get_data(G_OBJECT(extension), "dbus-connection"); | |
if (data) | |
emitURIChanged(G_DBUS_CONNECTION(data), webkit_web_page_get_uri(webPage)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment