Skip to content
Permalink
Browse files
8254836: Cherry pick GTK WebKit 2.30.3 changes
Reviewed-by: kcr, jvos
  • Loading branch information
arun-Joseph committed Feb 4, 2021
1 parent 215384d commit 425c3353199942924255930ce3a944dfcb4153bc
Showing with 592 additions and 196 deletions.
  1. +2 −0 modules/javafx.web/src/main/native/Source/JavaScriptCore/b3/B3ReduceStrength.cpp
  2. +1 −0 modules/javafx.web/src/main/native/Source/JavaScriptCore/b3/testb3.h
  3. +1 −0 modules/javafx.web/src/main/native/Source/JavaScriptCore/b3/testb3_1.cpp
  4. +32 −0 modules/javafx.web/src/main/native/Source/JavaScriptCore/b3/testb3_5.cpp
  5. +13 −13 modules/javafx.web/src/main/native/Source/JavaScriptCore/yarr/YarrParser.h
  6. +2 −2 modules/javafx.web/src/main/native/Source/WTF/wtf/PageBlock.h
  7. +3 −1 modules/javafx.web/src/main/native/Source/WTF/wtf/URL.cpp
  8. +1 −0 modules/javafx.web/src/main/native/Source/WebCore/Modules/webaudio/AudioContext.cpp
  9. +3 −3 modules/javafx.web/src/main/native/Source/WebCore/accessibility/AccessibilityObject.cpp
  10. +2 −2 modules/javafx.web/src/main/native/Source/WebCore/page/EventHandler.cpp
  11. +48 −48 modules/javafx.web/src/main/native/Source/WebCore/page/FrameView.cpp
  12. +2 −2 modules/javafx.web/src/main/native/Source/WebCore/page/scrolling/ThreadedScrollingTree.h
  13. +2 −0 ...eb/src/main/native/Source/WebCore/page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h
  14. +64 −0 modules/javafx.web/src/main/native/Source/WebCore/page/scrolling/nicosia/ScrollingTreeNicosia.cpp
  15. +2 −0 modules/javafx.web/src/main/native/Source/WebCore/page/scrolling/nicosia/ScrollingTreeNicosia.h
  16. +1 −1 modules/javafx.web/src/main/native/Source/WebCore/platform/UserAgentQuirks.cpp
  17. +17 −0 modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/nicosia/NicosiaPlatformLayer.h
  18. +9 −0 ...n/native/Source/WebCore/platform/graphics/nicosia/texmap/NicosiaImageBackingTextureMapperImpl.cpp
  19. +1 −1 ...ain/native/Source/WebCore/platform/graphics/nicosia/texmap/NicosiaImageBackingTextureMapperImpl.h
  20. +1 −0 modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/BitmapTextureGL.cpp
  21. +31 −0 modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/ClipStack.cpp
  22. +31 −3 modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/ClipStack.h
  23. +1 −1 ...javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
  24. +2 −1 modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/TextureMapper.h
  25. +84 −3 modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp
  26. +2 −1 modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/TextureMapperGL.h
  27. +2 −2 modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/TextureMapperJava.cpp
  28. +1 −1 modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/TextureMapperJava.h
  29. +69 −97 modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp
  30. +14 −5 modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h
  31. +91 −3 ...javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp
  32. +4 −0 ...s/javafx.web/src/main/native/Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.h
  33. +17 −3 .../src/main/native/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp
  34. +1 −0 ...eb/src/main/native/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h
  35. +4 −1 modules/javafx.web/src/main/native/Source/WebCore/platform/network/ResourceResponseBase.cpp
  36. +1 −1 modules/javafx.web/src/main/native/Source/WebKitLegacy/java/WebCoreSupport/WebPage.cpp
  37. +30 −1 modules/javafx.web/src/main/native/Source/cmake/WebKitFeatures.cmake
