⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Timeline



Jul 12, 2020:

11:28 PM Changeset in webkit [264294] by commit-queue@webkit.org
  • 2 edits in trunk/Source/WebCore/PAL

Building CFNetworkSPI with the macOS Big Sur public SDK fails
https://bugs.webkit.org/show_bug.cgi?id=214238

Patch by Rob Buis <rbuis@igalia.com> on 2020-07-12
Reviewed by Darin Adler.

Building CFNetworkSPI with the macOS Big Sur public SDK fails bacause
it has Objective-C declarations in a header that’s included by a
non-Objective-C source file, to fix wrap the declarations in a
defined(OBJC) block.

  • pal/spi/cf/CFNetworkSPI.h:
11:27 PM Changeset in webkit [264293] by ysuzuki@apple.com
  • 7 edits in trunk/Source

[JSC] String.protoytpe.toLocaleLowerCase's availableLocales HashSet is inefficient
https://bugs.webkit.org/show_bug.cgi?id=213158

Reviewed by Darin Adler.

Source/JavaScriptCore:

Currently, we are always creating the same HashSet every time String.protoytpe.toLocaleLowerCase is called.
We changed bestAvailableLocale to take predicate function. And we pass a predicate which returns true for
case-sensitive locales.

  • runtime/IntlObject.cpp:

(JSC::bestAvailableLocale):

  • runtime/IntlObject.h:
  • runtime/IntlObjectInlines.h:

(JSC::bestAvailableLocale):

  • runtime/StringPrototype.cpp:

(JSC::computeTwoCharacters16Code):
(JSC::toLocaleCase):

Source/WTF:

Add characterAt method to ASCIILiteral.

  • wtf/text/ASCIILiteral.h:
11:20 PM Changeset in webkit [264292] by commit-queue@webkit.org
  • 2 edits in trunk/Source/WebCore/PAL

Building NetworkSessionCocoa.mm with the macOS Big Sur public SDK fails
https://bugs.webkit.org/show_bug.cgi?id=214242

Patch by Rob Buis <rbuis@igalia.com> on 2020-07-12
Reviewed by Darin Adler.

Building NetworkSessionCocoa.mm with the macOS Big Sur public SDK fails
because _allowsHTTP3 is readonly yet it is being written to in
NetworkSessionCocoa.mm, mark it as readwrite instead.

  • pal/spi/cf/CFNetworkSPI.h:
10:51 PM Changeset in webkit [264291] by Fujii Hironori
  • 21 edits in trunk/LayoutTests

[WinCairo] Unreviewed test gardening

Windows WebKit1 doesn't check lines with "EDITING DELEGATE:" (Bug 64471).
Rebasedlined with WinCairo WebKit2's results.

  • platform/wincairo/editing/execCommand/findString-2-expected.txt:
  • platform/wincairo/editing/selection/6476-expected.txt:
  • platform/wincairo/editing/selection/click-start-of-line-expected.txt:
  • platform/wincairo/editing/selection/contenteditable-click-inside-expected.txt:
  • platform/wincairo/editing/selection/doubleclick-crash-expected.txt:
  • platform/wincairo/editing/selection/editable-html-element-expected.txt:
  • platform/wincairo/editing/selection/editable-links-expected.txt:
  • platform/wincairo/editing/selection/expanding-selections-expected.txt:
  • platform/wincairo/editing/selection/expanding-selections2-expected.txt:
  • platform/wincairo/editing/selection/fake-doubleclick-expected.txt:
  • platform/wincairo/editing/selection/focus-body-expected.txt:
  • platform/wincairo/editing/selection/focus_editable_html-expected.txt:
  • platform/wincairo/editing/selection/mixed-editability-1-expected.txt:
  • platform/wincairo/editing/selection/paragraph-granularity-expected.txt:
  • platform/wincairo/editing/selection/select-all-006-expected.txt:
  • platform/wincairo/editing/selection/select-from-textfield-outwards-expected.txt:
  • platform/wincairo/editing/selection/selection-actions-expected.txt:
  • platform/wincairo/editing/selection/triple-click-in-pre-expected.txt:
  • platform/wincairo/editing/selection/word-granularity-expected.txt:
  • platform/wincairo/editing/style/apple-style-editable-mix-expected.txt:
9:57 PM BuildingCairoOnWindows edited by Fujii Hironori
(diff)
9:09 PM Changeset in webkit [264290] by Darin Adler
  • 15 edits in trunk/Source

Some further streamlining of Gradient handling code
https://bugs.webkit.org/show_bug.cgi?id=214239

Reviewed by Sam Weinig.

Source/WebCore:

  • platform/graphics/cairo/GradientCairo.cpp:

(WebCore::interpolateColorStop): Deleted.
(WebCore::createConic): Rewrite the interpolation code to create a new
vector rather than edit the existing one and to use a more straightforward
idiom, and a lambda rather than a helper function. Also removed an explicit
conversion to Gradient::ColorStop, no longer needed because of the overload
added to Vector::insert.

  • rendering/svg/RenderSVGResourceGradient.cpp:

(WebCore::RenderSVGResourceGradient::applyResource): Use ensure rather
than add to initialize gradient data in the gradient map. Change the #if
for USE(CG) so it doesn't confuse brace matching from the syntax handling
of text editors like the one in Xcode. Update for the changes to the
buildGradient and gradientTransform functions. Use auto a bit more.
(WebCore::RenderSVGResourceGradient::postApplyResource): Update since the
map now contains GradientData rather than unique_ptr<GradientData>. Use
std::exchange when fetching m_savedContext and a local variable to make
the gradient-related code a bit less wordy.
(WebCore::RenderSVGResourceGradient::addStops): Updated to take Gradient&
rather than GradientData* and made this a static member function.
(WebCore::RenderSVGResourceGradient::platformSpreadMethodFromSVGType):
Made this a static member function.

  • rendering/svg/RenderSVGResourceGradient.h: Made more functions private.

