[webkit-changes] [295722] trunk/Source/WebCore/rendering/svg/SVGResourcesCache.cpp

2022-06-21 Thread heycam
Title: [295722] trunk/Source/WebCore/rendering/svg/SVGResourcesCache.cpp








Revision 295722
Author hey...@apple.com
Date 2022-06-21 22:58:16 -0700 (Tue, 21 Jun 2022)


Log Message
Eliminate one repaint from SVGResourcesCache::clientLayoutChanged
https://bugs.webkit.org/show_bug.cgi?id=241822

Reviewed by Simon Fraser.

SVGResourcesCache::clientLayoutChanged is called under all of the SVG
render object layout functions, to invalidate the SVG resource and
repaint the element. But all of the layout functions will already
repaint the element due to their LayoutRepainter on the stack.

This repaint can be expensive due to the rectangle calculations. We can
skip it by passing false into clientLayoutChanged.

This is an improvement of 3% on the MotionMark Suits sub-test on some
devices.

* Source/WebCore/rendering/svg/SVGResourcesCache.cpp:
(WebCore::SVGResourcesCache::clientLayoutChanged):

Canonical link: https://commits.webkit.org/251727@main

Modified Paths

trunk/Source/WebCore/rendering/svg/SVGResourcesCache.cpp




Diff

Modified: trunk/Source/WebCore/rendering/svg/SVGResourcesCache.cpp (295721 => 295722)

--- trunk/Source/WebCore/rendering/svg/SVGResourcesCache.cpp	2022-06-22 04:11:35 UTC (rev 295721)
+++ trunk/Source/WebCore/rendering/svg/SVGResourcesCache.cpp	2022-06-22 05:58:16 UTC (rev 295722)
@@ -88,7 +88,7 @@
 // Invalidate the resources if either the RenderElement itself changed,
 // or we have filter resources, which could depend on the layout of children.
 if (renderer.selfNeedsLayout())
-resources->removeClientFromCache(renderer);
+resources->removeClientFromCache(renderer, false);
 }
 
 static inline bool rendererCanHaveResources(RenderObject& renderer)






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [295706] trunk/Source/WebCore/platform/graphics/DecomposedGlyphs.cpp

2022-06-21 Thread heycam
Title: [295706] trunk/Source/WebCore/platform/graphics/DecomposedGlyphs.cpp








Revision 295706
Author hey...@apple.com
Date 2022-06-21 17:39:46 -0700 (Tue, 21 Jun 2022)


Log Message
DecomposedGlyphs should notify observers in destructor
https://bugs.webkit.org/show_bug.cgi?id=241752

Reviewed by Simon Fraser.

Currently old DecomposedGlyphs objects will hang around in the GPU process until
the document goes away, instead of (as is intended) when the display list they
are in is removed from the GlyphDisplayListCache.

* Source/WebCore/platform/graphics/DecomposedGlyphs.cpp:
(WebCore::DecomposedGlyphs::~DecomposedGlyphs):

Canonical link: https://commits.webkit.org/251711@main

Modified Paths

trunk/Source/WebCore/platform/graphics/DecomposedGlyphs.cpp




Diff

Modified: trunk/Source/WebCore/platform/graphics/DecomposedGlyphs.cpp (295705 => 295706)

--- trunk/Source/WebCore/platform/graphics/DecomposedGlyphs.cpp	2022-06-22 00:17:21 UTC (rev 295705)
+++ trunk/Source/WebCore/platform/graphics/DecomposedGlyphs.cpp	2022-06-22 00:39:46 UTC (rev 295706)
@@ -28,8 +28,6 @@
 
 namespace WebCore {
 
-DecomposedGlyphs::~DecomposedGlyphs() = default;
-
 Ref DecomposedGlyphs::create(const Font& font, const GlyphBufferGlyph* glyphs, const GlyphBufferAdvance* advances, unsigned count, const FloatPoint& localAnchor, FontSmoothingMode mode, RenderingResourceIdentifier renderingResourceIdentifier)
 {
 return adoptRef(*new DecomposedGlyphs(font, glyphs, advances, count, localAnchor, mode, renderingResourceIdentifier));
@@ -55,4 +53,10 @@
 ASSERT(m_positionedGlyphs.glyphs.size() == m_positionedGlyphs.advances.size());
 }
 
+DecomposedGlyphs::~DecomposedGlyphs()
+{
+for (auto observer : m_observers)
+observer->releaseDecomposedGlyphs(m_renderingResourceIdentifier);
+}
+
 } // namespace WebCore






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [295667] trunk/Source/WebCore

2022-06-19 Thread heycam
Title: [295667] trunk/Source/WebCore








Revision 295667
Author hey...@apple.com
Date 2022-06-19 21:27:35 -0700 (Sun, 19 Jun 2022)


Log Message
Add debug output support for WebCore::Gradient
https://bugs.webkit.org/show_bug.cgi?id=241767

Reviewed by Sam Weinig.

* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/platform/graphics/ColorInterpolationMethod.cpp: Added.
(WebCore::operator<<):
* Source/WebCore/platform/graphics/ColorInterpolationMethod.h:
* Source/WebCore/platform/graphics/Gradient.cpp:
(WebCore::operator<<):
* Source/WebCore/platform/graphics/Gradient.h:
* Source/WebCore/platform/graphics/GradientColorStop.cpp: Copied from Source/WebCore/platform/graphics/GradientColorStop.h.
(WebCore::operator<<):
* Source/WebCore/platform/graphics/GradientColorStop.h:
* Source/WebCore/platform/graphics/GradientColorStops.cpp: Copied from Source/WebCore/platform/graphics/GradientColorStop.h.
(WebCore::operator<<):
* Source/WebCore/platform/graphics/GradientColorStops.h:
* Source/WebCore/platform/graphics/GraphicsTypes.cpp:
(WebCore::operator<<):
* Source/WebCore/platform/graphics/GraphicsTypes.h:

Canonical link: https://commits.webkit.org/251672@main

Modified Paths

trunk/Source/WebCore/Sources.txt
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
trunk/Source/WebCore/platform/graphics/ColorInterpolationMethod.h
trunk/Source/WebCore/platform/graphics/Gradient.cpp
trunk/Source/WebCore/platform/graphics/Gradient.h
trunk/Source/WebCore/platform/graphics/GradientColorStop.h
trunk/Source/WebCore/platform/graphics/GradientColorStops.h
trunk/Source/WebCore/platform/graphics/GraphicsTypes.cpp
trunk/Source/WebCore/platform/graphics/GraphicsTypes.h
trunk/Source/WebCore/platform/graphics/SourceBrush.cpp


Added Paths

trunk/Source/WebCore/platform/graphics/ColorInterpolationMethod.cpp
trunk/Source/WebCore/platform/graphics/GradientColorStop.cpp
trunk/Source/WebCore/platform/graphics/GradientColorStops.cpp




Diff

Modified: trunk/Source/WebCore/Sources.txt (295666 => 295667)

--- trunk/Source/WebCore/Sources.txt	2022-06-20 04:25:46 UTC (rev 295666)
+++ trunk/Source/WebCore/Sources.txt	2022-06-20 04:27:35 UTC (rev 295667)
@@ -2023,6 +2023,7 @@
 platform/graphics/ColorBlending.cpp
 platform/graphics/ColorConversion.cpp
 platform/graphics/ColorInterpolation.cpp
+platform/graphics/ColorInterpolationMethod.cpp
 platform/graphics/ColorLuminance.cpp
 platform/graphics/ColorSerialization.cpp
 platform/graphics/ColorSpace.cpp
@@ -2060,6 +2061,8 @@
 platform/graphics/GeneratedImage.cpp
 platform/graphics/GeometryUtilities.cpp
 platform/graphics/Gradient.cpp
+platform/graphics/GradientColorStop.cpp
+platform/graphics/GradientColorStops.cpp
 platform/graphics/GradientImage.cpp
 platform/graphics/GraphicsContext.cpp
 platform/graphics/GraphicsContextGL.cpp


Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (295666 => 295667)

--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2022-06-20 04:25:46 UTC (rev 295666)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2022-06-20 04:27:35 UTC (rev 295667)
@@ -8509,6 +8509,9 @@
 		32A70D552836138D0080060C /* PositionedGlyphs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PositionedGlyphs.cpp; sourceTree = ""; };
 		32A70D562836138D0080060C /* PositionedGlyphs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PositionedGlyphs.h; sourceTree = ""; };
 		32B0B0CF283C7483006217C6 /* GlyphDisplayListCache.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = GlyphDisplayListCache.cpp; sourceTree = ""; };
+		32B17614285FDDA100ED6DB8 /* GradientColorStop.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = GradientColorStop.cpp; sourceTree = ""; };
+		32B17615285FDDA100ED6DB8 /* GradientColorStops.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = GradientColorStops.cpp; sourceTree = ""; };
+		32E268FC285FC8F7004660BB /* ColorInterpolationMethod.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ColorInterpolationMethod.cpp; sourceTree = ""; };
 		331FF67DE197B57393C46A7F /* RenderMathMLPadded.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMathMLPadded.h; sourceTree = ""; };
 		331FF67DE197B57393C46AA7 /* RenderMathMLSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMathMLSpace.h; sourceTree = ""; };
 		333F704E0FB49CA2008E12A6 /* Notification.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Notification.idl; sourceTree = ""; };
@@ -29199,6 +29202,7 @@
 3103B7DE1DB01556008BB890 /* ColorHash.h */,
 BCDC642427517B040038FB39 /* ColorInterpolation.cpp */,
 BCDC642527517B040038FB39 /* ColorInterpolation.h */,
+

[webkit-changes] [295664] trunk/Source/WebCore/platform/graphics/ContentTypeUtilities.cpp

2022-06-19 Thread heycam
Title: [295664] trunk/Source/WebCore/platform/graphics/ContentTypeUtilities.cpp








Revision 295664
Author hey...@apple.com
Date 2022-06-19 20:28:45 -0700 (Sun, 19 Jun 2022)


Log Message
Fix includes in ContentTypeUtilities.cpp
https://bugs.webkit.org/show_bug.cgi?id=241764

Reviewed by Sam Weinig.

They should be outside the namespace.

* Source/WebCore/platform/graphics/ContentTypeUtilities.cpp:

Canonical link: https://commits.webkit.org/251669@main

Modified Paths

trunk/Source/WebCore/platform/graphics/ContentTypeUtilities.cpp




Diff

Modified: trunk/Source/WebCore/platform/graphics/ContentTypeUtilities.cpp (295663 => 295664)

--- trunk/Source/WebCore/platform/graphics/ContentTypeUtilities.cpp	2022-06-20 01:46:52 UTC (rev 295663)
+++ trunk/Source/WebCore/platform/graphics/ContentTypeUtilities.cpp	2022-06-20 03:28:45 UTC (rev 295664)
@@ -26,11 +26,11 @@
 #include "config.h"
 #include "ContentTypeUtilities.h"
 