@@ -123,6 +123,8 @@ class IntRange {
{
if (!(mask + 1))
return top<T>();
if (mask < 0)
return IntRange(INT_MIN & mask, mask & INT_MAX);
return IntRange(0, mask);
}

@@ -804,6 +804,7 @@ void testCheckAddRemoveCheckWithZExt32(int32_t);
void testCheckSubImm();
void testCheckSubBadImm();
void testCheckSub();
void testCheckSubBitAnd();
double doubleSub(double, double);
void testCheckSub64();
void testCheckSubFold(int, int);
@@ -496,6 +496,7 @@ void run(const char* filter)
RUN(testCheckSubImm());
RUN(testCheckSubBadImm());
RUN(testCheckSub());
RUN(testCheckSubBitAnd());
RUN(testCheckSub64());
RUN(testCheckSubFold(100, 200));
RUN(testCheckSubFoldFail(-2147483647, 100));
@@ -1125,6 +1125,38 @@ void testCheckSub()
CHECK(invoke<double>(*code, -2147483647, 42) == -2147483689.0);
}

void testCheckSubBitAnd()
{
Procedure proc;
if (proc.optLevel() < 1)
return;
BasicBlock* root = proc.addBlock();
Value* zero = root->appendNew<Const32Value>(proc, Origin(), 0);
Value* arg1 = root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0);
Value* truncatedArg1 = root->appendNew<Value>(proc, Trunc, Origin(), arg1);
Value* minusTwo = root->appendNew<Const32Value>(proc, Origin(), -2);
Value* bitAnd = root->appendNew<Value>(proc, BitAnd, Origin(), truncatedArg1, minusTwo);
CheckValue* checkSub = root->appendNew<CheckValue>(proc, CheckSub, Origin(), zero, bitAnd);
checkSub->setGenerator([&] (CCallHelpers& jit, const StackmapGenerationParams&) {
AllowMacroScratchRegisterUsage allowScratch(jit);
jit.move(CCallHelpers::TrustedImm32(42), GPRInfo::returnValueGPR);
jit.emitFunctionEpilogue();
jit.ret();
});
root->appendNewControlValue(proc, Return, Origin(), checkSub);

auto code = compileProc(proc);

CHECK_EQ(invoke<int>(*code, 1), 0);
CHECK_EQ(invoke<int>(*code, 2), -2);
CHECK_EQ(invoke<int>(*code, 3), -2);
CHECK_EQ(invoke<int>(*code, -1), 2);
CHECK_EQ(invoke<int>(*code, -2), 2);
CHECK_EQ(invoke<int>(*code, -3), 4);
CHECK_EQ(invoke<int>(*code, INT_MAX), -(INT_MAX - 1));
CHECK_EQ(invoke<int>(*code, INT_MIN), 42);
}