Converted addStops and platformSpreadMethodFromSVGType to static member
functions. Made GradientData a member class, and put directly into the
HashMap rather than putting unique_ptr into the map. Changed
calculateGradientTransform to gradientTransform, which uses a return
value rather than an out argument. Changed buildGradient to return
Ref<Gradient> rather than taking a GradientData* to store it in.

  • rendering/svg/RenderSVGResourceLinearGradient.cpp:

(WebCore::RenderSVGResourceLinearGradient::buildGradient const):
Changed to return the gradient instead of modifying an argument and
updated for the change to addStops.

  • rendering/svg/RenderSVGResourceLinearGradient.h: Made more functions

private and updated for changes to gradientTransform and buildGradient.

  • rendering/svg/RenderSVGResourceRadialGradient.cpp:

(WebCore::RenderSVGResourceRadialGradient::buildGradient const):
Changed to return the gradient instead of modifying an argument and
updated for the change to addStops.

  • rendering/svg/RenderSVGResourceRadialGradient.h: Made more functions

private and updated for changes to gradientTransform and buildGradient.

  • svg/GradientAttributes.h: Removed the stopsSet boolean since

the stops vector is empty if and only if it's not set. Made the setStops
function take an rvalue reference so it doesn't always copy a vector.
Also use the ColorStopVector type, sharing the same inline capacity
policy with the Gradient class; both are optimizing the same thing.

  • svg/SVGGradientElement.cpp:

(WebCore::SVGGradientElement::buildStops): Use the ColorStopVector type.

  • svg/SVGGradientElement.h: Update for the above.
  • svg/SVGLinearGradientElement.cpp:

(WebCore::setGradientAttributes): Update for changes to buildStops and
removed an unnecessary check for an empty vector now that an empty
vector has the same semantics as "no stops".

  • svg/SVGRadialGradientElement.cpp:

(WebCore::setGradientAttributes): Ditto.

Source/WTF:

  • wtf/Vector.h: Added an overload for insert analogous to the ones we already have

for append and uncheckedAppend, helpful for type deduction.

6:11 PM Changeset in webkit [264289] by Fujii Hironori
  • 3 edits in trunk/Source/WebCore

[WinCairo][Clang] Unreviewed build fix for r264272
https://bugs.webkit.org/show_bug.cgi?id=214204
<rdar://problem/65414170>

clang-cl reported:

..\..\Source\WebCore\platform\graphics/ColorUtilities.h(200,26): error: no template named 'ComponentTraits'

constexpr auto min = ComponentTraits<typename ColorType::ComponentType>::minValue;


  • platform/graphics/ColorUtilities.cpp: Removed #include "ColorTypes.h".
  • platform/graphics/ColorUtilities.h: Added #include "ColorTypes.h".
3:53 PM Changeset in webkit [264288] by ysuzuki@apple.com
  • 2 edits in trunk/JSTests

Unreviewed, mark wasm/references/multitable.js as memory-exhausting

Got footprint exceeding crashes in Debug JSC tests in GTK.

  • wasm/references/multitable.js:
3:41 PM Changeset in webkit [264287] by ysuzuki@apple.com
  • 2 edits in trunk/Source/JavaScriptCore

[JSC] We should keep unaligned access feature in certain architectures in macro-assembler
https://bugs.webkit.org/show_bug.cgi?id=214243

Reviewed by Darin Adler.

We introduced the assertion in r263049, but this assertion crashes in testb3 Debug build.
testb3 actually tests unaligned access feature since ARM64 and x64 allow it. And unaligned access is useful
for Yarr etc., so we want to keep unaligned access feature if architecture allows it. We should make this
assertion effective only if CPU(NEEDS_ALIGNED_ACCESS) is true.

  • assembler/MacroAssembler.h:

(JSC::MacroAssembler::loadPtr):

2:20 PM Changeset in webkit [264286] by commit-queue@webkit.org
  • 27 edits
    1 move
    7 adds
    1 delete in trunk

[macOS]: A HEIF image, selected from the OpenPanel, should be converted to an accepted MIME type
https://bugs.webkit.org/show_bug.cgi?id=213347
<rdar://problem/57258464>

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2020-07-12
Reviewed by Darin Adler.

Source/WebCore:

Tests: fast/forms/file/entries-api/image-no-transcode-open-panel.html

fast/forms/file/entries-api/image-transcode-open-panel.html

  • platform/MIMETypeRegistry.cpp:

(WebCore::MIMETypeRegistry::allowedMIMETypes):
Make sure this function returns lowercase MIME types.

  • platform/MIMETypeRegistry.h:
  • platform/graphics/NativeImage.h:
  • platform/graphics/cg/NativeImageCG.cpp:

(WebCore::drawNativeImage):

Source/WebKit:

Transcode the images given the list of the selected file and the allowed
MIME types. Only selected files whose MIME types do not exist in the allowed
MIME types will be transcoded. Right now, this only will apply to the HEIF
images on macOS.

  • Platform/ImageUtilities.h: Renamed from Source/WebKit/Platform/cg/CGUtilities.h.
  • Platform/Logging.h:
  • Platform/cg/CGUtilities.cpp: Removed.
  • Platform/cg/ImageUtilitiesCG.cpp: Added.

(WebKit::transcodeImage):
(WebKit::findImagesForTranscoding):
(WebKit::transcodeImages):
Implement a function that transcodes images among a set of files given
the allowedMIMETypes. The destination MIME type of these images is the
first MIME type in the allowedMIMETypes which CG supports encoding to.

  • Shared/cg/ShareableBitmapCG.cpp:

(WebKit::ShareableBitmap::paint):
Call drawNativeImage() after renaming paintImage() to drawNativeImage().

  • SourcesCocoa.txt:
  • UIProcess/API/C/WKOpenPanelParametersRef.cpp:

(WKOpenPanelParametersCopyAllowedMIMETypes):

  • UIProcess/API/C/WKOpenPanelParametersRef.h:
  • UIProcess/API/C/WKOpenPanelResultListener.cpp:

(WKOpenPanelResultListenerChooseFiles):

  • UIProcess/API/C/WKOpenPanelResultListener.h:

Transfer the list of the allowed MIME types from the OpenPanel to the
file chooser listener.

  • UIProcess/WebPageProxy.cpp:

(WebKit::m_transcodingQueue):
(WebKit::WebPageProxy::didChooseFilesForOpenPanelWithImageTranscoding):
Transcode the images in a work queue so the UI process is not blocked.
Once the transcoding finishes, the message will be sent to the WebPage.

(WebKit::WebPageProxy::didChooseFilesForOpenPanel):

  • UIProcess/WebPageProxy.h:
  • WebKit.xcodeproj/project.pbxproj:

Source/WTF:

Allow a suffix to be included in the temporary file name. The goal is to
make it possible to create temporary image files with valid extensions.

  • wtf/FileSystem.h:

(WTF::FileSystemImpl::openTemporaryFile):

  • wtf/cocoa/FileSystemCocoa.mm:

(WTF::FileSystemImpl::openTemporaryFile):

  • wtf/glib/FileSystemGlib.cpp:

(WTF::FileSystemImpl::openTemporaryFile):

  • wtf/posix/FileSystemPOSIX.cpp:

(WTF::FileSystemImpl::openTemporaryFile):

  • wtf/win/FileSystemWin.cpp:

(WTF::FileSystemImpl::openTemporaryFile):

Tools:

  • WebKitTestRunner/TestController.cpp:

(WTR::runOpenPanel):

LayoutTests:

Ensure the HEIF image is converted to an accepted MIME type when it is
selected from the OpenPanel and the 'accept' attribute of the <input>
does allow the HEIF MIME type.

No need to test this functionality on WK1 since the image transcoding
should happen in the UI process.

  • TestExpectations:
  • fast/forms/file/entries-api/image-no-transcode-open-panel-expected.txt: Added.
  • fast/forms/file/entries-api/image-no-transcode-open-panel.html: Added.
  • fast/forms/file/entries-api/image-transcode-open-panel-expected.txt: Added.
  • fast/forms/file/entries-api/image-transcode-open-panel.html: Added.
  • fast/forms/file/entries-api/resources/images/green-400x400.heic: Added.
  • platform/mac-wk2/TestExpectations:
1:13 PM Changeset in webkit [264285] by ysuzuki@apple.com
  • 4 edits in trunk/Source/JavaScriptCore

[JSC] Avoid JSString creation in Intl.Locale#{minimize,maximize}
https://bugs.webkit.org/show_bug.cgi?id=214231

Reviewed by Darin Adler.

Add initializeLocale function taking String to avoid unnecessary JSString creation
in Intl.Locale#{maximize,minimize}.

  • runtime/IntlLocale.cpp:

(JSC::IntlLocale::initializeLocale):

  • runtime/IntlLocale.h:
  • runtime/IntlLocalePrototype.cpp:

(JSC::IntlLocalePrototypeFuncMaximize):
(JSC::IntlLocalePrototypeFuncMinimize):

12:46 PM Changeset in webkit [264284] by weinig@apple.com
  • 10 edits in trunk/Source/WebCore

Tidy up color usage in accessibility code
https://bugs.webkit.org/show_bug.cgi?id=214226

Reviewed by Darin Adler.

Rather than passing around r, g, b components as out-parameters,
use SRGBA<uint8_t> return values.

  • accessibility/AccessibilityNodeObject.cpp:

(WebCore::AccessibilityNodeObject::colorValue const):

  • accessibility/AccessibilityNodeObject.h:
  • accessibility/AccessibilityObject.h:
  • accessibility/AccessibilityObjectInterface.h:
  • accessibility/atk/WebKitAccessibleInterfaceText.cpp:

(webkitAccessibleTextGetText):

  • accessibility/isolatedtree/AXIsolatedObject.cpp:

(WebCore::AXIsolatedObject::initializeAttributeData):
(WebCore::AXIsolatedObject::colorValue const):

  • accessibility/isolatedtree/AXIsolatedObject.h:
  • accessibility/mac/WebAccessibilityObjectWrapperMac.mm:

(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):

11:53 AM Changeset in webkit [264283] by Darin Adler
  • 6 edits in trunk/Source/WebKit

REGRESSION (r261152): 9 blocks of critical sandboxing code disabled because they are guarded with HAVE(SANDBOX_ISSUE_READ_EXTENSION_TO_PROCESS_BY_AUDIT_TOKEN)
https://bugs.webkit.org/show_bug.cgi?id=214233

Reviewed by Per Arne Vollan.

  • NetworkProcess/NetworkResourceLoadParameters.cpp:

(WebKit::NetworkResourceLoadParameters::encode const): Remove #if HAVE.

  • UIProcess/Cocoa/WebPageProxyCocoa.mm:

(WebKit::WebPageProxy::createSandboxExtensionsIfNeeded): Ditto.

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle): Ditto.
(WebKit::WebPageProxy::loadRequestWithNavigationShared): Ditto.
(WebKit::WebPageProxy::loadFile): Ditto.

  • UIProcess/WebProcessProxy.cpp:

(WebKit::WebProcessProxy::shouldSendPendingMessage): Ditto.

  • WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:

(WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote::load): Ditto.

11:47 AM Changeset in webkit [264282] by commit-queue@webkit.org
  • 6 edits in trunk

Improve IPv6 detection when setting host/hostname
https://bugs.webkit.org/show_bug.cgi?id=214218

Patch by Rob Buis <rbuis@igalia.com> on 2020-07-12
Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Update improved test result.

  • web-platform-tests/url/url-setters-expected.txt:

Source/WebCore:

Improve IPv6 detection when setting host/hostname by checking for 'and' as
well as using reverse find for ':' separators, to ensure we are not finding a
separator within the IPv6 section of the url.

Behavior matches Chrome and Firefox.

Test: imported/w3c/web-platform-tests/url/url-setters.html

  • html/URLDecomposition.cpp:

(WebCore::URLDecomposition::setHost):

Source/WTF:

  • wtf/URL.cpp:

(WTF::URL::setHost): do not bail out if ':' was found but we start
with a '[', since the host may be IPv6.
(WTF::URL::setHostAndPort): multiple colons are acceptable only in case of IPv6.

11:08 AM Changeset in webkit [264281] by Alan Bujtas
  • 4 edits
    2 adds in trunk

[LFC][BFC][Min-Max width] Regular block level box resets the horizontal stacking
https://bugs.webkit.org/show_bug.cgi?id=214225

Reviewed by Antti Koivisto.

Source/WebCore:

Non-floating block level boxes reset the current horizontal float stacking.
e.g. with a shrink-to-fit width container:
<div style="float: left; width: 10px;"></div>
<div></div>
<div style="float: left; width: 40px;"></div>
will produce a max width of 40px which makes the floats vertically stacked.

Test: fast/layoutformattingcontext/min-max-content-width-with-nested-floats-simple.html

  • layout/blockformatting/BlockFormattingContext.cpp:

(WebCore::Layout::BlockFormattingContext::computedIntrinsicWidthConstraints):

  • layout/blockformatting/BlockFormattingContextGeometry.cpp:

(WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):

LayoutTests:

  • fast/layoutformattingcontext/min-max-content-width-with-nested-floats-simple-expected.html: Added.
  • fast/layoutformattingcontext/min-max-content-width-with-nested-floats-simple.html: Added.
10:28 AM Changeset in webkit [264280] by Darin Adler
  • 30 edits in trunk/Source/WebCore

Simplify and improve Gradient, some other small color-related removals
https://bugs.webkit.org/show_bug.cgi?id=214221

Reviewed by Sam Weinig.

  • css/CSSGradientValue.cpp: Removed some unneeded includes.
  • html/ColorInputType.cpp:

(WebCore::ColorInputType::currentColor): Deleted.
(WebCore::ColorInputType::shouldShowSuggestions const): Deleted.

  • html/ColorInputType.h: Updated for the above.
  • html/HTMLDocument.cpp: Removed unneeded include of HashTools.h.
  • html/canvas/CanvasGradient.cpp:

(WebCore::CanvasGradient::create): Moved these functions out of the
header since inlining should be the same or better with them here.
(WebCore::CanvasGradient::~CanvasGradient): Moved this out of the
header so we don't need to include Gradient.h in the header.
(WebCore::CanvasGradient::addColorStop): Updated for change to
Gradient::addColorStop and move Color rather than copying it.

  • html/canvas/CanvasGradient.h: Removed include of Gradient.h.

Moved things out of the header to make that work.

  • inspector/InspectorCanvas.cpp:

(WebCore::InspectorCanvas::buildArrayForCanvasGradient): Removed
use of Gradient::type and instead unify the type string code with
the code that interprets the data for the different types.

  • page/FrameView.cpp:

(WebCore::FrameView::recalculateScrollbarOverlayStyle): Refactored
to eliminate the multiple redundant code paths, otherwising leaving
the logic unchanged.

  • platform/ColorChooserClient.h: Remove unneeded includes and unused

currentColor and shouldShowSuggestions functions.

  • platform/graphics/Gradient.cpp:

(WebCore::Gradient::create): Replaced create functions that take
type-specific data structure with one that takes the variant Data.
(WebCore::Gradient::Gradient): Ditto. Also removed platformInit.
(WebCore::Gradient::~Gradient): Removed platformDestroy.
(WebCore::Gradient::type const): Deleted.
(WebCore::Gradient::addColorStop): Take an rvalue reference to cut down
a little bit on reference count churn. Replaced the platformDestroy
function with a new stopsChanged function. Removed an unneeded overload
that takes the two parts of a ColorStop separately.
(WebCore::Gradient::setSortedColorStops): Use stopsChanged.
(WebCore::Gradient::sortStops const): Simplify a bit, using a lambda.
Also gave this a shorter name; it still optimizes by not sorting if
the vector is already sorted.
(WebCore::Gradient::hasAlpha const): Deleted.
(WebCore::Gradient::setSpreadMethod): Removed some slightly overzealous
code checking this isn't used after creating the platform-specific gradient.
Decided not to bother with this for now.
(WebCore::Gradient::setGradientSpaceTransform): Tweaked formatting.
(WebCore::add): Added overloads to add(Hasher&) so we can use computeHash.
(WebCore::Gradient::hash const): Use computeHash instead of hashMemory.

  • platform/graphics/Gradient.h: Use RetainPtr, COMPtr, and RefPtr instead