-namespace WebCore {
-
 #include "FourCC.h"
 #include 
 
+namespace WebCore {
+
 bool contentTypeMeetsContainerAndCodecTypeRequirements(const ContentType& type, const std::optional>& allowedMediaContainerTypes, const std::optional>& allowedMediaCodecTypes)
 {
 if (allowedMediaContainerTypes && !allowedMediaContainerTypes->contains(type.containerType()))






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [295663] trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

2022-06-19 Thread heycam
Title: [295663] trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj








Revision 295663
Author hey...@apple.com
Date 2022-06-19 18:46:52 -0700 (Sun, 19 Jun 2022)


Log Message
Sort WebCore Xcode project file
https://bugs.webkit.org/show_bug.cgi?id=241768

Reviewed by Tim Horton.

* Source/WebCore/WebCore.xcodeproj/project.pbxproj:

Canonical link: https://commits.webkit.org/251668@main

Modified Paths

trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj




Diff

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (295662 => 295663)

--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2022-06-19 18:26:48 UTC (rev 295662)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2022-06-20 01:46:52 UTC (rev 295663)
@@ -24765,8 +24765,6 @@
 		6FB7D2D5250FD7B5000207AA /* flex */ = {
 			isa = PBXGroup;
 			children = (
-6F047A9128453EDB00C25EE7 /* FlexLayout.h */,
-6F047A9028453ED200C25EE7 /* FlexLayout.cpp */,
 6FB17475283A8FF40067D8CA /* FlexFormattingConstraints.h */,
 6FB7D2D7250FD7E5000207AA /* FlexFormattingContext.cpp */,
 6FB7D2D9250FD7FC000207AA /* FlexFormattingContext.h */,
@@ -24774,6 +24772,8 @@
 6FF911F626487FC8002021DF /* FlexFormattingGeometry.h */,
 6FB7D2D8250FD7EF000207AA /* FlexFormattingState.cpp */,
 6FB7D2DA250FD7FC000207AA /* FlexFormattingState.h */,
+6F047A9028453ED200C25EE7 /* FlexLayout.cpp */,
+6F047A9128453EDB00C25EE7 /* FlexLayout.h */,
 6FB9105B2830BC8A4929 /* FlexRect.h */,
 			);
 			path = flex;
@@ -29456,6 +29456,8 @@
 B23540F00D00782E002382FA /* StringTruncator.cpp */,
 B23540F10D00782E002382FA /* StringTruncator.h */,
 087558C413B4A57D00F49307 /* SurrogatePairAwareTextIterator.h */,
+1C4C77DE284DA83900BD0936 /* SystemFontDatabase.cpp */,
+1C4C77DF284DA83900BD0936 /* SystemFontDatabase.h */,
 95E9F44427C9A39B00945337 /* SystemImage.h */,
 3BB6B80F22A7D311003A2A69 /* TabSize.h */,
 722AF2E327E1CF110078D997 /* TextBoxIterator.h */,
@@ -29485,8 +29487,6 @@
 501BAAA813950E2C00F7ACEB /* WindRule.h */,
 379919941200DDF400EA041C /* WOFFFileFormat.cpp */,
 379919951200DDF400EA041C /* WOFFFileFormat.h */,
-1C4C77DE284DA83900BD0936 /* SystemFontDatabase.cpp */,
-1C4C77DF284DA83900BD0936 /* SystemFontDatabase.h */,
 			);
 			path = graphics;
 			sourceTree = "";
@@ -29584,6 +29584,7 @@
 F48D2AA32159740D00C6752B /* ColorCocoa.h */,
 F48D2AA42159740D00C6752B /* ColorCocoa.mm */,
 B275354C0B053814002CE64F /* FloatRectCocoa.mm */,
+1C16B86C284D73EF00318FEC /* FontCacheCocoa.mm */,
 1C3969CF1B74211E002BCFA7 /* FontCacheCoreText.cpp */,
 C2458E611FE8979E00594759 /* FontCacheCoreText.h */,
 B2AFFC780D00A5C10030074D /* FontCascadeCocoa.cpp */,
@@ -29614,6 +29615,7 @@
 CDEB3D7324C41A6E001FBEEF /* SourceBufferParser.h */,
 CD8F667024C0F208000C421C /* SourceBufferParserWebM.cpp */,
 CD8F667224C0F208000C421C /* SourceBufferParserWebM.h */,
+1C16B86A284D6B8200318FEC /* SystemFontDatabaseCocoa.mm */,
 E4E8B4ED216B79F400B8834D /* SystemFontDatabaseCoreText.cpp */,
 E4E8B4EA216B79E500B8834D /* SystemFontDatabaseCoreText.h */,
 526724F21CB2FDF60075974D /* TextTrackRepresentationCocoa.h */,
@@ -29631,8 +29633,6 @@
 07F5CFF42582A4F800662EF5 /* WebMAudioUtilitiesCocoa.h */,
 07F5CFF22582A4F800662EF5 /* WebMAudioUtilitiesCocoa.mm */,
 7B1619102719880E00C40EAC /* WebProcessGraphicsContextGLCocoa.mm */,
-1C16B86C284D73EF00318FEC /* FontCacheCocoa.mm */,
-1C16B86A284D6B8200318FEC /* SystemFontDatabaseCocoa.mm */,
 			);
 			path = cocoa;
 			sourceTree = "";
@@ -34057,6 +34057,7 @@
 7A45033018DB717200377B34 /* BufferedLineReader.h in Headers */,
 2DFA488F1DB541D000362B99 /* BufferSource.h in Headers */,
 F55B3DB01251F12D003EF269 /* ButtonInputType.h in Headers */,
+72C11DAD2849425800E826DD /* ByteArrayPixelBuffer.h in Headers */,
 07C046C41E42508B007201E7 /* CAAudioStreamDescription.h in Headers */,
 6353E1E61F91743100A34208 /* CachedApplicationManifest.h in Headers */,
 BCB16C1A0979C3BD00467741 /* CachedCSSStyleSheet.h in Headers */,
@@ -34845,6 +34846,8 @@
 51F645621F45398F00B54DED /* ExceptionData.h in Headers */,
 2D29386B235F6B6900C7F3B2 /* ExceptionDetails.h in Headers */,
 93D196311D6CAB7600FC7E47 /* ExceptionOr.h in Headers */,
+41860F0E2847A58B00E4A395 /* ExtendableEvent.h in Headers */,
+41860F0F2847A5BE00E4A395 /* ExtendableEventInit.h in Headers */,
 837FB3451F9EA06D00D0FC31 /* ExtendableMessageEvent.h in Headers */,
 FE0BCF3527C0661000BFB2DB /* ExtendedDOMClientIsoSubspaces.h in Headers */,
 FE0BCF3427C0661000BFB2DB /* ExtendedDOMIsoSubspaces.h in Headers */,
@@ -34873,6 +34876,7 @@
 84730D891248F0B300D3A9C9 /* FESpecularLighting.h in Headers */,
 517A535B1F588A4C00DCDC0A /* FetchBodyConsumer.h in Headers */,
 4129C9971F59B963009D7403 /* FetchBodySource.h in Headers */,
+41860F0D2847A49600E4A395 /* FetchEvent.h in 

[webkit-changes] [295657] trunk/Source/WebCore/svg/properties/SVGAnimatedProperty.h

2022-06-17 Thread heycam
Title: [295657] trunk/Source/WebCore/svg/properties/SVGAnimatedProperty.h








Revision 295657
Author hey...@apple.com
Date 2022-06-17 22:54:10 -0700 (Fri, 17 Jun 2022)


Log Message
SVGAnimatedProperty::isAnimating need not compute number of animators
https://bugs.webkit.org/show_bug.cgi?id=241732

Reviewed by Tim Horton.

We just need to know if there are any.

* Source/WebCore/svg/properties/SVGAnimatedProperty.h:
(WebCore::SVGAnimatedProperty::isAnimating const):

Canonical link: https://commits.webkit.org/251662@main

Modified Paths

trunk/Source/WebCore/svg/properties/SVGAnimatedProperty.h




Diff

Modified: trunk/Source/WebCore/svg/properties/SVGAnimatedProperty.h (295656 => 295657)

--- trunk/Source/WebCore/svg/properties/SVGAnimatedProperty.h	2022-06-18 04:26:27 UTC (rev 295656)
+++ trunk/Source/WebCore/svg/properties/SVGAnimatedProperty.h	2022-06-18 05:54:10 UTC (rev 295657)
@@ -53,7 +53,7 @@
 virtual std::optional synchronize() { return std::nullopt; }
 
 // Control the animation life cycle.
-bool isAnimating() const { return m_animators.computeSize(); }
+bool isAnimating() const { return !m_animators.computesEmpty(); }
 virtual void startAnimation(SVGAttributeAnimator& animator) { m_animators.add(animator); }
 virtual void stopAnimation(SVGAttributeAnimator& animator) { m_animators.remove(animator); }
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [295539] trunk/Source/WebCore

2022-06-14 Thread heycam
Title: [295539] trunk/Source/WebCore








Revision 295539
Author hey...@apple.com
Date 2022-06-14 14:59:59 -0700 (Tue, 14 Jun 2022)


Log Message
Track SVG renderer updates using a NodeFlag instead of on Style::Update
https://bugs.webkit.org/show_bug.cgi?id=241489


Reviewed by Antti Koivisto.

SVG renderer updates are currently tracked as a kind of Style::Update change.
When a page is updating attributes on many SVG elements, but is not making
changes that require a restyle on those elements, we can spend a lot of time
hashing to store and look up the Style::Update associated with an element.

This patch moves the "SVG renderer update is needed" state to a Node flag
instead, but continues to use the Style::Update mechanism for root tracking,
to reduce this overhead.

This is a 1% improvement on the MotionMark Suits sub-test.

* Source/WebCore/rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateRenderTree):
(WebCore::RenderTreeUpdater::updateSVGRendererIfNeeded):
(WebCore::RenderTreeUpdater::updateElementRenderer):
* Source/WebCore/rendering/updating/RenderTreeUpdater.h:
* Source/WebCore/style/StyleUpdate.cpp:
(WebCore::Style::Update::addElement):
(WebCore::Style::Update::addSVGRendererUpdate):
* Source/WebCore/style/StyleUpdate.h:

Canonical link: https://commits.webkit.org/251544@main

Modified Paths

trunk/Source/WebCore/dom/Node.h
trunk/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp
trunk/Source/WebCore/rendering/updating/RenderTreeUpdater.h
trunk/Source/WebCore/style/StyleUpdate.cpp
trunk/Source/WebCore/style/StyleUpdate.h




Diff

Modified: trunk/Source/WebCore/dom/Node.h (295538 => 295539)

--- trunk/Source/WebCore/dom/Node.h	2022-06-14 21:46:28 UTC (rev 295538)
+++ trunk/Source/WebCore/dom/Node.h	2022-06-14 21:59:59 UTC (rev 295539)
@@ -235,6 +235,9 @@
 bool hasShadowRootContainingSlots() const { return hasNodeFlag(NodeFlag::HasShadowRootContainingSlots); }
 void setHasShadowRootContainingSlots(bool flag) { setNodeFlag(NodeFlag::HasShadowRootContainingSlots, flag); }
 
+bool needsSVGRendererUpdate() const { return hasNodeFlag(NodeFlag::NeedsSVGRendererUpdate); }
+void setNeedsSVGRendererUpdate(bool flag) { setNodeFlag(NodeFlag::NeedsSVGRendererUpdate, flag); }
+
 // If this node is in a shadow tree, returns its shadow host. Otherwise, returns null.
 WEBCORE_EXPORT Element* shadowHost() const;
 ShadowRoot* containingShadowRoot() const;
@@ -579,8 +582,9 @@
 IsComputedStyleInvalidFlag = 1 << 25,
 HasShadowRootContainingSlots = 1 << 26,
 IsInTopLayer = 1 << 27,
+NeedsSVGRendererUpdate = 1 << 28
 
-// Bits 28-31 are free.
+// Bits 29-31 are free.
 };
 
 enum class TabIndexState : uint8_t {


Modified: trunk/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp (295538 => 295539)

--- trunk/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp	2022-06-14 21:46:28 UTC (rev 295538)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp	2022-06-14 21:59:59 UTC (rev 295539)
@@ -173,11 +173,15 @@
 
 auto& element = downcast(node);
 
+bool needsSVGRendererUpdate = element.needsSVGRendererUpdate();
+if (needsSVGRendererUpdate)
+updateSVGRenderer(element);
+
 auto* elementUpdate = m_styleUpdate->elementUpdate(element);
 
 // We hop through display: contents elements in findRenderingRoot, so
 // there may be other updates down the tree.
-if (!elementUpdate && !element.hasDisplayContents()) {
+if (!elementUpdate && !element.hasDisplayContents() && !needsSVGRendererUpdate) {
 storePreviousRenderer(element);
 it.traverseNextSkippingChildren();
 continue;
@@ -294,11 +298,16 @@
 m_builder.normalizeTreeAfterStyleChange(renderer, oldStyle);
 }
 
-void RenderTreeUpdater::updateElementRenderer(Element& element, const Style::ElementUpdate& elementUpdate)
+void RenderTreeUpdater::updateSVGRenderer(Element& element)
 {
-if (elementUpdate.updateSVGRenderer && element.renderer())
+ASSERT(element.needsSVGRendererUpdate());
+element.setNeedsSVGRendererUpdate(false);
+if (element.renderer())
 RenderSVGResource::markForLayoutAndParentResourceInvalidation(*element.renderer());
+}
 
+void RenderTreeUpdater::updateElementRenderer(Element& element, const Style::ElementUpdate& elementUpdate)
+{
 if (!elementUpdate.style)
 return;
 


Modified: trunk/Source/WebCore/rendering/updating/RenderTreeUpdater.h (295538 => 295539)

--- trunk/Source/WebCore/rendering/updating/RenderTreeUpdater.h	2022-06-14 21:46:28 UTC (rev 295538)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeUpdater.h	2022-06-14 21:59:59 UTC (rev 295539)
@@ -59,6 +59,7 @@
 void updateTextRenderer(Text&, const Style::TextUpdate*);
 void createTextRenderer(Text&, const Style::TextUpdate*);
 void updateElementRenderer(Element&, const Style::ElementUpdate&);
+void 

[webkit-changes] [295516] trunk/Source/WebCore/platform/graphics/TextRun.h

2022-06-14 Thread heycam
Title: [295516] trunk/Source/WebCore/platform/graphics/TextRun.h








Revision 295516
Author hey...@apple.com
Date 2022-06-13 23:30:59 -0700 (Mon, 13 Jun 2022)


Log Message
Make TextRun::isolatedCopy copy character data in more cases
https://bugs.webkit.org/show_bug.cgi?id=241581

Reviewed by Simon Fraser.

* Source/WebCore/platform/graphics/TextRun.h:
(WebCore::TextRun::isolatedCopy const):

Canonical link: https://commits.webkit.org/251521@main

Modified Paths

trunk/Source/WebCore/platform/graphics/TextRun.h




Diff

Modified: trunk/Source/WebCore/platform/graphics/TextRun.h (295515 => 295516)

--- trunk/Source/WebCore/platform/graphics/TextRun.h	2022-06-14 04:46:20 UTC (rev 295515)
+++ trunk/Source/WebCore/platform/graphics/TextRun.h	2022-06-14 06:30:59 UTC (rev 295516)
@@ -184,8 +184,10 @@
 inline TextRun TextRun::isolatedCopy() const
 {
 TextRun clone = *this;
-if (m_text.impl() && m_text.impl()->isExternal())
-clone.m_text = m_text.isolatedCopy();
+if (clone.m_text.is8Bit())
+clone.m_text = String(clone.m_text.characters8(), clone.m_text.length());
+else
+clone.m_text = String(clone.m_text.characters16(), clone.m_text.length());
 return clone;
 }
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [294981] trunk/Source/WebCore

2022-05-27 Thread heycam
Title: [294981] trunk/Source/WebCore








Revision 294981
Author hey...@apple.com
Date 2022-05-27 20:37:10 -0700 (Fri, 27 May 2022)


Log Message
Fix sense of the display list AsTextFlags
https://bugs.webkit.org/show_bug.cgi?id=240939

Reviewed by Simon Fraser.

They do the opposite of what their names suggest.

* Source/WebCore/platform/graphics/displaylists/DisplayList.cpp:
(WebCore::DisplayList::DisplayList::shouldDumpForFlags):
(WebCore::DisplayList::DisplayList::dump const):
* Source/WebCore/platform/graphics/displaylists/DisplayListItemType.h:
* Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp:
(WebCore::DisplayList::dumpItem):
* Source/WebCore/platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::operator<<):
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::displayListForElement):
(WebCore::Internals::replayDisplayListForElement):
(WebCore::Internals::cachedGlyphDisplayListsForTextNode):
* Source/WebCore/testing/Internals.h:
* Source/WebCore/testing/Internals.idl:

Canonical link: https://commits.webkit.org/251085@main

Modified Paths

trunk/Source/WebCore/platform/graphics/displaylists/DisplayList.cpp
trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItemType.h
trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp
trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h
trunk/Source/WebCore/testing/Internals.cpp
trunk/Source/WebCore/testing/Internals.h
trunk/Source/WebCore/testing/Internals.idl




Diff

Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayList.cpp (294980 => 294981)

--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayList.cpp	2022-05-28 03:16:46 UTC (rev 294980)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayList.cpp	2022-05-28 03:37:10 UTC (rev 294981)
@@ -87,7 +87,7 @@
 {
 switch (item.type()) {
 case ItemType::SetState:
-if (!flags.contains(AsTextFlag::IncludesPlatformOperations)) {
+if (flags.contains(AsTextFlag::IncludePlatformOperations)) {
 const auto& stateItem = item.get();
 // FIXME: for now, only drop the item if the only state-change flags are platform-specific.
 if (stateItem.state().changes() == GraphicsContextState::Change::ShouldSubpixelQuantizeFonts)
@@ -97,7 +97,7 @@
 #if USE(CG)
 case ItemType::ApplyFillPattern:
 case ItemType::ApplyStrokePattern:
-if (!flags.contains(AsTextFlag::IncludesPlatformOperations))
+if (flags.contains(AsTextFlag::IncludePlatformOperations))
 return false;
 break;
 #endif
@@ -136,7 +136,7 @@
 for (auto displayListItem : *this) {
 auto [item, extent, itemSizeInBuffer] = displayListItem.value();
 TextStream::GroupScope group(ts);
-dumpItemHandle(ts, item, { AsTextFlag::IncludesPlatformOperations, AsTextFlag::IncludesResourceIdentifiers });
+dumpItemHandle(ts, item, { AsTextFlag::IncludePlatformOperations, AsTextFlag::IncludeResourceIdentifiers });
 if (item.isDrawingItem())
 ts << " extent " << extent;
 }


Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItemType.h (294980 => 294981)

--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItemType.h	2022-05-28 03:16:46 UTC (rev 294980)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItemType.h	2022-05-28 03:37:10 UTC (rev 294981)
@@ -29,9 +29,8 @@
 namespace DisplayList {
 
 enum class AsTextFlag : uint8_t {
-IncludesPlatformOperations  = 1 << 0,
-IncludesResourceIdentifiers = 1 << 1,
-DecomposesDrawGlyphs= 1 << 2,
+IncludePlatformOperations  = 1 << 0,
+IncludeResourceIdentifiers = 1 << 1,
 };
 
 enum class ItemType : uint8_t {


Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp (294980 => 294981)

--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp	2022-05-28 03:16:46 UTC (rev 294980)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp	2022-05-28 03:37:10 UTC (rev 294981)
@@ -767,7 +767,7 @@
 
 void dumpItem(TextStream& ts, const ClipToImageBuffer& item, OptionSet flags)
 {
-if (!flags.contains(AsTextFlag::IncludesResourceIdentifiers))
+if (flags.contains(AsTextFlag::IncludeResourceIdentifiers))
 ts.dumpProperty("image-buffer-identifier", item.imageBufferIdentifier());
 ts.dumpProperty("dest-rect", item.destinationRect());
 }
@@ -785,7 +785,7 @@
 
 void dumpItem(TextStream& ts, const DrawFilteredImageBuffer& item, OptionSet flags)
 {
-if (!flags.contains(AsTextFlag::IncludesResourceIdentifiers))
+if (flags.contains(AsTextFlag::IncludeResourceIdentifiers))
 ts.dumpProperty("source-image-identifier", item.sourceImageIdentifier());
 ts.dumpProperty("source-image-rect", item.sourceImageRect());
 }
@@ -801,7 +801,7 @@
 
 void dumpItem(TextStream& ts, const 

[webkit-changes] [294979] trunk

2022-05-27 Thread heycam
Title: [294979] trunk








Revision 294979
Author hey...@apple.com
Date 2022-05-27 20:13:21 -0700 (Fri, 27 May 2022)


Log Message
Fix typo in ConcatenateCTM display list item serialization
https://bugs.webkit.org/show_bug.cgi?id=240935

Reviewed by Simon Fraser.

* LayoutTests/displaylists/extent-includes-transforms-expected.txt:
* LayoutTests/platform/mac-wk1/displaylists/extent-includes-transforms-expected.txt:
* Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp:
(WebCore::DisplayList::operator<<):

Canonical link: https://commits.webkit.org/251083@main

Modified Paths

trunk/LayoutTests/displaylists/extent-includes-transforms-expected.txt
trunk/LayoutTests/platform/mac-wk1/displaylists/extent-includes-transforms-expected.txt
trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp




Diff

Modified: trunk/LayoutTests/displaylists/extent-includes-transforms-expected.txt (294978 => 294979)

--- trunk/LayoutTests/displaylists/extent-includes-transforms-expected.txt	2022-05-28 02:40:34 UTC (rev 294978)
+++ trunk/LayoutTests/displaylists/extent-includes-transforms-expected.txt	2022-05-28 03:13:21 UTC (rev 294979)
@@ -2,7 +2,7 @@
 (translate
   (x 0.00)
   (y 22.00))
-(concatentate-ctm
+(concatenate-ctm
   (ctm {m=((0.87,0.50)(-0.50,0.87)) t=(81.70,-18.30)}))
 (save)
 (set-state


Modified: trunk/LayoutTests/platform/mac-wk1/displaylists/extent-includes-transforms-expected.txt (294978 => 294979)

--- trunk/LayoutTests/platform/mac-wk1/displaylists/extent-includes-transforms-expected.txt	2022-05-28 02:40:34 UTC (rev 294978)
+++ trunk/LayoutTests/platform/mac-wk1/displaylists/extent-includes-transforms-expected.txt	2022-05-28 03:13:21 UTC (rev 294979)
@@ -2,7 +2,7 @@
 (translate
   (x 0.00)
   (y 22.00))
-(concatentate-ctm
+(concatenate-ctm
   (ctm {m=((0.87,0.50)(-0.50,0.87)) t=(81.70,-18.30)}))
 (save
   (restore-index 5))


Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp (294978 => 294979)

--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp	2022-05-28 02:40:34 UTC (rev 294978)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp	2022-05-28 03:13:21 UTC (rev 294979)
@@ -621,7 +621,7 @@
 case ItemType::Rotate: ts << "rotate"; break;
 case ItemType::Scale: ts << "scale"; break;
 case ItemType::SetCTM: ts << "set-ctm"; break;
-case ItemType::ConcatenateCTM: ts << "concatentate-ctm"; break;
+case ItemType::ConcatenateCTM: ts << "concatenate-ctm"; break;
 case ItemType::SetInlineFillColor: ts << "set-inline-fill-color"; break;
 case ItemType::SetInlineStrokeColor: ts << "set-inline-stroke-color"; break;
 case ItemType::SetStrokeThickness: ts << "set-stroke-thickness"; break;






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [293951] trunk

2022-05-07 Thread heycam
Title: [293951] trunk








Revision 293951
Author hey...@apple.com
Date 2022-05-07 16:34:10 -0700 (Sat, 07 May 2022)


Log Message
Don't propagate GraphicsContextState change bits into TextPainter's glyph display list recorder
https://bugs.webkit.org/show_bug.cgi?id=239952


Source/WebCore:

Reviewed by Said Abou-Hallawa and Antti Koivisto.

In FontCascade::displayListForTextRun, we create a
DisplayList::Recorder, then call drawGlyphBuffer. We initialize the
DisplayList::Recorder with the GraphicsContextState of the
GraphicsContext we're drawing to. Just before this, we will have set the
current fill color on that GraphicsContext.

When GPUP DOM rendering is disabled, GraphicsContextCG responds to
setFillColor etc. by updating GraphicsContextState, including setting
the Change flag, then immediately updating the CGContext, and clearing
the Change flag.

But when GPUP DOM rendering is enabled, the GraphicsContext is a
DisplayList::Recorder for the layer we're painting in to. Because
DisplayList::Recorder applies its state changes lazily, it can be in the
situation where its GraphicsContextState has had the fill brush changed,
and the Change flag is still set. So DisplayList::Recorder starts off
with a GraphicsContextState with unapplied changes in it. We end up in
DisplayList::Recorder::drawGlyphsAndCacheFont, which calls
appendStateChangeItemIfNecessary, which sees that the Change bit is set,
and generates a SetInlineFillColor display list item, which is
recorded and then replayed the next time the same text is painted.
This recorded fill color then may be wrong for the next TextPainter
that wants to reuse the cached glyph display list.

Display list recorders should never be initialized with a
GraphicsContextState that has change flags set on it. We can assert
this, then make FontCascade explicitly clear those flags on the state
object it passes in to the DisplayList::Recorder.

Test: fast/text/glyph-display-list-color.html

* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::displayListForTextRun const):
* platform/graphics/GraphicsContextState.cpp:
(WebCore::GraphicsContextState::cloneForRecording const):
* platform/graphics/GraphicsContextState.h:
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::Recorder):

Add setForceUseGlyphDisplayListForTesting and
cachedGlyphDisplayListsForTextNode functions on Internal for the
test to use:

* rendering/GlyphDisplayListCache.h:
(WebCore::GlyphDisplayListCache::getIfExists):
* rendering/TextPainter.cpp:
(WebCore::TextPainter::shouldUseGlyphDisplayList):
(WebCore::TextPainter::setForceUseGlyphDisplayListForTesting):
(WebCore::TextPainter::cachedGlyphDisplayListsForTextNodeAsText):
* rendering/TextPainter.h:
(WebCore::TextPainter::glyphDisplayListIfExists):
* testing/Internals.cpp:
(WebCore::Internals::setForceUseGlyphDisplayListForTesting):
(WebCore::Internals::cachedGlyphDisplayListsForTextNode):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

Reviewed by Antti Koivisto.

* fast/text/glyph-display-list-color-expected.txt: Added.
* fast/text/glyph-display-list-color.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/TestExpectations
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/FontCascade.cpp
trunk/Source/WebCore/platform/graphics/GraphicsContextState.cpp
trunk/Source/WebCore/platform/graphics/GraphicsContextState.h
trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp
trunk/Source/WebCore/rendering/GlyphDisplayListCache.h
trunk/Source/WebCore/rendering/TextPainter.cpp
trunk/Source/WebCore/rendering/TextPainter.h
trunk/Source/WebCore/testing/Internals.cpp
trunk/Source/WebCore/testing/Internals.h
trunk/Source/WebCore/testing/Internals.idl


Added Paths

trunk/LayoutTests/fast/text/glyph-display-list-color-expected.txt
trunk/LayoutTests/fast/text/glyph-display-list-color.html




Diff

Modified: trunk/LayoutTests/ChangeLog (293950 => 293951)

--- trunk/LayoutTests/ChangeLog	2022-05-07 18:15:14 UTC (rev 293950)
+++ trunk/LayoutTests/ChangeLog	2022-05-07 23:34:10 UTC (rev 293951)
@@ -1,3 +1,14 @@
+2022-05-07  Cameron McCormack  
+
+Don't propagate GraphicsContextState change bits into TextPainter's glyph display list recorder
+https://bugs.webkit.org/show_bug.cgi?id=239952
+
+
+Reviewed by Antti Koivisto.
+
+* fast/text/glyph-display-list-color-expected.txt: Added.
+* fast/text/glyph-display-list-color.html: Added.
+
 2022-05-06  Megan Gardner  
 
 Fix flakey test by using the old API on old systems.


Modified: trunk/LayoutTests/TestExpectations (293950 => 293951)

--- trunk/LayoutTests/TestExpectations	2022-05-07 18:15:14 UTC (rev 293950)
+++ trunk/LayoutTests/TestExpectations	2022-05-07 23:34:10 UTC (rev 293951)
@@ -5116,6 +5116,9 @@
 # due to how MessagePort::dispatchMessages() is implemented.
 imported/w3c/web-platform-tests/workers/shared-worker-name-via-options.html [ 

[webkit-changes] [293867] trunk/Source/WebCore

2022-05-05 Thread heycam
Title: [293867] trunk/Source/WebCore








Revision 293867
Author hey...@apple.com
Date 2022-05-05 16:15:31 -0700 (Thu, 05 May 2022)


Log Message
Avoid using WebCore::Colors created with out-of-line components in DrawGlyphsRecorder
https://bugs.webkit.org/show_bug.cgi?id=235604
rdar://88345680

Reviewed by Simon Fraser.

Source/WebCore:

In DrawGlyphsRecorder::recordDrawGlyphs we interrogate the CGContext's
state to find out the current fill and stroke color. This needed to
record color font glyphs correctly. When we're not using a color font,
the CGColors for the fill and stroke will be the same as we set them
in prepareInternalContext.

Those CGColors we create in prepareInternalContext from the
WebCore::Colors (created by calling cachedCGColor) don't record the
exact form the original colors had. CGColors only expose float
components, so Color::createAndPreserveColorSpace conservatively
creates a Color with out-of-line components to store those float
values, even if the original Color the CGColor was created from had
uint8_t components.

Color::operator== treats colors of different forms as being different,
which means we generate additional, unnecessary SetState display list
items changing say the fill color from Color(255, 255, 255) (inline) to
Color(1.0, 1.0, 1.0) (out of line).

We can avoid this by checking whether the context state's fill and
stroke CGColors are the same object as the ones we set in
prepareInternalContext, and if so, set the current fill/stroke brush
based on m_originalState.fillBrush/strokeBrush. In the common case of
a non-color glyph, this brush change will be detected as the same as
the current value, and the SetState item generation will be avoided.

This improves the MotionMark design subtest by 2.4%, and the overall
score by 0.7%, when GPUP DOM rendering is enabled.

* platform/graphics/DrawGlyphsRecorder.h:
* platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp:
(WebCore::DrawGlyphsRecorder::recordInitialColors):
(WebCore::DrawGlyphsRecorder::prepareInternalContext):
(WebCore::DrawGlyphsRecorder::updateFillColor):
(WebCore::DrawGlyphsRecorder::updateStrokeColor):

Source/WebCore/PAL:

* pal/spi/cg/CoreGraphicsSPI.h: Add CGContextGetStrokeColorAsColor.

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/PAL/ChangeLog
trunk/Source/WebCore/PAL/pal/spi/cg/CoreGraphicsSPI.h
trunk/Source/WebCore/platform/graphics/DrawGlyphsRecorder.h
trunk/Source/WebCore/platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (293866 => 293867)

--- trunk/Source/WebCore/ChangeLog	2022-05-05 23:11:30 UTC (rev 293866)
+++ trunk/Source/WebCore/ChangeLog	2022-05-05 23:15:31 UTC (rev 293867)
@@ -1,3 +1,47 @@
+2022-05-05  Cameron McCormack  
+
+Avoid using WebCore::Colors created with out-of-line components in DrawGlyphsRecorder
+https://bugs.webkit.org/show_bug.cgi?id=235604
+rdar://88345680
+
+Reviewed by Simon Fraser.
+
+In DrawGlyphsRecorder::recordDrawGlyphs we interrogate the CGContext's
+state to find out the current fill and stroke color. This needed to
+record color font glyphs correctly. When we're not using a color font,
+the CGColors for the fill and stroke will be the same as we set them
+in prepareInternalContext.
+
+Those CGColors we create in prepareInternalContext from the
+WebCore::Colors (created by calling cachedCGColor) don't record the
+exact form the original colors had. CGColors only expose float
+components, so Color::createAndPreserveColorSpace conservatively
+creates a Color with out-of-line components to store those float
+values, even if the original Color the CGColor was created from had
+uint8_t components.
+
+Color::operator== treats colors of different forms as being different,
+which means we generate additional, unnecessary SetState display list
+items changing say the fill color from Color(255, 255, 255) (inline) to
+Color(1.0, 1.0, 1.0) (out of line).
+
+We can avoid this by checking whether the context state's fill and
+stroke CGColors are the same object as the ones we set in
+prepareInternalContext, and if so, set the current fill/stroke brush
+based on m_originalState.fillBrush/strokeBrush. In the common case of
+a non-color glyph, this brush change will be detected as the same as
+the current value, and the SetState item generation will be avoided.
+
+This improves the MotionMark design subtest by 2.4%, and the overall
+score by 0.7%, when GPUP DOM rendering is enabled.
+
+* platform/graphics/DrawGlyphsRecorder.h:
+* platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp:
+(WebCore::DrawGlyphsRecorder::recordInitialColors):
+(WebCore::DrawGlyphsRecorder::prepareInternalContext):
+

[webkit-changes] [292386] trunk/LayoutTests

2022-04-05 Thread heycam
Title: [292386] trunk/LayoutTests








Revision 292386
Author hey...@apple.com
Date 2022-04-05 01:50:32 -0700 (Tue, 05 Apr 2022)


Log Message
Skip editing-word-with-marker-1.html
https://bugs.webkit.org/show_bug.cgi?id=238767

Unreviewed test gardening.


* TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/TestExpectations
trunk/LayoutTests/platform/ios/TestExpectations




Diff

Modified: trunk/LayoutTests/ChangeLog (292385 => 292386)

--- trunk/LayoutTests/ChangeLog	2022-04-05 08:36:06 UTC (rev 292385)
+++ trunk/LayoutTests/ChangeLog	2022-04-05 08:50:32 UTC (rev 292386)
@@ -1,3 +1,12 @@
+2022-04-05  Cameron McCormack  
+
+Skip editing-word-with-marker-1.html
+https://bugs.webkit.org/show_bug.cgi?id=238767
+
+Unreviewed test gardening.
+
+* TestExpectations:
+
 2022-04-05  Tim Nguyen  
 
 [iOS] Add timeout expectations for focus-after-close.html WPT


Modified: trunk/LayoutTests/TestExpectations (292385 => 292386)

--- trunk/LayoutTests/TestExpectations	2022-04-05 08:36:06 UTC (rev 292385)
+++ trunk/LayoutTests/TestExpectations	2022-04-05 08:50:32 UTC (rev 292386)
@@ -4845,6 +4845,9 @@
 # "Opacity on an inline element should apply on float child".
 webkit.org/b/234690 imported/w3c/web-platform-tests/css/css-color/inline-opacity-float-child.html [ ImageOnlyFailure ]
 
+# Interferes with following test
+webkit.org/b/237812 editing/spelling/editing-word-with-marker-1.html [ Skip ]
+
 # color-mix() doesn't work with currentcolor
 webkit.org/b/234691 imported/w3c/web-platform-tests/css/css-color/color-mix-basic-001.html [ ImageOnlyFailure ]
 


Modified: trunk/LayoutTests/platform/ios/TestExpectations (292385 => 292386)

--- trunk/LayoutTests/platform/ios/TestExpectations	2022-04-05 08:36:06 UTC (rev 292385)
+++ trunk/LayoutTests/platform/ios/TestExpectations	2022-04-05 08:50:32 UTC (rev 292386)
@@ -3547,7 +3547,6 @@
 webkit.org/b/238519 animations/shadow-host-child-change.html [ Pass ImageOnlyFailure ]
 
 webkit.org/b/236930 accessibility/ios-simulator/aria-details.html [ Crash Pass ]
-webkit.org/b/236794 editing/spelling/editing-word-with-marker-2.html [ Pass Crash ]
 
 webkit.org/b/238284 editing/spelling/spellcheck-async-remove-frame.html [ Pass Crash ]
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292319] trunk/Source/WebKit

2022-04-04 Thread heycam
Title: [292319] trunk/Source/WebKit








Revision 292319
Author hey...@apple.com
Date 2022-04-04 14:38:05 -0700 (Mon, 04 Apr 2022)


Log Message
Remove display list map entry before remote resource
https://bugs.webkit.org/show_bug.cgi?id=238764

Reviewed by Simon Fraser.

* GPUProcess/graphics/RemoteDisplayListRecorder.cpp:
(WebKit::RemoteDisplayListRecorder::clearImageBufferReference):
* GPUProcess/graphics/RemoteDisplayListRecorder.h:
* GPUProcess/graphics/RemoteRenderingBackend.cpp:
(WebKit::RemoteRenderingBackend::releaseRemoteResourceWithQualifiedIdentifier):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.cpp
trunk/Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.h
trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp




Diff

Modified: trunk/Source/WebKit/ChangeLog (292318 => 292319)

--- trunk/Source/WebKit/ChangeLog	2022-04-04 21:30:31 UTC (rev 292318)
+++ trunk/Source/WebKit/ChangeLog	2022-04-04 21:38:05 UTC (rev 292319)
@@ -1,3 +1,16 @@
+2022-04-04  Cameron McCormack  
+
+Remove display list map entry before remote resource
+https://bugs.webkit.org/show_bug.cgi?id=238764
+
+Reviewed by Simon Fraser.
+
+* GPUProcess/graphics/RemoteDisplayListRecorder.cpp:
+(WebKit::RemoteDisplayListRecorder::clearImageBufferReference):
+* GPUProcess/graphics/RemoteDisplayListRecorder.h:
+* GPUProcess/graphics/RemoteRenderingBackend.cpp:
+(WebKit::RemoteRenderingBackend::releaseRemoteResourceWithQualifiedIdentifier):
+
 2022-04-04  Wenson Hsieh  
 
 [macOS] Add helper methods to install and uninstall VKCImageAnalysisOverlayView


Modified: trunk/Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.cpp (292318 => 292319)

--- trunk/Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.cpp	2022-04-04 21:30:31 UTC (rev 292318)
+++ trunk/Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.cpp	2022-04-04 21:38:05 UTC (rev 292319)
@@ -68,6 +68,11 @@
 renderingBackend->streamConnection().stopReceivingMessages(Messages::RemoteDisplayListRecorder::messageReceiverName(), m_imageBufferIdentifier.object().toUInt64());
 }
 
+void RemoteDisplayListRecorder::clearImageBufferReference()
+{
+m_imageBuffer.clear();
+}
+
 void RemoteDisplayListRecorder::save()
 {
 handleItem(DisplayList::Save());


Modified: trunk/Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.h (292318 => 292319)

--- trunk/Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.h	2022-04-04 21:30:31 UTC (rev 292318)
+++ trunk/Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.h	2022-04-04 21:38:05 UTC (rev 292319)
@@ -56,6 +56,7 @@
 }
 
 void stopListeningForIPC();
+void clearImageBufferReference();
 
 void save();
 void restore();


Modified: trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp (292318 => 292319)

--- trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp	2022-04-04 21:30:31 UTC (rev 292318)
+++ trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp	2022-04-04 21:38:05 UTC (rev 292319)
@@ -383,12 +383,14 @@
 void RemoteRenderingBackend::releaseRemoteResourceWithQualifiedIdentifier(QualifiedRenderingResourceIdentifier renderingResourceIdentifier)
 {
 ASSERT(!RunLoop::isMain());
+{
+Locker locker { m_remoteDisplayListsLock };
+if (auto remoteDisplayList = m_remoteDisplayLists.take(renderingResourceIdentifier))
+remoteDisplayList->clearImageBufferReference();
+}
 auto success = m_remoteResourceCache.releaseRemoteResource(renderingResourceIdentifier);
 MESSAGE_CHECK(success, "Resource is being released before being cached.");
 updateRenderingResourceRequest();
-
-Locker locker { m_remoteDisplayListsLock };
-m_remoteDisplayLists.remove(renderingResourceIdentifier);
 }
 
 static std::optional handleFromBuffer(WebCore::ImageBuffer& buffer)






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [291998] trunk

2022-03-28 Thread heycam
Title: [291998] trunk








Revision 291998
Author hey...@apple.com
Date 2022-03-28 15:35:26 -0700 (Mon, 28 Mar 2022)


Log Message
Remove the 1ms minimum for setTimeout
https://bugs.webkit.org/show_bug.cgi?id=221124


Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

* web-platform-tests/html/webappapis/timers/zero-settimeout.any-expected.txt:
* web-platform-tests/html/webappapis/timers/zero-settimeout.any.html:
* web-platform-tests/html/webappapis/timers/zero-settimeout.any.js:
(async_test):
* web-platform-tests/html/webappapis/timers/zero-settimeout.any.worker-expected.txt:
* web-platform-tests/html/webappapis/timers/zero-settimeout.any.worker.html:
New test checking that 0ms and 1ms timeouts are called in the right
order.

* web-platform-tests/FileAPI/file/File-constructor.any.worker-expected.txt:
* web-platform-tests/html/webappapis/microtask-queuing/queue-microtask-exceptions.any.worker-expected.txt:
* web-platform-tests/workers/interfaces/WorkerUtils/importScripts/report-error-cross-origin.sub.any.worker-expected.txt:
* web-platform-tests/workers/interfaces/WorkerUtils/importScripts/report-error-redirect-to-cross-origin.sub.any.worker-expected.txt:
* web-platform-tests/workers/interfaces/WorkerUtils/importScripts/report-error-same-origin.sub.any.worker-expected.txt:
* web-platform-tests/workers/interfaces/WorkerUtils/importScripts/report-error-setTimeout-cross-origin.sub.any.worker-expected.txt:
* web-platform-tests/workers/interfaces/WorkerUtils/importScripts/report-error-setTimeout-redirect-to-cross-origin.sub.any.worker-expected.txt:
* web-platform-tests/workers/interfaces/WorkerUtils/importScripts/report-error-setTimeout-same-origin.sub.any.worker-expected.txt:
Disable console output in some worker tests where the reduced timeout
would cause intemittent failures due to the console message sometimes
not making it to the test output in time.

Source/WebCore:

This patch removes the 1ms minimum for setTimeout. The HTML spec makes
no mention of such a minimum, and Firefox and Chrome do not enforce
this minimum. Removing this for setTimeout results in a 0.7-2.1%
improvement on Speedometer, depending on platform and hardware.

The WPT added here demonstrates how this change can affect pages: if a
page schedules a 1ms and then a 0ms timeout in the same turn of the
event loop, then with this patch they will now be fired in the reverse
order. Since Firefox and Chrome do not impose a 1ms minimum, this
reduces the risk of this being a compatbility problem.

Scheduling a 0ms timeout will cause its callback to be called the next
time around the event loop. Other, non-timer queued tasks, will be
pre-empted. This behavior is permitted by the HTML spec, since the
event loop processing model[1] states that the implementation can
choose which task source to service, and timer callbacks are
dispatched using their own task source. Due to the way the SharedTimer
is called, we don't need to literally dispatch a task with a new
TaskSource::Timer source. (If we decided later to make a different
about whether to service timer callbacks before tasks from all other
task sources, we might need to.)

Not addressing the setTimeout 1ms minimum here, which should likely also
be removed.

While we're here, settle on "one shot" rather rather than "single
shot" as the term for timers that fire once.

[1] https://html.spec.whatwg.org/#event-loop-processing-model

Tests: imported/w3c/web-platform-tests/html/webappapis/timers/zero-settimeout.any.html
   imported/w3c/web-platform-tests/html/webappapis/timers/zero-settimeout.any.worker.html

* page/DOMTimer.h:
* page/DOMTimer.cpp:
(WebCore::DOMTimer::DOMTimer):
(WebCore::DOMTimer::install):
(WebCore::DOMTimer::fired):
(WebCore::DOMTimer::updateTimerIntervalIfNecessary):
(WebCore::DOMTimer::intervalClampedToMinimum const):

LayoutTests:

* TestExpectations: Disable console output in some worker tests where
the reduced timeout would cause intemittent failures due to the
console message sometimes not making it to the test output in time.
* js/script-tests/weakref-finalizationregistry.js:
(turnEventLoop): Use a timeout of 1ms instead of 0ms so that
the deferred work task that calls the JS FinalizationRegistry
callback gets a chance to run before we continue on to the
assertion that it was run.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/TestExpectations
trunk/LayoutTests/imported/w3c/ChangeLog
trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/file/File-constructor.any.worker-expected.txt
trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/microtask-queuing/queue-microtask-exceptions.any.worker-expected.txt
trunk/LayoutTests/imported/w3c/web-platform-tests/workers/interfaces/WorkerUtils/importScripts/report-error-cross-origin.sub.any.worker-expected.txt
trunk/LayoutTests/imported/w3c/web-platform-tests/workers/interfaces/WorkerUtils/importScripts/report-error-redirect-to-cross-origin.sub.any.worker-expected.txt

[webkit-changes] [291961] trunk

2022-03-28 Thread heycam
Title: [291961] trunk








Revision 291961
Author hey...@apple.com
Date 2022-03-28 01:27:30 -0700 (Mon, 28 Mar 2022)


Log Message
Remove pending UA shadow tree state when an input element is removed from the document
https://bugs.webkit.org/show_bug.cgi?id=238429


Reviewed by Antti Koivisto.

Source/WebCore:

If an  element has a pending UA shadow tree, and the element is
removed from the document, we don't currently remove the element from
Document::m_elementsWithPendingUserAgentShadowTreeUpdates. Not only
does that means we may wastefully create the shadow tree if the
element is not inserted into the document again, but if the element is
then inserted into a different document, flushing style in the new
document won't correctly create the shadow tree.

Test: fast/forms/lazy-shadow-tree-creation-move-document-crash.html

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::removedFromAncestor):

LayoutTests:

* fast/forms/lazy-shadow-tree-creation-move-document-crash-expected.txt: Added.
* fast/forms/lazy-shadow-tree-creation-move-document-crash.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/html/HTMLInputElement.cpp


Added Paths

trunk/LayoutTests/fast/forms/lazy-shadow-tree-creation-move-document-crash-expected.txt
trunk/LayoutTests/fast/forms/lazy-shadow-tree-creation-move-document-crash.html




Diff

Modified: trunk/LayoutTests/ChangeLog (291960 => 291961)

--- trunk/LayoutTests/ChangeLog	2022-03-28 06:15:24 UTC (rev 291960)
+++ trunk/LayoutTests/ChangeLog	2022-03-28 08:27:30 UTC (rev 291961)
@@ -1,3 +1,14 @@
+2022-03-28  Cameron McCormack  
+
+Remove pending UA shadow tree state when an input element is removed from the document
+https://bugs.webkit.org/show_bug.cgi?id=238429
+
+
+Reviewed by Antti Koivisto.
+
+* fast/forms/lazy-shadow-tree-creation-move-document-crash-expected.txt: Added.
+* fast/forms/lazy-shadow-tree-creation-move-document-crash.html: Added.
+
 2022-03-27  Matt Woodrow  
 
 Preserve repeat() notation for grid-templates


Added: trunk/LayoutTests/fast/forms/lazy-shadow-tree-creation-move-document-crash-expected.txt (0 => 291961)

--- trunk/LayoutTests/fast/forms/lazy-shadow-tree-creation-move-document-crash-expected.txt	(rev 0)
+++ trunk/LayoutTests/fast/forms/lazy-shadow-tree-creation-move-document-crash-expected.txt	2022-03-28 08:27:30 UTC (rev 291961)
@@ -0,0 +1 @@
+PASS if no crash.


Added: trunk/LayoutTests/fast/forms/lazy-shadow-tree-creation-move-document-crash.html (0 => 291961)

--- trunk/LayoutTests/fast/forms/lazy-shadow-tree-creation-move-document-crash.html	(rev 0)
+++ trunk/LayoutTests/fast/forms/lazy-shadow-tree-creation-move-document-crash.html	2022-03-28 08:27:30 UTC (rev 291961)
@@ -0,0 +1,14 @@
+
+PASS if no crash.
+
+function run() {
+if (window.testRunner)
+testRunner.dumpAsText();
+
+let e = document.createElement("input");
+frames[0].document.body.offsetTop;
+document.body.append(e);
+frames[0].document.body.append(e);
+}
+
+


Modified: trunk/Source/WebCore/ChangeLog (291960 => 291961)

--- trunk/Source/WebCore/ChangeLog	2022-03-28 06:15:24 UTC (rev 291960)
+++ trunk/Source/WebCore/ChangeLog	2022-03-28 08:27:30 UTC (rev 291961)
@@ -1,3 +1,24 @@
+2022-03-28  Cameron McCormack  
+
+Remove pending UA shadow tree state when an input element is removed from the document
+https://bugs.webkit.org/show_bug.cgi?id=238429
+
+
+Reviewed by Antti Koivisto.
+
+If an  element has a pending UA shadow tree, and the element is
+removed from the document, we don't currently remove the element from
+Document::m_elementsWithPendingUserAgentShadowTreeUpdates. Not only
+does that means we may wastefully create the shadow tree if the
+element is not inserted into the document again, but if the element is
+then inserted into a different document, flushing style in the new
+document won't correctly create the shadow tree.
+
+Test: fast/forms/lazy-shadow-tree-creation-move-document-crash.html
+
+* html/HTMLInputElement.cpp:
+(WebCore::HTMLInputElement::removedFromAncestor):
+
 2022-03-27  Lauro Moura  
 
 Unreviewed, non-unified buildfix


Modified: trunk/Source/WebCore/html/HTMLInputElement.cpp (291960 => 291961)

--- trunk/Source/WebCore/html/HTMLInputElement.cpp	2022-03-28 06:15:24 UTC (rev 291960)
+++ trunk/Source/WebCore/html/HTMLInputElement.cpp	2022-03-28 08:27:30 UTC (rev 291961)
@@ -1637,6 +1637,10 @@
 oldParentOfRemovedTree.treeScope().radioButtonGroups().removeButton(*this);
 if (removalType.disconnectedFromDocument && !form())
 removeFromRadioButtonGroup();
+if (removalType.disconnectedFromDocument && m_hasPendingUserAgentShadowTreeUpdate) {
+document().removeElementWithPendingUserAgentShadowTreeUpdate(*this);
+

[webkit-changes] [291783] trunk/LayoutTests/imported/w3c

2022-03-23 Thread heycam
Title: [291783] trunk/LayoutTests/imported/w3c








Revision 291783
Author hey...@apple.com
Date 2022-03-23 21:17:57 -0700 (Wed, 23 Mar 2022)


Log Message
Bump up fuzzy tolerance on css-backgrounds/background-gradient-subpixel-fills-area.html
https://bugs.webkit.org/show_bug.cgi?id=238307

Unreviewed test gardening.


* web-platform-tests/css/css-backgrounds/background-gradient-subpixel-fills-area.html:

Modified Paths

trunk/LayoutTests/imported/w3c/ChangeLog
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/background-gradient-subpixel-fills-area.html




Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (291782 => 291783)

--- trunk/LayoutTests/imported/w3c/ChangeLog	2022-03-24 03:45:39 UTC (rev 291782)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2022-03-24 04:17:57 UTC (rev 291783)
@@ -1,3 +1,12 @@
+2022-03-23  Cameron McCormack  
+
+Bump up fuzzy tolerance on css-backgrounds/background-gradient-subpixel-fills-area.html
+https://bugs.webkit.org/show_bug.cgi?id=238307
+
+Unreviewed test gardening.
+
+* web-platform-tests/css/css-backgrounds/background-gradient-subpixel-fills-area.html:
+
 2022-03-23  Jon Lee  
 
 Unreviewed fuzzy gardening.


Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/background-gradient-subpixel-fills-area.html (291782 => 291783)

--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/background-gradient-subpixel-fills-area.html	2022-03-24 03:45:39 UTC (rev 291782)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/background-gradient-subpixel-fills-area.html	2022-03-24 04:17:57 UTC (rev 291783)
@@ -5,7 +5,7 @@
 -  
+  
   

[webkit-changes] [291702] trunk/LayoutTests

2022-03-22 Thread heycam
Title: [291702] trunk/LayoutTests








Revision 291702
Author hey...@apple.com
Date 2022-03-22 14:15:28 -0700 (Tue, 22 Mar 2022)


Log Message
Disable remaining HEIC tests
https://bugs.webkit.org/show_bug.cgi?id=238191


Reviewed by Simon Fraser.

* platform/ios/TestExpectations:
* platform/mac/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/ios/TestExpectations
trunk/LayoutTests/platform/mac/TestExpectations




Diff

Modified: trunk/LayoutTests/ChangeLog (291701 => 291702)

--- trunk/LayoutTests/ChangeLog	2022-03-22 21:11:31 UTC (rev 291701)
+++ trunk/LayoutTests/ChangeLog	2022-03-22 21:15:28 UTC (rev 291702)
@@ -1,3 +1,14 @@
+2022-03-22  Cameron McCormack  
+
+Disable remaining HEIC tests
+https://bugs.webkit.org/show_bug.cgi?id=238191
+
+
+Reviewed by Simon Fraser.
+
+* platform/ios/TestExpectations:
+* platform/mac/TestExpectations:
+
 2022-03-22  Matteo Flores  
 
 REGRESSION(r289402-r289376): [ Debug iOS ] webgl/1.0.3/conformance/uniforms/uniform-samplers-test.html is a constant timeout


Modified: trunk/LayoutTests/platform/ios/TestExpectations (291701 => 291702)

--- trunk/LayoutTests/platform/ios/TestExpectations	2022-03-22 21:11:31 UTC (rev 291701)
+++ trunk/LayoutTests/platform/ios/TestExpectations	2022-03-22 21:15:28 UTC (rev 291702)
@@ -2949,9 +2949,9 @@
 fast/forms/auto-fill-button/caps-lock-indicator-should-not-be-visible-when-auto-fill-strong-password-button-is-visible.html [ Pass ]
 fast/forms/password-scrolled-after-caps-lock-toggled.html [ Pass ]
 
-#  HEIF and HEICS images are supported only on iOS 13
-fast/images/animated-heics-draw.html [ Pass ]
-fast/images/animated-heics-verify.html [ Pass ]
+# 
+fast/images/animated-heics-draw.html [ Skip ]
+fast/images/animated-heics-verify.html [ Skip ]
 
 #  REGRESSION (iOS 13): Three cookie layout tests failing
 http/wpt/beacon/cors/cors-preflight-cookie.html [ Failure ]


Modified: trunk/LayoutTests/platform/mac/TestExpectations (291701 => 291702)

--- trunk/LayoutTests/platform/mac/TestExpectations	2022-03-22 21:11:31 UTC (rev 291701)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2022-03-22 21:15:28 UTC (rev 291702)
@@ -1473,9 +1473,9 @@
 
 webkit.org/b/190882 animations/change-one-anim.html [ Pass Failure ]
 
-# 
-[ Catalina+ ] fast/images/animated-heics-draw.html [ Pass ]
-[ Catalina+ ] fast/images/animated-heics-verify.html [ Pass ]
+# 
+[ Catalina+ ] fast/images/animated-heics-draw.html [ Skip ]
+[ Catalina+ ] fast/images/animated-heics-verify.html [ Skip ]
 
 # 
 webkit.org/b/212172 [ Catalina ] fast/text/font-collection.html [ ImageOnlyFailure ]






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [291476] trunk

2022-03-18 Thread heycam
Title: [291476] trunk








Revision 291476
Author hey...@apple.com
Date 2022-03-18 04:58:07 -0700 (Fri, 18 Mar 2022)


Log Message
Remove the 1ms minimum for setTimeout
https://bugs.webkit.org/show_bug.cgi?id=221124


Reviewed by Sam Weinig.

The HTML spec makes no mention of a 1ms minimum for timers. Removing
the 1ms minimum for setTimeout results in a 0.7-2.1% improvement on
Speedometer, depending on platform and hardware.

The WPT added here demonstrates how this change can affect pages: if a
page schedules a 1ms and then a 0ms timeout in the same turn of the
event loop, then with this patch they will now be fired in the reverse
order. Firefox and Chrome do not impose a 1ms minimum, which reduces
the risk of this being a problem.

Not addressing the setTimeout 1ms minimum here, which should likely also
be removed.

While we're here, settle on "one shot" rather rather than "single
shot" as the term for timers that fire once.

Tests: imported/w3c/web-platform-tests/html/webappapis/timers/zero-settimeout.any.html
   imported/w3c/web-platform-tests/html/webappapis/timers/zero-settimeout.any.worker.html

* page/DOMTimer.h:
* page/DOMTimer.cpp:
(WebCore::DOMTimer::DOMTimer): We must pass oneShot into
intervalClampedToMinimum, since the way isOneShot determines whether
we are a one shot timer is by checking repeatInterval, which is only
set once startRepeating is called.
(WebCore::DOMTimer::install):
(WebCore::DOMTimer::fired):
(WebCore::DOMTimer::updateTimerIntervalIfNecessary):
(WebCore::DOMTimer::isOneShot const):
(WebCore::DOMTimer::intervalClampedToMinimum const):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/page/DOMTimer.cpp
trunk/Source/WebCore/page/DOMTimer.h


Added Paths

trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/timers/zero-settimeout.any-expected.txt
trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/timers/zero-settimeout.any.html
trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/timers/zero-settimeout.any.js
trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/timers/zero-settimeout.any.worker-expected.txt
trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/timers/zero-settimeout.any.worker.html




Diff

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/timers/zero-settimeout.any-expected.txt (0 => 291476)

--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/timers/zero-settimeout.any-expected.txt	(rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/timers/zero-settimeout.any-expected.txt	2022-03-18 11:58:07 UTC (rev 291476)
@@ -0,0 +1,3 @@
+
+PASS A 0ms timeout should not be clamped to 1ms
+


Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/timers/zero-settimeout.any.html (0 => 291476)

--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/timers/zero-settimeout.any.html	(rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/timers/zero-settimeout.any.html	2022-03-18 11:58:07 UTC (rev 291476)
@@ -0,0 +1 @@
+
\ No newline at end of file


Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/timers/zero-settimeout.any.js (0 => 291476)

--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/timers/zero-settimeout.any.js	(rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/timers/zero-settimeout.any.js	2022-03-18 11:58:07 UTC (rev 291476)
@@ -0,0 +1,15 @@
+async_test((t) => {
+  let order = [];
+
+  function append(n) {
+order.push(`${n}ms`);
+if (order.length == 3) {
+  assert_array_equals(order, ["0ms", "1ms", "2ms"]);
+  t.done();
+}
+  }
+
+  setTimeout(t.step_func(() => append(2)), 2);
+  setTimeout(t.step_func(() => append(1)), 1);
+  setTimeout(t.step_func(() => append(0)), 0);
+}, "A 0ms timeout should not be clamped to 1ms");


Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/timers/zero-settimeout.any.worker-expected.txt (0 => 291476)

--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/timers/zero-settimeout.any.worker-expected.txt	(rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/timers/zero-settimeout.any.worker-expected.txt	2022-03-18 11:58:07 UTC (rev 291476)
@@ -0,0 +1,3 @@
+
+PASS A 0ms timeout should not be clamped to 1ms
+


Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/timers/zero-settimeout.any.worker.html (0 => 291476)

--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/timers/zero-settimeout.any.worker.html	(rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/timers/zero-settimeout.any.worker.html	2022-03-18 11:58:07 UTC (rev 291476)
@@ -0,0 +1 @@
+
\ No newline at end of file


Modified: 

[webkit-changes] [291435] trunk

2022-03-17 Thread heycam
Title: [291435] trunk








Revision 291435
Author hey...@apple.com
Date 2022-03-17 13:19:28 -0700 (Thu, 17 Mar 2022)


Log Message
Avoid calling connectionClosedFromServer on a connection twice when a version change is active
https://bugs.webkit.org/show_bug.cgi?id=215271

Reviewed by Sihui Liu.

Source/WebCore:

Since bug 203690, all IDB work is done on a single background thread.
A consequence of this change is that there are states when
UniqueIDBDatabase::m_versionChangeDatabaseConnection is also in
m_openDatabaseConnections. We should avoid calling
connectionClosedFromServer on the same connection twice, since that
can result in a spurious second error event being sent to the
IDBDatabase JS object if connections are closed while a version chnge
is in progress.

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::immediateClose):

LayoutTests:

* platform/ios-wk2/TestExpectations:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:
* platform/wincairo/TestExpectations:
Remove test flakiness annotations.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/ios-wk2/TestExpectations
trunk/LayoutTests/platform/mac/TestExpectations
trunk/LayoutTests/platform/win/TestExpectations
trunk/LayoutTests/platform/wincairo/TestExpectations
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp




Diff

Modified: trunk/LayoutTests/ChangeLog (291434 => 291435)

--- trunk/LayoutTests/ChangeLog	2022-03-17 20:18:06 UTC (rev 291434)
+++ trunk/LayoutTests/ChangeLog	2022-03-17 20:19:28 UTC (rev 291435)
@@ -1,3 +1,16 @@
+2022-03-17  Cameron McCormack  
+
+Avoid calling connectionClosedFromServer on a connection twice when a version change is active
+https://bugs.webkit.org/show_bug.cgi?id=215271
+
+Reviewed by Sihui Liu.
+
+* platform/ios-wk2/TestExpectations:
+* platform/mac/TestExpectations:
+* platform/win/TestExpectations:
+* platform/wincairo/TestExpectations:
+Remove test flakiness annotations.
+
 2022-03-17  Simon Lewis  
 
 Functional tests for read and write methods of JSIPCStreamConnectionBuffer


Modified: trunk/LayoutTests/platform/ios-wk2/TestExpectations (291434 => 291435)

--- trunk/LayoutTests/platform/ios-wk2/TestExpectations	2022-03-17 20:18:06 UTC (rev 291434)
+++ trunk/LayoutTests/platform/ios-wk2/TestExpectations	2022-03-17 20:19:28 UTC (rev 291435)
@@ -1913,8 +1913,6 @@
 
 webkit.org/b/215268 http/wpt/resource-timing/rt-revalidate-requests-3.html [ Pass Failure ]
 
-webkit.org/b/215271 [ Debug ] storage/indexeddb/modern/new-database-after-user-delete.html [ Pass Failure ]
-
 webkit.org/b/215273 svg/animations/smil-multiple-animate-list.svg [ Pass Timeout ]
 
 webkit.org/b/215324 compositing/clipping/border-radius-on-webgl.html [ Pass ImageOnlyFailure Timeout ]


Modified: trunk/LayoutTests/platform/mac/TestExpectations (291434 => 291435)

--- trunk/LayoutTests/platform/mac/TestExpectations	2022-03-17 20:18:06 UTC (rev 291434)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2022-03-17 20:19:28 UTC (rev 291435)
@@ -1704,8 +1704,6 @@
 
 webkit.org/b/215177 [ Release ] editing/selection/navigation-clears-editor-state.html [ Pass Failure ]
 
-webkit.org/b/215271 [ Debug ] storage/indexeddb/modern/new-database-after-user-delete.html [ Pass Failure ]
-
 webkit.org/b/215450 imported/w3c/web-platform-tests/media-source/mediasource-changetype-play-negative.html [ Pass Failure ]
 
 #  Stress GC bot failing LayoutTest step with timeout while running WebCryptoAPI/derive_bits_keys tests


Modified: trunk/LayoutTests/platform/win/TestExpectations (291434 => 291435)

--- trunk/LayoutTests/platform/win/TestExpectations	2022-03-17 20:18:06 UTC (rev 291434)
+++ trunk/LayoutTests/platform/win/TestExpectations	2022-03-17 20:19:28 UTC (rev 291435)
@@ -4617,8 +4617,6 @@
 webkit.org/b/204439 fast/repaint/backgroundSizeRepaint.html [ Pass ImageOnlyFailure ]
 webkit.org/b/204440 imported/blink/fast/events/panScroll-crash.html [ Pass Crash ]
 
-webkit.org/b/204489 storage/indexeddb/modern/new-database-after-user-delete.html [ Pass Failure ]
-
 webkit.org/b/204545 fast/xsl/sort-unicode.xml [ Failure ]
 webkit.org/b/204545 svg/W3C-SVG-1.1/paths-data-02-t.svg [ Failure ]
 webkit.org/b/204545 css2.1/20110323/border-conflict-element-001d.htm [ ImageOnlyFailure ]


Modified: trunk/LayoutTests/platform/wincairo/TestExpectations (291434 => 291435)

--- trunk/LayoutTests/platform/wincairo/TestExpectations	2022-03-17 20:18:06 UTC (rev 291434)
+++ trunk/LayoutTests/platform/wincairo/TestExpectations	2022-03-17 20:19:28 UTC (rev 291435)
@@ -1468,8 +1468,6 @@
 
 webkit.org/b/227189 fast/forms/checkbox-and-pseudo.html [ Skip ] # Require expect file for dumped render tree.
 
-webkit.org/b/215271 storage/indexeddb/modern/new-database-after-user-delete.html [ Pass Failure ]
-
 

[webkit-changes] [291089] trunk/LayoutTests

2022-03-09 Thread heycam
Title: [291089] trunk/LayoutTests








Revision 291089
Author hey...@apple.com
Date 2022-03-09 20:36:00 -0800 (Wed, 09 Mar 2022)


Log Message
Unreviewed test gardening
https://bugs.webkit.org/show_bug.cgi?id=237688


* gpu-process/TestExpectations:
* svg/W3C-SVG-1.2-Tiny/struct-use-recursion-01-t.svg:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/gpu-process/TestExpectations
trunk/LayoutTests/svg/W3C-SVG-1.2-Tiny/struct-use-recursion-01-t.svg




Diff

Modified: trunk/LayoutTests/ChangeLog (291088 => 291089)

--- trunk/LayoutTests/ChangeLog	2022-03-10 04:31:35 UTC (rev 291088)
+++ trunk/LayoutTests/ChangeLog	2022-03-10 04:36:00 UTC (rev 291089)
@@ -1,6 +1,14 @@
 2022-03-09  Cameron McCormack  
 
 Unreviewed test gardening
+https://bugs.webkit.org/show_bug.cgi?id=237688
+
+* gpu-process/TestExpectations:
+* svg/W3C-SVG-1.2-Tiny/struct-use-recursion-01-t.svg:
+
+2022-03-09  Cameron McCormack  
+
+Unreviewed test gardening
 https://bugs.webkit.org/show_bug.cgi?id=236931
 
 * gpu-process/TestExpectations:


Modified: trunk/LayoutTests/gpu-process/TestExpectations (291088 => 291089)

--- trunk/LayoutTests/gpu-process/TestExpectations	2022-03-10 04:31:35 UTC (rev 291088)
+++ trunk/LayoutTests/gpu-process/TestExpectations	2022-03-10 04:36:00 UTC (rev 291089)
@@ -321,20 +321,10 @@
 webkit.org/b/236927 fast/forms/input-text-autofocus.html [ Pass Failure ]
 
 # Flaky failure
-webkit.org/b/236932 css3/filters/backdrop/dynamic-with-clip-path.html [ Pass ImageOnlyFailure ]
+webkit.org/b/237684 css3/filters/backdrop/dynamic-with-clip-path.html [ Pass ImageOnlyFailure ]
 webkit.org/b/236932 css3/masking/mask-repeat-one-copy.html [ Pass ImageOnlyFailure ]
-webkit.org/b/236932 editing/pasteboard/paste-dark-mode-color-filtered.html [ Pass Failure ]
-webkit.org/b/236932 fast/speechrecognition/start-recognition-then-stop.html [ Pass Failure ]
-webkit.org/b/236932 imported/w3c/web-platform-tests/css/css-masking/clip-path-svg-content/clip-path-content-use-007.svg [ Pass Failure ]
-webkit.org/b/236932 imported/w3c/web-platform-tests/css/css-masking/mask-image/mask-image-url-image.html [ Pass ImageOnlyFailure ]
-webkit.org/b/236932 svg/W3C-SVG-1.2-Tiny/struct-use-recursion-01-t.svg [ Pass ImageOnlyFailure ]
-# Also happening on Mac...
-webkit.org/b/236932 imported/w3c/web-platform-tests/mimesniff/mime-types/charset-parameter.window.html [ Pass Failure ]
-webkit.org/b/221487 imported/w3c/web-platform-tests/server-timing/server_timing_header-parsing.https.html [ Pass Failure ]
-webkit.org/b/236932 imported/w3c/web-platform-tests/workers/SharedWorker_dataUrl.html [ Pass Failure ]
-webkit.org/b/236932 js/dom/Promise-reject-large-string.html [ Pass Failure ]
-webkit.org/b/236932 svg/animations/smil-leak-element-instances.svg [ Pass Failure ]
-webkit.org/b/68278 http/tests/history/back-with-fragment-change.py [ Pass Failure ]
+webkit.org/b/237685 imported/w3c/web-platform-tests/css/css-masking/clip-path-svg-content/clip-path-content-use-007.svg [ Pass Failure ]
+webkit.org/b/237686 imported/w3c/web-platform-tests/css/css-masking/mask-image/mask-image-url-image.html [ Pass ImageOnlyFailure ]
 
 # Flaky crash
 webkit.org/b/236930 imported/w3c/web-platform-tests/html/semantics/links/links-created-by-a-and-area-elements/target_blank_implicit_noopener.html [ Crash Pass ]


Modified: trunk/LayoutTests/svg/W3C-SVG-1.2-Tiny/struct-use-recursion-01-t.svg (291088 => 291089)

--- trunk/LayoutTests/svg/W3C-SVG-1.2-Tiny/struct-use-recursion-01-t.svg	2022-03-10 04:31:35 UTC (rev 291088)
+++ trunk/LayoutTests/svg/W3C-SVG-1.2-Tiny/struct-use-recursion-01-t.svg	2022-03-10 04:36:00 UTC (rev 291089)
@@ -2,6 +2,7 @@
viewBox="0 0 480 360" xmlns="http://www.w3.org/2000/svg"
   xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xe="http://www.w3.org/2001/xml-events">
+  
   
   
   

[webkit-changes] [291088] trunk/LayoutTests

2022-03-09 Thread heycam
Title: [291088] trunk/LayoutTests








Revision 291088
Author hey...@apple.com
Date 2022-03-09 20:31:35 -0800 (Wed, 09 Mar 2022)


Log Message
Unreviewed test gardening
https://bugs.webkit.org/show_bug.cgi?id=236931


* gpu-process/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/gpu-process/TestExpectations




Diff

Modified: trunk/LayoutTests/ChangeLog (291087 => 291088)

--- trunk/LayoutTests/ChangeLog	2022-03-10 03:31:10 UTC (rev 291087)
+++ trunk/LayoutTests/ChangeLog	2022-03-10 04:31:35 UTC (rev 291088)
@@ -1,6 +1,13 @@
 2022-03-09  Cameron McCormack  
 
 Unreviewed test gardening
+https://bugs.webkit.org/show_bug.cgi?id=236931
+
+* gpu-process/TestExpectations:
+
+2022-03-09  Cameron McCormack  
+
+Unreviewed test gardening
 https://bugs.webkit.org/show_bug.cgi?id=236930
 
 * gpu-process/TestExpectations:


Modified: trunk/LayoutTests/gpu-process/TestExpectations (291087 => 291088)

--- trunk/LayoutTests/gpu-process/TestExpectations	2022-03-10 03:31:10 UTC (rev 291087)
+++ trunk/LayoutTests/gpu-process/TestExpectations	2022-03-10 04:31:35 UTC (rev 291088)
@@ -320,9 +320,6 @@
 webkit.org/b/236927 fast/forms/autofocus-readonly-attribute.html [ Failure Pass ]
 webkit.org/b/236927 fast/forms/input-text-autofocus.html [ Pass Failure ]
 
-# Flaky timeout
-webkit.org/b/236931 editing/pasteboard/dom-paste/dom-paste-same-origin.html [ Timeout Pass ]
-
 # Flaky failure
 webkit.org/b/236932 css3/filters/backdrop/dynamic-with-clip-path.html [ Pass ImageOnlyFailure ]
 webkit.org/b/236932 css3/masking/mask-repeat-one-copy.html [ Pass ImageOnlyFailure ]






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [291086] trunk/LayoutTests

2022-03-09 Thread heycam
Title: [291086] trunk/LayoutTests








Revision 291086
Author hey...@apple.com
Date 2022-03-09 19:18:08 -0800 (Wed, 09 Mar 2022)


Log Message
Unreviewed test gardening
https://bugs.webkit.org/show_bug.cgi?id=236930


* gpu-process/TestExpectations:
* platform/ios/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/gpu-process/TestExpectations
trunk/LayoutTests/platform/ios/TestExpectations




Diff

Modified: trunk/LayoutTests/ChangeLog (291085 => 291086)

--- trunk/LayoutTests/ChangeLog	2022-03-10 03:05:30 UTC (rev 291085)
+++ trunk/LayoutTests/ChangeLog	2022-03-10 03:18:08 UTC (rev 291086)
@@ -1,3 +1,11 @@
+2022-03-09  Cameron McCormack  
+
+Unreviewed test gardening
+https://bugs.webkit.org/show_bug.cgi?id=236930
+
+* gpu-process/TestExpectations:
+* platform/ios/TestExpectations:
+
 2022-03-09  Matt Woodrow  
 
 Empty float rects should remain empty after integrally enclosing them.


Modified: trunk/LayoutTests/gpu-process/TestExpectations (291085 => 291086)

--- trunk/LayoutTests/gpu-process/TestExpectations	2022-03-10 03:05:30 UTC (rev 291085)
+++ trunk/LayoutTests/gpu-process/TestExpectations	2022-03-10 03:18:08 UTC (rev 291086)
@@ -340,9 +340,6 @@
 webkit.org/b/68278 http/tests/history/back-with-fragment-change.py [ Pass Failure ]
 
 # Flaky crash
-webkit.org/b/236930 accessibility/ios-simulator/aria-details.html [ Crash Pass ]
-webkit.org/b/236930 ddcss3/images/cross-fade-simple.html [ Crash Pass ]
-webkit.org/b/236794 editing/spelling/editing-word-with-marker-2.html [ Crash Pass ]
 webkit.org/b/236930 imported/w3c/web-platform-tests/html/semantics/links/links-created-by-a-and-area-elements/target_blank_implicit_noopener.html [ Crash Pass ]
 webkit.org/b/236930 imported/w3c/web-platform-tests/html/semantics/links/links-created-by-a-and-area-elements/target_blank_implicit_noopener_base.html [ Crash Pass ]
 webkit.org/b/236930 imported/w3c/web-platform-tests/webstorage/storage_session_window_open.window.html [ Crash Pass ]


Modified: trunk/LayoutTests/platform/ios/TestExpectations (291085 => 291086)

--- trunk/LayoutTests/platform/ios/TestExpectations	2022-03-10 03:05:30 UTC (rev 291085)
+++ trunk/LayoutTests/platform/ios/TestExpectations	2022-03-10 03:18:08 UTC (rev 291086)
@@ -3504,6 +3504,7 @@
 
 webkit.org/b/237295 fast/mediastream/video-rotation-gpu-process-crash.html [ Pass Crash ]
 
+webkit.org/b/236930 accessibility/ios-simulator/aria-details.html [ Crash Pass ]
 webkit.org/b/236794 editing/spelling/editing-word-with-marker-2.html [ Pass Crash ]
 
 webkit.org/b/237159 imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-049.html [ Pass Crash ]






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [291028] trunk/Source/WebCore

2022-03-08 Thread heycam
Title: [291028] trunk/Source/WebCore








Revision 291028
Author hey...@apple.com
Date 2022-03-08 18:58:53 -0800 (Tue, 08 Mar 2022)


Log Message
Skip scheduling lazy UA shadow tree creation if already created or not needed
https://bugs.webkit.org/show_bug.cgi?id=237546


Reviewed by Aditya Keerthi.

Bug 236747 made  element UA shadow trees get created lazily.
HTMLInputElement::insertedIntoAncestor now schedules the UA shadow tree
to be created the next time style is flushed. We currently do this every
time an  element is inserted into the document, but there's only
a need to do this if the particular input type needs a shadow tree and
we haven't already created it.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::insertedIntoAncestor):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/html/HTMLInputElement.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (291027 => 291028)

--- trunk/Source/WebCore/ChangeLog	2022-03-09 02:56:37 UTC (rev 291027)
+++ trunk/Source/WebCore/ChangeLog	2022-03-09 02:58:53 UTC (rev 291028)
@@ -1,3 +1,21 @@
+2022-03-08  Cameron McCormack  
+
+Skip scheduling lazy UA shadow tree creation if already created or not needed
+https://bugs.webkit.org/show_bug.cgi?id=237546
+
+
+Reviewed by Aditya Keerthi.
+
+Bug 236747 made  element UA shadow trees get created lazily.
+HTMLInputElement::insertedIntoAncestor now schedules the UA shadow tree
+to be created the next time style is flushed. We currently do this every
+time an  element is inserted into the document, but there's only
+a need to do this if the particular input type needs a shadow tree and
+we haven't already created it.
+
+* html/HTMLInputElement.cpp:
+(WebCore::HTMLInputElement::insertedIntoAncestor):
+
 2022-03-08  Jean-Yves Avenard  
 
 Split SourceBufferParserWebM and have platform agnostic WebMParser


Modified: trunk/Source/WebCore/html/HTMLInputElement.cpp (291027 => 291028)

--- trunk/Source/WebCore/html/HTMLInputElement.cpp	2022-03-09 02:56:37 UTC (rev 291027)
+++ trunk/Source/WebCore/html/HTMLInputElement.cpp	2022-03-09 02:58:53 UTC (rev 291028)
@@ -1574,7 +1574,7 @@
 #endif
 if (isRadioButton())
 updateValidity();
-if (insertionType.connectedToDocument && !m_hasPendingUserAgentShadowTreeUpdate) {
+if (insertionType.connectedToDocument && m_inputType->needsShadowSubtree() && !m_inputType->hasCreatedShadowSubtree() && !m_hasPendingUserAgentShadowTreeUpdate) {
 document().addElementWithPendingUserAgentShadowTreeUpdate(*this);
 m_hasPendingUserAgentShadowTreeUpdate = true;
 }






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [290639] trunk

2022-03-01 Thread heycam
Title: [290639] trunk








Revision 290639
Author hey...@apple.com
Date 2022-03-01 02:28:38 -0800 (Tue, 01 Mar 2022)


Log Message
Make input element UA shadow tree creation lazy
https://bugs.webkit.org/show_bug.cgi?id=236747

Reviewed by Aditya Keerthi.

Source/WebCore:

We currently delay InputType creation for parser inserted elements until
just after the attributes have been set, so that we don't wastefully
create an InputType and the UA shadow tree creation if a non-text
type="" was specified on the tag. We don't do anything similar for
script inserted input elements. We could make the InputType creation
lazy, but most of the wasted time is due to the shadow tree creation.

This patch makes InputType shadow tree creation lazy by delaying it
until one of the following happens:

1. the element is inserted into the document
2. the type="" or value="" attributes are changed before the element
   is inserted into the document
3. any DOM methods that need access to the innerTextElement() are
   called on the element before the element is inserted into the
   document

Not all places where we call innerTextElement() on the
HTMLInputElement are safe to lazily create the shadow trees, so we
have two accessors:

- innerTextElement() returns the inner text element if it's been
  created already
- innerTextElementCreatingShadowSubtreeIfNeeded will perform the lazy
  shadow tree construction if it hasn't already been done

Since the existing
createShadowSubtreeAndUpdateInnerTextElementEditability function has
more responsibility than just creating the subtree and ensuring the
editability is set appropriately, it's renamed to a more manageable
createShadowSubtree.

This change is a 0.5% progression on Speedometer 2.

Test: fast/forms/lazy-shadow-tree-creation.html

* html/BaseDateAndTimeInputType.h:
* html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::createShadowSubtree):
(WebCore::BaseDateAndTimeInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/ColorInputType.h:
* html/ColorInputType.cpp:
(WebCore::ColorInputType::createShadowSubtree):
(WebCore::ColorInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/FileInputType.h:
* html/FileInputType.cpp:
(WebCore::FileInputType::createShadowSubtree):
(WebCore::FileInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/InputType.cpp:
(WebCore::InputType::createShadowSubtree):
(WebCore::InputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/RangeInputType.h:
* html/RangeInputType.cpp:
(WebCore::RangeInputType::createShadowSubtree):
(WebCore::RangeInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/SearchInputType.h:
* html/SearchInputType.cpp:
(WebCore::SearchInputType::createShadowSubtree):
(WebCore::SearchInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
Renamed createShadowSubtreeAndUpdateInnerTextElementEditability to
createShadowSubtree and remove the "isInnerTextElementEditable"
argument, since we can ask the element() for its value if needed.
createShadowSubtree is now also responsible for creating the shadow
root.

* html/TextFieldInputType.h:
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::createShadowSubtree):
(WebCore::TextFieldInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
Renamed. Ensure all shadow tree state is up to date now that it can be
created later.

* html/InputType.h:
* html/InputType.cpp:
(WebCore::InputType::createShadowSubtree):
(WebCore::InputType::hasCreatedShadowSubtree const):
New functions to create the shadow subtree if it hasn't been done
already, and to query whether it's been done.

* html/HTMLInputElement.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::innerTextElementCreatingShadowSubtreeIfNeeded):
* html/HTMLTextAreaElement.h:
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::innerTextElementCreatingShadowSubtreeIfNeeded):
* html/HTMLTextFormControlElement.h:
* html/InputType.h:
* html/InputType.cpp:
(WebCore::InputType::innerTextElementCreatingShadowSubtreeIfNeeded):
New functions to first create the shadow subtree before returning
innerTextElement(). HTMLTextAreaElement never lazily creates its
shadow subtree and so just returns innerTextElement().

* html/HTMLInputElement.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::createShadowSubtreeAndUpdateInnerTextElementEditability):
Deleted. Just call through to m_inputType->createShadowTree()
directly.

(WebCore::HTMLInputElement::HTMLInputElement):
(WebCore::HTMLInputElement::create):
(WebCore::HTMLInputElement::initializeInputType):
(WebCore::HTMLInputElement::updateType):
Don't immediately create the shadow tree.

(WebCore::HTMLInputElement::didFinishInsertingNode):
Create the shadow subtree now that the element's been inserted. No
need to call dataListMayHaveChanged since
TextFieldInputType::createShadowSubtree will now do this.

* 

[webkit-changes] [290574] trunk/Source/WebCore

2022-02-27 Thread heycam
Title: [290574] trunk/Source/WebCore








Revision 290574
Author hey...@apple.com
Date 2022-02-27 17:16:00 -0800 (Sun, 27 Feb 2022)


Log Message
Add a mechanism to request a UA shadow tree update before style
https://bugs.webkit.org/show_bug.cgi?id=237224

Reviewed by Antti Koivisto.

SVG  elements register themselves with the document when their
shadow tree contents need updating, and this updating is done in
Document::resolveStyle. For lazy HTML  element UA shadow trees
(in bug 236747) we need something similar.

* dom/Document.cpp:
(WebCore::Document::resolveStyle):
(WebCore::Document::addElementWithPendingUserAgentShadowTreeUpdate):
(WebCore::Document::removeElementWithPendingUserAgentShadowTreeUpdate):
* dom/Document.h:
* dom/Element.h:
(WebCore::Element::updateUserAgentShadowTree):
* svg/SVGDocumentExtensions.cpp:
(WebCore::SVGDocumentExtensions::~SVGDocumentExtensions): Deleted.
(WebCore::SVGDocumentExtensions::addUseElementWithPendingShadowTreeUpdate): Deleted.
(WebCore::SVGDocumentExtensions::removeUseElementWithPendingShadowTreeUpdate): Deleted.
* svg/SVGDocumentExtensions.h:
(WebCore::SVGDocumentExtensions::useElementsWithPendingShadowTreeUpdate const): Deleted.
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::insertedIntoAncestor):
(WebCore::SVGUseElement::removedFromAncestor):
(WebCore::SVGUseElement::updateUserAgentShadowTree):
(WebCore::SVGUseElement::invalidateShadowTree):
(WebCore::SVGUseElement::updateShadowTree): Deleted.
* svg/SVGUseElement.h:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/dom/Document.cpp
trunk/Source/WebCore/dom/Document.h
trunk/Source/WebCore/dom/Element.h
trunk/Source/WebCore/svg/SVGDocumentExtensions.cpp
trunk/Source/WebCore/svg/SVGDocumentExtensions.h
trunk/Source/WebCore/svg/SVGUseElement.cpp
trunk/Source/WebCore/svg/SVGUseElement.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (290573 => 290574)

--- trunk/Source/WebCore/ChangeLog	2022-02-27 23:52:38 UTC (rev 290573)
+++ trunk/Source/WebCore/ChangeLog	2022-02-28 01:16:00 UTC (rev 290574)
@@ -1,3 +1,36 @@
+2022-02-27  Cameron McCormack  
+
+Add a mechanism to request a UA shadow tree update before style
+https://bugs.webkit.org/show_bug.cgi?id=237224
+
+Reviewed by Antti Koivisto.
+
+SVG  elements register themselves with the document when their
+shadow tree contents need updating, and this updating is done in
+Document::resolveStyle. For lazy HTML  element UA shadow trees
+(in bug 236747) we need something similar.
+
+* dom/Document.cpp:
+(WebCore::Document::resolveStyle):
+(WebCore::Document::addElementWithPendingUserAgentShadowTreeUpdate):
+(WebCore::Document::removeElementWithPendingUserAgentShadowTreeUpdate):
+* dom/Document.h:
+* dom/Element.h:
+(WebCore::Element::updateUserAgentShadowTree):
+* svg/SVGDocumentExtensions.cpp:
+(WebCore::SVGDocumentExtensions::~SVGDocumentExtensions): Deleted.
+(WebCore::SVGDocumentExtensions::addUseElementWithPendingShadowTreeUpdate): Deleted.
+(WebCore::SVGDocumentExtensions::removeUseElementWithPendingShadowTreeUpdate): Deleted.
+* svg/SVGDocumentExtensions.h:
+(WebCore::SVGDocumentExtensions::useElementsWithPendingShadowTreeUpdate const): Deleted.
+* svg/SVGUseElement.cpp:
+(WebCore::SVGUseElement::insertedIntoAncestor):
+(WebCore::SVGUseElement::removedFromAncestor):
+(WebCore::SVGUseElement::updateUserAgentShadowTree):
+(WebCore::SVGUseElement::invalidateShadowTree):
+(WebCore::SVGUseElement::updateShadowTree): Deleted.
+* svg/SVGUseElement.h:
+
 2022-02-27  Antoine Quint  
 
 [web-animations] web-animations/timing-model/animations/setting-the-timeline-of-an-animation.html is a unique failure


Modified: trunk/Source/WebCore/dom/Document.cpp (290573 => 290574)

--- trunk/Source/WebCore/dom/Document.cpp	2022-02-27 23:52:38 UTC (rev 290573)
+++ trunk/Source/WebCore/dom/Document.cpp	2022-02-28 01:16:00 UTC (rev 290574)
@@ -2005,15 +2005,18 @@
 
 RenderView::RepaintRegionAccumulator repaintRegionAccumulator(renderView());
 
-// FIXME: Do this update per tree scope.
-if (auto* extensions = m_svgExtensions.get()) {
-auto elements = copyToVectorOf>(extensions->useElementsWithPendingShadowTreeUpdate());
-// We can't clear m_svgUseElements here because updateShadowTree may end up executing arbitrary scripts
-// which may insert new SVG use elements or remove existing ones inside sync IPC via ImageLoader::updateFromElement.
-for (auto& element : elements)
-element->updateShadowTree();
-}
+// FIXME: Do this user agent shadow tree update per tree scope.
 
+// We can't clear m_elementsWithPendingUserAgentShadowTreeUpdates here
+// because SVGUseElement::updateUserAgentShadowTree may end up executing
+// arbitrary scripts which may insert new SVG use 

[webkit-changes] [290284] trunk

2022-02-21 Thread heycam
Title: [290284] trunk








Revision 290284
Author hey...@apple.com
Date 2022-02-21 19:36:52 -0800 (Mon, 21 Feb 2022)


Log Message
Make input element UA shadow tree creation lazy
https://bugs.webkit.org/show_bug.cgi?id=236747

Reviewed by Aditya Keerthi.

Source/WebCore:

We currently delay InputType creation for parser inserted elements until
just after the attributes have been set, so that we don't wastefully
create an InputType and the UA shadow tree creation if a non-text
type="" was specified on the tag. We don't do anything similar for
script inserted input elements. We could make the InputType creation
lazy, but most of the wasted time is due to the shadow tree creation.

This patch makes InputType shadow tree creation lazy by delaying it
until one of the following happens:

1. the element is inserted into the document
2. the type="" or value="" attributes are changed before the element
   is inserted into the document
3. any DOM methods that need access to the innerTextElement() are
   called on the element before the element is inserted into the
   document

Not all places where we call innerTextElement() on the
HTMLInputElement are safe to lazily create the shadow trees, so we
have two accessors:

- innerTextElement() returns the inner text element if it's been
  created already
- innerTextElementCreatingShadowSubtreeIfNeeded will perform the lazy
  shadow tree construction if it hasn't already been done

Since the existing
createShadowSubtreeAndUpdateInnerTextElementEditability function has
more responsibility than just creating the subtree and ensuring the
editability is set appropriately, it's renamed to a more manageable
createShadowSubtree.

This change is a 0.5% progression on Speedometer 2.

Test: fast/forms/lazy-shadow-tree-creation.html

* html/BaseDateAndTimeInputType.h:
* html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::createShadowSubtree):
(WebCore::BaseDateAndTimeInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/ColorInputType.h:
* html/ColorInputType.cpp:
(WebCore::ColorInputType::createShadowSubtree):
(WebCore::ColorInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/FileInputType.h:
* html/FileInputType.cpp:
(WebCore::FileInputType::createShadowSubtree):
(WebCore::FileInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/InputType.cpp:
(WebCore::InputType::createShadowSubtree):
(WebCore::InputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/RangeInputType.h:
* html/RangeInputType.cpp:
(WebCore::RangeInputType::createShadowSubtree):
(WebCore::RangeInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/SearchInputType.h:
* html/SearchInputType.cpp:
(WebCore::SearchInputType::createShadowSubtree):
(WebCore::SearchInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
Renamed createShadowSubtreeAndUpdateInnerTextElementEditability to
createShadowSubtree and remove the "isInnerTextElementEditable"
argument, since we can ask the element() for its value if needed.
createShadowSubtree is now also responsible for creating the shadow
root.

* html/TextFieldInputType.h:
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::createShadowSubtree):
(WebCore::TextFieldInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
Renamed. Ensure all shadow tree state is up to date now that it can be
created later.

* html/InputType.h:
* html/InputType.cpp:
(WebCore::InputType::createShadowSubtree):
(WebCore::InputType::hasCreatedShadowSubtree const):
New functions to create the shadow subtree if it hasn't been done
already, and to query whether it's been done.

* html/HTMLInputElement.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::innerTextElementCreatingShadowSubtreeIfNeeded):
* html/HTMLTextAreaElement.h:
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::innerTextElementCreatingShadowSubtreeIfNeeded):
* html/HTMLTextFormControlElement.h:
* html/InputType.h:
* html/InputType.cpp:
(WebCore::InputType::innerTextElementCreatingShadowSubtreeIfNeeded):
New functions to first create the shadow subtree before returning
innerTextElement(). HTMLTextAreaElement never lazily creates its
shadow subtree and so just returns innerTextElement().

* html/HTMLInputElement.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::createShadowSubtreeAndUpdateInnerTextElementEditability):
Deleted. Just call through to m_inputType->createShadowTree()
directly.

(WebCore::HTMLInputElement::HTMLInputElement):
(WebCore::HTMLInputElement::create):
(WebCore::HTMLInputElement::initializeInputType):
(WebCore::HTMLInputElement::updateType):
Don't immediately create the shadow tree.

(WebCore::HTMLInputElement::didFinishInsertingNode):
Create the shadow subtree now that the element's been inserted. No
need to call dataListMayHaveChanged since
TextFieldInputType::createShadowSubtree will now do this.

* 

[webkit-changes] [290086] trunk/Source/WebCore

2022-02-17 Thread heycam
Title: [290086] trunk/Source/WebCore








Revision 290086
Author hey...@apple.com
Date 2022-02-17 16:01:20 -0800 (Thu, 17 Feb 2022)


Log Message
Always use ChildChange::Source::Parser when creating input element UA shadow tree contents
https://bugs.webkit.org/show_bug.cgi?id=236740

Reviewed by Dean Jackson.

When creating an input element's UA shadow tree, we currently use a
ChildChange::Source value that depends on whether the input element
itself was parser- or script-inserted. But since UA shadow trees are
not exposed to content, and we don't have any dependency on the extra
work that inserting using ChildChange::Source::API does, we can use
ChildChange::Source::Parser unconditionally.

Local testing shows this scores a 0.1% Speedometer 2 improvement.

* html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/BaseDateAndTimeInputType.h:
* html/ColorInputType.cpp:
(WebCore::ColorInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/ColorInputType.h:
* html/FileInputType.cpp:
(WebCore::FileInputType::appendFormData const):
(WebCore::FileInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/FileInputType.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/InputType.cpp:
(WebCore::InputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/InputType.h:
* html/RangeInputType.cpp:
(WebCore::RangeInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/RangeInputType.h:
* html/SearchInputType.cpp:
(WebCore::SearchInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/SearchInputType.h:
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
* html/TextFieldInputType.h:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/html/BaseDateAndTimeInputType.cpp
trunk/Source/WebCore/html/BaseDateAndTimeInputType.h
trunk/Source/WebCore/html/ColorInputType.cpp
trunk/Source/WebCore/html/ColorInputType.h
trunk/Source/WebCore/html/FileInputType.cpp
trunk/Source/WebCore/html/FileInputType.h
trunk/Source/WebCore/html/HTMLInputElement.cpp
trunk/Source/WebCore/html/InputType.cpp
trunk/Source/WebCore/html/InputType.h
trunk/Source/WebCore/html/RangeInputType.cpp
trunk/Source/WebCore/html/RangeInputType.h
trunk/Source/WebCore/html/SearchInputType.cpp
trunk/Source/WebCore/html/SearchInputType.h
trunk/Source/WebCore/html/TextFieldInputType.cpp
trunk/Source/WebCore/html/TextFieldInputType.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (290085 => 290086)

--- trunk/Source/WebCore/ChangeLog	2022-02-17 23:48:45 UTC (rev 290085)
+++ trunk/Source/WebCore/ChangeLog	2022-02-18 00:01:20 UTC (rev 290086)
@@ -1,3 +1,44 @@
+2022-02-17  Cameron McCormack  
+
+Always use ChildChange::Source::Parser when creating input element UA shadow tree contents
+https://bugs.webkit.org/show_bug.cgi?id=236740
+
+Reviewed by Dean Jackson.
+
+When creating an input element's UA shadow tree, we currently use a
+ChildChange::Source value that depends on whether the input element
+itself was parser- or script-inserted. But since UA shadow trees are
+not exposed to content, and we don't have any dependency on the extra
+work that inserting using ChildChange::Source::API does, we can use
+ChildChange::Source::Parser unconditionally.
+
+Local testing shows this scores a 0.1% Speedometer 2 improvement.
+
+* html/BaseDateAndTimeInputType.cpp:
+(WebCore::BaseDateAndTimeInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
+* html/BaseDateAndTimeInputType.h:
+* html/ColorInputType.cpp:
+(WebCore::ColorInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
+* html/ColorInputType.h:
+* html/FileInputType.cpp:
+(WebCore::FileInputType::appendFormData const):
+(WebCore::FileInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
+* html/FileInputType.h:
+* html/HTMLInputElement.cpp:
+(WebCore::HTMLInputElement::createShadowSubtreeAndUpdateInnerTextElementEditability):
+* html/InputType.cpp:
+(WebCore::InputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
+* html/InputType.h:
+* html/RangeInputType.cpp:
+(WebCore::RangeInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
+* html/RangeInputType.h:
+* html/SearchInputType.cpp:
+(WebCore::SearchInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
+* html/SearchInputType.h:
+* html/TextFieldInputType.cpp:
+(WebCore::TextFieldInputType::createShadowSubtreeAndUpdateInnerTextElementEditability):
+* html/TextFieldInputType.h:
+
 2022-02-17  

[webkit-changes] [289991] trunk/Source/WebCore

2022-02-16 Thread heycam
Title: [289991] trunk/Source/WebCore








Revision 289991
Author hey...@apple.com
Date 2022-02-16 19:21:00 -0800 (Wed, 16 Feb 2022)


Log Message
Cache an entire attribute QualifiedName when parsing HTML, not just its local name AtomString
https://bugs.webkit.org/show_bug.cgi?id=236570


Reviewed by Darin Adler.

Bug 229907 added HTMLAtomStringCache, which uses a fast to compute hash
that works well to cache HTML tag names, attribute names, and attribute
values. When AtomHTMLToken initializes its list of Attributes, it uses
HTMLAtomStringCache to look up or create an AtomString for the
attribute's local name, and then creates a QualifiedName to wrap it.
QualifiedName construction involves looking up QualifiedNameCache, which
is a thread-specific cache of QualifiedNameImpl objects. If we make
HTMLAtomStringCache responsible for caching an attribute's QualifiedName
instead of just its local name AtomString, we can avoid the work of
looking up the QualifiedNameCache.

To reflect its broader responsibilities, HTMLAtomStringCache is renamed
to HTMLNameCache.

Doing this results in a 0.2-0.3% improvement on Speedometer 2, and a
0.3-0.4% improvement on PLT5 (with the lower end of those ranges being
on Apple Silicon and the higher end on Intel).

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/QualifiedName.h:
(WebCore::QualifiedName::QualifiedName):
* html/parser/AtomHTMLToken.h:
(WebCore::AtomHTMLToken::initializeAttributes):
(WebCore::AtomHTMLToken::AtomHTMLToken):
* html/parser/HTMLAtomStringCache.h: Removed.
(WebCore::HTMLAtomStringCache::makeTagOrAttributeName): Deleted.
(WebCore::HTMLAtomStringCache::makeAttributeValue): Deleted.
(WebCore::HTMLAtomStringCache::clear): Deleted.
(WebCore::HTMLAtomStringCache::make): Deleted.
(WebCore::HTMLAtomStringCache::cacheSlot): Deleted.
* html/parser/HTMLNameCache.cpp: Renamed from Source/WebCore/html/parser/HTMLAtomStringCache.cpp.
(WebCore::HTMLNameCache::atomStringCache):
(WebCore::HTMLNameCache::qualifiedNameCache):
* html/parser/HTMLNameCache.h: Added.
(WebCore::HTMLNameCache::makeTagName):
(WebCore::HTMLNameCache::makeAttributeQualifiedName):
(WebCore::HTMLNameCache::makeAttributeValue):
(WebCore::HTMLNameCache::clear):
(WebCore::HTMLNameCache::makeAtomString):
(WebCore::HTMLNameCache::makeQualifiedName):
(WebCore::HTMLNameCache::slotIndex):
(WebCore::HTMLNameCache::atomStringCacheSlot):
(WebCore::HTMLNameCache::qualifiedNameCacheSlot):
* page/MemoryRelease.cpp:
(WebCore::releaseNoncriticalMemory):
* page/cocoa/MemoryReleaseCocoa.mm:
(WebCore::jettisonExpensiveObjectsOnTopLevelNavigation):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Sources.txt
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
trunk/Source/WebCore/dom/QualifiedName.h
trunk/Source/WebCore/html/parser/AtomHTMLToken.h
trunk/Source/WebCore/page/MemoryRelease.cpp
trunk/Source/WebCore/page/cocoa/MemoryReleaseCocoa.mm


Added Paths

trunk/Source/WebCore/html/parser/HTMLNameCache.cpp
trunk/Source/WebCore/html/parser/HTMLNameCache.h


Removed Paths

trunk/Source/WebCore/html/parser/HTMLAtomStringCache.cpp
trunk/Source/WebCore/html/parser/HTMLAtomStringCache.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (289990 => 289991)

--- trunk/Source/WebCore/ChangeLog	2022-02-17 03:19:39 UTC (rev 289990)
+++ trunk/Source/WebCore/ChangeLog	2022-02-17 03:21:00 UTC (rev 289991)
@@ -1,3 +1,60 @@
+2022-02-16  Cameron McCormack  
+
+Cache an entire attribute QualifiedName when parsing HTML, not just its local name AtomString
+https://bugs.webkit.org/show_bug.cgi?id=236570
+
+
+Reviewed by Darin Adler.
+
+Bug 229907 added HTMLAtomStringCache, which uses a fast to compute hash
+that works well to cache HTML tag names, attribute names, and attribute
+values. When AtomHTMLToken initializes its list of Attributes, it uses
+HTMLAtomStringCache to look up or create an AtomString for the
+attribute's local name, and then creates a QualifiedName to wrap it.
+QualifiedName construction involves looking up QualifiedNameCache, which
+is a thread-specific cache of QualifiedNameImpl objects. If we make
+HTMLAtomStringCache responsible for caching an attribute's QualifiedName
+instead of just its local name AtomString, we can avoid the work of
+looking up the QualifiedNameCache.
+
+To reflect its broader responsibilities, HTMLAtomStringCache is renamed
+to HTMLNameCache.
+
+Doing this results in a 0.2-0.3% improvement on Speedometer 2, and a
+0.3-0.4% improvement on PLT5 (with the lower end of those ranges being
+on Apple Silicon and the higher end on Intel).
+
+* Sources.txt:
+* WebCore.xcodeproj/project.pbxproj:
+* dom/QualifiedName.h:
+(WebCore::QualifiedName::QualifiedName):
+* html/parser/AtomHTMLToken.h:
+(WebCore::AtomHTMLToken::initializeAttributes):
+

[webkit-changes] [289777] trunk/Source/WebCore

2022-02-14 Thread heycam
Title: [289777] trunk/Source/WebCore








Revision 289777
Author hey...@apple.com
Date 2022-02-14 15:59:59 -0800 (Mon, 14 Feb 2022)


Log Message
Consistenly use hasTagName instead of is<> in HTMLStackItem testing functions
https://bugs.webkit.org/show_bug.cgi?id=236571

Reviewed by Sam Weinig.

No reason to use is<> for a couple of element names but hasTagName for
all others.

* html/parser/HTMLElementStack.cpp:
(WebCore::HTMLNames::isScopeMarker):
(WebCore::HTMLNames::isTableScopeMarker):
(WebCore::HTMLNames::isSelectScopeMarker):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/html/parser/HTMLElementStack.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (289776 => 289777)

--- trunk/Source/WebCore/ChangeLog	2022-02-14 23:33:58 UTC (rev 289776)
+++ trunk/Source/WebCore/ChangeLog	2022-02-14 23:59:59 UTC (rev 289777)
@@ -1,3 +1,18 @@
+2022-02-14  Cameron McCormack  
+
+Consistenly use hasTagName instead of is<> in HTMLStackItem testing functions
+https://bugs.webkit.org/show_bug.cgi?id=236571
+
+Reviewed by Sam Weinig.
+
+No reason to use is<> for a couple of element names but hasTagName for
+all others.
+
+* html/parser/HTMLElementStack.cpp:
+(WebCore::HTMLNames::isScopeMarker):
+(WebCore::HTMLNames::isTableScopeMarker):
+(WebCore::HTMLNames::isSelectScopeMarker):
+
 2022-02-14  Simon Fraser  
 
 Fix crash with deeply nested async overflow scroll


Modified: trunk/Source/WebCore/html/parser/HTMLElementStack.cpp (289776 => 289777)

--- trunk/Source/WebCore/html/parser/HTMLElementStack.cpp	2022-02-14 23:33:58 UTC (rev 289776)
+++ trunk/Source/WebCore/html/parser/HTMLElementStack.cpp	2022-02-14 23:59:59 UTC (rev 289777)
@@ -49,7 +49,7 @@
 || item.hasTagName(captionTag)
 || item.hasTagName(marqueeTag)
 || item.hasTagName(objectTag)
-|| is(item.node())
+|| item.hasTagName(tableTag)
 || item.hasTagName(tdTag)
 || item.hasTagName(thTag)
 || item.hasTagName(MathMLNames::miTag)
@@ -74,7 +74,7 @@
 
 inline bool isTableScopeMarker(HTMLStackItem& item)
 {
-return is(item.node())
+return item.hasTagName(tableTag)
 || item.hasTagName(templateTag)
 || isRootNode(item);
 }
@@ -110,7 +110,7 @@
 
 inline bool isSelectScopeMarker(HTMLStackItem& item)
 {
-return !is(item.node()) && !is(item.node());
+return !item.hasTagName(optgroupTag) && !item.hasTagName(optionTag);
 }
 
 }






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [289692] trunk/Source/WebCore

2022-02-12 Thread heycam
Title: [289692] trunk/Source/WebCore








Revision 289692
Author hey...@apple.com
Date 2022-02-12 07:29:06 -0800 (Sat, 12 Feb 2022)


Log Message
Make WidgetHierarchyUpdatesSuspensionScope cheaper if it has nothing to do
https://bugs.webkit.org/show_bug.cgi?id=236486

Reviewed by Simon Fraser.

With content that does a lot of DOM manipulation, we can create and
destroy a WidgetHierarchyUpdatesSuspensionScope on the stack many times.
When this object has nothing to do, it calls an out of line function.
This patch pulls out the check for whether it needs to call
moveWidgets() into the inline destructor.

This is a 1% saving on the jQuery-TodoMVC subtest of Speedometer 2,
though the effect on the top line score is minimal.

* rendering/RenderWidget.cpp:
(WebCore::WidgetHierarchyUpdatesSuspensionScope::moveWidgets):
* rendering/RenderWidget.h:
(WebCore::WidgetHierarchyUpdatesSuspensionScope::~WidgetHierarchyUpdatesSuspensionScope):
(WebCore::WidgetHierarchyUpdatesSuspensionScope::scheduleWidgetToMove):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/rendering/RenderWidget.cpp
trunk/Source/WebCore/rendering/RenderWidget.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (289691 => 289692)

--- trunk/Source/WebCore/ChangeLog	2022-02-12 15:08:16 UTC (rev 289691)
+++ trunk/Source/WebCore/ChangeLog	2022-02-12 15:29:06 UTC (rev 289692)
@@ -1,5 +1,27 @@
 2022-02-12  Cameron McCormack  
 
+Make WidgetHierarchyUpdatesSuspensionScope cheaper if it has nothing to do
+https://bugs.webkit.org/show_bug.cgi?id=236486
+
+Reviewed by Simon Fraser.
+
+With content that does a lot of DOM manipulation, we can create and
+destroy a WidgetHierarchyUpdatesSuspensionScope on the stack many times.
+When this object has nothing to do, it calls an out of line function.
+This patch pulls out the check for whether it needs to call
+moveWidgets() into the inline destructor.
+
+This is a 1% saving on the jQuery-TodoMVC subtest of Speedometer 2,
+though the effect on the top line score is minimal.
+
+* rendering/RenderWidget.cpp:
+(WebCore::WidgetHierarchyUpdatesSuspensionScope::moveWidgets):
+* rendering/RenderWidget.h:
+(WebCore::WidgetHierarchyUpdatesSuspensionScope::~WidgetHierarchyUpdatesSuspensionScope):
+(WebCore::WidgetHierarchyUpdatesSuspensionScope::scheduleWidgetToMove):
+
+2022-02-12  Cameron McCormack  
+
 Look up InputTypeFactoryMap with an ASCII lowercase string instead of using a ASCIICaseInsensitiveHash
 https://bugs.webkit.org/show_bug.cgi?id=236532
 


Modified: trunk/Source/WebCore/rendering/RenderWidget.cpp (289691 => 289692)

--- trunk/Source/WebCore/rendering/RenderWidget.cpp	2022-02-12 15:08:16 UTC (rev 289691)
+++ trunk/Source/WebCore/rendering/RenderWidget.cpp	2022-02-12 15:29:06 UTC (rev 289692)
@@ -49,6 +49,7 @@
 }
 
 unsigned WidgetHierarchyUpdatesSuspensionScope::s_widgetHierarchyUpdateSuspendCount = 0;
+bool WidgetHierarchyUpdatesSuspensionScope::s_haveScheduledWidgetToMove = false;
 
 WidgetHierarchyUpdatesSuspensionScope::WidgetToParentMap& WidgetHierarchyUpdatesSuspensionScope::widgetNewParentMap()
 {
@@ -58,6 +59,7 @@
 
 void WidgetHierarchyUpdatesSuspensionScope::moveWidgets()
 {
+ASSERT(s_haveScheduledWidgetToMove);
 while (!widgetNewParentMap().isEmpty()) {
 auto map = std::exchange(widgetNewParentMap(), { });
 for (auto& entry : map) {
@@ -72,6 +74,7 @@
 }
 }
 }
+s_haveScheduledWidgetToMove = false;
 }
 
 static void moveWidgetToParentSoon(Widget& child, FrameView* parent)


Modified: trunk/Source/WebCore/rendering/RenderWidget.h (289691 => 289692)

--- trunk/Source/WebCore/rendering/RenderWidget.h	2022-02-12 15:08:16 UTC (rev 289691)
+++ trunk/Source/WebCore/rendering/RenderWidget.h	2022-02-12 15:29:06 UTC (rev 289692)
@@ -37,13 +37,13 @@
 ~WidgetHierarchyUpdatesSuspensionScope()
 {
 ASSERT(s_widgetHierarchyUpdateSuspendCount);
-if (s_widgetHierarchyUpdateSuspendCount == 1)
+if (s_widgetHierarchyUpdateSuspendCount == 1 && s_haveScheduledWidgetToMove)
 moveWidgets();
 s_widgetHierarchyUpdateSuspendCount--;
 }
 
 static bool isSuspended() { return s_widgetHierarchyUpdateSuspendCount; }
-static void scheduleWidgetToMove(Widget& widget, FrameView* frame) { widgetNewParentMap().set(, frame); }
+static void scheduleWidgetToMove(Widget&, FrameView*);
 
 private:
 using WidgetToParentMap = HashMap, FrameView*>;
@@ -51,8 +51,15 @@
 
 WEBCORE_EXPORT void moveWidgets();
 WEBCORE_EXPORT static unsigned s_widgetHierarchyUpdateSuspendCount;
+WEBCORE_EXPORT static bool s_haveScheduledWidgetToMove;
 };
-
+
+inline void WidgetHierarchyUpdatesSuspensionScope::scheduleWidgetToMove(Widget& widget, FrameView* frame)
+{
+s_haveScheduledWidgetToMove = true;
+widgetNewParentMap().set(, frame);
+}
+
 class RenderWidget : 

[webkit-changes] [289691] trunk/Source/WebCore

2022-02-12 Thread heycam
Title: [289691] trunk/Source/WebCore








Revision 289691
Author hey...@apple.com
Date 2022-02-12 07:08:16 -0800 (Sat, 12 Feb 2022)


Log Message
Look up InputTypeFactoryMap with an ASCII lowercase string instead of using a ASCIICaseInsensitiveHash
https://bugs.webkit.org/show_bug.cgi?id=236532

Reviewed by Myles C. Maxfield.

InputType::create looks up the InputTypeFactoryMap based on the
AtomString value of the  attribute. The HashMap uses an
ASCIICaseInsensitiveHash, but the AtomStrings stored in the map are all
ASCII lowercase to begin with. This means that we spend time doing an
ASCII case insensitive hash computation on the query string. Most
content already supplies an ASCII lowercase type value, so it's less
work to ASCII lowercase the type value and then look up the HashMap
using the regular hash for AtomStrings (i.e., pulling the hash out of
AtomString).

Doing this is a 0.5% improvement on a couple of Speedometer 2 subtests,
and a 0.1% improvement to the overall score.

* html/InputType.cpp:
(WebCore::InputType::create):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/html/InputType.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (289690 => 289691)

--- trunk/Source/WebCore/ChangeLog	2022-02-12 14:20:42 UTC (rev 289690)
+++ trunk/Source/WebCore/ChangeLog	2022-02-12 15:08:16 UTC (rev 289691)
@@ -1,3 +1,26 @@
+2022-02-12  Cameron McCormack  
+
+Look up InputTypeFactoryMap with an ASCII lowercase string instead of using a ASCIICaseInsensitiveHash
+https://bugs.webkit.org/show_bug.cgi?id=236532
+
+Reviewed by Myles C. Maxfield.
+
+InputType::create looks up the InputTypeFactoryMap based on the
+AtomString value of the  attribute. The HashMap uses an
+ASCIICaseInsensitiveHash, but the AtomStrings stored in the map are all
+ASCII lowercase to begin with. This means that we spend time doing an
+ASCII case insensitive hash computation on the query string. Most
+content already supplies an ASCII lowercase type value, so it's less
+work to ASCII lowercase the type value and then look up the HashMap
+using the regular hash for AtomStrings (i.e., pulling the hash out of
+AtomString).
+
+Doing this is a 0.5% improvement on a couple of Speedometer 2 subtests,
+and a 0.1% improvement to the overall score.
+
+* html/InputType.cpp:
+(WebCore::InputType::create):
+
 2022-02-11  Alan Bujtas  
 
 `contain:content` breaks fullscreen


Modified: trunk/Source/WebCore/html/InputType.cpp (289690 => 289691)

--- trunk/Source/WebCore/html/InputType.cpp	2022-02-12 14:20:42 UTC (rev 289690)
+++ trunk/Source/WebCore/html/InputType.cpp	2022-02-12 15:08:16 UTC (rev 289691)
@@ -90,7 +90,7 @@
 typedef bool (Settings::*InputTypeConditionalFunction)() const;
 typedef const AtomString& (*InputTypeNameFunction)();
 typedef Ref (*InputTypeFactoryFunction)(HTMLInputElement&);
-typedef HashMap, ASCIICaseInsensitiveHash> InputTypeFactoryMap;
+typedef HashMap> InputTypeFactoryMap;
 
 template static Ref createInputType(HTMLInputElement& element)
 {
@@ -150,7 +150,7 @@
 {
 if (!typeName.isEmpty()) {
 static NeverDestroyed factoryMap = createInputTypeFactoryMap();
-auto&& [conditional, factory] = factoryMap.get().get(typeName);
+auto&& [conditional, factory] = factoryMap.get().get(typeName.convertToASCIILowercase());
 if (factory && (!conditional || std::invoke(conditional, element.document().settings(
 return factory(element);
 }






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [289410] trunk/Source/WebCore

2022-02-08 Thread heycam
Title: [289410] trunk/Source/WebCore








Revision 289410
Author hey...@apple.com
Date 2022-02-08 11:32:21 -0800 (Tue, 08 Feb 2022)


Log Message
Make HTMLToken::beginStartTag tag an 8 bit character
https://bugs.webkit.org/show_bug.cgi?id=236283

Reviewed by Sam Weinig.

HTMLToken::beginStartTag is only ever called with an ASCII lowercase
letter. It can take an LChar instead of a UChar, and we can avoid
updating m_data8BitCheck.

* html/parser/HTMLToken.h:
(WebCore::HTMLToken::beginStartTag):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/html/parser/HTMLToken.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (289409 => 289410)

--- trunk/Source/WebCore/ChangeLog	2022-02-08 19:30:28 UTC (rev 289409)
+++ trunk/Source/WebCore/ChangeLog	2022-02-08 19:32:21 UTC (rev 289410)
@@ -1,3 +1,17 @@
+2022-02-08  Cameron McCormack  
+
+Make HTMLToken::beginStartTag tag an 8 bit character
+https://bugs.webkit.org/show_bug.cgi?id=236283
+
+Reviewed by Sam Weinig.
+
+HTMLToken::beginStartTag is only ever called with an ASCII lowercase
+letter. It can take an LChar instead of a UChar, and we can avoid
+updating m_data8BitCheck.
+
+* html/parser/HTMLToken.h:
+(WebCore::HTMLToken::beginStartTag):
+
 2022-02-08  Ada Chan  
 
 [WebXR] Ensure only one frame update can be requested with the device at any time


Modified: trunk/Source/WebCore/html/parser/HTMLToken.h (289409 => 289410)

--- trunk/Source/WebCore/html/parser/HTMLToken.h	2022-02-08 19:30:28 UTC (rev 289409)
+++ trunk/Source/WebCore/html/parser/HTMLToken.h	2022-02-08 19:32:21 UTC (rev 289410)
@@ -97,7 +97,7 @@
 bool selfClosing() const;
 const AttributeList& attributes() const;
 
-void beginStartTag(UChar);
+void beginStartTag(LChar);
 
 void beginEndTag(LChar);
 void beginEndTag(const Vector&);
@@ -254,7 +254,7 @@
 m_selfClosing = true;
 }
 
-inline void HTMLToken::beginStartTag(UChar character)
+inline void HTMLToken::beginStartTag(LChar character)
 {
 ASSERT(character);
 ASSERT(m_type == Uninitialized);
@@ -267,7 +267,6 @@
 #endif
 
 m_data.append(character);
-m_data8BitCheck = character;
 }
 
 inline void HTMLToken::beginEndTag(LChar character)






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [289356] trunk/Source/WebCore

2022-02-07 Thread heycam
Title: [289356] trunk/Source/WebCore








Revision 289356
Author hey...@apple.com
Date 2022-02-07 20:24:37 -0800 (Mon, 07 Feb 2022)


Log Message
Remove HTMLSourceTracker
https://bugs.webkit.org/show_bug.cgi?id=236259

Reviewed by Geoffrey Garen.

Since the removal of the XSS Auditor in bug 230499, the tracking of
attribute locations that HTMLSourceTracker does is unused.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::pumpTokenizerLoop):
* html/parser/HTMLDocumentParser.h:
* html/parser/HTMLSourceTracker.cpp: Removed.
* html/parser/HTMLSourceTracker.h: Removed.
* html/parser/HTMLToken.h:
(WebCore::HTMLToken::beginAttribute):
(WebCore::HTMLToken::endAttribute):
(WebCore::HTMLToken::setAttributeBaseOffset): Deleted.
* html/parser/HTMLTokenizer.cpp:
(WebCore::HTMLTokenizer::processToken):
* html/parser/HTMLTokenizer.h:
(WebCore::HTMLTokenizer::setTokenAttributeBaseOffset): Deleted.

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Sources.txt
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
trunk/Source/WebCore/html/parser/HTMLDocumentParser.cpp
trunk/Source/WebCore/html/parser/HTMLDocumentParser.h
trunk/Source/WebCore/html/parser/HTMLToken.h
trunk/Source/WebCore/html/parser/HTMLTokenizer.cpp
trunk/Source/WebCore/html/parser/HTMLTokenizer.h


Removed Paths

trunk/Source/WebCore/html/parser/HTMLSourceTracker.cpp
trunk/Source/WebCore/html/parser/HTMLSourceTracker.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (289355 => 289356)

--- trunk/Source/WebCore/ChangeLog	2022-02-08 03:31:51 UTC (rev 289355)
+++ trunk/Source/WebCore/ChangeLog	2022-02-08 04:24:37 UTC (rev 289356)
@@ -1,3 +1,29 @@
+2022-02-07  Cameron McCormack  
+
+Remove HTMLSourceTracker
+https://bugs.webkit.org/show_bug.cgi?id=236259
+
+Reviewed by Geoffrey Garen.
+
+Since the removal of the XSS Auditor in bug 230499, the tracking of
+attribute locations that HTMLSourceTracker does is unused.
+
+* Sources.txt:
+* WebCore.xcodeproj/project.pbxproj:
+* html/parser/HTMLDocumentParser.cpp:
+(WebCore::HTMLDocumentParser::pumpTokenizerLoop):
+* html/parser/HTMLDocumentParser.h:
+* html/parser/HTMLSourceTracker.cpp: Removed.
+* html/parser/HTMLSourceTracker.h: Removed.
+* html/parser/HTMLToken.h:
+(WebCore::HTMLToken::beginAttribute):
+(WebCore::HTMLToken::endAttribute):
+(WebCore::HTMLToken::setAttributeBaseOffset): Deleted.
+* html/parser/HTMLTokenizer.cpp:
+(WebCore::HTMLTokenizer::processToken):
+* html/parser/HTMLTokenizer.h:
+(WebCore::HTMLTokenizer::setTokenAttributeBaseOffset): Deleted.
+
 2022-02-07  Andres Gonzalez  
 
 Prevent removal of isolated objects from a different parent than the current parent.


Modified: trunk/Source/WebCore/Sources.txt (289355 => 289356)

--- trunk/Source/WebCore/Sources.txt	2022-02-08 03:31:51 UTC (rev 289355)
+++ trunk/Source/WebCore/Sources.txt	2022-02-08 04:24:37 UTC (rev 289356)
@@ -1421,7 +1421,6 @@
 html/parser/HTMLPreloadScanner.cpp
 html/parser/HTMLResourcePreloader.cpp
 html/parser/HTMLScriptRunner.cpp
-html/parser/HTMLSourceTracker.cpp
 html/parser/HTMLSrcsetParser.cpp
 html/parser/HTMLTokenizer.cpp
 html/parser/HTMLTreeBuilder.cpp


Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (289355 => 289356)

--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2022-02-08 03:31:51 UTC (rev 289355)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2022-02-08 04:24:37 UTC (rev 289356)
@@ -3184,7 +3184,6 @@
 		977B3875122883E900B81FF8 /* HTMLScriptRunner.h in Headers */ = {isa = PBXBuildFile; fileRef = 977B385C122883E900B81FF8 /* HTMLScriptRunner.h */; };
 		977B3876122883E900B81FF8 /* HTMLScriptRunnerHost.h in Headers */ = {isa = PBXBuildFile; fileRef = 977B385D122883E900B81FF8 /* HTMLScriptRunnerHost.h */; };
 		977B3878122883E900B81FF8 /* HTMLTokenizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 977B385F122883E900B81FF8 /* HTMLTokenizer.h */; };
-		977E2DCE12F0E28300C13379 /* HTMLSourceTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 977E2DCC12F0E28300C13379 /* HTMLSourceTracker.h */; };
 		978AD67514130A8D00C7CAE3 /* HTMLSpanElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 978AD67214130A8D00C7CAE3 /* HTMLSpanElement.h */; };
 		979F43D41075E44AF83B /* NavigationScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = 979F43D21075E44AF83B /* NavigationScheduler.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		97AA3CA5145237CC003E1DA6 /* EventTargetHeaders.h in Headers */ = {isa = PBXBuildFile; fileRef = 97AA3CA3145237CC003E1DA6 /* EventTargetHeaders.h */; };