NEVER_INLINE double doubleSub(double a, double b)
{
return a - b;
@@ -454,22 +454,22 @@ class Parser {
consume();
ParseState state = saveState();
if (!inCharacterClass && tryConsume('<')) {
auto groupName = tryConsumeGroupName();
auto groupName = tryConsumeGroupName();
if (hasError(m_errorCode))
break;

if (groupName) {
if (m_captureGroupNames.contains(groupName.value())) {
delegate.atomNamedBackReference(groupName.value());
break;
}

if (m_isNamedForwardReferenceAllowed) {
m_forwardReferenceNames.add(groupName.value());
delegate.atomNamedForwardReference(groupName.value());
break;
}
if (groupName) {
if (m_captureGroupNames.contains(groupName.value())) {
delegate.atomNamedBackReference(groupName.value());
break;
}

if (m_isNamedForwardReferenceAllowed) {
m_forwardReferenceNames.add(groupName.value());
delegate.atomNamedForwardReference(groupName.value());
break;
}
}
}

restoreState(state);
@@ -860,7 +860,7 @@ class Parser {
if (m_size > MAX_PATTERN_SIZE)
return ErrorCode::PatternTooLarge;

parseTokens();
parseTokens();

if (!hasError(m_errorCode)) {
ASSERT(atEndOfPattern());
@@ -49,10 +49,10 @@ namespace WTF {
// Use 64 KiB for any unknown CPUs to be conservative.
#if OS(DARWIN) || PLATFORM(PLAYSTATION)
constexpr size_t CeilingOnPageSize = 16 * KB;
#elif USE(64KB_PAGE_BLOCK) || CPU(PPC) || CPU(PPC64) || CPU(PPC64LE) || CPU(UNKNOWN)
constexpr size_t CeilingOnPageSize = 64 * KB;
#elif OS(WINDOWS) || CPU(MIPS) || CPU(MIPS64) || CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(ARM64)
constexpr size_t CeilingOnPageSize = 4 * KB;
#elif CPU(UNKNOWN) || CPU(PPC) || CPU(PPC64) || CPU(PPC64LE)
constexpr size_t CeilingOnPageSize = 64 * KB;
#else
#error Must set CeilingOnPageSize in PageBlock.h when adding a new CPU architecture!
#endif
@@ -598,7 +598,7 @@ void URL::removeFragmentIdentifier()
if (!m_isValid)
return;

m_string = m_string.left(m_queryEnd);
m_string = m_string.left(m_queryEnd);
}

void URL::removeQueryAndFragmentIdentifier()
@@ -917,6 +917,8 @@ bool portAllowed(const URL& url)
3659, // apple-sasl / PasswordServer [Apple addition]
4045, // lockd
4190, // ManageSieve [Apple addition]
5060, // SIP
5061, // SIPS
6000, // X11
6665, // Alternate IRC [Apple addition]
6666, // Alternate IRC [Apple addition]
@@ -29,6 +29,7 @@

#include "AudioContext.h"
#include "DefaultAudioDestinationNode.h"
#include "Document.h"
#include "JSDOMPromiseDeferred.h"
#include <wtf/IsoMallocInlines.h>

@@ -681,13 +681,13 @@ Vector<SimpleRange> AccessibilityObject::findTextRanges(const AccessibilitySearc
if (!range)
return { };

if (criteria.start == AccessibilitySearchTextStartFrom::Begin)
if (criteria.start == AccessibilitySearchTextStartFrom::Begin)
range->end = range->start;
else if (criteria.start == AccessibilitySearchTextStartFrom::End)
else if (criteria.start == AccessibilitySearchTextStartFrom::End)
range->start = range->end;
else if (criteria.direction == AccessibilitySearchTextDirection::Backward)
range->start = range->end;
else
else
range->end = range->start;

Vector<SimpleRange> result;
@@ -3138,8 +3138,8 @@ void EventHandler::scheduleCursorUpdate()
if (!page)
return;

if (!page->chrome().client().supportsSettingCursor())
return;
if (!page->chrome().client().supportsSettingCursor())
return;

m_hasScheduledCursorUpdate = true;
page->scheduleRenderingUpdate();
@@ -2538,9 +2538,9 @@ void FrameView::updateScriptedAnimationsAndTimersThrottlingState(const IntRect&
if (!scriptedAnimationController)
return;

if (shouldThrottle)
scriptedAnimationController->addThrottlingReason(ThrottlingReason::OutsideViewport);
else
if (shouldThrottle)
scriptedAnimationController->addThrottlingReason(ThrottlingReason::OutsideViewport);
else
scriptedAnimationController->removeThrottlingReason(ThrottlingReason::OutsideViewport);
}

@@ -4517,74 +4517,74 @@ bool FrameView::qualifiesAsSignificantRenderedText() const
void FrameView::checkAndDispatchDidReachVisuallyNonEmptyState()
{
auto qualifiesAsVisuallyNonEmpty = [&] {
// No content yet.
// No content yet.
auto& document = *frame().document();
auto* documentElement = document.documentElement();
if (!documentElement || !documentElement->renderer())
return false;
if (!documentElement || !documentElement->renderer())
return false;

if (document.hasVisuallyNonEmptyCustomContent())
return true;

// FIXME: We should also ignore renderers with non-final style.
// FIXME: We should also ignore renderers with non-final style.
if (document.styleScope().hasPendingSheetsBeforeBody())
return false;
return false;

auto finishedParsingMainDocument = frame().loader().stateMachine().committedFirstRealDocumentLoad() && (document.readyState() == Document::Interactive || document.readyState() == Document::Complete);
// Ensure that we always fire visually non-empty milestone eventually.
if (finishedParsingMainDocument && frame().loader().isComplete())
return true;
// Ensure that we always fire visually non-empty milestone eventually.
if (finishedParsingMainDocument && frame().loader().isComplete())
return true;

auto isVisible = [](const Element* element) {
if (!element || !element->renderer())
auto isVisible = [](const Element* element) {
if (!element || !element->renderer())
return false;
if (!element->renderer()->opacity())
return false;
return element->renderer()->style().visibility() == Visibility::Visible;
};

if (!isVisible(documentElement))
return false;
if (!element->renderer()->opacity())

if (!isVisible(document.body()))
return false;
return element->renderer()->style().visibility() == Visibility::Visible;
};

if (!isVisible(documentElement))
return false;
// The first few hundred characters rarely contain the interesting content of the page.
if (m_visuallyNonEmptyCharacterCount > visualCharacterThreshold)
return true;

if (!isVisible(document.body()))
return false;
// Use a threshold value to prevent very small amounts of visible content from triggering didFirstVisuallyNonEmptyLayout
if (m_visuallyNonEmptyPixelCount > visualPixelThreshold)
return true;

// The first few hundred characters rarely contain the interesting content of the page.
if (m_visuallyNonEmptyCharacterCount > visualCharacterThreshold)
return true;
auto isMoreContentExpected = [&]() {
ASSERT(finishedParsingMainDocument);
// Pending css/font loading means we should wait a little longer. Classic non-async, non-defer scripts are all processed by now.
auto* documentLoader = frame().loader().documentLoader();
if (!documentLoader)
return false;

// Use a threshold value to prevent very small amounts of visible content from triggering didFirstVisuallyNonEmptyLayout
if (m_visuallyNonEmptyPixelCount > visualPixelThreshold)
return true;
auto& resourceLoader = documentLoader->cachedResourceLoader();
if (!resourceLoader.requestCount())
return false;

auto isMoreContentExpected = [&]() {
ASSERT(finishedParsingMainDocument);
// Pending css/font loading means we should wait a little longer. Classic non-async, non-defer scripts are all processed by now.
auto* documentLoader = frame().loader().documentLoader();
if (!documentLoader)
auto& resources = resourceLoader.allCachedResources();
for (auto& resource : resources) {
if (resource.value->isLoaded())
continue;
if (resource.value->type() == CachedResource::Type::CSSStyleSheet || resource.value->type() == CachedResource::Type::FontResource)
return true;
}
return false;
};

auto& resourceLoader = documentLoader->cachedResourceLoader();
if (!resourceLoader.requestCount())
return false;
// Finished parsing the main document and we still don't yet have enough content. Check if we might be getting some more.
if (finishedParsingMainDocument)
return !isMoreContentExpected();

auto& resources = resourceLoader.allCachedResources();
for (auto& resource : resources) {
if (resource.value->isLoaded())
continue;
if (resource.value->type() == CachedResource::Type::CSSStyleSheet || resource.value->type() == CachedResource::Type::FontResource)
return true;
}
return false;
};

// Finished parsing the main document and we still don't yet have enough content. Check if we might be getting some more.
if (finishedParsingMainDocument)
return !isMoreContentExpected();

return false;
};

if (m_contentQualifiesAsVisuallyNonEmpty)
return;

@@ -77,6 +77,8 @@ class ThreadedScrollingTree : public ScrollingTree {
void reportExposedUnfilledArea(MonotonicTime, unsigned unfilledArea) override;
void reportSynchronousScrollingReasonsChanged(MonotonicTime, OptionSet<SynchronousScrollingReason>) override;

RefPtr<AsyncScrollingCoordinator> m_scrollingCoordinator;

private:
bool isThreadedScrollingTree() const override { return true; }
void propagateSynchronousScrollingReasons(const HashSet<ScrollingNodeID>&) override;
@@ -89,8 +91,6 @@ class ThreadedScrollingTree : public ScrollingTree {

Seconds maxAllowableRenderingUpdateDurationForSynchronization();

RefPtr<AsyncScrollingCoordinator> m_scrollingCoordinator;

enum class SynchronizationState : uint8_t {
Idle,
WaitingForRenderingUpdate,
@@ -47,6 +47,8 @@ class ScrollingTreeFrameScrollingNodeNicosia final : public ScrollingTreeFrameSc
static Ref<ScrollingTreeFrameScrollingNode> create(ScrollingTree&, ScrollingNodeType, ScrollingNodeID);
virtual ~ScrollingTreeFrameScrollingNodeNicosia();

RefPtr<Nicosia::CompositionLayer> rootContentsLayer() const { return m_rootContentsLayer; }

private:
ScrollingTreeFrameScrollingNodeNicosia(ScrollingTree&, ScrollingNodeType, ScrollingNodeID);

1 comment on commit 425c335

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on 425c335 Feb 4, 2021

Please sign in to comment.