of manually managing the lifetimes of the platform-specific underlying
gradient objects. Also removed the unhelpful PlatformGradient type. This
pattern, all too common in our platform library, provides no useful
abstraction here. Removed unneeded constructors from ColorStop.
Updated for changes above. Added platform-specific functions createBrush,
createPattern, and createCGGradient. Simplify encoding and decoding by
taking advantage of the support for encoding/decoding variants.
Remove the enum Gradient::Type entirely. Removed the invalidateHash
function because it's only used in a few setters and setting the hash
to 0 is a fine way to write it there.

  • platform/graphics/GraphicsContext.cpp:

(WebCore::GraphicsContextState::GraphicsContextState): Moved here from
the header so we don't need to include Gradient.h in the header.
(WebCore::GraphicsContextState::~GraphicsContextState): Ditto.
(WebCore::GraphicsContextState::operator=): Ditto.

  • platform/graphics/GraphicsContext.h: Removed include of Gradient.h.

Moved things out of the header to make that work.

  • platform/graphics/cairo/CairoOperations.cpp:

(WebCore::Cairo::FillSource::FillSource): Use createPattern instead of
createPlatformGradient.
(WebCore::Cairo::StrokeSource::StrokeSource): Ditto.

  • platform/graphics/cairo/GradientCairo.cpp:

(WebCore::Gradient::stopsChanged): Renamed from platformDestroy.
(WebCore::interpolateColorStop): Rewrote to use existing blend functions.
(WebCore::createConic): Changed return type to RefPtr. Tweaked to match
WebKit coding style a bit better, use auto, use Vector::first/last, and
updated for removal of the Gradient::ColorStop constructor.
(WebCore::Gradient::createPattern): Renamed from createPlatformGradient.
Changed to return a RefPtr instead of a raw pointer the caller needs to
adopt at each call site. Refactored so it no longer uses Gradient::type.
(WebCore::Gradient::fill): Use createPattern.

  • platform/graphics/cairo/GraphicsContextImplCairo.cpp:

(WebCore::GraphicsContextImplCairo::fillRect): Ditto.

  • platform/graphics/cg/GradientCG.cpp:

(WebCore::Gradient::stopsChanged): Renamed from platformDestroy, and
simplified implementation now that we use RetainPtr.
(WebCore::Gradient::createCGGradient): Renamed from platformGradient,
got rid of the return value, and made it caller responsibility to only
call this when a gradeitn needs to be allocated.
(WebCore::Gradient::paint): Updated to use the above.

  • platform/graphics/cg/GraphicsContextCG.cpp: Add include of Gradient.h.
  • platform/graphics/displaylists/DisplayListItems.h:

Added include of Gradient.h since the function templates in this file
encode and decode gradients.

  • platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp:

(Nicosia::CairoOperationRecorder::fillRect): Use createPattern.

  • platform/graphics/win/Direct2DOperations.cpp:

(WebCore::Direct2D::FillSource::FillSource): Use createBrush
(WebCore::Direct2D::StrokeSource::StrokeSource): Ditto.

  • platform/graphics/win/GradientDirect2D.cpp:

(WebCore::Gradient::stopsChanged): Renamed from platformDestroy and
simplified implementation now that we use COMPtr.
(WebCore::Gradient::platformGradient): Deleted.
(WebCore::Gradient::createPlatformGradientIfNecessary): Deleted.
(WebCore::Gradient::createBrush): Renamed from generateGradient and
added a return value. Simplified now that we use COMPtr, optimized
the code a bit, and added some FIXME about mistakes I noticed.
(WebCore::Gradient::fill): Use createBrush and m_brush.

  • platform/graphics/win/GraphicsContextImplDirect2D.cpp:

(WebCore::GraphicsContextImplDirect2D::fillRect): Use createBrush.

  • platform/mac/ScrollAnimatorMac.mm: Added include of Gradient.h.
  • rendering/RenderThemeIOS.mm:

(WebCore::RenderThemeIOS::paintProgressBar): Updated for changes to
addColorStop. Also remove a lot of unnecessary conversion from float
to double and back to float.

  • rendering/svg/RenderSVGResourceGradient.cpp:

(WebCore::RenderSVGResourceGradient::addStops): Update to make
and move a new color stop instead of copying it, modifying it in
place, and then copying it again.

  • rendering/svg/RenderSVGResourceGradient.cpp: Removed include of

Gradient.h.

  • svg/SVGGradientElement.cpp:

(WebCore::SVGGradientElement::buildStops): Use std::clamp to convert
the offsets into monotonically increasing ones in a more direct way,
using variable names instead of comments to clarify what we are doing.

4:25 AM Changeset in webkit [264279] by ysuzuki@apple.com
  • 2 edits in trunk/Source/WebCore

Unreviewed, fix GTK debian builds

Include <functional> in ExtendedColor.h since it uses std::invoke.

  • platform/graphics/ExtendedColor.h:
4:13 AM Changeset in webkit [264278] by ysuzuki@apple.com
  • 2 edits in trunk/Source/WebCore/PAL

Unreviewed, speculative build fix for internal build

Followed the style of WebKit/Platform/spi/ios/UIKitSPI.h. Using __has_include to
conditionally define LSDatabaseContext (WebKitChangeTracking) category.

  • pal/spi/cocoa/LaunchServicesSPI.h:
2:47 AM Changeset in webkit [264277] by ysuzuki@apple.com
  • 6 edits in trunk

Relanding "Make hasher work with tuple-like classes"
https://bugs.webkit.org/show_bug.cgi?id=214224

Reviewed by Darin Adler.

Source/WTF:

The original patch broke the internal build. And reverting patch (r264274) broke the build too.
This patch relands r264270 with constexpr => inline constexpr template variable fix.

  • wtf/Hasher.h:

(WTF::add):
(WTF::addTupleLikeHelper):
(WTF::TypeCheckHelper<decltype): Deleted.
(WTF::addTupleHelper): Deleted.
Add support for tuple-like classes. These are classes that:

  • Have defined specializations of std::tuple_size<> and std::tuple_element<>.
  • And have either a member function named get<> or there exists a function get<>() that takes the class as argument that can be looked up via ADL.

To avoid abiguity when hashing std::array, the add() overload enabled for containers
with a begin member functions also now checks that the container is not tuple-like.
The std::pair overload is no longer needed as it will use the tuple-like one now.

  • wtf/OptionSet.h:
  • wtf/StdLibExtras.h:

Move is_type_complete_v<> from OptionSet.h to StdLibExtras.h and rename to
adhere to WebKit style as IsTypeComplete<>.

Tools:

  • TestWebKitAPI/Tests/WTF/Hasher.cpp:

(TestWebKitAPI::get):
(TestWebKitAPI::HasherAddTupleLikeClass3::get const):
(TestWebKitAPI::TEST):
Update using new Color constructor for extended colors.

1:16 AM Changeset in webkit [264276] by ysuzuki@apple.com
  • 1 edit
    2 adds in trunk/Tools

Unreviewed, follow-up after r264210
https://bugs.webkit.org/show_bug.cgi?id=211707

Missing package.json and package-lock.json in the landed patch (while reviewed patch included them).

  • WebKitBot/package-lock.json: Added.
  • WebKitBot/package.json: Added.

Jul 11, 2020:

9:49 PM Changeset in webkit [264275] by ysuzuki@apple.com
  • 6 edits in trunk

Intl.Locale maximize, minimize should return Intl.Locale instead of String
https://bugs.webkit.org/show_bug.cgi?id=214223
<rdar://problem/65413620>

Reviewed by Ross Kirsling.

JSTests:

  • stress/intl-locale.js:

(minimize.toString):
(shouldBe):

Source/JavaScriptCore:

Intl.Locale#{maximize,minimize} should return Intl.Locale object instead of generated locale string.

We also add some protection and use jsString instead of jsNontrivialString because it would be still
possible that ICU's locale recognition and our locale interpretation do not agree each other and ICU
failed to produce locale, and then the string becomes empty. Since this is a boundary between third-party
library and JSC, and we are not ensuring our invariant inside third-party library, taking safer path makes
it better.

We also change IntlLocale#{maximize,minimize} C++ function names to maximal and minimal to align them
to the sepc's definitions.

  • runtime/IntlLocale.cpp:

(JSC::IntlLocale::maximal):
(JSC::IntlLocale::minimal):
(JSC::IntlLocale::maximize): Deleted.
(JSC::IntlLocale::minimize): Deleted.

  • runtime/IntlLocale.h:
  • runtime/IntlLocalePrototype.cpp:

(JSC::IntlLocalePrototypeFuncMaximize):
(JSC::IntlLocalePrototypeFuncMinimize):
(JSC::IntlLocalePrototypeFuncToString):
(JSC::IntlLocalePrototypeGetterBaseName):
(JSC::IntlLocalePrototypeGetterCalendar):
(JSC::IntlLocalePrototypeGetterCaseFirst):
(JSC::IntlLocalePrototypeGetterCollation):
(JSC::IntlLocalePrototypeGetterHourCycle):
(JSC::IntlLocalePrototypeGetterNumberingSystem):
(JSC::IntlLocalePrototypeGetterLanguage):
(JSC::IntlLocalePrototypeGetterScript):
(JSC::IntlLocalePrototypeGetterRegion):

9:39 PM Changeset in webkit [264274] by commit-queue@webkit.org
  • 6 edits in trunk

Unreviewed, reverting r264270.
https://bugs.webkit.org/show_bug.cgi?id=214228

Broke the build

Reverted changeset:

"Make hasher work with tuple-like classes"
https://bugs.webkit.org/show_bug.cgi?id=214224
https://trac.webkit.org/changeset/264270

7:51 PM Changeset in webkit [264273] by Fujii Hironori
  • 6 edits in trunk

[WinCairo] Conic gradients support
https://bugs.webkit.org/show_bug.cgi?id=214216

Reviewed by Sam Weinig.

.:

  • Source/cmake/OptionsWin.cmake: Turn ENABLE_CSS_CONIC_GRADIENTS on.

Source/WebCore:

  • platform/graphics/cairo/GradientCairo.cpp:

(WebCore::addConicSector): Replaced M_PI with piDouble of WTF.
(WebCore::Gradient::createPlatformGradient): Don't use C++20 designated initializers.

LayoutTests:

  • platform/wincairo/TestExpectations: Marked some conic-gradient tests Pass.
6:01 PM Changeset in webkit [264272] by weinig@apple.com
  • 16 edits
    1 delete in trunk

Reduce surface area of the ExtendedColor class to a bare minimum
https://bugs.webkit.org/show_bug.cgi?id=214204

Reviewed by Darin Adler.

Source/WebCore:

  • Add helper function to Color to operate on the underlying color type and reimplement a bunch of functionality using it, reducing the need for duplicate implementations in ExtendedColor.
  • Add constructors to Color that take extended color types, replacing the makeExtendedColor helper function.
  • Sources.txt:
  • WebCore.xcodeproj/project.pbxproj:

Remove ExtenedColor.cpp

  • css/parser/CSSPropertyParserHelpers.cpp:

(WebCore::CSSPropertyParserHelpers::parseColorFunctionParameters):
Use new Color constructor taking ColorComponents and ColorSpace.

  • platform/graphics/Color.cpp:

(WebCore::Color::colorWithAlpha const): Reimpliment using callOnUnderlyingType.
(WebCore::Color::invertedColorWithAlpha const): Reimpliment using callOnUnderlyingType.

  • platform/graphics/Color.h:

(WebCore::Color::Color):
(WebCore::Color::hash const):
(WebCore::Color::callOnUnderlyingType const):
(WebCore::Color::toSRGBALossy const):
(WebCore::Color::setColor):
(WebCore::Color::isBlackColor):
(WebCore::Color::isWhiteColor):

  • Add new constructors taking extended color types: SRGBA<float>, LinearSRGBA<float> and DiplayP3<float>.
  • Add new function, callOnUnderlyingType, to make working with any underlying type more streamlined.
  • platform/graphics/ColorConversion.h:

(WebCore::toSRGBA):
(WebCore::toLinearSRGBA):
(WebCore::toDisplayP3):
(WebCore::toLinearDisplayP3):
(WebCore::toHSLA):
Add identity conversion functions to make implementing generic functions like Color::toSRGBALossy more
straigtforward.

  • platform/graphics/ColorSerialization.cpp:

(WebCore::serialization):
(WebCore::serializationForCSS):
(WebCore::serializationForHTML):
(WebCore::serializationForRenderTreeAsText):

  • platform/graphics/ColorSerialization.h:

Replace serialization of the ExtendedColor type itself, with serialization for the underlying color
types. Use callOnUnderlyingType to dispatch to the right one.

  • platform/graphics/ColorTypes.h:
  • Adds ComponentTraits struct to get information like min/max value of the component types.
  • Adds using ComponentType = T; to each color type, to allow easy access to the type in deduced contexts.
  • Adds static constexpr ColorSpace to each color type that currently has a ColorSpace mapping.
  • platform/graphics/ColorUtilities.h:

(WebCore::isBlack):
(WebCore::isWhite):
Add helpers to implement Color::isBlack/Color::isWhiteColor for each color type.

  • platform/graphics/ExtendedColor.cpp: Removed.
  • platform/graphics/ExtendedColor.h:

(WebCore::ExtendedColor::create):
(WebCore::ExtendedColor::ExtendedColor):
(WebCore::ExtendedColor::callOnUnderlyingType const):
(WebCore::ExtendedColor::toSRGBALossy const): Deleted.
Reduce down to just construction, member access and the callOnUnderlyingType helper.
In future revisions, ExtendedColor should be converted to an internal class of Color.

  • platform/graphics/gtk/ColorGtk.cpp:

(WebCore::Color::Color):

  • platform/graphics/win/ColorDirect2D.cpp:

(WebCore::Color::Color):
Update to use constructor delegation.

Tools:

  • TestWebKitAPI/Tests/WebCore/ExtendedColorTests.cpp:

(TestWebKitAPI::TEST):
(TestWebKitAPI::makeColor):
Update using new Color constructor for extended colors.

3:38 PM Changeset in webkit [264271] by Darin Adler
  • 21 edits in trunk/Source

Remove live ranges from AccessibilityObject.h, AccessibilityObjectInterface.h, AccessibilityRenderObject.h, AXIsolatedObject.h
https://bugs.webkit.org/show_bug.cgi?id=214215

Reviewed by Sam Weinig.

Source/WebCore:

Also use the IntPoint and LayoutPoint center() functions instead of rolling our own.

  • accessibility/AccessibilityObject.cpp:

(WebCore::AccessibilityObject::misspellingRange const): Return SimpleRange. Also
renamed from getMisspellingRange.
(WebCore::rangeClosestToRange): Take and return SimpleRange.
(WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const): Ditto.
(WebCore::AccessibilityObject::elementRange const): Return SimpleRange.
(WebCore::AccessibilityObject::findTextRange const): Take and return SimpleRange.
(WebCore::AccessibilityObject::findTextRanges const): Ditto.
(WebCore::AccessibilityObject::performTextOperation): Use SimpleRange.
(WebCore::AccessibilityObject::clickPoint): Use center().
(WebCore::AccessibilityObject::rangeForPlainTextRange const): Return SimpleRange.
(WebCore::AccessibilityObject::stringForRange const): Take SimpleRange.
(WebCore::AccessibilityObject::stringForVisiblePositionRange): Use SimpleRange.
(WebCore::AccessibilityObject::lengthForVisiblePositionRange const): Ditto.
(WebCore::AccessibilityObject::replaceTextInRange): Use SimpleRange.

  • accessibility/AccessibilityObject.h: Update for above.
  • accessibility/AccessibilityObjectInterface.h: Take and return SimpleRange.
  • accessibility/AccessibilityRenderObject.cpp:

(WebCore::AccessibilityRenderObject::linkClickPoint): Use SimpleRange.
(WebCore::AccessibilityRenderObject::clickPoint): Ditto.
(WebCore::AccessibilityRenderObject::setSelectedTextRange): Ditto.
(WebCore::AccessibilityRenderObject::boundsForRange const): Take SimpleRange.
(WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange const):
Use SimpleRange.
(WebCore::AccessibilityRenderObject::doAXBoundsForRangeUsingCharacterOffset const):
Use SimpleRange.

  • accessibility/AccessibilityRenderObject.h: Update for above.
  • accessibility/atk/WebKitAccessibleInterfaceText.cpp: Include Range.h.
  • accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:

(-[WebAccessibilityObjectWrapper stringForTextMarkers:]): Use SimpleRange.
(-[WebAccessibilityObjectWrapper textMarkerRange]): Ditto.
(-[WebAccessibilityObjectWrapper stringForRange:]): Ditto.
(-[WebAccessibilityObjectWrapper misspellingTextMarkerRange:forward:]): Ditto.
(-[WebAccessibilityObjectWrapper frameForTextMarkers:]): Ditto.

  • accessibility/isolatedtree/AXIsolatedObject.cpp:

(WebCore::AXIsolatedObject::stringForRange const): Take SimpleRange.
(WebCore::AXIsolatedObject::findTextRanges const): Return SimpleRange.

  • accessibility/isolatedtree/AXIsolatedObject.h: Update for above.
  • accessibility/mac/WebAccessibilityObjectWrapperMac.mm:

(accessibilityTextOperationForParameterizedAttribute): Use SimpleRange.
(-[WebAccessibilityObjectWrapper doAXAttributedStringForRange:]): Ditto.
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]): Ditto.

  • dom/Range.cpp:

(WebCore::makeSimpleRange): Added.

  • dom/Range.h: Added makeSimpleRange so we can explicitly convert from

live ranges to simple ranges.

  • editing/Editing.cpp:

(WebCore::indexForVisiblePosition): Use separate returns for start and end.

  • editing/TextCheckingHelper.cpp:

(WebCore::TextCheckingParagraph::offsetTo const): Ditto.
(WebCore::TextCheckingParagraph::automaticReplacementStart const): Ditto.

  • page/FocusController.cpp:

(WebCore::updateFocusCandidateIfNeeded): Use center().

Source/WebKit:

  • WebProcess/WebPage/ios/WebPageIOS.mm:

(WebKit::WebPage::requestDocumentEditingContext): Use nested if for start and end
so we don't do the work on end if the test fails on start.

Source/WTF:

  • wtf/cocoa/VectorCocoa.h: Added a new makeVector that takes a function.

Also updated createNSArray to use std::invoke.

3:12 PM Changeset in webkit [264270] by weinig@apple.com
  • 6 edits in trunk

Make hasher work with tuple-like classes
https://bugs.webkit.org/show_bug.cgi?id=214224

Reviewed by Darin Adler.

Source/WTF:

  • wtf/Hasher.h:

(WTF::add):
(WTF::addTupleLikeHelper):
(WTF::TypeCheckHelper<decltype): Deleted.
(WTF::addTupleHelper): Deleted.
Add support for tuple-like classes. These are classes that:

  • Have defined specializations of std::tuple_size<> and std::tuple_element<>.
  • And have either a member function named get<> or there exists a function get<>() that takes the class as argument that can be looked up via ADL.

To avoid abiguity when hashing std::array, the add() overload enabled for containers
with a begin member functions also now checks that the container is not tuple-like.
The std::pair overload is no longer needed as it will use the tuple-like one now.

  • wtf/OptionSet.h:
  • wtf/StdLibExtras.h:

Move is_type_complete_v<> from OptionSet.h to StdLibExtras.h and rename to
adhere to WebKit style as IsTypeComplete<>.

Tools:

  • TestWebKitAPI/Tests/WTF/Hasher.cpp:

Enable and extend tests for using computeHash() with user defined tuple-like classes, supporting
both the get function as a member and as a ADL-able free function.

10:55 AM Changeset in webkit [264269] by Simon Fraser
  • 7 edits
    2 adds in trunk

REGRESSION(r260276): Overflow scrolling layers misplaced inside SVG foreign object
https://bugs.webkit.org/show_bug.cgi?id=213788
<rdar://problem/65039637>

Reviewed by Zalan Bujtas.
Source/WebCore:

RenderLayers inside SVG <foreignObject> don't display correctly, so don't use
accelerated overflow scroll (which requires layers) inside <foreignObject>.

This reverts behavior to macOS Catalina behavior (i.e. as soon as the overflow
becomes scrollable, rendering problems appear), and to pre-iOS 13 behavior.

Test: fast/scrolling/overflow-inside-foreignobject.html

  • dom/Document.h:

(WebCore::Document::mayHaveRenderedSVGForeignObjects const):
(WebCore::Document::setMayHaveRenderedSVGForeignObjects):

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::RenderLayer):
(WebCore::RenderLayer::addChild):
(WebCore::RenderLayer::updateAncestorDependentState):
(WebCore::RenderLayer::canUseCompositedScrolling const):

  • rendering/RenderLayer.h:
  • rendering/svg/RenderSVGForeignObject.h:
  • svg/SVGForeignObjectElement.cpp:

(WebCore::SVGForeignObjectElement::createElementRenderer):

LayoutTests:

  • fast/scrolling/overflow-inside-foreignobject-expected.html: Added.
  • fast/scrolling/overflow-inside-foreignobject.html: Added.
10:21 AM Changeset in webkit [264268] by Chris Dumez
  • 2 edits in trunk/LayoutTests

Unreviewed, mark imported/w3c/web-platform-tests/websockets/cookies/third-party-cookie-accepted.https.html as crashing on iOS WK2 Debug.

This test has been crashing consistently since import in r264145.

  • platform/ios-wk2/TestExpectations:
8:45 AM Changeset in webkit [264267] by Alan Bujtas
  • 4 edits
    2 adds in trunk

[LFC][BFC][Min-Max width] Add support for float avoiders
https://bugs.webkit.org/show_bug.cgi?id=214220

Reviewed by Antti Koivisto.

Source/WebCore:

Test: fast/layoutformattingcontext/min-max-content-width-with-floats-simple.html

Float avoiders (including the float boxes) with infinite constraint form a horizontal float stack.
(This does not yet support clear property/non-direct children.)

  • layout/blockformatting/BlockFormattingContext.cpp:

(WebCore::Layout::BlockFormattingContext::computedIntrinsicWidthConstraints):

  • layout/blockformatting/BlockFormattingContextGeometry.cpp:

(WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):

LayoutTests:

  • fast/layoutformattingcontext/min-max-content-width-with-floats-simple-expected.html: Added.
  • fast/layoutformattingcontext/min-max-content-width-with-floats-simple.html: Added.
Note: See TracTimeline for information about the timeline view.