@@ -13192,8 +13191,6 @@
 		977B385D122883E900B81FF8 /* HTMLScriptRunnerHost.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLScriptRunnerHost.h; sourceTree = ""; };
 		

[webkit-changes] [289177] trunk/Source/JavaScriptCore

2022-02-06 Thread heycam
Title: [289177] trunk/Source/_javascript_Core








Revision 289177
Author hey...@apple.com
Date 2022-02-06 12:37:53 -0800 (Sun, 06 Feb 2022)


Log Message
Cache the most recent AtomString produced by JSString::toIdentifier
https://bugs.webkit.org/show_bug.cgi?id=236124

Reviewed by Yusuke Suzuki.

JSString::toIdentifier does not store the result of atomizing its string
value, except when it is a rope. We can often end up atomizing the same
JSString a number of times.

This patch caches the last atomized string produced from
JSString::toIdentifier in a given VM. From local testing, this is a 0.5%
Speedometer2 improvement on an M1 MacBook Air, although surprisingly is
neutral on a recent Intel MacBook Pro.

* runtime/JSString.h:
(JSC::JSRopeString::toIdentifier const):
(JSC::JSString::toIdentifier const):
* runtime/VM.h:

Modified Paths

trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/runtime/JSString.h
trunk/Source/_javascript_Core/runtime/VM.h




Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (289176 => 289177)

--- trunk/Source/_javascript_Core/ChangeLog	2022-02-06 20:25:30 UTC (rev 289176)
+++ trunk/Source/_javascript_Core/ChangeLog	2022-02-06 20:37:53 UTC (rev 289177)
@@ -1,3 +1,24 @@
+2022-02-06  Cameron McCormack  
+
+Cache the most recent AtomString produced by JSString::toIdentifier
+https://bugs.webkit.org/show_bug.cgi?id=236124
+
+Reviewed by Yusuke Suzuki.
+
+JSString::toIdentifier does not store the result of atomizing its string
+value, except when it is a rope. We can often end up atomizing the same
+JSString a number of times.
+
+This patch caches the last atomized string produced from
+JSString::toIdentifier in a given VM. From local testing, this is a 0.5%
+Speedometer2 improvement on an M1 MacBook Air, although surprisingly is
+neutral on a recent Intel MacBook Pro.
+
+* runtime/JSString.h:
+(JSC::JSRopeString::toIdentifier const):
+(JSC::JSString::toIdentifier const):
+* runtime/VM.h:
+
 2022-02-06  David Kilzer  
 
 [WASM] Fix clang tidy bugprone-move-forwarding-reference static analyzer warnings in WasmLLIntGenerator.cpp


Modified: trunk/Source/_javascript_Core/runtime/JSString.h (289176 => 289177)

--- trunk/Source/_javascript_Core/runtime/JSString.h	2022-02-06 20:25:30 UTC (rev 289176)
+++ trunk/Source/_javascript_Core/runtime/JSString.h	2022-02-06 20:37:53 UTC (rev 289177)
@@ -602,6 +602,7 @@
 JS_EXPORT_PRIVATE RefPtr resolveRopeToExistingAtomString(JSGlobalObject*) const;
 template NEVER_INLINE void resolveRopeSlowCase(CharacterType*) const;
 template void resolveRopeInternalNoSubstring(CharacterType*) const;
+Identifier toIdentifier(JSGlobalObject*) const;
 void outOfMemory(JSGlobalObject* nullOrGlobalObjectForOOM) const;
 void resolveRopeInternal8(LChar*) const;
 void resolveRopeInternal16(UChar*) const;
@@ -759,15 +760,31 @@
 return JSString::create(vm, s.releaseImpl().releaseNonNull());
 }
 
-ALWAYS_INLINE Identifier JSString::toIdentifier(JSGlobalObject* globalObject) const
+ALWAYS_INLINE Identifier JSRopeString::toIdentifier(JSGlobalObject* globalObject) const
 {
 VM& vm = getVM(globalObject);
 auto scope = DECLARE_THROW_SCOPE(vm);
-AtomString atomString = toAtomString(globalObject);
+auto atomString = static_cast(this)->resolveRopeToAtomString(globalObject);
 RETURN_IF_EXCEPTION(scope, { });
 return Identifier::fromString(vm, atomString);
 }
 
+ALWAYS_INLINE Identifier JSString::toIdentifier(JSGlobalObject* globalObject) const
+{
+if constexpr (validateDFGDoesGC)
+vm().verifyCanGC();
+if (isRope())
+return static_cast(this)->toIdentifier(globalObject);
+VM& vm = getVM(globalObject);
+if (valueInternal().impl()->isAtom())
+return Identifier::fromString(vm, Ref { *static_cast(valueInternal().impl()) });
+if (vm.lastAtomizedIdentifierStringImpl.ptr() != valueInternal().impl()) {
+vm.lastAtomizedIdentifierStringImpl = *valueInternal().impl();
+vm.lastAtomizedIdentifierAtomStringImpl = AtomStringImpl::add(valueInternal().impl()).releaseNonNull();
+}
+return Identifier::fromString(vm, Ref { vm.lastAtomizedIdentifierAtomStringImpl });
+}
+
 ALWAYS_INLINE AtomString JSString::toAtomString(JSGlobalObject* globalObject) const
 {
 if constexpr (validateDFGDoesGC)


Modified: trunk/Source/_javascript_Core/runtime/VM.h (289176 => 289177)

--- trunk/Source/_javascript_Core/runtime/VM.h	2022-02-06 20:25:30 UTC (rev 289176)
+++ trunk/Source/_javascript_Core/runtime/VM.h	2022-02-06 20:37:53 UTC (rev 289177)
@@ -586,6 +586,8 @@
 NumericStrings numericStrings;
 std::unique_ptr machineCodeBytesPerBytecodeWordForBaselineJIT;
 Strong lastCachedString;
+Ref lastAtomizedIdentifierStringImpl { *StringImpl::empty() };
+Ref lastAtomizedIdentifierAtomStringImpl { *static_cast(StringImpl::empty()) };
 

[webkit-changes] [288669] trunk

2022-01-27 Thread heycam
Title: [288669] trunk








Revision 288669
Author hey...@apple.com
Date 2022-01-27 00:48:17 -0800 (Thu, 27 Jan 2022)


Log Message
Avoid setting and clearing :active state when dispatching synthetic click events when possible
https://bugs.webkit.org/show_bug.cgi?id=235672


Reviewed by Simon Fraser.

Source/WebCore:

Simulated click events are dispatched with two options:

- whether to send associated events mouseover, mouseup, mousedown
- whether to repaint the target element with its pressed look

We currently always set the element's :active state just after when we'd
send the mousedown event, and clear it just after that.

When we dispatch a simulated click event with neither of the above
options set, there's no way to observe the temporary :active state on
the element. We can skip it in that case.

We need to continue clearing clearing the :active state regardless,
because some callers have already set :active and are relying on
simulateClick to clear it.

This patch is a 0.3-0.4% improvement on Speedometer 2.

* dom/SimulatedClick.cpp:
(WebCore::simulateClick):

LayoutTests:

* platform/gtk/inspector/timeline/line-column-expected.txt:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/gtk/inspector/timeline/line-column-expected.txt
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/dom/SimulatedClick.cpp




Diff

Modified: trunk/LayoutTests/ChangeLog (288668 => 288669)

--- trunk/LayoutTests/ChangeLog	2022-01-27 07:21:34 UTC (rev 288668)
+++ trunk/LayoutTests/ChangeLog	2022-01-27 08:48:17 UTC (rev 288669)
@@ -1,3 +1,13 @@
+2022-01-27  Cameron McCormack  
+
+Avoid setting and clearing :active state when dispatching synthetic click events when possible
+https://bugs.webkit.org/show_bug.cgi?id=235672
+
+
+Reviewed by Simon Fraser.
+
+* platform/gtk/inspector/timeline/line-column-expected.txt:
+
 2022-01-26  ChangSeok Oh  
 
 [GTK] WTR: Native HTML form validation popover is not supported


Modified: trunk/LayoutTests/platform/gtk/inspector/timeline/line-column-expected.txt (288668 => 288669)

--- trunk/LayoutTests/platform/gtk/inspector/timeline/line-column-expected.txt	2022-01-27 07:21:34 UTC (rev 288668)
+++ trunk/LayoutTests/platform/gtk/inspector/timeline/line-column-expected.txt	2022-01-27 08:48:17 UTC (rev 288669)
@@ -8,50 +8,7 @@
 PASS: Capturing started.
 {
   "startTime": "",
-  "stackTrace": [
-{
-  "functionName": "click",
-  "url": "[native code]",
-  "scriptId": "",
-  "lineNumber": 0,
-  "columnNumber": 0
-},
-{
-  "functionName": "willCallFunctionTest",
-  "url": "timeline/line-column.html",
-  "scriptId": "",
-  "lineNumber": 26,
-  "columnNumber": 44
-},
-{
-  "functionName": "global code",
-  "url": "",
-  "scriptId": "",
-  "lineNumber": 1,
-  "columnNumber": 21
-},
-{
-  "functionName": "evaluateWithScopeExtension",
-  "url": "[native code]",
-  "scriptId": "",
-  "lineNumber": 0,
-  "columnNumber": 0
-},
-{
-  "functionName": "",
-  "url": "",
-  "scriptId": "",
-  "lineNumber": 142,
-  "columnNumber": 97
-}
-  ],
-  "data": {},
   "frameId": "",
-  "type": "ScheduleStyleRecalculation"
-}
-{
-  "startTime": "",
-  "frameId": "",
   "data": {
 "type": "click",
 "defaultPrevented": false


Modified: trunk/Source/WebCore/ChangeLog (288668 => 288669)

--- trunk/Source/WebCore/ChangeLog	2022-01-27 07:21:34 UTC (rev 288668)
+++ trunk/Source/WebCore/ChangeLog	2022-01-27 08:48:17 UTC (rev 288669)
@@ -1,3 +1,32 @@
+2022-01-27  Cameron McCormack  
+
+Avoid setting and clearing :active state when dispatching synthetic click events when possible
+https://bugs.webkit.org/show_bug.cgi?id=235672
+
+
+Reviewed by Simon Fraser.
+
+Simulated click events are dispatched with two options:
+
+- whether to send associated events mouseover, mouseup, mousedown
+- whether to repaint the target element with its pressed look
+
+We currently always set the element's :active state just after when we'd
+send the mousedown event, and clear it just after that.
+
+When we dispatch a simulated click event with neither of the above
+options set, there's no way to observe the temporary :active state on
+the element. We can skip it in that case.
+
+We need to continue clearing clearing the :active state regardless,
+because some callers have already set :active and are relying on
+simulateClick to clear it.
+
+This patch is a 0.3-0.4% improvement on Speedometer 2.
+
+* dom/SimulatedClick.cpp:
+(WebCore::simulateClick):
+
 2022-01-26  Jean-Yves Avenard  
 
 REGRESSION(r287684) speedtest.net uses many GB of memory


Modified: trunk/Source/WebCore/dom/SimulatedClick.cpp (288668 => 288669)

--- trunk/Source/WebCore/dom/SimulatedClick.cpp	2022-01-27 

[webkit-changes] [288537] trunk/Source/JavaScriptCore

2022-01-24 Thread heycam
Title: [288537] trunk/Source/_javascript_Core








Revision 288537
Author hey...@apple.com
Date 2022-01-24 21:13:18 -0800 (Mon, 24 Jan 2022)


Log Message
Remove VM::stringCache
https://bugs.webkit.org/show_bug.cgi?id=235536

Reviewed by Sam Weinig.

We consult VM::stringCache when creating a JSString, but since
bug 142115 we never insert anything into it.

Removing this results in almost-significant improvements in the VueJS,
Vanilla-ES2015, and jQuery sub-tests of Speedometer 2 (of 0.5-2%,
0.03 <= p <= 0.05), and an almost significant 0.2% improvement in the
overall score (p = 0.06).

* runtime/JSString.cpp:
(JSC::jsStringWithCacheSlowCase):
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:

Modified Paths

trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/runtime/JSString.cpp
trunk/Source/_javascript_Core/runtime/VM.cpp
trunk/Source/_javascript_Core/runtime/VM.h




Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (288536 => 288537)

--- trunk/Source/_javascript_Core/ChangeLog	2022-01-25 04:59:14 UTC (rev 288536)
+++ trunk/Source/_javascript_Core/ChangeLog	2022-01-25 05:13:18 UTC (rev 288537)
@@ -1,3 +1,24 @@
+2022-01-24  Cameron McCormack  
+
+Remove VM::stringCache
+https://bugs.webkit.org/show_bug.cgi?id=235536
+
+Reviewed by Sam Weinig.
+
+We consult VM::stringCache when creating a JSString, but since
+bug 142115 we never insert anything into it.
+
+Removing this results in almost-significant improvements in the VueJS,
+Vanilla-ES2015, and jQuery sub-tests of Speedometer 2 (of 0.5-2%,
+0.03 <= p <= 0.05), and an almost significant 0.2% improvement in the
+overall score (p = 0.06).
+
+* runtime/JSString.cpp:
+(JSC::jsStringWithCacheSlowCase):
+* runtime/VM.cpp:
+(JSC::VM::VM):
+* runtime/VM.h:
+
 2022-01-24  Diego Pino Garcia  
 
 Unreviewed, fix non-unified build after r288458


Modified: trunk/Source/_javascript_Core/runtime/JSString.cpp (288536 => 288537)

--- trunk/Source/_javascript_Core/runtime/JSString.cpp	2022-01-25 04:59:14 UTC (rev 288536)
+++ trunk/Source/_javascript_Core/runtime/JSString.cpp	2022-01-25 05:13:18 UTC (rev 288537)
@@ -436,9 +436,6 @@
 
 JSString* jsStringWithCacheSlowCase(VM& vm, StringImpl& stringImpl)
 {
-if (JSString* string = vm.stringCache.get())
-return string;
-
 JSString* string = jsString(vm, String(stringImpl));
 vm.lastCachedString.set(vm, string);
 return string;


Modified: trunk/Source/_javascript_Core/runtime/VM.cpp (288536 => 288537)

--- trunk/Source/_javascript_Core/runtime/VM.cpp	2022-01-25 04:59:14 UTC (rev 288536)
+++ trunk/Source/_javascript_Core/runtime/VM.cpp	2022-01-25 05:13:18 UTC (rev 288537)
@@ -218,7 +218,6 @@
 , propertyNames(nullptr)
 , emptyList(new ArgList)
 , machineCodeBytesPerBytecodeWordForBaselineJIT(makeUnique())
-, stringCache(*this)
 , symbolImplToSymbolMap(*this)
 , structureCache(*this)
 , interpreter(nullptr)


Modified: trunk/Source/_javascript_Core/runtime/VM.h (288536 => 288537)

--- trunk/Source/_javascript_Core/runtime/VM.h	2022-01-25 04:59:14 UTC (rev 288536)
+++ trunk/Source/_javascript_Core/runtime/VM.h	2022-01-25 05:13:18 UTC (rev 288537)
@@ -585,7 +585,6 @@
 SmallStrings smallStrings;
 NumericStrings numericStrings;
 std::unique_ptr machineCodeBytesPerBytecodeWordForBaselineJIT;
-WeakGCMap> stringCache;
 Strong lastCachedString;
 JSONAtomStringCache jsonAtomStringCache;
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [288076] trunk/Source

2022-01-16 Thread heycam
Title: [288076] trunk/Source








Revision 288076
Author hey...@apple.com
Date 2022-01-16 14:10:02 -0800 (Sun, 16 Jan 2022)


Log Message
Ensure in flight layer transactions don't accumulate further canvas drawing
https://bugs.webkit.org/show_bug.cgi?id=231163


Reviewed by Simon Fraser.

Source/WebCore:

When UI side compositing is enabled (as it is on iOS), we build a
layer tree transaction in RemoteLayerTreeDrawingArea::updateRendering to
send off to the UI process. At a high level, updateRendering does this:

1. Run any requestAnimationFrame callbacks
2. Iterate over the composited layers to draw their contents into the
   layer backing stores
3. Dispatch a task to a different thread to flush the contexts of the
   layer backing stores and then send the transaction to the UI
   process

Step 3 is done off a separate task as an optimization, to get the
drawing work queued up by step 2 happening in parallel to any work the
page may day once updateRendering is finished. This can be a problem
when:

- GPU process canvas rendering is enabled (but DOM rendering is
  disabled)
- we have accelerated ImageBuffers for both layer backing stores and
  canvas backing stores
- the page does canvas drawing between steps 2 and 3, which affects
  the contents of a canvas backing store IOSurface that was drawn into
  a layer backing store IOSurface while building the transaction

The way we draw the canvas contents into the layer is by creating a
CGImage from the canvas backing store ImageBuffer's IOSurface.
Normally, if we draw into an IOSurface that has been wrapped by a
CGImage, this will cause the CGImage to obtain a unique copy of the
IOSurface's pixels, rather than continue holding on to the IOSurface
itself.

When the drawing of this CGImage on to the layer backing store
IOSurface happens, the "draw image" command is queued up to be
processed later. It's only when the flush happens in step 3 above that
the drawing occurs. This means that the CGImage wrapping the IOSurface
exists until that flush.

But while the CGImage does exist, it's in the Web process, and the
canvas drawing on to the same IOSurface happens in the GPU process.
Since QuartzCore doesn't know of its existence, it doesn't cause the
copy-on-write to occur. The effect of this is that subsequent page
drawing on to the canvas can make its way into the layer transaction
unexpectedly.

This patch induces the copy-on-write in the Web process when needed,
by tracking whether a canvas has been drawn into a layer backing
store and the layer transaction flush hasn't happened yet. Just before
we do any more drawing on the canvas, if we are in this state, we
perform a no-op drawing command on the IOSurface, then flush, to make
the CGImage copy the IOSurface data out.

* html/HTMLCanvasElement.cpp:
(WebCore::imageDrawingRequiresGuardAgainstUseByPendingLayerTransaction):
We only need to induce the CGImage copy-on-write behavior if both the
layer and canvas backing stores are accelerated, the canvas
ImageBuffer is remote, and the layer ImageBuffer is not remote.
(WebCore::HTMLCanvasElement::paint):
(WebCore::HTMLCanvasElement::drawingContext const):
Use drawingContext as a convenient single place to check whether we
are performing the first drawing command before the layer tree
transaction flush has happened.
* html/HTMLCanvasElement.h:
* page/Page.h:
(WebCore::Page::setIsAwaitingLayerTreeTransactionFlush):
(WebCore::Page::isAwaitingLayerTreeTransactionFlush const):
* platform/graphics/ImageBufferBackend.h:
(WebCore::ImageBufferBackend::ensureNativeImagesHaveCopiedBackingStore):
* platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp:
(WebCore::ImageBufferIOSurfaceBackend::ensureNativeImagesHaveCopiedBackingStore):
The flush is needed since the CGImage wrapping the IOSurface will only
copy the pixel data out once the no-op drawing command is processed.
* platform/graphics/cg/ImageBufferIOSurfaceBackend.h:

Source/WebKit:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::willCommitLayerTree):
(WebKit::WebPage::didFlushLayerTreeAtTime):
Inform the WebCore::Page about the state of the layer tree transaction
building.
* WebProcess/WebPage/WebPage.h:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/html/HTMLCanvasElement.cpp
trunk/Source/WebCore/html/HTMLCanvasElement.h
trunk/Source/WebCore/page/Page.h
trunk/Source/WebCore/platform/graphics/ImageBufferBackend.h
trunk/Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp
trunk/Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.h
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (288075 => 288076)

--- trunk/Source/WebCore/ChangeLog	2022-01-16 21:44:55 UTC (rev 288075)
+++ trunk/Source/WebCore/ChangeLog	2022-01-16 22:10:02 UTC (rev 288076)
@@ -1,3 +1,84 @@
+2022-01-16  Cameron McCormack  
+
+Ensure in flight layer transactions don't accumulate further canvas drawing
+

[webkit-changes] [288003] trunk

2022-01-13 Thread heycam
Title: [288003] trunk








Revision 288003
Author hey...@apple.com
Date 2022-01-13 18:53:22 -0800 (Thu, 13 Jan 2022)


Log Message
Only apply automatic minimum block-size aspect-ratio rules to non-replaced elements
https://bugs.webkit.org/show_bug.cgi?id=235058


Reviewed by Alan Bujtas.

Source/WebCore:

The rules in https://www.w3.org/TR/css-sizing-4/#aspect-ratio-minimum
that define the automatic minimum size of an element subject to an
aspect-ratio only apply if the element is non-replaced.

In constrainLogicalHeightByMinMax specifically, when min-height is
auto, after applying the aspect-ratio to produce an automatic minimum
height, we bump it up to the content height if the element has
children. This, presumably, is to account for the way the height of a
block is computed in CSS 2.2. (As CSS 2.2 doesn't have an auto value
for min-height, and a CSS Block Layout module has not been written in
terms of CSS Sizing concepts, there is no clear definition of
automatic minimum sizing for blocks at the moment.) If we erroneously
apply this to a replaced element, such as an image or video, it can
get a computed min-height equal to the intrinsic height of the image,
which may be much larger than expected.

This commit adds an is() check for both automatic
minimum logical width and height calculations, although I was unable to
produce a test to exercise the logical width case (which does not take
the intrinsic size into account when computing the automatic minimum).

Test: fast/css/aspect-ratio-min-height-replaced.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::constrainLogicalWidthInFragmentByMinMax const):
(WebCore::RenderBox::constrainLogicalHeightByMinMax const):

LayoutTests:

Test that replaced elements with child content (in this case, a
 element's controls in the UA shadow tree) don't influence the
automatic minimum size calculation.

* fast/css/aspect-ratio-min-height-replaced-expected.html: Added.
* fast/css/aspect-ratio-min-height-replaced.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/rendering/RenderBox.cpp


Added Paths

trunk/LayoutTests/fast/css/aspect-ratio-min-height-replaced-expected.html
trunk/LayoutTests/fast/css/aspect-ratio-min-height-replaced.html




Diff

Modified: trunk/LayoutTests/ChangeLog (288002 => 288003)

--- trunk/LayoutTests/ChangeLog	2022-01-14 02:40:08 UTC (rev 288002)
+++ trunk/LayoutTests/ChangeLog	2022-01-14 02:53:22 UTC (rev 288003)
@@ -1,3 +1,18 @@
+2022-01-13  Cameron McCormack  
+
+Only apply automatic minimum block-size aspect-ratio rules to non-replaced elements
+https://bugs.webkit.org/show_bug.cgi?id=235058
+
+
+Reviewed by Alan Bujtas.
+
+Test that replaced elements with child content (in this case, a
+ element's controls in the UA shadow tree) don't influence the
+automatic minimum size calculation.
+
+* fast/css/aspect-ratio-min-height-replaced-expected.html: Added.
+* fast/css/aspect-ratio-min-height-replaced.html: Added.
+
 2022-01-13  Chris Dumez  
 
 Implement HTMLScriptElement.supports(type) method


Added: trunk/LayoutTests/fast/css/aspect-ratio-min-height-replaced-expected.html (0 => 288003)

--- trunk/LayoutTests/fast/css/aspect-ratio-min-height-replaced-expected.html	(rev 0)
+++ trunk/LayoutTests/fast/css/aspect-ratio-min-height-replaced-expected.html	2022-01-14 02:53:22 UTC (rev 288003)
@@ -0,0 +1,4 @@
+
+
+  
+


Added: trunk/LayoutTests/fast/css/aspect-ratio-min-height-replaced.html (0 => 288003)

--- trunk/LayoutTests/fast/css/aspect-ratio-min-height-replaced.html	(rev 0)
+++ trunk/LayoutTests/fast/css/aspect-ratio-min-height-replaced.html	2022-01-14 02:53:22 UTC (rev 288003)
@@ -0,0 +1,4 @@
+
+
+  
+


Modified: trunk/Source/WebCore/ChangeLog (288002 => 288003)

--- trunk/Source/WebCore/ChangeLog	2022-01-14 02:40:08 UTC (rev 288002)
+++ trunk/Source/WebCore/ChangeLog	2022-01-14 02:53:22 UTC (rev 288003)
@@ -1,3 +1,38 @@
+2022-01-13  Cameron McCormack  
+
+Only apply automatic minimum block-size aspect-ratio rules to non-replaced elements
+https://bugs.webkit.org/show_bug.cgi?id=235058
+
+
+Reviewed by Alan Bujtas.
+
+The rules in https://www.w3.org/TR/css-sizing-4/#aspect-ratio-minimum
+that define the automatic minimum size of an element subject to an
+aspect-ratio only apply if the element is non-replaced.
+
+In constrainLogicalHeightByMinMax specifically, when min-height is
+auto, after applying the aspect-ratio to produce an automatic minimum
+height, we bump it up to the content height if the element has
+children. This, presumably, is to account for the way the height of a
+block is computed in CSS 2.2. (As CSS 2.2 doesn't have an auto value
+for min-height, and a CSS Block Layout module has not been written in
+terms of CSS Sizing 

[webkit-changes] [286637] trunk/Source/WebCore

2021-12-07 Thread heycam
Title: [286637] trunk/Source/WebCore








Revision 286637
Author hey...@apple.com
Date 2021-12-07 18:11:05 -0800 (Tue, 07 Dec 2021)


Log Message
Remove expandAroundIdeographs static variables
https://bugs.webkit.org/show_bug.cgi?id=233750

Reviewed by Myles Maxfield.

With OffscreenCanvas, we can call into
ComplexTextController::adjustGlyphsAndAdvances,
FontCascade::expansionOpportunityCountInternal, and
WidthIterator::calculateAdditionalWidth from worker threads.
These all have a static variable variable with an initializer
that calls FontCascade::canExpandAroundIdeographsInComplexText,
and such initializers are not safe under -fno-threadsafe-statics.

canExpandAroundIdeographsInComplexText is a simple enough function in
all ports (it just returns a constant bool) that it's not worth caching
the result in a static.

* platform/graphics/ComplexTextController.cpp:
(WebCore::ComplexTextController::adjustGlyphsAndAdvances):
* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::expansionOpportunityCountInternal):
* platform/graphics/WidthIterator.cpp:
(WebCore::WidthIterator::calculateAdditionalWidth const):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/ComplexTextController.cpp
trunk/Source/WebCore/platform/graphics/FontCascade.cpp
trunk/Source/WebCore/platform/graphics/WidthIterator.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (286636 => 286637)

--- trunk/Source/WebCore/ChangeLog	2021-12-08 02:09:34 UTC (rev 286636)
+++ trunk/Source/WebCore/ChangeLog	2021-12-08 02:11:05 UTC (rev 286637)
@@ -1,5 +1,31 @@
 2021-12-07  Cameron McCormack  
 
+Remove expandAroundIdeographs static variables
+https://bugs.webkit.org/show_bug.cgi?id=233750
+
+Reviewed by Myles Maxfield.
+
+With OffscreenCanvas, we can call into
+ComplexTextController::adjustGlyphsAndAdvances,
+FontCascade::expansionOpportunityCountInternal, and
+WidthIterator::calculateAdditionalWidth from worker threads.
+These all have a static variable variable with an initializer
+that calls FontCascade::canExpandAroundIdeographsInComplexText,
+and such initializers are not safe under -fno-threadsafe-statics.
+
+canExpandAroundIdeographsInComplexText is a simple enough function in
+all ports (it just returns a constant bool) that it's not worth caching
+the result in a static.
+
+* platform/graphics/ComplexTextController.cpp:
+(WebCore::ComplexTextController::adjustGlyphsAndAdvances):
+* platform/graphics/FontCascade.cpp:
+(WebCore::FontCascade::expansionOpportunityCountInternal):
+* platform/graphics/WidthIterator.cpp:
+(WebCore::WidthIterator::calculateAdditionalWidth const):
+
+2021-12-07  Cameron McCormack  
+
 Move shouldAutoActivateFontIfNeeded knownFamilies cache to FontCache
 https://bugs.webkit.org/show_bug.cgi?id=233749
 


Modified: trunk/Source/WebCore/platform/graphics/ComplexTextController.cpp (286636 => 286637)

--- trunk/Source/WebCore/platform/graphics/ComplexTextController.cpp	2021-12-08 02:09:34 UTC (rev 286636)
+++ trunk/Source/WebCore/platform/graphics/ComplexTextController.cpp	2021-12-08 02:11:05 UTC (rev 286637)
@@ -752,8 +752,7 @@
 if (runForbidsRightExpansion)
 forbidRightExpansion = m_run.ltr() ? isLastCharacter : isFirstCharacter;
 // Handle justification and word-spacing.
-static bool expandAroundIdeographs = FontCascade::canExpandAroundIdeographsInComplexText();
-bool ideograph = expandAroundIdeographs && FontCascade::isCJKIdeographOrSymbol(ch);
+bool ideograph = FontCascade::canExpandAroundIdeographsInComplexText() && FontCascade::isCJKIdeographOrSymbol(ch);
 if (treatAsSpace || ideograph || forceLeftExpansion || forceRightExpansion) {
 // Distribute the run's total expansion evenly over all expansion opportunities in the run.
 if (m_expansion) {


Modified: trunk/Source/WebCore/platform/graphics/FontCascade.cpp (286636 => 286637)

--- trunk/Source/WebCore/platform/graphics/FontCascade.cpp	2021-12-08 02:09:34 UTC (rev 286636)
+++ trunk/Source/WebCore/platform/graphics/FontCascade.cpp	2021-12-08 02:11:05 UTC (rev 286637)
@@ -1001,7 +1001,6 @@
 
 std::pair FontCascade::expansionOpportunityCountInternal(const UChar* characters, unsigned length, TextDirection direction, ExpansionBehavior expansionBehavior)
 {
-static bool expandAroundIdeographs = canExpandAroundIdeographsInComplexText();
 unsigned count = 0;
 bool isAfterExpansion = (expansionBehavior & LeftExpansionMask) == ForbidLeftExpansion;
 if ((expansionBehavior & LeftExpansionMask) == ForceLeftExpansion) {
@@ -1020,7 +1019,7 @@
 character = U16_GET_SUPPLEMENTARY(character, characters[i + 1]);
 i++;
 }
-if (expandAroundIdeographs 

[webkit-changes] [286634] trunk/Source/WebCore

2021-12-07 Thread heycam
Title: [286634] trunk/Source/WebCore








Revision 286634
Author hey...@apple.com
Date 2021-12-07 17:35:15 -0800 (Tue, 07 Dec 2021)


Log Message
Move shouldAutoActivateFontIfNeeded knownFamilies cache to FontCache
https://bugs.webkit.org/show_bug.cgi?id=233749

Reviewed by Myles Maxfield.

With OffscreenCanvas, we can call shouldAutoActivateFontIfNeeded on a
worker thread, and the knownFamilies HashSet is not thread safe. Also,
the AtomStrings it stores are thread-specific. Move it to FontCache, so
each thread has its own set.

* platform/graphics/FontCache.h:
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontCache::shouldAutoActivateFontIfNeeded):
(WebCore::shouldAutoActivateFontIfNeeded): Deleted.

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/FontCache.h
trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (286633 => 286634)

--- trunk/Source/WebCore/ChangeLog	2021-12-08 01:32:10 UTC (rev 286633)
+++ trunk/Source/WebCore/ChangeLog	2021-12-08 01:35:15 UTC (rev 286634)
@@ -1,3 +1,20 @@
+2021-12-07  Cameron McCormack  
+
+Move shouldAutoActivateFontIfNeeded knownFamilies cache to FontCache
+https://bugs.webkit.org/show_bug.cgi?id=233749
+
+Reviewed by Myles Maxfield.
+
+With OffscreenCanvas, we can call shouldAutoActivateFontIfNeeded on a
+worker thread, and the knownFamilies HashSet is not thread safe. Also,
+the AtomStrings it stores are thread-specific. Move it to FontCache, so
+each thread has its own set.
+
+* platform/graphics/FontCache.h:
+* platform/graphics/cocoa/FontCacheCoreText.cpp:
+(WebCore::FontCache::shouldAutoActivateFontIfNeeded):
+(WebCore::shouldAutoActivateFontIfNeeded): Deleted.
+
 2021-12-07  Devin Rousso  
 
 Add a `DOMPasteAccessCategory` to control which pasteboard the WebProcess is granted access to when pasting


Modified: trunk/Source/WebCore/platform/graphics/FontCache.h (286633 => 286634)

--- trunk/Source/WebCore/platform/graphics/FontCache.h	2021-12-08 01:32:10 UTC (rev 286633)
+++ trunk/Source/WebCore/platform/graphics/FontCache.h	2021-12-08 01:35:15 UTC (rev 286634)
@@ -374,6 +374,10 @@
 static std::optional alternateFamilyName(const String&);
 static std::optional platformAlternateFamilyName(const String&);
 
+#if PLATFORM(MAC)
+bool shouldAutoActivateFontIfNeeded(const AtomString& family);
+#endif
+
 Timer m_purgeTimer;
 
 bool m_shouldMockBoldSystemFontForAccessibility { false };
@@ -389,6 +393,10 @@
 RecursiveLock m_fontLock;
 #endif
 
+#if PLATFORM(MAC)
+HashSet m_knownFamilies;
+#endif
+
 #if PLATFORM(COCOA)
 ListHashSet m_seenFamiliesForPrewarming;
 ListHashSet m_fontNamesRequiringSystemFallbackForPrewarming;


Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp (286633 => 286634)

--- trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp	2021-12-08 01:32:10 UTC (rev 286633)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp	2021-12-08 01:35:15 UTC (rev 286634)
@@ -1338,23 +1338,15 @@
 }
 
 #if PLATFORM(MAC)
-static bool shouldAutoActivateFontIfNeeded(const AtomString& family)
+bool FontCache::shouldAutoActivateFontIfNeeded(const AtomString& family)
 {
-#ifndef NDEBUG
-// This cache is not thread safe so the following assertion is there to
-// make sure this function is always called from the same thread.
-static Thread* initThread = ::current();
-ASSERT(initThread == ::current());
-#endif
-
-static NeverDestroyed> knownFamilies;
 static const unsigned maxCacheSize = 128;
-ASSERT(knownFamilies.get().size() <= maxCacheSize);
-if (knownFamilies.get().size() == maxCacheSize)
-knownFamilies.get().remove(knownFamilies.get().random());
+ASSERT(m_knownFamilies.size() <= maxCacheSize);
+if (m_knownFamilies.size() == maxCacheSize)
+m_knownFamilies.remove(m_knownFamilies.random());
 
 // Only attempt to auto-activate fonts once for performance reasons.
-return knownFamilies.get().add(family).isNewEntry;
+return m_knownFamilies.add(family).isNewEntry;
 }
 
 static void autoActivateFont(const String& name, CGFloat size)






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [286625] trunk/Source

2021-12-07 Thread heycam
Title: [286625] trunk/Source








Revision 286625
Author hey...@apple.com
Date 2021-12-07 15:33:30 -0800 (Tue, 07 Dec 2021)


Log Message
Move FontCache singleton and instance on WorkerGlobalScope to ThreadGlobalData
https://bugs.webkit.org/show_bug.cgi?id=233747

Reviewed by Darin Adler.

Source/WebCore:

There are various places in font code where we need access to a
FontCache instance. Currently we:

- assume that we're on the main thread and call
  FontCache::singleton(), or
- get a FontCache off WorkerGlobalScope and pass it down (or store it)
  where it's needed, then pass it to fontCacheFallingBackToSingleton.

Having to thread through, or store, the FontCache pointer is
inconvenient, and there are some places where we don't have access to
a FontCache pointer, but we're on a worker, and we call
fontCacheFallingBackToSingleton and incorrectly get back the main
thread's instance.

I think it would be cleaner if we moved both the main thread FontCache
singleton, and the one stored on a WorkerGlobalScope, to
ThreadGlobalData, which is easily globally accessible. Performing a
TLS lookup is cheap these days.

* css/CSSFontFace.h:
* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::font):
(WebCore::CSSFontFace::fontCacheFallingBackToSingleton):
Remove fontCacheFallingBackToSingleton and replace calls to it with
FontCache::forCurrentThread.

* css/CSSFontFaceSet.cpp:
(WebCore::CSSFontFaceSet::ensureLocalFontFacesForFamilyRegistered):
Replace getting the FontCache from the ScriptExecutionContext with a
call to FontCache::forCurrentThread.

* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::load):
(WebCore::CSSFontFaceSource::font):
* editing/cocoa/FontAttributeChangesCocoa.mm:
(WebCore::FontChanges::platformFontFamilyNameForCSS const):
* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::getSupportedSystemFontFamilyNames):
* page/MemoryRelease.cpp:
(WebCore::releaseNoncriticalMemory):
* page/ProcessWarming.cpp:
(WebCore::ProcessWarming::prewarmGlobally):
(WebCore::ProcessWarming::collectPrewarmInformation):
(WebCore::ProcessWarming::prewarmWithInformation):
* page/SettingsBase.cpp:
(WebCore::invalidateAfterGenericFamilyChange):
Replace calls to FontCache::singleton with calls to
FontCache::forCurrentThread.

* css/CSSFontSelector.h:
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::CSSFontSelector):
(WebCore::CSSFontSelector::~CSSFontSelector):
(WebCore::CSSFontSelector::fontRangesForFamily):
(WebCore::CSSFontSelector::fallbackFontAt):
Remove CSSFontSelector::m_fontCache and use
FontCache::forCurrentThread instead. For the CSSFontSelector
destructor, we call forCurrentThreadIfNotDestroyed since it
can run after ThreadGlobalData::destroy has been called for
a worker, and we don't want to cause a fresh FontCache object to be
created at this point.

* dom/ScriptExecutionContext.h:
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::fontCache):
Remove the FontCache member.

* platform/ThreadGlobalData.h:
(WebCore::ThreadGlobalData::ThreadGlobalData::cachedResourceRequestInitiators):
(WebCore::ThreadGlobalData::ThreadGlobalData::eventNames):
(WebCore::ThreadGlobalData::ThreadGlobalData::qualifiedNameCache):
(WebCore::ThreadGlobalData::ThreadGlobalData::mimeTypeRegistryThreadGlobalData):
(WebCore::ThreadGlobalData::ThreadGlobalData::fontCache):
(WebCore::ThreadGlobalData::ThreadGlobalData::fontCacheIfNotDestroyed):
* platform/ThreadGlobalData.cpp:
(WebCore::ThreadGlobalData::destroy):
(WebCore::ThreadGlobalData::initializeFontCache):
Add accessors for a lazily created FontCache. Also record whether
destroy has been called on the ThreadGlobalData so that
fontCacheIfNotDestroyed can check it, and the other lazy object
creation methods can assert destroy hasn't been called yet.

* platform/graphics/Font.h:
* platform/graphics/Font.cpp:
(WebCore::Font::create):
(WebCore::Font::Font):
(WebCore::Font::systemFallbackFontForCharacter const):
* platform/graphics/FontCache.cpp:
(WebCore::FontCache::fontForPlatformData):
* workers/WorkerFontLoadRequest.cpp:
(WebCore::WorkerFontLoadRequest::createFont):
Remove FontCache arguments and use FontCache::forCurrentThread in
their place.

* platform/graphics/FontCache.cpp:
(WebCore::FontCache::create): Removed.
(WebCore::FontCache::singleton):
(WebCore::FontCache::forCurrentThread):
Replace FontCache::singleton with FontCache::forCurrentThread, which
looks up the FontCache on ThreadGlobalData.
(WebCore::FontCache::invalidateAllFontCaches):
New function that will in the future invalidate the main thread and
all worker thread FontCaches.

* platform/graphics/FontCache.h:
Remove refcounting from FontCache since we no longer need to store a
strong reference to it on other objects.
(WebCore::FontCache::fontCacheFallingBackToSingleton): Deleted.

* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::isCurrent const):
(WebCore::FontCascade::update const):
Call FontCache::forCurrentThread instead of getting it from the
FontSelector.

* 

[webkit-changes] [286610] trunk/Websites/webkit.org

2021-12-07 Thread heycam
Title: [286610] trunk/Websites/webkit.org








Revision 286610
Author hey...@apple.com
Date 2021-12-07 12:51:03 -0800 (Tue, 07 Dec 2021)


Log Message
Puzzle feature detection followup
https://bugs.webkit.org/show_bug.cgi?id=233946

Unreviewed.


* blog-files/wide-gamut-canvas/puzzle.html:

Modified Paths

trunk/Websites/webkit.org/ChangeLog
trunk/Websites/webkit.org/blog-files/wide-gamut-canvas/puzzle.html




Diff

Modified: trunk/Websites/webkit.org/ChangeLog (286609 => 286610)

--- trunk/Websites/webkit.org/ChangeLog	2021-12-07 20:42:25 UTC (rev 286609)
+++ trunk/Websites/webkit.org/ChangeLog	2021-12-07 20:51:03 UTC (rev 286610)
@@ -1,5 +1,14 @@
 2021-12-07  Cameron McCormack  
 
+Puzzle feature detection followup
+https://bugs.webkit.org/show_bug.cgi?id=233946
+
+Unreviewed.
+
+* blog-files/wide-gamut-canvas/puzzle.html:
+
+2021-12-07  Cameron McCormack  
+
 Tweak puzzle to use feature detection
 https://bugs.webkit.org/show_bug.cgi?id=233946
 


Modified: trunk/Websites/webkit.org/blog-files/wide-gamut-canvas/puzzle.html (286609 => 286610)

--- trunk/Websites/webkit.org/blog-files/wide-gamut-canvas/puzzle.html	2021-12-07 20:42:25 UTC (rev 286609)
+++ trunk/Websites/webkit.org/blog-files/wide-gamut-canvas/puzzle.html	2021-12-07 20:51:03 UTC (rev 286610)
@@ -31,6 +31,7 @@
 const EMPTY_SQUARE = SIZE * SIZE - 1;
 const TILE_CORNER_RADIUS = 8;
 
+let supported = false;
 let width, height, board, blank;
 let canvas, ctx;
 let scale = 1;
@@ -68,7 +69,21 @@
 return "data:image/svg+xml;base64," + btoa(svg);
 }
 
+function canvasSupportsDisplayP3() {
+let canvas = document.createElement("canvas");
+try {
+let context = canvas.getContext("2d", { colorSpace: "display-p3" });
+return context.getContextAttributes().colorSpace == "display-p3";
+} catch {
+}
+return false;
+}
+
 function init() {
+supported = canvasSupportsDisplayP3();
+if (!supported)
+document.body.className = "unsupported";
+
 canvas = placeholder;
 width = image.naturalWidth;
 height = image.naturalHeight;
@@ -163,7 +178,7 @@
 }
 
 function updateCanvas() {
-let colorSpace = displayP3.checked ? "display-p3" : "srgb";
+let colorSpace = displayP3.checked && supported ? "display-p3" : "srgb";
 
 let newCanvas = cachedCanvases[colorSpace];
 if (newCanvas != canvas) {
@@ -182,12 +197,7 @@
 canvas.style.width = `${width / scale}px`;
 canvas.style.height = `${height / scale}px`;
 
-try {
-ctx = canvas.getContext("2d", { colorSpace });
-} catch {
-ctx = canvas.getContext("2d");
-document.body.className = "unsupported";
-}
+ctx = canvas.getContext("2d", { colorSpace });
 
 drawBoard();
 }






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [286608] trunk/Websites/webkit.org

2021-12-07 Thread heycam
Title: [286608] trunk/Websites/webkit.org








Revision 286608
Author hey...@apple.com
Date 2021-12-07 12:40:06 -0800 (Tue, 07 Dec 2021)


Log Message
Tweak puzzle to use feature detection
https://bugs.webkit.org/show_bug.cgi?id=233946

Unreviewed.


* blog-files/wide-gamut-canvas/puzzle.html:

Modified Paths

trunk/Websites/webkit.org/ChangeLog
trunk/Websites/webkit.org/blog-files/wide-gamut-canvas/puzzle.html




Diff

Modified: trunk/Websites/webkit.org/ChangeLog (286607 => 286608)

--- trunk/Websites/webkit.org/ChangeLog	2021-12-07 20:33:09 UTC (rev 286607)
+++ trunk/Websites/webkit.org/ChangeLog	2021-12-07 20:40:06 UTC (rev 286608)
@@ -1,3 +1,12 @@
+2021-12-07  Cameron McCormack  
+
+Tweak puzzle to use feature detection
+https://bugs.webkit.org/show_bug.cgi?id=233946
+
+Unreviewed.
+
+* blog-files/wide-gamut-canvas/puzzle.html:
+
 2021-11-30  Cameron McCormack  
 
 Add resources for an upcoming blog post


Modified: trunk/Websites/webkit.org/blog-files/wide-gamut-canvas/puzzle.html (286607 => 286608)

--- trunk/Websites/webkit.org/blog-files/wide-gamut-canvas/puzzle.html	2021-12-07 20:33:09 UTC (rev 286607)
+++ trunk/Websites/webkit.org/blog-files/wide-gamut-canvas/puzzle.html	2021-12-07 20:40:06 UTC (rev 286608)
@@ -2,14 +2,18 @@
 
 
 

[webkit-changes] [286142] trunk/Source/WebCore

2021-11-23 Thread heycam
Title: [286142] trunk/Source/WebCore








Revision 286142
Author hey...@apple.com
Date 2021-11-23 22:20:34 -0800 (Tue, 23 Nov 2021)


Log Message
Remove unnecessary explicit initializer_list usage
https://bugs.webkit.org/show_bug.cgi?id=233456


Reviewed by Myles C. Maxfield.

* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontCache::prewarmGlobally):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (286141 => 286142)

--- trunk/Source/WebCore/ChangeLog	2021-11-24 03:47:06 UTC (rev 286141)
+++ trunk/Source/WebCore/ChangeLog	2021-11-24 06:20:34 UTC (rev 286142)
@@ -1,3 +1,14 @@
+2021-11-23  Cameron McCormack  
+
+Remove unnecessary explicit initializer_list usage
+https://bugs.webkit.org/show_bug.cgi?id=233456
+
+
+Reviewed by Myles C. Maxfield.
+
+* platform/graphics/cocoa/FontCacheCoreText.cpp:
+(WebCore::FontCache::prewarmGlobally):
+
 2021-11-23  Said Abou-Hallawa  
 
 [GPU Process] Move the software FilterEffect functions to separate applier classes


Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp (286141 => 286142)

--- trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp	2021-11-24 03:47:06 UTC (rev 286141)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp	2021-11-24 06:20:34 UTC (rev 286142)
@@ -1681,7 +1681,7 @@
 if (MemoryPressureHandler::singleton().isUnderMemoryPressure())
 return;
 
-Vector families = std::initializer_list {
+Vector families {
 #if PLATFORM(MAC) || PLATFORM(MACCATALYST)
 ".SF NS Text"_s,
 ".SF NS Display"_s,






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [286122] trunk/Source/WebCore

2021-11-22 Thread heycam
Title: [286122] trunk/Source/WebCore








Revision 286122
Author hey...@apple.com
Date 2021-11-22 16:51:53 -0800 (Mon, 22 Nov 2021)


Log Message
Fix some license find/replace errors
https://bugs.webkit.org/show_bug.cgi?id=233435

Reviewed by Sam Weinig.

* platform/graphics/FontCascadeDescription.h:
* platform/graphics/FontDescription.h:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/FontCascadeDescription.h
trunk/Source/WebCore/platform/graphics/FontDescription.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (286121 => 286122)

--- trunk/Source/WebCore/ChangeLog	2021-11-22 23:32:20 UTC (rev 286121)
+++ trunk/Source/WebCore/ChangeLog	2021-11-23 00:51:53 UTC (rev 286122)
@@ -1,3 +1,13 @@
+2021-11-22  Cameron McCormack  
+
+Fix some license find/replace errors
+https://bugs.webkit.org/show_bug.cgi?id=233435
+
+Reviewed by Sam Weinig.
+
+* platform/graphics/FontCascadeDescription.h:
+* platform/graphics/FontDescription.h:
+
 2021-11-22  Antti Koivisto  
 
 [LFC][Integration] Use IFC for preferred width computation for inline boxes


Modified: trunk/Source/WebCore/platform/graphics/FontCascadeDescription.h (286121 => 286122)

--- trunk/Source/WebCore/platform/graphics/FontCascadeDescription.h	2021-11-22 23:32:20 UTC (rev 286121)
+++ trunk/Source/WebCore/platform/graphics/FontCascadeDescription.h	2021-11-23 00:51:53 UTC (rev 286122)
@@ -16,9 +16,9 @@
  * Library General Public License for more details.
  *
  * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIother.m_  If not, write to
+ * along with this library; see the file COPYING.LIB.  If not, write to
  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USm_
+ * Boston, MA 02110-1301, USA.
  *
  */
 


