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

Timeline



Dec 31, 2021:

10:03 PM Changeset in webkit [287498] by Tyler Wilcock
  • 3 edits in trunk/Source/WebCore

Reduce repetition in Internals "set page activity state" methods
https://bugs.webkit.org/show_bug.cgi?id=234768

Reviewed by Darin Adler.

setPageVisibility, setPageIsFocusedAndActive, and
setPageIsInWindow all modify page activity state, and repeat a lot
of the same logic to do so. This patch refactors this into a common
updatePageActivityState method.

  • testing/Internals.cpp:

(WebCore::Internals::setPageVisibility):
(WebCore::Internals::setPageIsFocusedAndActive):
(WebCore::Internals::setPageIsInWindow):
Refactor to use the new updatePageActivityState method.
(WebCore::Internals::updatePageActivityState):
Added.

  • testing/Internals.h:
4:22 PM Changeset in webkit [287497] by Wenson Hsieh
  • 4 edits in trunk

Include a few more tag names to search when running modal container detection
https://bugs.webkit.org/show_bug.cgi?id=234652

Reviewed by Darin Adler.

Source/WebCore:

Broaden the list of tag names that we heuristically scan for the search term. This particular modal container
detection failure was due to the search term appearing inside a b element, though I'm adding a few additional
types just to be safe. Since we're checking more than just few tag names, we also take this opportunity to
convert this into a compact AtomString hashtable of tag names that we should scan in the process of detecting
modal containers.

Test: ModalContainerObservation.DetectSearchTermInBoldTag

  • page/ModalContainerObserver.cpp:

(WebCore::matchesSearchTerm):

Tools:

Add an API test that's representative of the website where modal container observation failed (due to the search
term being inside a b element).

  • TestWebKitAPI/Tests/WebKitCocoa/ModalContainerObservation.mm:

(TestWebKitAPI::TEST):

3:33 PM Changeset in webkit [287496] by Wenson Hsieh
  • 20 edits
    1 move in trunk/Source

Refactor some Cocoa-specific code in WebCore::FontAttributes to be platform-agnostic
https://bugs.webkit.org/show_bug.cgi?id=234757

Source/WebCore:

Reviewed by Darin Adler.

Replace the UIFont/NSFont currently in WebCore::FontAttributes with a WebCore::Font instead. This removes a bit
of platform-specific logic in an otherwise platform-agnostic class (with the exception of a couple Cocoa-
specific helper methods). This additionally lets us remove some platform-specific logic for computing font
attributes (i.e. platformFontAttributesAtSelectionStart) below.

  • WebCore.xcodeproj/project.pbxproj:
  • editing/Editor.cpp:

(WebCore::Editor::fontAttributesAtSelectionStart):
(WebCore::Editor::platformFontAttributesAtSelectionStart const): Deleted.

  • editing/Editor.h:
  • editing/FontAttributes.h:

(WebCore::TextList::encode const):
(WebCore::TextList::decode):

Drive-by fix: instead of static_cast-ing to a uint8_t and encoding/decoding the raw value, encode and decode
the ListStyleType as a normal enum instead. This also ensures that we validate the enum value upon decoding.

(WebCore::FontAttributes::encodingRequiresPlatformData const): Deleted.

  • editing/cocoa/EditorCocoa.mm:

(WebCore::Editor::platformFontAttributesAtSelectionStart const): Deleted.

  • editing/cocoa/FontAttributesCocoa.mm:

(WebCore::FontAttributes::createDictionary const):

Only grab the NSFont or UIFont from the WebCore::Font object once we're in this Cocoa-specific helper.

  • platform/graphics/cocoa/FontCocoa.h: Added.

Moved here from CocoaFont.h in WebKit. See WebKit/ChangeLog for more details.

  • rendering/style/RenderStyleConstants.h:

Add EnumTraits for ListStyleType, so that it can be encoded/decoded.

Source/WebKit:

See comments below (as well as WebCore/ChangeLog) for more details.

Reviewed by Darin Adler.

  • Platform/cocoa/CocoaFont.h: Removed.

Move this file into WebCore, as FontCocoa.h.

  • Shared/Cocoa/ArgumentCodersCocoa.mm:
  • Shared/Cocoa/CoreTextHelpers.h:
  • Shared/Cocoa/CoreTextHelpers.mm:

Adjust a few places that currently import CocoaFont.h to import WebCore/FontCocoa.h instead. Additonally, change
CocoaFont to WebCore::CocoaFont where necessary.

  • Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:

(IPC::ArgumentCoder<WebCore::FontAttributes>::encodePlatformData): Deleted.
(IPC::ArgumentCoder<WebCore::FontAttributes>::decodePlatformData): Deleted.

Remove platform-specific FontAttributes encoding/decoding logic. This is no longer needed, since we just
propagate a Font instead of an NSFont or UIFont.

  • Shared/WebCoreArgumentCoders.cpp:

(IPC::ArgumentCoder<RefPtr<Font>>::encode):
(IPC::ArgumentCoder<RefPtr<Font>>::decode):

Add argument coders for RefPtr<Font> that encode the font only if it's non-null.

(IPC::ArgumentCoder<FontAttributes>::encode):
(IPC::ArgumentCoder<FontAttributes>::decode):

Remove the calls to encodePlatformData/decodePlatformData, and instead encode the RefPtr<WebCore::Font>.

  • Shared/WebCoreArgumentCoders.h:
  • Shared/playstation/WebCoreArgumentCodersPlayStation.cpp:

(IPC::ArgumentCoder<FontAttributes>::encodePlatformData): Deleted.
(IPC::ArgumentCoder<FontAttributes>::decodePlatformData): Deleted.

  • Shared/soup/WebCoreArgumentCodersSoup.cpp:

(IPC::ArgumentCoder<FontAttributes>::encodePlatformData): Deleted.
(IPC::ArgumentCoder<FontAttributes>::decodePlatformData): Deleted.

  • Shared/win/WebCoreArgumentCodersWin.cpp:

(IPC::ArgumentCoder<FontAttributes>::encodePlatformData): Deleted.
(IPC::ArgumentCoder<FontAttributes>::decodePlatformData): Deleted.

Remove some method stubs that are now unnecessary.

  • UIProcess/Cocoa/WKSafeBrowsingWarning.mm:

(fontOfSize):

  • WebKit.xcodeproj/project.pbxproj:
12:08 PM Changeset in webkit [287495] by Alan Bujtas
  • 3 edits
    2 adds in trunk

REGRESSION (r287028): Incorrect root inline box horizontal position when text-align offset is present
https://bugs.webkit.org/show_bug.cgi?id=234767

Reviewed by Antti Koivisto.

Source/WebCore:

Display line has the content's visual left (rtl vs ltr) which should be used to position the root inline box.
We use the same offset when construcing the non-root display boxes.

Test: fast/text/root-inline-box-offset-with-text-align.html

  • layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp:

(WebCore::Layout::InlineDisplayContentBuilder::build):

LayoutTests:

  • fast/text/root-inline-box-offset-with-text-align-expected.html: Added.
  • fast/text/root-inline-box-offset-with-text-align.html: Added.
11:46 AM Changeset in webkit [287494] by Wenson Hsieh
  • 6 edits in trunk

Updating the file name of attachment-backed images should automatically set the alt attribute
https://bugs.webkit.org/show_bug.cgi?id=234747
rdar://85899879

Reviewed by Darin Adler.

Source/WebCore:

Make a small adjustment when updating attachment attributes for attachment-backed images (i.e. when using
-[_WKAttachmentInfo setFileWrapper:contentType:completion:]), such that the alt attribute of the image is
set to the attachment element's title. While convenient for all internal clients of the _WKAttachment SPI
(i.e. Mail, Notes), this has the added benefit of preserving the attachment's file name when copying and pasting
across different web views (where a new API::Attachment is generated on paste), instead of defaulting to the
last path component of the blob URL corresponding to the image data in the web archive.

Test: WKAttachmentTests.CopyAndPasteImageBetweenWebViews

  • editing/Editor.cpp:

(WebCore::Editor::notifyClientOfAttachmentUpdates):

  • html/HTMLAttachmentElement.cpp:

(WebCore::HTMLAttachmentElement::enclosingImageElement const):
(WebCore::HTMLAttachmentElement::updateAttributes):
(WebCore::HTMLAttachmentElement::updateEnclosingImageWithData):
(WebCore::HTMLAttachmentElement::hasEnclosingImage const): Deleted.

Replace hasEnclosingImage() with enclosingImageElement(), a helper that returns the enclosing image element
(or null if there is none). We use the latter in a couple of places above, where we modify some attributes on
the enclosing image in response to attribute and data updates.

  • html/HTMLAttachmentElement.h:

Tools:

Add a new API test to exercise this scenario -- i.e. copying an attachment-backed image in one web view, pasting
it into another web view, and confirming that the pasted attachment preserves the _WKAttachment file name.

  • TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:

(-[TestWKWebView ensureAttachmentForImageElement]):
(TestWebKitAPI::TEST):

6:21 AM Changeset in webkit [287493] by Alan Bujtas
  • 9 edits in trunk/Source/WebCore

[LFC][IFC] Take grapheme clusters into account when keeping the first "character" on the line
https://bugs.webkit.org/show_bug.cgi?id=234758

Reviewed by Antti Koivisto.

When dealing with complex fonts, we have to start looking beyond code points and taking
larger cluster of code units into account.

This patch is in preparation for enabling complex font codepath.

  • layout/formattingContexts/inline/InlineContentBreaker.cpp:

(WebCore::Layout::InlineContentBreaker::processOverflowingContent const):

  • layout/formattingContexts/inline/text/TextUtil.cpp:

(WebCore::Layout::TextUtil::firstUserPerceivedCharacterLength): user-perceived character is a unicode term.
see https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries

  • layout/formattingContexts/inline/text/TextUtil.h:
  • layout/integration/LayoutIntegrationBoxTree.cpp:

(WebCore::LayoutIntegration::BoxTree::buildTree):

  • layout/layouttree/LayoutInlineTextBox.cpp:

(WebCore::Layout::InlineTextBox::InlineTextBox):
(WebCore::Layout::m_canUseSimpleFontCodePath):
(WebCore::Layout::m_canUseSimplifiedContentMeasuring): Deleted.

  • layout/layouttree/LayoutInlineTextBox.h:

(WebCore::Layout::InlineTextBox::canUseSimpleFontCodePath const):

  • layout/layouttree/LayoutTreeBuilder.cpp:

(WebCore::Layout::TreeBuilder::createTextBox):
(WebCore::Layout::TreeBuilder::createLayoutBox):

  • layout/layouttree/LayoutTreeBuilder.h:
2:11 AM Changeset in webkit [287492] by Diego Pino Garcia
  • 4 edits in trunk/LayoutTests

[GTK][WPE] Unreviewed test gardening, move several fast/scrolling tests failures to GLIB
https://bugs.webkit.org/show_bug.cgi?id=234759

  • platform/glib/TestExpectations:
  • platform/gtk/TestExpectations:
  • platform/wpe/TestExpectations:
1:13 AM Changeset in webkit [287491] by ntim@apple.com
  • 2 edits in trunk/Source/WebInspectorUI

Web Inspector: fix assert text in Gradient.js

Unreviewed.

Wrong assert text was added in r287409, it should be radial instead of conic gradients.

  • UserInterface/Models/Gradient.js:

(WI.RadialGradient.prototype.set angleValue):
(WI.RadialGradient.prototype.set angleUnits):

Dec 30, 2021:

8:46 PM Changeset in webkit [287490] by Diego Pino Garcia
  • 3 edits
    4 deletes in trunk/LayoutTests

[GLIB] Unreviewed test gardening, update state of flakey tests
https://bugs.webkit.org/show_bug.cgi?id=234749

Remove tests that have been constantly passing for the last 4000 revisions, as well as update state of tests
that have been constantly failing with a single state.

  • platform/glib/TestExpectations:
  • platform/glib/imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/successes_RSA-OAEP.https.any.worker-expected.txt: Removed.
  • platform/glib/imported/w3c/web-platform-tests/WebCryptoAPI/wrapKey_unwrapKey/wrapKey_unwrapKey.https.any-expected.txt: Removed.
  • platform/glib/imported/w3c/web-platform-tests/WebCryptoAPI/wrapKey_unwrapKey/wrapKey_unwrapKey.https.worker-expected.txt: Removed.
  • platform/glib/media/context-menu-actions-expected.txt: Removed.
  • platform/gtk/TestExpectations:
7:20 PM Changeset in webkit [287489] by Jean-Yves Avenard
  • 4 edits in trunk

SharedBuffer::takeData() is still dangerous
https://bugs.webkit.org/show_bug.cgi?id=234724
rdar://problem/86957233

Reviewed by Darin Adler.

Source/WebCore:

Similar to bug 228161; however we only take the content of the DataSegment
if its refcount is 1.
DataSegments can be shared across multiple SharedBuffer and so we can't
assume that when the SharedBuffer refcount is 1 that it is safe to use
the DataSegment.
This use of SharedBuffer::extractData will need to be revisited when
SharedBuffer are used across different threads as the operation isn't
thread-safe.

API tests added.

  • platform/SharedBuffer.cpp:

(WebCore::FragmentedSharedBuffer::takeData):

Tools:

  • TestWebKitAPI/Tests/WebCore/SharedBuffer.cpp:

(TestWebKitAPI::TEST_F):

5:32 PM Changeset in webkit [287488] by ntim@apple.com
  • 4 edits in trunk

REGRESSION(r286955): Fix painting text-decorations with combined text
https://bugs.webkit.org/show_bug.cgi?id=234707

Reviewed by Dean Jackson.

Source/WebCore:

Test: imported/w3c/web-platform-tests/css/css-writing-modes/text-combine-upright-decorations-001.html

  • rendering/TextBoxPainter.cpp:

(WebCore::TextBoxPainter::createDecorationPainter):
(WebCore::TextBoxPainter::paintBackgroundDecorations):
(WebCore::TextBoxPainter::paintForegroundDecorations):

LayoutTests:

4:26 PM Changeset in webkit [287487] by ntim@apple.com
  • 39 edits in trunk

Implement text-combine-upright property
https://bugs.webkit.org/show_bug.cgi?id=150821

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

  • web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
  • web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-expected.txt:
  • web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt:
  • web-platform-tests/css/css-writing-modes/inheritance-expected.txt:
  • web-platform-tests/css/css-writing-modes/parsing/text-combine-upright-computed-expected.txt:
  • web-platform-tests/css/css-writing-modes/parsing/text-combine-upright-valid-expected.txt:
  • web-platform-tests/css/css-writing-modes/text-combine-upright-parsing-digits-001-expected.txt:
  • web-platform-tests/css/css-writing-modes/text-combine-upright-parsing-digits-002-expected.txt:
  • web-platform-tests/css/css-writing-modes/text-combine-upright-parsing-invalid-001-expected.txt:
  • web-platform-tests/css/css-writing-modes/text-combine-upright-parsing-invalid-002-expected.txt:
  • web-platform-tests/css/css-writing-modes/text-combine-upright-parsing-valid-001-expected.txt:
  • web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:

Source/WebCore:

webkit.org/b/234694 and webkit.org/b/234707 are landed for this initial version of text-combine-upright.

To reach Chrome parity, layout needs to be tweaked (webkit.org/b/234704), and pseudo elements need to be properly supported (webkit.org/b/234705).

To reach standards parity, it also needs the digits syntax to be implemented (webkit.org/b/234706), which no browser implements yet.

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):

  • css/CSSPrimitiveValueMappings.h:

(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator TextCombine const):

  • css/CSSProperties.json:
  • css/CSSValueKeywords.in:
  • css/parser/CSSParserFastPaths.cpp:

(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):

  • rendering/LegacyLineLayout.cpp:

(WebCore::expansionBehaviorForInlineTextBox):

  • rendering/style/RenderStyleConstants.cpp:

(WebCore::operator<<):

  • rendering/style/RenderStyleConstants.h:
  • style/PropertyAllowlist.cpp:

(WebCore::Style::isValidMarkerStyleProperty):
Allow setting text-combine-upright on ::marker.

LayoutTests:

  • TestExpectations:
  • fast/css/getComputedStyle/computed-style-expected.txt:
  • fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
  • fast/css/getComputedStyle/resources/property-names.js:
  • platform/glib/fast/css/getComputedStyle/computed-style-expected.txt:
  • platform/glib/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
  • platform/glib/svg/css/getComputedStyle-basic-expected.txt:
  • platform/gtk/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:
  • platform/ios/fast/css/getComputedStyle/computed-style-expected.txt:
  • platform/ios/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
  • platform/ios/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
  • platform/ios/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:
  • platform/ios/svg/css/getComputedStyle-basic-expected.txt:
  • platform/wpe/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:
  • svg/css/getComputedStyle-basic-expected.txt:
2:33 PM Changeset in webkit [287486] by Adrian Perez de Castro
  • 12 edits in trunk/Source

Non-unified build fixes, end-of-year 2021 edition
https://bugs.webkit.org/show_bug.cgi?id=234755

Unreviewed non-unified build fixes.

Source/JavaScriptCore:

  • runtime/DeferredWorkTimer.h: Add missing JSCast.h header.

Source/WebCore:

No new tests needed.

  • bindings/js/JSExecState.cpp:

