https://bugs.webkit.org/show_bug.cgi?id=228050
Reviewed by Sam Weinig.
LineBoxGeometry class provides the line's geometry. This is also in preparation for making LineBox a non-persistent type of structure.
* layout/formattingContexts/inline/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
* layout/formattingContexts/inline/InlineFormattingGeometry.cpp:
(WebCore::Layout::LineBoxBuilder::build):
(WebCore::Layout::LineBoxBuilder::constructAndAlignInlineLevelBoxes):
(WebCore::Layout::LineBoxBuilder::computeLineBoxHeightAndAlignInlineLevelBoxesVertically):
(WebCore::Layout::InlineFormattingGeometry::verticallyAdjustedLineForLineContent const):
(WebCore::Layout::InlineFormattingGeometry::lineBoxForLineContent const): Deleted.
* layout/formattingContexts/inline/InlineFormattingGeometry.h:
* layout/formattingContexts/inline/InlineLineBox.cpp:
(WebCore::Layout::LineBox::LineBox):
(WebCore::Layout::m_rootInlineBox): Deleted.
* layout/formattingContexts/inline/InlineLineBox.h:
(WebCore::Layout::LineBox::logicalRect const): Deleted.
(WebCore::Layout::LineBox::alignmentBaseline const): Deleted.
(WebCore::Layout::LineBox::setLogicalHeight): Deleted.
* layout/integration/LayoutIntegrationInlineContentBuilder.cpp:
(WebCore::LayoutIntegration::InlineContentBuilder::createDisplayNonRootInlineBoxes const):
Canonical link: https://commits.webkit.org/240752@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281335 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=229269
rdar://81349236
Reviewed by Jer Noble.
Make two minor adjustments after the changes in r281288:
1. Rename `keyPathsForValuesAffectingValueCanBeginTouchBarScrubbing` to just
`keyPathsForValuesAffectingCanBeginTouchBarScrubbing`, since the Objective-C property name is
`-canBeginTouchBarScrubbing` rather than `-valueCanBeginTouchBarScrubbing`.
2. After fixing (1), the implementation of this method is no longer dead code, so we'll to make sure that the
`NSSet` we create and return contains valid Objective-C objects (i.e. NSString instead of `const char*`) --
in particular, this affects `"contentDuration"`.
* platform/mac/WebPlaybackControlsManager.mm:
(+[WebPlaybackControlsManager keyPathsForValuesAffectingCanBeginTouchBarScrubbing]):
(+[WebPlaybackControlsManager keyPathsForValuesAffectingValueCanBeginTouchBarScrubbing]): Deleted.
Canonical link: https://commits.webkit.org/240751@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281334 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=229304
Reviewed by Tim Horton.
We can encode a OptionSet<WebCore::DataDetectorType> in IPC messages now, so do so for DetectDataInAllFrames().
Also use OptionSet<WebCore::DataDetectorType> in some cases where WebCore::DataDetectorType was being used
to hold a bit set.
* Shared/API/Cocoa/WKDataDetectorTypesInternal.h:
(fromWKDataDetectorTypes):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setupPageConfiguration:]):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::detectDataInAllFrames):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::detectDataInAllFrames):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
Canonical link: https://commits.webkit.org/240749@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281332 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=229110
<rdar://problem/81940621>
Reviewed by Tim Horton.
Source/WebCore:
If we get into the state with an immersive session and only one view,
we should treat that view as the full width. This situation should never
happen with a real headset, but can be found in testing scenarios.
Test: http/wpt/webxr/xrViewport_singleView_valid.https.html
* Modules/webxr/WebXRWebGLLayer.cpp:
(WebCore::WebXRWebGLLayer::computeViewports): Add test for only one
view and assume it is the left eye.
LayoutTests:
Add a test that provides an immersive session with only one view.
This required copying a few more things over from the WPT directory.
* http/wpt/webxr/resources/test-only-api.js: Added.
(loadScript):
* http/wpt/webxr/resources/webxr_test_constants_single_view.js: Added.
* http/wpt/webxr/resources/webxr_util.js: Added.
* http/wpt/webxr/xrViewport_singleView_valid.https-expected.txt: Added.
* http/wpt/webxr/xrViewport_singleView_valid.https.html: Added.
Canonical link: https://commits.webkit.org/240748@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281331 268f45cc-cd09-0410-ab3c-d52691b4dbfc
The date extracted from the FTP listing is compared with the local time
and displayed to the user. Clearly it should be in the local timezone
and not in UTC.
Fixes #17118.
https://bugs.webkit.org/show_bug.cgi?id=228813
Reviewed by Mark Lam.
This patch adds three operand sub32 to X64 masm so that we can use it in all masms.
We use add32 and sub32 in YarrJIT to remove unnecessary mov instructions in ARM64.
* assembler/MacroAssembler.h:
(JSC::MacroAssembler::sub32):
* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::sub32):
* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::sub32):
* assembler/testmasm.cpp:
(JSC::testSub32ArgImm):
* yarr/YarrJIT.cpp:
Canonical link: https://commits.webkit.org/240743@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281326 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=229293
Patch by Mikhail R. Gadelha <mikhail@igalia.com> on 2021-08-20
Reviewed by Keith Miller.
In SpeculativeJIT::compileGetByValOnString the format can be either DataFormatJS
or DataFormatCell so assert either value when compiling it in 32 bits.
It's the same assert already present in the DFG 64 bits counterpart
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
Canonical link: https://commits.webkit.org/240741@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281324 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=229301
Reviewed by Ryosuke Niwa.
Source/WebCore:
Test: http/tests/websocket/tests/hybi/inspector/send-and-recieve-debugger.html
`WebCore::WebSocket::didReceiveMessage` and other functions that fire JS events may be called while the
`WebSocketChannel` is being resumed, but it is not yet safe to evaluate JavaScript during resuming. This was
already accounted for with some events like errors and closing, but it holds true for all events. We should
delay firing these events as well.
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::didConnect):
(WebCore::WebSocket::didReceiveMessage):
(WebCore::WebSocket::didReceiveBinaryData):
LayoutTests:
* http/tests/websocket/tests/hybi/inspector/echo-delayed_wsh.py: Added.
(web_socket_do_extra_handshake):
(web_socket_transfer_data):
- Similar to `echo_wsh.py`, respond with the provided message when received, but delay the response by 100ms.
* http/tests/websocket/tests/hybi/inspector/send-and-recieve-debugger-expected.txt: Added.
* http/tests/websocket/tests/hybi/inspector/send-and-recieve-debugger.html: Added.
Canonical link: https://commits.webkit.org/240740@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281323 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=229319
Reviewed by Aakash Jain.
Add a unit test listing all the expected build steps for each queue
like the one added in r281286 for build.webkit.org
Also remove the previous unit tests to not duplicate test functionality.
And replace doble-quotes with single-ones on the test for build.webkit.org
* CISupport/build-webkit-org/factories_unittest.py:
(TestExpectedBuildSteps):
(TestExpectedBuildSteps.test_all_expected_steps):
(TestExpectedBuildSteps.test_unnecessary_expected_steps):
* CISupport/ews-build/factories_unittest.py:
(TestExpectedBuildSteps):
(TestExpectedBuildSteps.setUp):
(TestExpectedBuildSteps.test_all_expected_steps):
(TestExpectedBuildSteps.test_unnecessary_expected_steps):
Canonical link: https://commits.webkit.org/240739@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281322 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=229332
rdar://82163923
Reviewed by Keith Miller.
1. Enhance "include" offlineasm Instruction to always attempt to include an asm
file from <build-products>/usr/local/include/WebKitAdditions/ first. If the
specified file is not available there, then it will attempt to include the file
from the same directory as the current source file (which in practice, means
Source/JavaScriptCore/llint/).
2. Enhance "include" offlineasm Instruction to allow an optional file to be
included if it exists. For example, the following offlineasm code:
include? LowLevelInterpreterAdditions
... will attempt to include a file LowLevelInterpreterAdditions.asm. If the
file does not exist, this will be a no-op. Note: the "?" after the "include"
means the include is optional.
3. Enhanced "emit" offlineasm Instruction to be able to take more than one operand.
"emit" used to just copy the string operand that follows into the generated
LLIntAssembly.h. Now, "emit" can take multiple comma separated operands, and
will concatenate all the operands.
Additionally, "emit" can now take a LocalLabelReference as an operand. For
example, this offline asm code:
emit "b ", .done
...
.done:
... will generate this inline asm code in LLIntAssembly.h:
"b " LOCAL_LABEL_STRING(_offlineasm_someLabel_done) "\n"
This makes it easier to emit branches to local labels.
4. Also fixed LLInt code alignment for ARM_THUMB2 and ARM64.
Previously, it was aligned using ".align 4" which means aligned on a 4
instruction boundary. Note: the interpretation of .align varies for different
target CPU architectures.
Now, we do the alignment using ".balign 4" which means align on a 4 byte
boundary. This is the intended alignment because ARM64 instruction size is
4 bytes, and ARM_THUMB2 instruction size is either 2 bytes or 4 bytes.
Using .align before was potentially wasting some code space.
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter.cpp:
* offlineasm/ast.rb:
* offlineasm/parser.rb:
Canonical link: https://commits.webkit.org/240738@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281321 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=229329
rdar://82162851
Reviewed by Yusuke Suzuki.
These assertion utility functions rely on tagged pointers always having non-zero
PAC bits. This is an incorrect assumption. A tagged pointer can have PAC bits
that are completely zero. Hence, these assert functions cannot be made to work
reliably. We should remove them to prevent them from being used, and potentially
resulting in flaky assertion failures that will be hard to debug later.
Note: assertIsNotTagged is fine to keep. It asserts that PAC bits of a pointer
are all 0. As a result, this assertion can have false positives where it may think
a tagged pointer is an untagged pointer. However, this is rare because it is not
common to have 0 PAC bits in tagged pointers. False positives on this assertion
won't result in flaky test failures that will waste our time later. Hence,
keeping the assertion will do more good (it will tend to help us find bugs) than
bad (it will rarely let false positives thru). As a result, I'm opting to not
remove it.
* wtf/PtrTag.h:
(WTF::assertIsTagged): Deleted.
(WTF::assertIsNullOrTagged): Deleted.
Canonical link: https://commits.webkit.org/240734@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281317 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=229322
Reviewed by Alan Bujtas.
Source/WebCore:
We can now paint all underlines.
* layout/integration/LayoutIntegrationCoverage.cpp:
(WebCore::LayoutIntegration::printReason):
(WebCore::LayoutIntegration::canUseForStyle):
* layout/integration/LayoutIntegrationCoverage.h:
* layout/integration/LayoutIntegrationInlineContent.cpp:
(WebCore::LayoutIntegration::InlineContent::iteratorForRun const):
(WebCore::LayoutIntegration::InlineContent::iteratorForTextRun const):
* layout/integration/LayoutIntegrationInlineContent.h:
* layout/integration/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::paint):
LayoutTests:
Remove a test that just checks we are forcing legacy for underline-position:under.
* fast/text/simple-line-layout-with-text-underline-position-expected.html: Removed.
* fast/text/simple-line-layout-with-text-underline-position.html: Removed.
Canonical link: https://commits.webkit.org/240731@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281311 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=110952
Reviewed by Antti Koivisto.
Currently covers:
- Blocking focus & selecting
- aria-hidden like behaviour
Hit testing/event retargeting will be covered by https://bugs.webkit.org/show_bug.cgi?id=229330 pending a spec issue
Relevant WPT enabled. More testing coverage will be provided with the inert attribute.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/interactive-elements/the-dialog-element/inert-node-is-unfocusable-expected.txt:
* web-platform-tests/html/semantics/interactive-elements/the-dialog-element/remove-dialog-should-unblock-document-expected.txt:
Source/WebCore:
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isAXHidden const):
* dom/Element.cpp:
(WebCore::Element::isFocusable const):
* dom/Node.cpp:
(WebCore::Node::canStartSelection const):
(WebCore::Node::isInert const):
* dom/Node.h:
Canonical link: https://commits.webkit.org/240729@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281309 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=228794
Reviewed by Simon Fraser.
Let's bail out on -webkit-line-clamp instead of the presence of a deprecated flex box. While line clamping requires legacy line layout, regular flex item content is fine with either line layout codepaths.
* layout/integration/LayoutIntegrationCoverage.cpp:
(WebCore::LayoutIntegration::printReason):
(WebCore::LayoutIntegration::canUseForLineLayoutWithReason):
* layout/integration/LayoutIntegrationCoverage.h:
Canonical link: https://commits.webkit.org/240728@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281308 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=228805
Reviewed by Antti Koivisto.
Treat non-breaking space as regular space.
TextUtil::findNextBreakablePosition already covers the "find the soft wrapping opportunity" part.
e.g.
<div style="-webkit-nbsp-mode: space">1 2</div>
produces 3 InlineTextItem objects as follows
[1][whitespace][2]
as opposed to just 1 [1non-breakable-space2]
* layout/formattingContexts/inline/InlineTextItem.cpp:
(WebCore::Layout::moveToNextNonWhitespacePosition):
(WebCore::Layout::InlineTextItem::createAndAppendTextItems):
* layout/integration/LayoutIntegrationCoverage.cpp:
(WebCore::LayoutIntegration::canUseForStyle):
Canonical link: https://commits.webkit.org/240726@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281306 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=228941
Reviewed by Youenn Fablet.
Source/WebCore:
The GStreamer mock display capture source is now wrapped in another RealtimeMediaSource in
order to avoid a spurious setSize() call from the RealtimeVideoSource constructor that would
then prevent the mock source to ensure its size matches the intrinsic size.
For the non-mock display capture source, we now ensure the size matches the intrinsic size
whenever the capture settings have changed.
* platform/mediastream/RealtimeVideoCaptureSource.h:
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
(WebCore::GStreamerVideoCaptureSource::settingsDidChange):
* platform/mediastream/gstreamer/MockRealtimeVideoSourceGStreamer.cpp:
(WebCore::MockDisplayCaptureSourceGStreamer::create):
(WebCore::MockDisplayCaptureSourceGStreamer::capabilities):
(WebCore::MockDisplayCaptureSourceGStreamer::settings):
* platform/mediastream/gstreamer/MockRealtimeVideoSourceGStreamer.h:
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::generateFrame):
LayoutTests:
* platform/glib/TestExpectations: Unflag tests now passing.
Canonical link: https://commits.webkit.org/240725@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281305 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=229064
Reviewed by Alan Bujtas.
This is split out from https://bugs.webkit.org/show_bug.cgi?id=215643.
Before shaping, the glyphs in the GlyphBuffer need to match one-to-one with code units in the string.
We iterate over the string, adding glyphs into the GlyphBuffer, but there was one early "continue"
in the loop that skips the add() call.
Because this patch adds ASSERT()s, this is actually covered by existing tests.
* platform/graphics/WidthIterator.cpp:
(WebCore::WidthIterator::commitCurrentFontRange):
(WebCore::addToGlyphBuffer):
(WebCore::WidthIterator::advanceInternal):
* platform/graphics/WidthIterator.h:
Canonical link: https://commits.webkit.org/240724@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281300 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=229287
Reviewed by Eric Carlson.
LayoutTests/imported/w3c:
* web-platform-tests/webrtc/RTCPeerConnection-canTrickleIceCandidates-expected.txt:
* web-platform-tests/webrtc/RTCPeerConnection-constructor-expected.txt:
* web-platform-tests/webrtc/idlharness.https.window-expected.txt:
Source/WebCore:
Add support for https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-cantrickleicecandidates.
Return null in case connection is closed or setRemoteDescription was never called successfully.
Add binding code to get the value from webrtc backend.
Covered by rebased tests.
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::canTrickleIceCandidates const):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::canTrickleIceCandidates const):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::canTrickleIceCandidates const):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
LayoutTests:
* webrtc/rtcpeerconnection-error-messages-expected.txt:
Canonical link: https://commits.webkit.org/240722@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281298 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=229188
Reviewed by Jonathan Bedard.
Some logging beneath WebKit is making WebRTC tests flaky.
While we work on the cause of this bug, we can still beef-up our test output clean up steps to handle this logging.
Instead of stripping lines based on a known pattern, which does not always work as per current results,
we can simply remove all logging before the 'Content-Type:text/plain\n' string that WebKitTestRunner is adding before
printing the text generated by the test itself.
We update webkitpy scripts accordingly and add this new clean-up for:
- tests that have webrtc in their name
- tests whose output contain some known logging strings like 'LRP' or 'Negotiation String'.
This should hopefully be more robust while not hiding real regressions.
* Scripts/webkitpy/layout_tests/controllers/single_test_runner.py:
(SingleTestRunner):
* Scripts/webkitpy/port/base.py:
(Port.logging_detectors_to_strip_text_start):
* Scripts/webkitpy/port/driver.py:
(DriverOutput.strip_text_start_if_needed):
* Scripts/webkitpy/port/mac.py:
(MacPort.logging_patterns_to_strip):
(MacPort.logging_detectors_to_strip_text_start):
Canonical link: https://commits.webkit.org/240721@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281297 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=228894
Reviewed by Simon Fraser.
LayoutTests/imported/w3c:
* web-platform-tests/css/selectors/has-basic-expected.txt:
* web-platform-tests/css/selectors/has-relative-argument-expected.txt:
* web-platform-tests/css/selectors/parsing/parse-has-expected.txt:
* web-platform-tests/dom/nodes/Element-closest-expected.txt:
Source/WebCore:
This patch adds basic support for :has() pseudo-class, https://drafts.csswg.org/selectors/#has-pseudo.
The initial implementation is very inefficient. There is no support for invalidation yet.
The feature is disabled by default.
* css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText const):
Serialization.
* css/CSSSelector.h:
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne const):
Selector matching using nested SelectorChecker.
* css/SelectorPseudoClassAndCompatibilityElementMap.in:
* css/parser/CSSParserContext.cpp:
(WebCore::operator==):
(WebCore::add):
* css/parser/CSSParserContext.h:
* css/parser/CSSParserSelector.h:
(WebCore::CSSParserSelector::setPseudoClassType):
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumeForgivingSelectorList):
Add a template version of the forgiving parsing function.
(WebCore::CSSSelectorParser::consumeForgivingComplexSelectorList):
Use it for complex selector lists.
(WebCore::CSSSelectorParser::consumeForgivingRelativeSelectorList):
And the new relative selector lists.
(WebCore::CSSSelectorParser::consumeRelativeSelector):
Parse relative selectors like "> foo".
(WebCore::CSSSelectorParser::consumePseudo):
(WebCore::CSSSelectorParser::consumeComplexForgivingSelectorList): Deleted.
* css/parser/CSSSelectorParser.h:
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::addPseudoClassType):
No compiler support yet.
Source/WTF:
* Scripts/Preferences/WebPreferencesExperimental.yaml:
Add off-by-default HasPseudoClassEnabled preference value.
Canonical link: https://commits.webkit.org/240719@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281295 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=227979
Reviewed by Alan Bujtas.
This is the next step to delete the complex text codepath from Cocoa ports.
The initial advance contributes to the layout width of text. Its purpose is to move
all the visually successive glyphs to the right. For the leftmost run, WidthIterator
saves this initial advance to the GlyphBuffer, because knowing it is necessary to
compute the paint location of glyphs (inside GlyphBuffer::flatten()). For all other
runs other than the leftmost run, those runs' initial advance is added to the advance
width of whichever glyph ends up being just to the left of the run. In LTR, this is
the last glyph of the last (logical) run, whereas in RTL this is the first glyph of
the next (logical) run.
Because this is just adding infrastructure, it doesn't add any tests yet. This will be
tested when we delete the complex text codepath.
* platform/graphics/ComplexTextController.h: Because we're going to stop using
ComplexTextController, we should move this (presumably helpful) comment somewhere
where it will be accessible to the Cocoa ports. This would be GlyphBuffer::flatten().
* platform/graphics/Font.cpp:
(WebCore::Font::applyTransforms const): Return the initial advance.
* platform/graphics/Font.h: Ditto.
* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::widthOfTextRange const):
(WebCore::FontCascade::widthForSimpleText const): Make sure that the initial advance
contributes to layout width.
(WebCore::FontCascade::layoutSimpleText const): The initial advance is actually NOT
supposed to point directly to the first glyph's paint position. See
https://bugs.webkit.org/show_bug.cgi?id=228180.
(WebCore::FontCascade::drawEmphasisMarks const):
* platform/graphics/GlyphBuffer.h:
(WebCore::GlyphBuffer::flatten):
(WebCore::GlyphBuffer::isFlattened const):
* platform/graphics/WidthIterator.cpp:
(WebCore::WidthIterator::applyFontTransforms): Return the initial advance.
(WebCore::expandWithInitialAdvance):
(WebCore::WidthIterator::applyInitialAdvance): This implements the logic above, where
the initial advance of non-leftmost runs get added to the visually previous glyph's
advance. For LTR, we can just add it directly to the previously-recorded glyph advance.
However, for RTL, we have to save the initial advance to a variable, which is named
m_leftoverInitialAdvance, and apply it when we encounter the next run. This is because
WidthIterator encounters run in logical order.
(WebCore::WidthIterator::commitCurrentFontRange):
(WebCore::WidthIterator::finalize): For RTL, if the last run has an initial advance,
we need to save it to the GlyphBuffer's initial advance field. We know if the last run
has an initial advance because there will still be data in m_leftoverInitialAdvance
left over.
* platform/graphics/WidthIterator.h:
* platform/graphics/coretext/FontCoreText.cpp:
(WebCore::Font::applyTransforms const): Return the initial advance.
Canonical link: https://commits.webkit.org/240718@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281294 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=228177
Reviewed by Sam Weinig.
Source/WebCore:
Dot-prefixed fonts are intentionally unsupported. We should stop supporting them.
If authors want to access the various system fonts, they can use system-ui,
ui-serif, ui-monospace, or ui-rounded.
Test: fast/text/font-lookup-dot-prefix-case-sensitive.html
* platform/cocoa/VersionChecks.h:
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::isDotPrefixedForbiddenFont):
(WebCore::platformFontLookupWithFamily):
LayoutTests:
* fast/text/font-lookup-dot-prefix-case-sensitive-expected.html: Renamed from LayoutTests/fast/text/font-lookup-dot-prefix-case-sensitive-expected-mismatch.html.
* platform/ios/TestExpectations:
* platform/mac/TestExpectations:
Canonical link: https://commits.webkit.org/240717@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281293 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=228176
Reviewed by Sam Weinig.
Source/WebCore:
Modern versions of macOS and iOS can treat the system font as a variable font,
and be able to apply weights like "342" instead of just "300" or "400".
Tests: fast/text/variable-system-font-2.html
fast/text/variable-system-font.html
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::preparePlatformFont):
Source/WTF:
* wtf/PlatformUse.h:
LayoutTests:
Update tests.
* fast/text/resources/Ahem-trak.ttf: Added. This is a font which has a trak table.
* fast/text/trak-optimizeLegibility-expected-mismatch.html: Added.
* fast/text/trak-optimizeLegibility-expected.txt: Removed.
* fast/text/trak-optimizeLegibility.html:
* fast/text/variable-system-font-2-expected-mismatch.html: Added.
* fast/text/variable-system-font-2.html: Added.
* fast/text/variable-system-font-expected-mismatch.html: Added.
* fast/text/variable-system-font.html: Added.
* svg/dom/altGlyph-dom-expected.txt:
* svg/dom/resources/altGlyph-dom.js:
Canonical link: https://commits.webkit.org/240715@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=229100
<rdar://problem/82145920>
Reviewed by Myles C. Maxfield.
Update code guarded by `USE(APPLE_INTERNAL_SDK)`, such that it works with a `Vector<SandboxExtension::Handle>`.
Preserve the existing behavior of appending `handles` and `ids` in reverse order, but leave a FIXME questioning
the need for this.
* UIProcess/UserMediaProcessManager.cpp:
(WebKit::UserMediaProcessManager::willCreateMediaStream):
Canonical link: https://commits.webkit.org/240713@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281289 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=229269
rdar://81349236
Reviewed by Jer Noble.
AVKit uses canSeek to determine when to show the time scrubber
in the touch bar. This was a synthesized method determined on weither the video
is seekable and has a seekable range set.
Should the value of either boolean change which would impact the final value of
[AVTouchBarPlaybackControlsControlling canSeek] , no observers would be called.
Add the appropriate obj-c methods to explicitly set a dependency between properties
willChange/didChange.
Been unable to reproduce the problem programatically, the issue is highly timing
dependent.
An API test will be added with https://bugs.webkit.org/show_bug.cgi?id=229286.
* platform/mac/WebPlaybackControlsManager.mm:
(+[WebPlaybackControlsManager keyPathsForValuesAffectingCanSeek]):
(+[WebPlaybackControlsManager keyPathsForValuesAffectingContentDuration]):
(-[WebPlaybackControlsManager setSeekableTimeRanges:]):
(+[WebPlaybackControlsManager keyPathsForValuesAffectingValueCanBeginTouchBarScrubbing]):
Canonical link: https://commits.webkit.org/240712@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281288 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=229311
Reviewed by Aakash Jain.
Port the test that checked every worker and the expected steps to the new buildbot version.
Also delete the file steps_unittest_old.py because the gross of the other tests contained in
this old file are already ported in the current steps_unittests.py
* CISupport/build-webkit-org/factories_unittest.py: Added.
(TestExpectedBuildSteps):
(TestExpectedBuildSteps.setUp):
(TestExpectedBuildSteps.test_all_expected_results):
(TestExpectedBuildSteps.test_unnecessary_expected_results):
* CISupport/build-webkit-org/steps_unittest_old.py: Removed.
Canonical link: https://commits.webkit.org/240711@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281286 268f45cc-cd09-0410-ab3c-d52691b4dbfc