Modified: trunk/Source/WebCore/platform/graphics/FontDescription.h (286121 => 286122)

--- trunk/Source/WebCore/platform/graphics/FontDescription.h	2021-11-22 23:32:20 UTC (rev 286121)
+++ trunk/Source/WebCore/platform/graphics/FontDescription.h	2021-11-23 00:51:53 UTC (rev 286122)
@@ -16,9 +16,9 @@
  * Library General Public License for more details.
  *
  * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIother.m_  If not, write to
+ * along with this library; see the file COPYING.LIB.  If not, write to
  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USm_
+ * Boston, MA 02110-1301, USA.
  *
  */
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [285976] trunk/Source/WebKit

2021-11-17 Thread heycam
Title: [285976] trunk/Source/WebKit








Revision 285976
Author hey...@apple.com
Date 2021-11-17 19:54:56 -0800 (Wed, 17 Nov 2021)


Log Message
Protect against null SharedBitmaps when starting a drag
https://bugs.webkit.org/show_bug.cgi?id=233217


Reviewed by Wenson Hsieh.

* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::startDrag):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm




Diff

Modified: trunk/Source/WebKit/ChangeLog (285975 => 285976)

--- trunk/Source/WebKit/ChangeLog	2021-11-18 03:46:53 UTC (rev 285975)
+++ trunk/Source/WebKit/ChangeLog	2021-11-18 03:54:56 UTC (rev 285976)
@@ -1,3 +1,14 @@
+2021-11-17  Cameron McCormack  
+
+Protect against null SharedBitmaps when starting a drag
+https://bugs.webkit.org/show_bug.cgi?id=233217
+
+
+Reviewed by Wenson Hsieh.
+
+* UIProcess/ios/PageClientImplIOS.mm:
+(WebKit::PageClientImpl::startDrag):
+
 2021-11-17  Wenson Hsieh  
 
 [Live Text] Plumb an identifier string through `ChromeClient::requestTextRecognition()`