(WebCore::executionContext): Add missing namespace prefix in usage of JSC::jsCast() function.

  • bindings/js/SerializedScriptValue.cpp: Add missing JSExecState.h header.
  • inspector/InspectorFrontendHost.cpp: Add missing ScriptController.h header.
  • inspector/WebInjectedScriptManager.cpp: Add missing DOMWindow.h and JSExecState.h headers.
  • inspector/agents/InspectorTimelineAgent.cpp: Add missing JSExecState.h header.
  • inspector/agents/WebConsoleAgent.cpp: Add missing InspectorWebAgentBase.h and

JSExecState.h headers.

  • inspector/agents/WebConsoleAgent.h: Add missing forward declaration of struct

WebAgentContext.

  • layout/formattingContexts/inline/display/InlineDisplayLineBuilder.cpp: Add missing

LayoutBoxGeometry.h header.

  • loader/CrossOriginAccessControl.cpp: Add missing DocumentLoader.h header.
12:32 PM Changeset in webkit [287485] by Alan Bujtas
  • 35 edits in trunk

[IFC][Integration] Enable RTL inline base direction
https://bugs.webkit.org/show_bug.cgi?id=234736

Reviewed by Antti Koivisto.

Source/WebCore:

  • layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp:

(WebCore::Layout::InlineDisplayContentBuilder::processBidiContent):

  • layout/integration/LayoutIntegrationCoverage.cpp:

(WebCore::LayoutIntegration::canUseForStyle):

LayoutTests:

  • platform/ios-wk2/fast/text/international/rtl-white-space-pre-wrap-expected.txt:
  • platform/ios/fast/block/basic/016-expected.txt:
  • platform/ios/fast/borders/rtl-border-04-expected.txt:
  • platform/ios/fast/css/text-overflow-ellipsis-bidi-expected.txt:
  • platform/ios/fast/css/text-overflow-input-expected.txt:
  • platform/ios/fast/dom/34176-expected.txt:
  • platform/ios/fast/dom/52776-expected.txt:
  • platform/ios/fast/dom/HTMLElement/bdo-expected.txt:
  • platform/ios/fast/forms/input-text-scroll-left-on-blur-expected.txt:
  • platform/ios/fast/text/international/bidi-LDB-2-formatting-characters-expected.txt:
  • platform/ios/fast/text/international/bidi-neutral-run-expected.txt:
  • platform/ios/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt:
  • platform/ios/fast/text/international/rtl-white-space-pre-wrap-expected.txt:
  • platform/mac-bigsur/fast/dom/52776-expected.txt:
  • platform/mac-bigsur/fast/text/international/bidi-neutral-run-expected.txt:
  • platform/mac-catalina/fast/css/text-overflow-input-expected.txt:
  • platform/mac/fast/block/basic/016-expected.txt:
  • platform/mac/fast/borders/rtl-border-05-expected.txt:
  • platform/mac/fast/css/text-overflow-ellipsis-bidi-expected.txt:
  • platform/mac/fast/css/text-overflow-input-expected.txt:
  • platform/mac/fast/dom/34176-expected.txt:
  • platform/mac/fast/dom/52776-expected.txt:
  • platform/mac/fast/dom/HTMLElement/bdo-expected.txt:
  • platform/mac/fast/forms/input-text-scroll-left-on-blur-expected.txt:
  • platform/mac/fast/text/international/bidi-LDB-2-formatting-characters-expected.txt:
  • platform/mac/fast/text/international/bidi-layout-across-linebreak-expected.txt:
  • platform/mac/fast/text/international/bidi-neutral-run-expected.txt:
  • platform/mac/fast/text/international/bidi-override-expected.txt:
  • platform/mac/fast/text/international/rtl-white-space-pre-wrap-expected.txt:
  • platform/mac/fast/text/text-letter-spacing-expected.txt:
6:32 AM Changeset in webkit [287484] by Alan Bujtas
  • 2 edits in trunk/Source/WebCore

[LFC][IFC] Non-empty inline boxes construction should be driven by their content
https://bugs.webkit.org/show_bug.cgi?id=234744

Reviewed by Antti Koivisto.

At bidi paragraph processing, we assign bidi levels to inline items. Normally only content type
of inline items need bidi levels as inline box start(end) visual order is driven by their content.
However there are 2 cases when inline box start require bidi level

  • empty inline boxes (1<span></span>2) -so that we can find out their position.
  • inline boxes with unicode-bidi style -they change their content's bidi behavior.

In this patch we ignore the second type of inline boxes at display box construction
as they may trigger redundant inline boxes on the line (as we create them for their content).

  • layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp:

(WebCore::Layout::InlineDisplayContentBuilder::processBidiContent):

Note: See TracTimeline for information about the timeline view.