Modified: trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm (285975 => 285976)

--- trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm	2021-11-18 03:46:53 UTC (rev 285975)
+++ trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm	2021-11-18 03:54:56 UTC (rev 285976)
@@ -910,7 +910,10 @@
 
 void PageClientImpl::startDrag(const DragItem& item, const ShareableBitmap::Handle& image)
 {
-[m_contentView _startDrag:ShareableBitmap::create(image)->makeCGImageCopy() item:item];
+auto bitmap = ShareableBitmap::create(image);
+if (!bitmap)
+return;
+[m_contentView _startDrag:bitmap->makeCGImageCopy() item:item];
 }
 
 void PageClientImpl::willReceiveEditDragSnapshot()






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [285440] trunk

2021-11-08 Thread heycam
Title: [285440] trunk








Revision 285440
Author hey...@apple.com
Date 2021-11-08 15:45:45 -0800 (Mon, 08 Nov 2021)


Log Message
Update my status to reviewer
https://bugs.webkit.org/show_bug.cgi?id=232854

Unreviewed.


* metadata/contributors.json:

Modified Paths

trunk/ChangeLog
trunk/metadata/contributors.json




Diff

Modified: trunk/ChangeLog (285439 => 285440)

--- trunk/ChangeLog	2021-11-08 23:41:45 UTC (rev 285439)
+++ trunk/ChangeLog	2021-11-08 23:45:45 UTC (rev 285440)
@@ -1,3 +1,12 @@
+2021-11-08  Cameron McCormack  
+
+Update my status to reviewer
+https://bugs.webkit.org/show_bug.cgi?id=232854
+
+Unreviewed.
+
+* metadata/contributors.json:
+
 2021-11-04  Roy Reapor  
 
 Update rreapor's status in contributors.json.


Modified: trunk/metadata/contributors.json (285439 => 285440)

--- trunk/metadata/contributors.json	2021-11-08 23:41:45 UTC (rev 285439)
+++ trunk/metadata/contributors.json	2021-11-08 23:45:45 UTC (rev 285440)
@@ -1256,7 +1256,7 @@
   "nicks" : [
  "heycam"
   ],
-  "status" : "committer"
+  "status" : "reviewer"
},
{
   "emails" : [






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [285334] trunk/Source/WebCore

2021-11-04 Thread heycam
Title: [285334] trunk/Source/WebCore








Revision 285334
Author hey...@apple.com
Date 2021-11-04 21:52:41 -0700 (Thu, 04 Nov 2021)


Log Message
Factor out didDraw / didDrawEntireCanvas calls in canvas drawing functions
https://bugs.webkit.org/show_bug.cgi?id=232527


Reviewed by Antti Koivisto.

No behavior change except for in drawImage, where the
paintCurrentFrameInContext code path now will check whether to call
didDrawEntireCanvas.

* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::fillInternal):
(WebCore::CanvasRenderingContext2DBase::strokeInternal):
(WebCore::CanvasRenderingContext2DBase::fillRect):
(WebCore::CanvasRenderingContext2DBase::strokeRect):
(WebCore::CanvasRenderingContext2DBase::drawImage):
(WebCore::CanvasRenderingContext2DBase::didDraw):
(WebCore::CanvasRenderingContext2DBase::drawTextUnchecked):
* html/canvas/CanvasRenderingContext2DBase.h:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (285333 => 285334)

--- trunk/Source/WebCore/ChangeLog	2021-11-05 04:06:12 UTC (rev 285333)
+++ trunk/Source/WebCore/ChangeLog	2021-11-05 04:52:41 UTC (rev 285334)
@@ -1,5 +1,27 @@
 2021-11-04  Cameron McCormack  
 
+Factor out didDraw / didDrawEntireCanvas calls in canvas drawing functions
+https://bugs.webkit.org/show_bug.cgi?id=232527
+
+
+Reviewed by Antti Koivisto.
+
+No behavior change except for in drawImage, where the
+paintCurrentFrameInContext code path now will check whether to call
+didDrawEntireCanvas.
+
+* html/canvas/CanvasRenderingContext2DBase.cpp:
+(WebCore::CanvasRenderingContext2DBase::fillInternal):
+(WebCore::CanvasRenderingContext2DBase::strokeInternal):
+(WebCore::CanvasRenderingContext2DBase::fillRect):
+(WebCore::CanvasRenderingContext2DBase::strokeRect):
+(WebCore::CanvasRenderingContext2DBase::drawImage):
+(WebCore::CanvasRenderingContext2DBase::didDraw):
+(WebCore::CanvasRenderingContext2DBase::drawTextUnchecked):
+* html/canvas/CanvasRenderingContext2DBase.h:
+
+2021-11-04  Cameron McCormack  
+
 Avoid sending video data to Web process for canvas.drawImage(video)
 https://bugs.webkit.org/show_bug.cgi?id=230766
 


Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp (285333 => 285334)

--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp	2021-11-05 04:06:12 UTC (rev 285333)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp	2021-11-05 04:52:41 UTC (rev 285334)
@@ -1061,12 +1061,9 @@
 } else
 c->fillPath(path);
 
-if (isEntireBackingStoreDirty())
-didDraw(std::nullopt);
-else if (repaintEntireCanvas)
-didDrawEntireCanvas();
-else
-didDraw(path.fastBoundingRect());
+didDraw(repaintEntireCanvas, [&] {
+return path.fastBoundingRect();
+});
 
 c->setFillRule(savedFillRule);
 }
@@ -1100,15 +1097,11 @@
 } else
 c->strokePath(path);
 
-if (isEntireBackingStoreDirty())
-didDraw(std::nullopt);
-else if (repaintEntireCanvas)
-didDrawEntireCanvas();
-else {
+didDraw(repaintEntireCanvas, [&] {
 auto dirtyRect = path.fastBoundingRect();
 inflateStrokeRect(dirtyRect);
-didDraw(dirtyRect);
-}
+return dirtyRect;
+});
 }
 
 void CanvasRenderingContext2DBase::clipInternal(const Path& path, CanvasFillRule windingRule)
@@ -1270,12 +1263,7 @@
 } else
 c->fillRect(rect);
 
-if (isEntireBackingStoreDirty())
-didDraw(std::nullopt);
-else if (repaintEntireCanvas)
-didDrawEntireCanvas();
-else
-didDraw(rect);
+didDraw(repaintEntireCanvas, rect);
 }
 
 void CanvasRenderingContext2DBase::strokeRect(double x, double y, double width, double height)
@@ -1310,15 +1298,11 @@
 } else
 c->strokeRect(rect, state().lineWidth);
 
-if (isEntireBackingStoreDirty())
-didDraw(std::nullopt);
-else if (repaintEntireCanvas)
-didDrawEntireCanvas();
-else {
+didDraw(repaintEntireCanvas, [&] {
 auto boundingRect = rect;
 boundingRect.inflate(state().lineWidth / 2);
-didDraw(boundingRect);
-}
+return boundingRect;
+});
 }
 
 void CanvasRenderingContext2DBase::setShadow(float width, float height, float blur, const String& colorString, std::optional alpha)
@@ -1582,12 +1566,7 @@
 } else
 c->drawImageForCanvas(*image, normalizedDstRect, normalizedSrcRect, options, colorSpace());
 
-if (isEntireBackingStoreDirty())
-didDraw(std::nullopt);
-else if (repaintEntireCanvas)
-didDrawEntireCanvas();
-else
-didDraw(normalizedDstRect);
+didDraw(repaintEntireCanvas, 

[webkit-changes] [285333] trunk/Source/WebCore

2021-11-04 Thread heycam
Title: [285333] trunk/Source/WebCore








Revision 285333
Author hey...@apple.com
Date 2021-11-04 21:06:12 -0700 (Thu, 04 Nov 2021)


Log Message
Avoid sending video data to Web process for canvas.drawImage(video)
https://bugs.webkit.org/show_bug.cgi?id=230766


Reviewed by Simon Fraser.

Using nativeImageForCurrentTime() to get the image to paint on to the
canvas results in a ShareableBitmap being created to send to the
Web process, the identifier for which we then send back to the GPU
process for the drawImage() call. But if we use
paintCurrentFrameInContext(), this uses the PaintFrameForMedia
message, which just sends the MediaPlayer ID and avoids the bitmap
creation.

* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::drawImage):
* platform/graphics/ImageBuffer.h:
(WebCore::ImageBuffer::isRemote const):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (285332 => 285333)

--- trunk/Source/WebCore/ChangeLog	2021-11-05 03:40:04 UTC (rev 285332)
+++ trunk/Source/WebCore/ChangeLog	2021-11-05 04:06:12 UTC (rev 285333)
@@ -1,5 +1,26 @@
 2021-11-04  Cameron McCormack  
 
+Avoid sending video data to Web process for canvas.drawImage(video)
+https://bugs.webkit.org/show_bug.cgi?id=230766
+
+
+Reviewed by Simon Fraser.
+
+Using nativeImageForCurrentTime() to get the image to paint on to the
+canvas results in a ShareableBitmap being created to send to the
+Web process, the identifier for which we then send back to the GPU
+process for the drawImage() call. But if we use
+paintCurrentFrameInContext(), this uses the PaintFrameForMedia
+message, which just sends the MediaPlayer ID and avoids the bitmap
+creation.
+
+* html/canvas/CanvasRenderingContext2DBase.cpp:
+(WebCore::CanvasRenderingContext2DBase::drawImage):
+* platform/graphics/ImageBuffer.h:
+(WebCore::ImageBuffer::isRemote const):
+
+2021-11-04  Cameron McCormack  
+
 Nested run loops under MediaPlayerPrivateAVFoundationObjC::waitForVideoOutputMediaDataWillChange can cause hang when timeout fires
 https://bugs.webkit.org/show_bug.cgi?id=232695
 


Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp (285332 => 285333)

--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp	2021-11-05 03:40:04 UTC (rev 285332)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp	2021-11-05 04:06:12 UTC (rev 285333)
@@ -1677,17 +1677,19 @@
 checkOrigin();
 
 #if USE(CG)
-if (auto image = video.nativeImageForCurrentTime()) {
-c->drawNativeImage(*image, FloatSize(video.videoWidth(), video.videoHeight()), dstRect, srcRect);
+if (c->hasPlatformContext()) {
+if (auto image = video.nativeImageForCurrentTime()) {
+c->drawNativeImage(*image, FloatSize(video.videoWidth(), video.videoHeight()), dstRect, srcRect);
 
-if (isEntireBackingStoreDirty())
-didDraw(std::nullopt);
-else if (rectContainsCanvas(dstRect))
-didDrawEntireCanvas();
-else
-didDraw(dstRect);
+if (isEntireBackingStoreDirty())
+didDraw(std::nullopt);
+else if (rectContainsCanvas(dstRect))
+didDrawEntireCanvas();
+else
+didDraw(dstRect);
 
-return { };
+return { };
+}
 }
 #endif
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [285330] trunk/Source/WebCore

2021-11-04 Thread heycam
Title: [285330] trunk/Source/WebCore








Revision 285330
Author hey...@apple.com
Date 2021-11-04 20:27:54 -0700 (Thu, 04 Nov 2021)


Log Message
Nested run loops under MediaPlayerPrivateAVFoundationObjC::waitForVideoOutputMediaDataWillChange can cause hang when timeout fires
https://bugs.webkit.org/show_bug.cgi?id=232695


Reviewed by Jer Noble.

It's possible for MediaPlayerPrivateAVFoundationObjC::waitForVideoOutputMediaDataWillChange
to be called re-entrantly, if the RunLoop::run call ends up processing
an event that also wants to synchronously update the media image. This
can cause a hang:

1. Enter the outer waitForVideoOutputMediaDataWillChange call.
2. Set up the outer timeout timer.
3. Call RunLoop::run.
3.1. Enter the inner waitForVideoOutputMediaDataWillChange call.
3.2. Set up the inner timeout timer.
3.3. Call RunLoop::run.
3.3.1. Wait for new RunLoop events, and none arrive.
3.3.2. The outer timeout timer fires, calling RunLoop::stop.
3.4. Return from waitForVideoOutputMediaDataWillChange, cancelling
 the inner timeout timer.
3.5. Wait for more events on the run loop, forever.

To avoid this, we can set up a single timeout timer, and track the
nesting level of our RunLoop::run calls. The innermost RunLoop::run call
will finish either by the timer firing (which calls RunLoop::stop) or by
the video data updating (which also calls RunLoop::stop, under
outputMediaDataWillChange). Either way, once the innermost
RunLoop::run call is finished, we know we can stop processing all of
the ancestor RunLoop:run calls.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::waitForVideoOutputMediaDataWillChange):
(WebCore::MediaPlayerPrivateAVFoundationObjC::outputMediaDataWillChange):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h
trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (285329 => 285330)

--- trunk/Source/WebCore/ChangeLog	2021-11-05 03:25:23 UTC (rev 285329)
+++ trunk/Source/WebCore/ChangeLog	2021-11-05 03:27:54 UTC (rev 285330)
@@ -1,3 +1,41 @@
+2021-11-04  Cameron McCormack  
+
+Nested run loops under MediaPlayerPrivateAVFoundationObjC::waitForVideoOutputMediaDataWillChange can cause hang when timeout fires
+https://bugs.webkit.org/show_bug.cgi?id=232695
+
+
+Reviewed by Jer Noble.
+
+It's possible for MediaPlayerPrivateAVFoundationObjC::waitForVideoOutputMediaDataWillChange
+to be called re-entrantly, if the RunLoop::run call ends up processing
+an event that also wants to synchronously update the media image. This
+can cause a hang:
+
+1. Enter the outer waitForVideoOutputMediaDataWillChange call.
+2. Set up the outer timeout timer.
+3. Call RunLoop::run.
+3.1. Enter the inner waitForVideoOutputMediaDataWillChange call.
+3.2. Set up the inner timeout timer.
+3.3. Call RunLoop::run.
+3.3.1. Wait for new RunLoop events, and none arrive.
+3.3.2. The outer timeout timer fires, calling RunLoop::stop.
+3.4. Return from waitForVideoOutputMediaDataWillChange, cancelling
+ the inner timeout timer.
+3.5. Wait for more events on the run loop, forever.
+
+To avoid this, we can set up a single timeout timer, and track the
+nesting level of our RunLoop::run calls. The innermost RunLoop::run call
+will finish either by the timer firing (which calls RunLoop::stop) or by
+the video data updating (which also calls RunLoop::stop, under
+outputMediaDataWillChange). Either way, once the innermost
+RunLoop::run call is finished, we know we can stop processing all of
+the ancestor RunLoop:run calls.
+
+* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
+* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+(WebCore::MediaPlayerPrivateAVFoundationObjC::waitForVideoOutputMediaDataWillChange):
+(WebCore::MediaPlayerPrivateAVFoundationObjC::outputMediaDataWillChange):
+
 2021-11-04  Alan Bujtas  
 
 [LFC][IFC] Use objectReplacementCharacter to mark atomic inline box position.


Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h (285329 => 285330)

--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h	2021-11-05 03:25:23 UTC (rev 285329)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h	2021-11-05 03:27:54 UTC (rev 285330)
@@ -428,6 +428,7 @@
 mutable long long 

[webkit-changes] [285098] trunk/Source

2021-10-31 Thread heycam
Title: [285098] trunk/Source








Revision 285098
Author hey...@apple.com
Date 2021-10-31 14:40:58 -0700 (Sun, 31 Oct 2021)


Log Message
Update Web IDL links to new URL
https://bugs.webkit.org/show_bug.cgi?id=232533


Reviewed by Sam Weinig.

Source/_javascript_Core:

* wasm/js/WebAssemblyMemoryConstructor.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
* wasm/js/WebAssemblyTableConstructor.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):

Source/WebCore:

* Modules/mediastream/OverconstrainedError.idl:
* bindings/js/JSCallbackData.cpp:
* bindings/js/JSDOMAbstractOperations.h:
* bindings/js/JSDOMConvertPromise.h:
* bindings/scripts/CodeGenerator.pm:
* bindings/scripts/CodeGeneratorJS.pm:
(AddMapLikeAttributesAndOperationIfNeeded):
(AddSetLikeAttributesAndOperationIfNeeded):
(GenerateGetOwnPropertySlot):
(GenerateGetOwnPropertySlotByIndex):
(GenerateDeletePropertyCommon):
(GenerateDeleteProperty):
(GenerateDeletePropertyByIndex):
(GenerateNamedDeleterDefinition):
(AttributeShouldBeOnInstance):
(OperationShouldBeOnInstance):
(GenerateDictionaryImplementationContent):
(GenerateAttributeSetterBodyDefinition):
(GenerateOperationBodyDefinition):
(GenerateDefaultToJSONOperationDefinition):
(GenerateConstructorHelperMethods):
* bindings/scripts/IDLAttributes.json:
* bindings/scripts/IDLParser.pm:
* bindings/scripts/preprocess-idls.pl:
* dom/ExceptionCode.h:

Modified Paths

trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/wasm/js/WebAssemblyMemoryConstructor.cpp
trunk/Source/_javascript_Core/wasm/js/WebAssemblyTableConstructor.cpp
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/mediastream/OverconstrainedError.idl
trunk/Source/WebCore/bindings/js/JSCallbackData.cpp
trunk/Source/WebCore/bindings/js/JSDOMAbstractOperations.h
trunk/Source/WebCore/bindings/js/JSDOMConvertPromise.h
trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
trunk/Source/WebCore/bindings/scripts/IDLAttributes.json
trunk/Source/WebCore/bindings/scripts/IDLParser.pm
trunk/Source/WebCore/bindings/scripts/preprocess-idls.pl
trunk/Source/WebCore/dom/ExceptionCode.h




Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (285097 => 285098)

--- trunk/Source/_javascript_Core/ChangeLog	2021-10-31 20:31:14 UTC (rev 285097)
+++ trunk/Source/_javascript_Core/ChangeLog	2021-10-31 21:40:58 UTC (rev 285098)
@@ -1,3 +1,16 @@
+2021-10-31  Cameron McCormack  
+
+Update Web IDL links to new URL
+https://bugs.webkit.org/show_bug.cgi?id=232533
+
+
+Reviewed by Sam Weinig.
+
+* wasm/js/WebAssemblyMemoryConstructor.cpp:
+(JSC::JSC_DEFINE_HOST_FUNCTION):
+* wasm/js/WebAssemblyTableConstructor.cpp:
+(JSC::JSC_DEFINE_HOST_FUNCTION):
+
 2021-10-29  Yusuke Suzuki  
 
 [JSC] Having StructureStubInfo and CallLinkInfo via FixedVector for Baseline JIT


Modified: trunk/Source/_javascript_Core/wasm/js/WebAssemblyMemoryConstructor.cpp (285097 => 285098)

--- trunk/Source/_javascript_Core/wasm/js/WebAssemblyMemoryConstructor.cpp	2021-10-31 20:31:14 UTC (rev 285097)
+++ trunk/Source/_javascript_Core/wasm/js/WebAssemblyMemoryConstructor.cpp	2021-10-31 21:40:58 UTC (rev 285098)
@@ -96,7 +96,7 @@
 Wasm::PageCount maximumPageCount;
 {
 // In WebIDL, "present" means that [[Get]] result is undefined, not [[HasProperty]] result.
-// https://heycam.github.io/webidl/#idl-dictionaries
+// https://webidl.spec.whatwg.org/#idl-dictionaries
 Identifier maximum = Identifier::fromString(vm, "maximum");
 JSValue maxSizeValue = memoryDescriptor->get(globalObject, maximum);
 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());


Modified: trunk/Source/_javascript_Core/wasm/js/WebAssemblyTableConstructor.cpp (285097 => 285098)

--- trunk/Source/_javascript_Core/wasm/js/WebAssemblyTableConstructor.cpp	2021-10-31 20:31:14 UTC (rev 285097)
+++ trunk/Source/_javascript_Core/wasm/js/WebAssemblyTableConstructor.cpp	2021-10-31 21:40:58 UTC (rev 285098)
@@ -98,7 +98,7 @@
 RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
 
 // In WebIDL, "present" means that [[Get]] result is undefined, not [[HasProperty]] result.
-// https://heycam.github.io/webidl/#idl-dictionaries
+// https://webidl.spec.whatwg.org/#idl-dictionaries
 std::optional maximum;
 Identifier maximumIdent = Identifier::fromString(vm, "maximum");
 JSValue maxSizeValue = memoryDescriptor->get(globalObject, maximumIdent);


Modified: trunk/Source/WebCore/ChangeLog (285097 => 285098)

--- trunk/Source/WebCore/ChangeLog	2021-10-31 20:31:14 UTC (rev 285097)
+++ trunk/Source/WebCore/ChangeLog	2021-10-31 21:40:58 UTC (rev 285098)
@@ -1,3 +1,37 @@
+2021-10-31  Cameron McCormack  
+
+Update Web IDL links to new URL
+https://bugs.webkit.org/show_bug.cgi?id=232533
+
+
+Reviewed by Sam Weinig.
+
+* Modules/mediastream/OverconstrainedError.idl:
+* bindings/js/JSCallbackData.cpp:

[webkit-changes] [285091] trunk/Source/WebCore

2021-10-31 Thread heycam
Title: [285091] trunk/Source/WebCore








Revision 285091
Author hey...@apple.com
Date 2021-10-31 01:49:17 -0700 (Sun, 31 Oct 2021)


Log Message
Change some bitwise OR operators to logical OR
https://bugs.webkit.org/show_bug.cgi?id=232537


Reviewed by Alexey Proskuryakov.

* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::translate):
(WebCore::CanvasRenderingContext2DBase::transform):
(WebCore::CanvasRenderingContext2DBase::setTransform):
(WebCore::validateRectForCanvas):
(WebCore::CanvasRenderingContext2DBase::canDrawText):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (285090 => 285091)

--- trunk/Source/WebCore/ChangeLog	2021-10-31 03:22:46 UTC (rev 285090)
+++ trunk/Source/WebCore/ChangeLog	2021-10-31 08:49:17 UTC (rev 285091)
@@ -1,3 +1,18 @@
+2021-10-31  Cameron McCormack  
+
+Change some bitwise OR operators to logical OR
+https://bugs.webkit.org/show_bug.cgi?id=232537
+
+
+Reviewed by Alexey Proskuryakov.
+
+* html/canvas/CanvasRenderingContext2DBase.cpp:
+(WebCore::CanvasRenderingContext2DBase::translate):
+(WebCore::CanvasRenderingContext2DBase::transform):
+(WebCore::CanvasRenderingContext2DBase::setTransform):
+(WebCore::validateRectForCanvas):
+(WebCore::CanvasRenderingContext2DBase::canDrawText):
+
 2021-10-30  Myles C. Maxfield  
 
 Migrate the first few callers from ImageBuffer::truncatedLogicalSize() to ImageBuffer::logicalSize()


Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp (285090 => 285091)

--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp	2021-10-31 03:22:46 UTC (rev 285090)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp	2021-10-31 08:49:17 UTC (rev 285091)
@@ -790,7 +790,7 @@
 if (!state().hasInvertibleTransform)
 return;
 
-if (!std::isfinite(tx) | !std::isfinite(ty))
+if (!std::isfinite(tx) || !std::isfinite(ty))
 return;
 
 AffineTransform newTransform = state().transform;
@@ -813,7 +813,7 @@
 if (!state().hasInvertibleTransform)
 return;
 
-if (!std::isfinite(m11) | !std::isfinite(m21) | !std::isfinite(dx) | !std::isfinite(m12) | !std::isfinite(m22) | !std::isfinite(dy))
+if (!std::isfinite(m11) || !std::isfinite(m21) || !std::isfinite(dx) || !std::isfinite(m12) || !std::isfinite(m22) || !std::isfinite(dy))
 return;
 
 AffineTransform transform(m11, m12, m21, m22, dx, dy);
@@ -843,7 +843,7 @@
 if (!c)
 return;
 
-if (!std::isfinite(m11) | !std::isfinite(m21) | !std::isfinite(dx) | !std::isfinite(m12) | !std::isfinite(m22) | !std::isfinite(dy))
+if (!std::isfinite(m11) || !std::isfinite(m21) || !std::isfinite(dx) || !std::isfinite(m12) || !std::isfinite(m22) || !std::isfinite(dy))
 return;
 
 resetTransform();
@@ -967,7 +967,7 @@
 
 static bool validateRectForCanvas(double& x, double& y, double& width, double& height)
 {
-if (!std::isfinite(x) | !std::isfinite(y) | !std::isfinite(width) | !std::isfinite(height))
+if (!std::isfinite(x) || !std::isfinite(y) || !std::isfinite(width) || !std::isfinite(height))
 return false;
 
 if (!width && !height)
@@ -2364,7 +2364,7 @@
 return false;
 if (!state().hasInvertibleTransform)
 return false;
-if (!std::isfinite(x) | !std::isfinite(y))
+if (!std::isfinite(x) || !std::isfinite(y))
 return false;
 if (maxWidth && (!std::isfinite(maxWidth.value()) || maxWidth.value() <= 0))
 return false;






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [285055] trunk/Source

2021-10-29 Thread heycam
Title: [285055] trunk/Source








Revision 285055
Author hey...@apple.com
Date 2021-10-29 14:45:39 -0700 (Fri, 29 Oct 2021)


Log Message
Source/WebCore:
Avoid sending video data to Web process for canvas.drawImage(video)
https://bugs.webkit.org/show_bug.cgi?id=230766


Reviewed by Simon Fraser.

Using nativeImageForCurrentTime() to get the image to paint on to the
canvas results in a ShareableBitmap being created to send to the
Web process, the identifier for which we then send back to the GPU
process for the drawImage() call. But if we use
paintCurrentFrameInContext(), this uses the PaintFrameForMedia
message, which just sends the MediaPlayer ID and avoids the bitmap
creation.

* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::drawImage):
* platform/graphics/ImageBuffer.h:
(WebCore::ImageBuffer::isRemote const):

Source/WebKit:
Avoid sending video data to Web process for canvas.drawImage(video).
https://bugs.webkit.org/show_bug.cgi?id=230766


Reviewed by Simon Fraser.

* WebProcess/GPU/graphics/RemoteImageBufferProxy.h:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp
trunk/Source/WebCore/platform/graphics/ImageBuffer.h
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (285054 => 285055)

--- trunk/Source/WebCore/ChangeLog	2021-10-29 21:42:50 UTC (rev 285054)
+++ trunk/Source/WebCore/ChangeLog	2021-10-29 21:45:39 UTC (rev 285055)
@@ -1,3 +1,24 @@
+2021-10-29  Cameron McCormack  
+
+Avoid sending video data to Web process for canvas.drawImage(video)
+https://bugs.webkit.org/show_bug.cgi?id=230766
+
+
+Reviewed by Simon Fraser.
+
+Using nativeImageForCurrentTime() to get the image to paint on to the
+canvas results in a ShareableBitmap being created to send to the
+Web process, the identifier for which we then send back to the GPU
+process for the drawImage() call. But if we use
+paintCurrentFrameInContext(), this uses the PaintFrameForMedia
+message, which just sends the MediaPlayer ID and avoids the bitmap
+creation.
+
+* html/canvas/CanvasRenderingContext2DBase.cpp:
+(WebCore::CanvasRenderingContext2DBase::drawImage):
+* platform/graphics/ImageBuffer.h:
+(WebCore::ImageBuffer::isRemote const):
+
 2021-10-29  Antti Koivisto  
 
 Allow :is/:where after all pseudo elements


Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp (285054 => 285055)

--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp	2021-10-29 21:42:50 UTC (rev 285054)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp	2021-10-29 21:45:39 UTC (rev 285055)
@@ -1677,17 +1677,19 @@
 checkOrigin();
 
 #if USE(CG)
-if (auto image = video.nativeImageForCurrentTime()) {
-c->drawNativeImage(*image, FloatSize(video.videoWidth(), video.videoHeight()), dstRect, srcRect);
+if (!canvasBase().buffer()->isRemote()) {
+if (auto image = video.nativeImageForCurrentTime()) {
+c->drawNativeImage(*image, FloatSize(video.videoWidth(), video.videoHeight()), dstRect, srcRect);
 
-if (isEntireBackingStoreDirty())
-didDraw(std::nullopt);
-else if (rectContainsCanvas(dstRect))
-didDrawEntireCanvas();
-else
-didDraw(dstRect);
+if (isEntireBackingStoreDirty())
+didDraw(std::nullopt);
+else if (rectContainsCanvas(dstRect))
+didDrawEntireCanvas();
+else
+didDraw(dstRect);
 
-return { };
+return { };
+}
 }
 #endif
 


Modified: trunk/Source/WebCore/platform/graphics/ImageBuffer.h (285054 => 285055)

--- trunk/Source/WebCore/platform/graphics/ImageBuffer.h	2021-10-29 21:42:50 UTC (rev 285054)
+++ trunk/Source/WebCore/platform/graphics/ImageBuffer.h	2021-10-29 21:45:39 UTC (rev 285055)
@@ -71,6 +71,7 @@
 
 virtual RenderingMode renderingMode() const = 0;
 virtual bool canMapBackingStore() const = 0;
+virtual bool isRemote() const { return false; }
 virtual RenderingResourceIdentifier renderingResourceIdentifier() const { return { }; }
 
 virtual GraphicsContext& context() const = 0;


Modified: trunk/Source/WebKit/ChangeLog (285054 => 285055)

--- trunk/Source/WebKit/ChangeLog	2021-10-29 21:42:50 UTC (rev 285054)
+++ trunk/Source/WebKit/ChangeLog	2021-10-29 21:45:39 UTC (rev 285055)
@@ -1,3 +1,13 @@
+2021-10-29  Cameron McCormack  
+
+Avoid sending video data to Web process for canvas.drawImage(video).
+https://bugs.webkit.org/show_bug.cgi?id=230766
+
+
+Reviewed by Simon Fraser.
+
+* WebProcess/GPU/graphics/RemoteImageBufferProxy.h:
+
 2021-10-29  Alex Christensen  
 
 Fix internal macOS build after r285047

[webkit-changes] [284752] trunk/LayoutTests

2021-10-23 Thread heycam
Title: [284752] trunk/LayoutTests








Revision 284752
Author hey...@apple.com
Date 2021-10-23 19:56:46 -0700 (Sat, 23 Oct 2021)


Log Message
LayoutTests/imported/w3c:
Tweak test tolerance
https://bugs.webkit.org/show_bug.cgi?id=231959


Unreviewed.


* web-platform-tests/html/canvas/element/manual/imagebitmap/createImageBitmap-drawImage.html:
* web-platform-tests/html/canvas/element/manual/imagebitmap/createImageBitmap-flipY.html:

LayoutTests:
Update WPT test tolerance and mark some failures as simulator-only
https://bugs.webkit.org/show_bug.cgi?id=231959


Unreviewed test gardening.

The ipad failures are really iPad simulator failures.


* platform/ios-simulator/TestExpectations:
* platform/ipad/TestExpectations:
* platform/mac/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/imported/w3c/ChangeLog
trunk/LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/manual/imagebitmap/createImageBitmap-drawImage.html
trunk/LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/manual/imagebitmap/createImageBitmap-flipY.html
trunk/LayoutTests/platform/ios-simulator/TestExpectations
trunk/LayoutTests/platform/ipad/TestExpectations
trunk/LayoutTests/platform/mac/TestExpectations
trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/html/canvas/element/manual/imagebitmap/createImageBitmap-flipY-expected.txt




Diff

Modified: trunk/LayoutTests/ChangeLog (284751 => 284752)

--- trunk/LayoutTests/ChangeLog	2021-10-24 00:47:22 UTC (rev 284751)
+++ trunk/LayoutTests/ChangeLog	2021-10-24 02:56:46 UTC (rev 284752)
@@ -1,3 +1,17 @@
+2021-10-23  Cameron McCormack  
+
+Update WPT test tolerance and mark some failures as simulator-only
+https://bugs.webkit.org/show_bug.cgi?id=231959
+
+
+Unreviewed test gardening.
+
+The ipad failures are really iPad simulator failures.
+
+* platform/ios-simulator/TestExpectations:
+* platform/ipad/TestExpectations:
+* platform/mac/TestExpectations:
+
 2021-10-23  Chris Dumez  
 
 Add support for rel="noopener/noreferrer" on  elements


Modified: trunk/LayoutTests/imported/w3c/ChangeLog (284751 => 284752)

--- trunk/LayoutTests/imported/w3c/ChangeLog	2021-10-24 00:47:22 UTC (rev 284751)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2021-10-24 02:56:46 UTC (rev 284752)
@@ -1,3 +1,14 @@
+2021-10-23  Cameron McCormack  
+
+Tweak test tolerance
+https://bugs.webkit.org/show_bug.cgi?id=231959
+
+
+Unreviewed.
+
+* web-platform-tests/html/canvas/element/manual/imagebitmap/createImageBitmap-drawImage.html:
+* web-platform-tests/html/canvas/element/manual/imagebitmap/createImageBitmap-flipY.html:
+
 2021-10-23  Chris Dumez  
 
 Add support for rel="noopener/noreferrer" on  elements


Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/manual/imagebitmap/createImageBitmap-drawImage.html (284751 => 284752)

--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/manual/imagebitmap/createImageBitmap-drawImage.html	2021-10-24 00:47:22 UTC (rev 284751)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/manual/imagebitmap/createImageBitmap-drawImage.html	2021-10-24 02:56:46 UTC (rev 284752)
@@ -11,7 +11,7 @@
 

[webkit-changes] [284436] trunk

2021-10-19 Thread heycam
Title: [284436] trunk








Revision 284436
Author hey...@apple.com
Date 2021-10-18 23:32:24 -0700 (Mon, 18 Oct 2021)


Log Message
Make createImageBitmap() take EXIF orientation into account correctly
https://bugs.webkit.org/show_bug.cgi?id=231063


Reviewed by Myles Maxfield and Said Abou-Hallawa.

LayoutTests/imported/w3c:

* web-platform-tests/html/canvas/element/manual/imagebitmap/createImageBitmap-exif-orientation-expected.txt: Added.
* web-platform-tests/html/canvas/element/manual/imagebitmap/createImageBitmap-exif-orientation.html: Added.
* web-platform-tests/html/canvas/element/manual/imagebitmap/resources/squares.jpg: Added.

Source/WebCore:

Test: imported/w3c/web-platform-tests/html/canvas/element/manual/imagebitmap/createImageBitmap-exif-orientation.html

This makes us treat {imageOrientation:"none"} as meaning "apply EXIF
orientation without any additional transformation", and
{imageOrientation:"flipY"} as meaning "apply EXIF orientation and then
apply an additional vertical flip". This behavior matches Firefox;
https://github.com/whatwg/html/issues/7210 is open on clarifying this
behavior in the HTML spec.

* html/ImageBitmap.cpp:
(WebCore::ImageBitmap::createPromise):
(WebCore::ImageBitmap::createFromBuffer):
(WebCore::imageOrientationForOrientation): Deleted.
* html/ImageBitmapOptions.h:
(WebCore::ImageBitmapOptions::resolvedImageOrientation const):
* html/ImageBitmapOptions.idl:
* platform/graphics/ImageOrientation.h:
(WebCore::ImageOrientation::withFlippedY const):

Modified Paths

trunk/LayoutTests/imported/w3c/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/html/ImageBitmap.cpp
trunk/Source/WebCore/html/ImageBitmapOptions.h
trunk/Source/WebCore/html/ImageBitmapOptions.idl
trunk/Source/WebCore/platform/graphics/ImageOrientation.h


Added Paths

trunk/LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/manual/imagebitmap/createImageBitmap-exif-orientation-expected.txt
trunk/LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/manual/imagebitmap/createImageBitmap-exif-orientation.html
trunk/LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/manual/imagebitmap/resources/
trunk/LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/manual/imagebitmap/resources/squares.jpg




Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (284435 => 284436)

--- trunk/LayoutTests/imported/w3c/ChangeLog	2021-10-19 04:07:22 UTC (rev 284435)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2021-10-19 06:32:24 UTC (rev 284436)
@@ -1,3 +1,15 @@
+2021-10-18  Cameron McCormack  
+
+Make createImageBitmap() take EXIF orientation into account correctly
+https://bugs.webkit.org/show_bug.cgi?id=231063
+
+
+Reviewed by Myles Maxfield and Said Abou-Hallawa.
+
+* web-platform-tests/html/canvas/element/manual/imagebitmap/createImageBitmap-exif-orientation-expected.txt: Added.
+* web-platform-tests/html/canvas/element/manual/imagebitmap/createImageBitmap-exif-orientation.html: Added.
+* web-platform-tests/html/canvas/element/manual/imagebitmap/resources/squares.jpg: Added.
+
 2021-10-18  Chris Dumez  
 
 Resync web-platform-tests/tools from upstream


Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/manual/imagebitmap/createImageBitmap-exif-orientation-expected.txt (0 => 284436)

--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/manual/imagebitmap/createImageBitmap-exif-orientation-expected.txt	(rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/manual/imagebitmap/createImageBitmap-exif-orientation-expected.txt	2021-10-19 06:32:24 UTC (rev 284436)
@@ -0,0 +1,6 @@
+
+PASS createImageBitmap with EXIF rotation, imageOrientation none, and no cropping
+PASS createImageBitmap with EXIF rotation, imageOrientation flipY, and no cropping
+PASS createImageBitmap with EXIF rotation, imageOrientation none, and cropping
+PASS createImageBitmap with EXIF rotation, imageOrientation flipY, and cropping
+


Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/manual/imagebitmap/createImageBitmap-exif-orientation.html (0 => 284436)

--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/manual/imagebitmap/createImageBitmap-exif-orientation.html	(rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/manual/imagebitmap/createImageBitmap-exif-orientation.html	2021-10-19 06:32:24 UTC (rev 284436)
@@ -0,0 +1,121 @@
+
+Test that createImageBitmap honors EXIF orientation
+canvas { outline: 1px solid black; margin-right: 1em; }
+
+