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

Timeline



Sep 10, 2018:

10:18 PM Changeset in webkit [235886] by Fujii Hironori
  • 9 edits in trunk/Source

Remove unused needsDestruction class variables from HashTraits
https://bugs.webkit.org/show_bug.cgi?id=189490

Reviewed by Daniel Bates.

Source/WebCore:

needsDestruction has been obsoleted in Bug 121983.

No new tests (No behavior change).

  • css/makeprop.pl: Removed needsDestruction.
  • platform/graphics/FloatSizeHash.h: Ditto.
  • platform/graphics/IntPointHash.h: Ditto.
  • platform/graphics/IntRectHash.h: Ditto.
  • platform/graphics/IntSizeHash.h: Ditto.
  • platform/graphics/WidthCache.h: Ditto.

Source/WebKitLegacy/mac:

  • History/BinaryPropertyList.cpp: Removed needsDestruction.
10:07 PM Changeset in webkit [235885] by mitz@apple.com
  • 8 copies
    1 add in releases/Apple/iOS 11.4.1

Added a tag for iOS 11.4.1.

10:06 PM Changeset in webkit [235884] by mitz@apple.com
  • 9 copies
    1 add in releases/Apple/Safari 11.1.2

Added a tag for Safari 11.1.2.

10:01 PM Changeset in webkit [235883] by mitz@apple.com
  • 9 copies
    1 add in releases/Apple/Safari Technology Preview 65

Added a tag for Safari Technology Preview release 65.

9:53 PM Changeset in webkit [235882] by msaboff@apple.com
  • 16 edits in trunk

Test262 failure with Named Capture Groups - using a reference before the group is defined
https://bugs.webkit.org/show_bug.cgi?id=189407

Reviewed by Alex Christensen.

JSTests:

Re-enabled previously failing test.

  • test262.yaml:
  • test262/expectations.yaml:

Source/JavaScriptCore:

Added code to save the named forward references we see during parsing and validating that
they are all present when parsing the RegExp is complete. If there are unnamed references,
we reparse with some variation of behavior. Just like for numeric references, the
behavior is different depending on whether or not the unicode (u flag) is present.
For non-unicode patterns, we treat the \k<...> as a literal pattern. For a unicode
pattern we throw an exception.

Did some refactoring, renaming YarrPattern::reset() and YarrPatternConstructor::reset()
resetForReparsing() as that is the only use for those methods. Also changed
all the delegate methods that take a String to take a const String& to eliminate
copy churn.

  • yarr/YarrParser.h:

(JSC::Yarr::Parser::CharacterClassParserDelegate::atomNamedBackReference):
(JSC::Yarr::Parser::CharacterClassParserDelegate::isValidNamedForwardReference):
(JSC::Yarr::Parser::CharacterClassParserDelegate::atomNamedForwardReference):
(JSC::Yarr::Parser::parseEscape):

  • yarr/YarrPattern.cpp:

(JSC::Yarr::YarrPatternConstructor::resetForReparsing):
(JSC::Yarr::YarrPatternConstructor::saveUnmatchedNamedForwardReferences):
(JSC::Yarr::YarrPatternConstructor::atomNamedBackReference):
(JSC::Yarr::YarrPatternConstructor::isValidNamedForwardReference):
(JSC::Yarr::YarrPatternConstructor::atomNamedForwardReference):
(JSC::Yarr::YarrPattern::compile):
(JSC::Yarr::YarrPatternConstructor::reset): Deleted.

  • yarr/YarrPattern.h:

(JSC::Yarr::YarrPattern::resetForReparsing):
(JSC::Yarr::YarrPattern::containsIllegalNamedForwardReferences):
(JSC::Yarr::YarrPattern::reset): Deleted.

  • yarr/YarrSyntaxChecker.cpp:

(JSC::Yarr::SyntaxChecker::atomNamedBackReference):
(JSC::Yarr::SyntaxChecker::isValidNamedForwardReference):
(JSC::Yarr::SyntaxChecker::atomNamedForwardReference):

Source/WebCore:

Created new delegate stubs for RegExp parsing. These are not needed for the URL filtering
use cases. Also changed all the delegate methods that take a String to take
const String& to eliminate copy churn.

Updated TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp.

  • contentextensions/URLFilterParser.cpp:

(WebCore::ContentExtensions::PatternParser::atomNamedBackReference):
(WebCore::ContentExtensions::PatternParser::isValidNamedForwardReference):
(WebCore::ContentExtensions::PatternParser::atomNamedForwardReference):
(WebCore::ContentExtensions::URLFilterParser::statusString):

  • contentextensions/URLFilterParser.h:

Tools:

Updated test.

  • TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:

(TestWebKitAPI::TEST_F):

LayoutTests:

Updated tests.

  • js/regexp-named-capture-groups-expected.txt:
  • js/script-tests/regexp-named-capture-groups.js:
8:59 PM Changeset in webkit [235881] by rniwa@webkit.org
  • 18 edits
    20 adds
    1 delete in trunk/LayoutTests

Update shadow DOM and custom elements tests
https://bugs.webkit.org/show_bug.cgi?id=189494

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Re-imported WPT tests for shadow DOM and custom elements.

  • resources/import-expectations.json:
  • web-platform-tests/custom-elements/range-and-constructors-expected.txt: Added.
  • web-platform-tests/custom-elements/range-and-constructors.html: Added.
  • web-platform-tests/custom-elements/w3c-import.log:
  • web-platform-tests/shadow-dom/Document-prototype-currentScript-expected.txt:
  • web-platform-tests/shadow-dom/Document-prototype-currentScript.html:
  • web-platform-tests/shadow-dom/DocumentOrShadowRoot-prototype-elementFromPoint-expected.txt: Added.
  • web-platform-tests/shadow-dom/DocumentOrShadowRoot-prototype-elementFromPoint.html: Added.
  • web-platform-tests/shadow-dom/Element-interface-attachShadow-custom-element-expected.txt: Added.
  • web-platform-tests/shadow-dom/Element-interface-attachShadow-custom-element.html: Added.
  • web-platform-tests/shadow-dom/Element-interface-attachShadow-expected.txt:
  • web-platform-tests/shadow-dom/Element-interface-attachShadow.html:
  • web-platform-tests/shadow-dom/Extensions-to-Event-Interface-expected.txt:
  • web-platform-tests/shadow-dom/Extensions-to-Event-Interface.html:
  • web-platform-tests/shadow-dom/OWNERS: Removed.
  • web-platform-tests/shadow-dom/directionality-001.tentative-expected.html: Added.
  • web-platform-tests/shadow-dom/directionality-001.tentative.html: Added.
  • web-platform-tests/shadow-dom/event-composed-path-after-dom-mutation-expected.txt: Added.
  • web-platform-tests/shadow-dom/event-composed-path-after-dom-mutation.html: Added.
  • web-platform-tests/shadow-dom/form-control-form-attribute-expected.txt: Added.
  • web-platform-tests/shadow-dom/form-control-form-attribute.html: Added.
  • web-platform-tests/shadow-dom/getElementById-dynamic-001-expected.txt: Added.
  • web-platform-tests/shadow-dom/getElementById-dynamic-001.html: Added.
  • web-platform-tests/shadow-dom/input-element-list-expected.txt: Added.
  • web-platform-tests/shadow-dom/input-element-list.html: Added.
  • web-platform-tests/shadow-dom/layout-slot-no-longer-assigned-expected.html: Added.
  • web-platform-tests/shadow-dom/layout-slot-no-longer-assigned.html: Added.
  • web-platform-tests/shadow-dom/layout-slot-no-longer-fallback-expected.html: Added.
  • web-platform-tests/shadow-dom/layout-slot-no-longer-fallback.html: Added.
  • web-platform-tests/shadow-dom/leaktests/get-elements-expected.txt:
  • web-platform-tests/shadow-dom/leaktests/get-elements.html:
  • web-platform-tests/shadow-dom/leaktests/w3c-import.log:
  • web-platform-tests/shadow-dom/resources/event-path-test-helpers.js:

(dispatchEventWithEventLog):

  • web-platform-tests/shadow-dom/resources/shadow-dom-utils.js:
  • web-platform-tests/shadow-dom/resources/w3c-import.log:
  • web-platform-tests/shadow-dom/w3c-import.log:

LayoutTests:

Skip the test hitting a debug assertion until the bug 189493 is fixed.

6:35 PM Changeset in webkit [235880] by Chris Dumez
  • 2 edits in trunk/Source/WebKit

Unreviewed, fix ProcessSwap API tests after r235867.

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::exitAcceleratedCompositingMode):
Add null-check for drawing area.

6:25 PM Changeset in webkit [235879] by commit-queue@webkit.org
  • 10 edits
    1 copy in trunk/Tools

[WHLSL] Inlining should be optional
https://bugs.webkit.org/show_bug.cgi?id=188641

Patch by Thomas Denney <tdenney@apple.com> on 2018-09-10
Reviewed by Myles C. Maxfield.

Inlining functions is now optional, and disabled by default. This patch
additionally resolves https://bugs.webkit.org/show_bug.cgi?id=189326 as
the code for calling functions was completely rewritten.

  • WebGPUShadingLanguageRI/All.js: Add LateCheckAndLayoutBuffers.js
  • WebGPUShadingLanguageRI/CallFunction.js:

(callFunction): Remove dependency on inlining.

  • WebGPUShadingLanguageRI/Evaluator.js:

(Evaluator.prototype._snapshot): Allow null srcPtr in the case of void
returns from functions.
(Evaluator.prototype._evaluateArguments): Abstract out argument
evaluation, ensuring that the order is right-to-left for
FunctionLikeBlocks (i.e. inlined functions) and regular calls.
(Evaluator.prototype._evaluateFunction): Abstracted out function body
evaluation for inlined and non-inlined functions.
(Evaluator.prototype.visitFunctionLikeBlock): Ditto.
(Evaluator.prototype.visitCallExpression): Ditto.

  • WebGPUShadingLanguageRI/Inline.js:

(_inlineFunction): Moved logic that is needed regardless of inlining
into LateCheckAndLayoutBuffers.js
(resolveInlinedFunction): Deleted.

  • WebGPUShadingLanguageRI/LateCheckAndLayoutBuffers.js: Moved logic for

late checking.

  • WebGPUShadingLanguageRI/Prepare.js: Make inlining optional and off by

default.

  • WebGPUShadingLanguageRI/SPIRV.html: Update include.
  • WebGPUShadingLanguageRI/Test.html: Ditto.
  • WebGPUShadingLanguageRI/Test.js: Right-to-left argument evaluation,

and inlining tests.

  • WebGPUShadingLanguageRI/index.html: Update include.
6:18 PM Changeset in webkit [235878] by Wenson Hsieh
  • 12 edits
    1 add in trunk

[iOS] Unable to change the value of select elements while preserving focus state
https://bugs.webkit.org/show_bug.cgi?id=189475
<rdar://problem/41125764>

Reviewed by Tim Horton.

Source/WebKit:

With UITextInputMultiDocument support in WebKit (r226911), WKContentView may enter a state where the user is
able to interact with web content, but focus state is being preserved on WKWebView. This prevents keyboard and
input view dismissal from blurring the focused element (which, in turn, means that the value of certain form
controls, such as select elements, cannot be changed). This can happen in the following scenario:

  1. Suppose we have a web view embedded inside of a view controller (let's call it A).
  2. Another view controller (let's call this one B) is modally presented over A.
  3. The web view is removed from A's view hierarchy and reparented under B's view.
  4. The user taps a form control in the web view, interacts with the keyboard, and taps the Done button.

After step 2, WKContentView gets a call to -_preserveFocusWithToken:destructively:, which increments its focus
retain count to 1. Thus, in step 3, resigning first responder using the Done button fails to blur the element.
To fix this, we split the existing _activeFocusedStateRetainCount into two values: _focusPreservationCount,
which is safe to reset and resets to 0 when changing the focused element, and _activeFocusedStateRetainCount,
which always increments and decrements, and only does so when using -_retainActiveFocusedState.

This also fixes a bug wherein -_restoreFocusWithToken: is implemented as returning void in WebKit, even
though its declaration in UIKit returns a BOOL. UIKit currently calls this selector on WKContentView and
stores the result within a BOOL; this results in the return value of -_restoreFocusWithToken: effectively
becoming the last byte of the most recent value stored in $rax when exiting -_restoreFocusWithToken:. From
debugging a release build of WebKit, this turns out to just be 0x0, becoming NO, which is correct given that
WKContentView does not attempt to become first responder within _restoreFocusWithToken:.

Tests: FocusPreservationTests.PreserveAndRestoreFocus

FocusPreservationTests.ChangingFocusedNodeResetsFocusPreservationState

  • Platform/spi/ios/UIKitSPI.h:
  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView _incrementFocusPreservationCount]):
(-[WKWebView _decrementFocusPreservationCount]):
(-[WKWebView _resetFocusPreservationCount]):
(-[WKWebView _isRetainingActiveFocusedState]):

Active focus state is retained if either the focus preservation count or active focus state count is non-zero.
Splitting this into two variables ensures that SPI clients of -_retainActiveFocusedState won't have active
focus state reset from underneath them, and additionally prevents WKContentView from retaining active focus due
to UITextInputMultiDocument protocol methods while the user is still interacting with it.

  • UIProcess/API/Cocoa/WKWebViewInternal.h:

Move _activeFocusedStateRetainCount to the implementation of WKContentView; instead of directly manipulating the
variable, add helper methods to increment, decrement, or reset the focus preservation count.

  • UIProcess/ios/PageClientImplIOS.mm:

(WebKit::PageClientImpl::isViewWindowActive):
(WebKit::PageClientImpl::isViewFocused):

  • UIProcess/ios/WKContentViewInteraction.h:
  • UIProcess/ios/WKContentViewInteraction.mm:

(-[WKContentView resignFirstResponderForWebView]):
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):

Reset the focus preservation count.

(-[WKContentView addFocusedFormControlOverlay]):
(-[WKContentView removeFocusedFormControlOverlay]):

Use -_retainActiveFocusedState instead of incrementing and decrementing the counter directly.

(-[WKContentView _restoreFocusWithToken:]):
(-[WKContentView _preserveFocusWithToken:destructively:]):

Use _incrementFocusPreservationCount and _decrementFocusPreservationCount instead of manipulating counter
variables directly.

Tools:

Adds a pair of new API tests to verify that (1) resigning first responder while preserving focus does not blur
the focused element, and (2) if another element is focused and presents an input view while preserving focus,
then we reset preservation state and allow first responder resignation to blur the focused element.

  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
  • TestWebKitAPI/Tests/ios/FocusPreservationTests.mm: Added.

(webViewForTestingFocusPreservation):
(TestWebKitAPI::TEST):

  • TestWebKitAPI/cocoa/TestWKWebView.h:
  • TestWebKitAPI/cocoa/TestWKWebView.mm:

(-[TestWKWebView textInputContentView]):

  • TestWebKitAPI/ios/UIKitSPI.h:
5:51 PM Changeset in webkit [235877] by Megan Gardner
  • 6 edits in trunk/Source/WebCore

Correctly interpret from angle for conic gradients
https://bugs.webkit.org/show_bug.cgi?id=189445

Reviewed by Simon Fraser

No new tests, no functionality is changing.

Just renaming angle to angleRadians to make the type more clear,
and hopefully avoid bugs in the future. Update patch to original bug
fix.

  • css/CSSGradientValue.cpp:

(WebCore::CSSConicGradientValue::createGradient):

  • inspector/InspectorCanvas.cpp:

(WebCore::InspectorCanvas::buildArrayForCanvasGradient):

  • platform/graphics/Gradient.cpp:

(WebCore::Gradient::hash const):

  • platform/graphics/Gradient.h:
  • platform/graphics/cg/GradientCG.cpp:

(WebCore::Gradient::paint):

5:44 PM Changeset in webkit [235876] by rniwa@webkit.org
  • 1 edit
    1 copy in trunk/LayoutTests/imported/w3c

Revert the errornous change to the test in r235864.

  • web-platform-tests/shadow-dom/Extensions-to-Event-Interface.html: Replaced with LayoutTests/imported/w3c/web-platform-tests/shadow-dom/Extensions-to-Event-Interface.html.
5:31 PM Changeset in webkit [235875] by commit-queue@webkit.org
  • 4 edits in trunk/Tools

[WHLSL] Add the test shader type
https://bugs.webkit.org/show_bug.cgi?id=189484

Patch by Thomas Denney <tdenney@apple.com> on 2018-09-10
Reviewed by Myles C. Maxfield.

Tests are now precedeed by the 'test' keyword so that they are treated
as entry points, in the same way as vertex and fragment shaders.

  • WebGPUShadingLanguageRI/LateChecker.js:

(LateChecker.prototype._checkShaderType): Allow tests to return any
type, as some currently return void/pointer types.

  • WebGPUShadingLanguageRI/Parse.js:

(parseFuncDecl): Add the test keyword.

  • WebGPUShadingLanguageRI/Test.js: Prepend 'test' to every single test.
4:54 PM Changeset in webkit [235874] by Truitt Savell
  • 2 edits in trunk/LayoutTests

Rebaseline test after https://trac.webkit.org/changeset/235866/webkit.
https://bugs.webkit.org/show_bug.cgi?id=189178.

Unreviewed Test Gardening.

  • platform/mac-highsierra/fast/css/apple-system-control-colors-expected.txt:
4:47 PM Changeset in webkit [235873] by Joseph Pecoraro
  • 28 edits in trunk/Source/WebInspectorUI

Web Inspector: Address some ESLint warnings
https://bugs.webkit.org/show_bug.cgi?id=188824

Reviewed by Matt Baker.

  • .eslintrc:
  • UserInterface/Base/Platform.js:
  • UserInterface/Controllers/AuditManager.js:
  • UserInterface/Controllers/BasicBlockAnnotator.js:
  • UserInterface/Controllers/CallFrameTreeController.js:
  • UserInterface/Controllers/HARBuilder.js:
  • UserInterface/Models/AuditReport.js:
  • UserInterface/Models/AuditResult.js:
  • UserInterface/Models/AuditTestCase.js:
  • UserInterface/Models/AuditTestSuite.js:
  • UserInterface/Models/Cookie.js:
  • UserInterface/Models/SourceCodePosition.js:
  • UserInterface/Test/FrontendTestHarness.js:
  • UserInterface/Test/TestSuite.js:
  • UserInterface/Views/CanvasContentView.js:
  • UserInterface/Views/CollectionContentView.js:
  • UserInterface/Views/ContentBrowser.js:
  • UserInterface/Views/CookieStorageContentView.js:
  • UserInterface/Views/DataGrid.js:
  • UserInterface/Views/DatabaseTableContentView.js:
  • UserInterface/Views/FindBanner.js:
  • UserInterface/Views/JSONResourceContentView.js:
  • UserInterface/Views/LogContentView.js:
  • UserInterface/Views/ResourceSidebarPanel.js:
  • UserInterface/Views/SourceCodeTextEditor.js:
  • UserInterface/Views/SpreadsheetTextField.js:
  • UserInterface/Workers/Formatter/FormatterUtilities.js:
4:24 PM Changeset in webkit [235872] by timothy_horton@apple.com
  • 4 edits in trunk

Make it easier to build for SDK_VARIANT=iosmac
https://bugs.webkit.org/show_bug.cgi?id=189488
<rdar://problem/38254840>

Reviewed by Wenson Hsieh.

  • Makefile:
  • Makefile.shared:
  • Source/Makefile:

Set a variety of build flags (disable libwebrtc, tools, and set
SDK_VARIANT and WK_ALTERNATE_FRAMEWORKS_DIR).

4:15 PM Changeset in webkit [235871] by Ryan Haddad
  • 2 edits in trunk/LayoutTests

Unreviewed test gardening, rebaseline fast/events/ios/keyup.html after r235818.

  • fast/events/ios/keyup-expected.txt:
3:59 PM Changeset in webkit [235870] by commit-queue@webkit.org
  • 4 edits in trunk/Source/WebKit

Long press on picture/link show menu obscured by keyboard.
https://bugs.webkit.org/show_bug.cgi?id=189114.

Patch by James Savage <James Savage> on 2018-09-10
Reviewed by Megan Gardner.

Use the visible bounds of the window, not the full bounds, when deciding if
an element's rect takes up too much screen space to present from. This factors
in occlusion of the window by the keyboard, bars, and other overlapping content.

If possible, it would be nice to only account for overlapping geometry which a
popover would avoid, but that information is not available. This approach will
produce some false positives in favor of the "from touch" style, but those are
still better than getting an unusably small action sheet.

  • UIProcess/ios/WKActionSheetAssistant.h:
  • UIProcess/ios/WKActionSheetAssistant.mm:

(-[WKActionSheetAssistant showImageSheet]): Use new helper method for style.
(-[WKActionSheetAssistant showLinkSheet]): Ditto.
(-[WKActionSheetAssistant _presentationStyleForPositionInfo:elementInfo:]):
Query new delegate method to figure out the unobscured rect of the window. This
information only exists on WKScrollView, so we have to ask for it. If this method
is not implemented, fall back to the current approach of assuming the full window
bounds are available.
(presentationStyleForView): Deleted. Replaced by instance method.

  • UIProcess/ios/WKContentViewInteraction.mm:

(-[WKContentView unoccludedWindowBoundsForActionSheetAssistant:]):
Calculate the unoccluded rect using -[UIScrollView adjustedContentInset], which
factors in client specified insets and system insets (such as the keyboard).

3:47 PM Changeset in webkit [235869] by youenn@apple.com
  • 4 edits
    1 copy
    1 add in trunk

ontrack events should be fired even if an existing transceiver exists
https://bugs.webkit.org/show_bug.cgi?id=189477

Reviewed by Eric Carlson.

Source/WebCore:

In case of an OnTrack callback from libwebrtc, make sure the ontrack event is called even if a transceiver already exists for that track.

Covered by updated video-addTransceiver.html
New test video-addLegacyTransceiver.html keeps testing the old transceiver behavior.
Test: webrtc/video-addLegacyTransceiver.html

  • Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:

(WebCore::LibWebRTCMediaEndpoint::newTransceiver):

LayoutTests:

  • webrtc/video-addLegacyTransceiver-expected.txt: Added.
  • webrtc/video-addLegacyTransceiver.html: Copied from LayoutTests/webrtc/video-addTransceiver.html.
  • webrtc/video-addTransceiver.html:
3:23 PM Changeset in webkit [235868] by Megan Gardner
  • 6 edits
    2 adds in trunk

Correctly interpret from angle for conic gradients
https://bugs.webkit.org/show_bug.cgi?id=189445
<rdar://problem/44158271>

Reviewed by Tim Horton.

Source/WebCore:

Test: fast/gradients/conic-from-angle.html

We were pulling the angle as degrees when we really need radians.

  • css/CSSGradientValue.cpp:

(WebCore::CSSConicGradientValue::createGradient):

LayoutTests:

Adding a test for a conic gradient that starts at an angle.
Cover the edges because triangles and conic gradients aren't rendered
exactly the same.

  • TestExpectations:
  • fast/gradients/conic-from-angle-expected.html: Added.
  • fast/gradients/conic-from-angle.html: Added.
  • platform/ios-12/TestExpectations:
  • platform/mac/TestExpectations:
3:17 PM Changeset in webkit [235867] by Chris Dumez
  • 4 edits in trunk/Source/WebKit

Regression(PSON): WebView is blank when navigating back cross-process on iOS
https://bugs.webkit.org/show_bug.cgi?id=189481
<rdar://problem/44315010>

Reviewed by Tim Horton.

When process swapping on navigation, the WebPageProxy would detach from the old WebProcess and destroy
its RemoteLayerTreeDrawingAreaProxy. It would then create a new process and a new RemoteLayerTreeDrawingAreaProxy
to listen for IPC from this new process. When navigating back to the original process, we would do the
same in the opposite direction. However, the issue was that the old WebProcess's WebPage would not destroy its
drawing area and some state would persist and cause issues. For example, the DrawingArea would send a
CommitLayerTree IPC to the UIProcess and set m_waitingForBackingStoreSwap to true. It normally resets
m_waitingForBackingStoreSwap to false when getting the DidUpdate IPC from the UIProcess. However, when the
WebPage is detached from its WebPageProxy (i.e. suspended due to PSON), the UIProcess would not respond to
IPC from the old WebProcess and m_waitingForBackingStoreSwap would never get reset.

  • UIProcess/SuspendedPageProxy.cpp:

(WebKit::SuspendedPageProxy::~SuspendedPageProxy):
Make sure we send the SetIsSuspended IPC to the WebProcess with false value when
the SuspendedPageProxy gets destroyed, so that the WebProcess can update its
m_isSuspended flag. Previous, it was set to true when constructing the
SuspendedPageProxy but never reset to false.

  • WebProcess/WebCoreSupport/WebChromeClient.cpp:

(WebKit::WebChromeClient::invalidateContentsAndRootView):
(WebKit::WebChromeClient::invalidateContentsForSlowScroll):
Add null checks for the drawing area now that it can be null while suspended.

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::reinitializeWebPage):
When a WebPage gets reattached to a WebPageProxy, this method is called. Since we now
destroy the drawing area upon suspension (WebPage gets detached from WebPageProxy), we
need to make sure we recreate the drawing area when reattaching.

(WebKit::WebPage::setIsSuspended):
Destroy the drawing area when the WebPage is suspended, meaning that this WebPage
is no longer associated with a WebPageProxy.

3:16 PM Changeset in webkit [235866] by commit-queue@webkit.org
  • 11 edits in trunk

Expose -apple-system-container-border color to internal web views.
https://bugs.webkit.org/show_bug.cgi?id=189178.

Patch by James Savage <James Savage> on 2018-09-10
Reviewed by Timothy Hatcher.

Source/WebCore:

Tests: LayoutTests/fast/css/apple-system-colors.html

  • css/CSSValueKeywords.in: Add new semantic color name.
  • rendering/RenderThemeMac.mm:

(WebCore::RenderThemeMac::systemColor const): Use system color on supported
systems, and fall back to approximation for older systems.

Source/WebCore/PAL:

  • pal/spi/cocoa/NSColorSPI.h: Declare SPI.

LayoutTests:

  • fast/css/apple-system-control-colors-expected.txt:
  • fast/css/apple-system-control-colors.html:
  • platform/mac-highsierra/fast/css/apple-system-control-colors-expected.txt:
  • platform/mac-sierra/fast/css/apple-system-control-colors-expected.txt:
  • platform/mac/fast/css/apple-system-control-colors-expected.txt:
2:54 PM Changeset in webkit [235865] by rniwa@webkit.org
  • 5 edits
    6 adds in trunk

mouseenter and mouseleave events don't get dispatched even when there is a capturing event listener for a slot ancestor
https://bugs.webkit.org/show_bug.cgi?id=188561

Reviewed by Darin Adler.

Source/WebCore:

This patch makes mouseenter and mouseleave events to work with shadow trees and slots therein, and makes them uncomposed
as discussed in https://github.com/w3c/uievents/issues/208.

This patch also makes these events dispatched on DOM tree ancestors of the currently hovered element instead of
render tree's hover ancestors to be consistent with the check in hierarchyHasCapturingEventListeners and other browsers.
In particular, using hover ancestors is problematic when there is an element with display: contents such as slot elements,
which do not have a render object.

Tests: fast/shadow-dom/mouseenter-mouseleave-across-shadow-boundary.html

fast/shadow-dom/mouseenter-mouseleave-inside-shadow-tree.html
fast/shadow-dom/mouseenter-mouseleave-on-slot-parent.html

  • dom/MouseEvent.cpp:

(WebCore::MouseEvent::create):

  • page/EventHandler.cpp:

(WebCore::nearestCommonHoverAncestor): Deleted.
(WebCore::hierarchyHasCapturingEventListeners): Use parentInComposedTree. Else we would miss capturing event listeners
on inclusive ancestors of slots.
(WebCore::EventHandler::updateMouseEventTargetNode): Use the composed tree's ancestor chain to fire mouseenter and
mouseleave events. This is needed to dispatch mouseenter / mouseleave events on slot elements. Also removed comments
which just state what is self-evident from the code beneath them.

LayoutTests:

Added tests for listening to mouseenter and mouseleave events using capturing and bubbling event listeners
across shadow boundaries.

  • fast/shadow-dom/mouseenter-mouseleave-across-shadow-boundary-expected.txt: Added.
  • fast/shadow-dom/mouseenter-mouseleave-across-shadow-boundary.html: Added.
  • fast/shadow-dom/mouseenter-mouseleave-inside-shadow-tree-expected.txt: Added.
  • fast/shadow-dom/mouseenter-mouseleave-inside-shadow-tree.html: Added.
  • fast/shadow-dom/mouseenter-mouseleave-on-slot-parent-expected.txt: Added.
  • fast/shadow-dom/mouseenter-mouseleave-on-slot-parent.html: Added.
  • platform/ios/TestExpectations: Skip the new tests since mouse events aren't supported on iOS.
2:48 PM Changeset in webkit [235864] by rniwa@webkit.org
  • 4 edits in trunk

Remove isOrphan check in ShadowRoot::setInnerHTML
https://bugs.webkit.org/show_bug.cgi?id=189449

Reviewed by Darin Adler.

Removed isOrphan() check in ShadowRoot::setInnerHTML needed for webkit.org/b/88834.

The only reason this check was kept in the code was because the fix for V8 couldn't be landed
due to a perf regression but V8 binding isn't even a thing in WebKit anymore.

  • dom/ShadowRoot.cpp:

(WebCore::ShadowRoot::setInnerHTML):

  • dom/ShadowRoot.h:
2:42 PM Changeset in webkit [235863] by Simon Fraser
  • 2 edits in trunk/Source/WebCore

Many textarea tests leak documents because Document::removeFocusNavigationNodeOfSubtree() can trigger a Document retain cycle
https://bugs.webkit.org/show_bug.cgi?id=188722

Reviewed by Ryosuke Niwa.

Fix a retain cycle created when Document::adjustFocusNavigationNodeOnNodeRemoval() sets
m_focusNavigationStartingNode to itself. m_focusNavigationStartingNode is a Node* (not sure why it's not an Element*),
making it possible to assign the Document to it, which creates a reference to the document which prevents
Document::removedLastRef() ever running and doing the necessary cleanup.

Fix by setting m_focusNavigationStartingNode to null if code tries to set it to the Document. This can happen
when an element is focused and the page calls document.write(), which removes all children.

Will be tested by future leak testing. Fixes the document leak in at least the following tests:

fast/forms/append-children-during-form-submission.html
fast/forms/empty-textarea-toggle-disabled.html
fast/forms/textarea-paste-newline.html
fast/forms/textarea-trailing-newline.html

  • dom/Document.cpp:

(WebCore::Document::setFocusNavigationStartingNode):
(WebCore::Document::adjustFocusNavigationNodeOnNodeRemoval):

2:19 PM Changeset in webkit [235862] by Simon Fraser
  • 7 edits in trunk/Source/WebCore

svg/W3C-SVG-1.1/render-groups-03-t.svg and some other SVG tests leak documents
https://bugs.webkit.org/show_bug.cgi?id=189147

Reviewed by Dean Jackson.

Document::removedLastRef() needs to clean up m_fontSelector, because it can reference
CSSFontFaceSources that keep SVGFontFaceElements alive, and they in turn will keep
the Document alive.

Also add the beginnings of a Fonts log channel.

This will be tested by world leak testing (webkit.org/b/189332).

  • css/CSSFontSelector.cpp:

(WebCore::CSSFontSelector::CSSFontSelector):
(WebCore::CSSFontSelector::~CSSFontSelector):

  • dom/Document.cpp:

(WebCore::Document::removedLastRef):

  • platform/Logging.h:
  • platform/graphics/FontCache.cpp:

(WebCore::FontCache::purgeInactiveFontDataIfNeeded):
(WebCore::FontCache::purgeInactiveFontData):

  • svg/SVGFontFaceElement.cpp:

(WebCore::SVGFontFaceElement::SVGFontFaceElement):
(WebCore::SVGFontFaceElement::~SVGFontFaceElement):

  • svg/SVGFontFaceElement.h:
2:11 PM Changeset in webkit [235861] by don.olmstead@sony.com
  • 12 edits in trunk

CBOR coders should only be compiled if WebAuthN is enabled
https://bugs.webkit.org/show_bug.cgi?id=189425

Reviewed by Jiewen Tan.

Source/WebCore:

No new tests. No change in behavior.

Just places ENABLE(WEB_AUTHN) guards around all CBOR files.

  • Modules/webauthn/cbor/CBORBinary.h:
  • Modules/webauthn/cbor/CBORReader.cpp:
  • Modules/webauthn/cbor/CBORReader.h:
  • Modules/webauthn/cbor/CBORValue.cpp:
  • Modules/webauthn/cbor/CBORValue.h:
  • Modules/webauthn/cbor/CBORWriter.cpp:
  • Modules/webauthn/cbor/CBORWriter.h:

Tools:

Just places ENABLE(WEB_AUTHN) guards around CBOR test files.

  • TestWebKitAPI/Tests/WebCore/CBORReaderTest.cpp:
  • TestWebKitAPI/Tests/WebCore/CBORValueTest.cpp:
  • TestWebKitAPI/Tests/WebCore/CBORWriterTest.cpp:
2:02 PM Changeset in webkit [235860] by dbates@webkit.org
  • 9 edits in trunk

[iOS] Arrow keys do not dispatch DOM events to non-editable elements
https://bugs.webkit.org/show_bug.cgi?id=189389

Reviewed by Simon Fraser.

Source/WebCore:

On iOS the arrow keys are identified by special multi character key strings: UIKeyInput{Up,
Down, Left, Right}Arrow as opposed to special key codes as on Mac. When converting the iOS-
specific WebEvent we need to take care to recognize when the key string for the event is
one of these special key strings when computing key code, character code, and key identifier
properties for the WebCore platform-specific event. These details will be included in
the corresponding DOM keyboard events that are dispatched when the arrow keys are pressed.

  • SourcesCocoa.txt:
  • WebCore.xcodeproj/project.pbxproj:

Mark file PlatformEventFactoryIOS as @no-unify as it is not compatible with the unified sources
build strategy given its use of wtf/cocoa/SoftLinking.h macros.

  • platform/ios/PlatformEventFactoryIOS.h:
  • platform/ios/PlatformEventFactoryIOS.mm:

(WebCore::convertSpecialKeyToCharCode): Manufacture the appropriate character code for an
event that represents an arrow key. Otherwise, return std::nullopt to indicate that the
event is not for an arrow key.
(WebCore::keyCodeForEvent): Manufacture the appropriate Windows virtual key code for an
event that represents an arrow key. Otherwise, do what we do now and return the key code
associated with the WebEvent.
(WebCore::keyIdentifierForKeyEvent): Modified to test if the event is for an arrow key
and return the appropriate key identifier.
(WebCore::keyForKeyEvent): Modified to test if the event is for an arrow key
and return the appropriate character code.
(WebCore::codeForKeyEvent): Modified to call keyCodeForEvent(), which knows how to account
for events that represent arrow keys.
(WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):

Source/WebKit:

Use WebCore::keyCodeForEvent() to retrieve the key code for a WebEvent instead of querying
the key code from the WebEvent directly. The function WebCore::keyCodeForEvent() knows how
to compute the key code for an event that represents an arrow key.

  • Shared/ios/WebIOSEventFactory.mm:

(WebIOSEventFactory::createWebKeyboardEvent):

LayoutTests:

Update expected result now that we compute the correct keyIdentifier, keycode, and which properties
for DOM keyboard events dispatched when the arrow keys are pressed.

  • fast/events/ios/keydown-keyup-in-non-editable-content-expected.txt:
1:57 PM Changeset in webkit [235859] by timothy_horton@apple.com
  • 4 edits in trunk/Source/WebKit

Try to fix the iOSMac build
https://bugs.webkit.org/show_bug.cgi?id=189469

  • UIProcess/API/C/mac/WKContextPrivateMac.mm:

(WKContextSetPluginLoadClientPolicy):
(WKContextClearPluginClientPolicies):
(WKContextCopyPlugInInfoForBundleIdentifier):
(WKContextGetInfoForInstalledPlugIns):
(WKContextResetHSTSHosts):
(WKContextResetHSTSHostsAddedAfterDate):
(WKContextRegisterSchemeForCustomProtocol):
(WKContextUnregisterSchemeForCustomProtocol):

  • UIProcess/API/C/mac/WKPagePrivateMac.mm:

(-[WKObservablePageState initWithPage:]):
(WKPageCreateObservableState):
(WKPageGetObjectRegistry):
(WKPageIsURLKnownHSTSHost):
(WKPageLoadURLRequestReturningNavigation):
(WKPageLoadFileReturningNavigation):
(WKPageIsPlayingVideoInEnhancedFullscreen):
(WKPageSetFullscreenDelegate):
(WKPageGetFullscreenDelegate):

  • UIProcess/API/C/mac/WKProtectionSpaceNS.mm:

(WKProtectionSpaceCopyNSURLProtectionSpace):

1:55 PM Changeset in webkit [235858] by dbates@webkit.org
  • 3 edits
    2 adds in trunk

[iOS] Make WKWebView become the first responder to support testing key presses to non-editable elements
https://bugs.webkit.org/show_bug.cgi?id=189432

Reviewed by Simon Fraser.

Tools:

Make the WKWebView become the first responder immediately without the need to focus an editable
element. This allows us to test that DOM keyboard events are dispatched to non-editable elements.

  • WebKitTestRunner/ios/PlatformWebViewIOS.mm:

(WTR::PlatformWebView::PlatformWebView):

LayoutTests:

Add a test that DOM keyboard events are dispatched to a non-editable <body> when simulating key
presses using a hardware keyboard.

  • fast/events/ios/keydown-keyup-in-non-editable-content-expected.txt: Added.
  • fast/events/ios/keydown-keyup-in-non-editable-content.html: Added.
1:39 PM Changeset in webkit [235857] by mitz@apple.com
  • 3 edits in trunk/Source/WebCore

[macOS] Editor::readSelectionFromPasteboard’s MailBlockquoteHandling argument is effectively unused
https://bugs.webkit.org/show_bug.cgi?id=189480

Reviewed by Anders Carlsson.

No new tests, because this doesn’t change behavior.

  • editing/Editor.h: Removed the MailBlockquoteHandling argument from readSelectionFromPasteboard.
  • editing/mac/EditorMac.mm:

(WebCore::Editor::readSelectionFromPasteboard): Don’t pass mailBlockquoteHandling to

pasteWithPasteboard. It was always set to RespectBlockquote, which is the latter’s
default.

1:08 PM Changeset in webkit [235856] by aestes@apple.com
  • 12 edits
    1 copy
    2 adds in trunk

[Payment Request] Use JSValueInWrappedObject for PaymentResponse's details attribute
https://bugs.webkit.org/show_bug.cgi?id=189458

Reviewed by Youenn Fablet.

Source/WebCore:

Test: http/tests/paymentrequest/payment-response-reference-cycle-leak.https.html

  • Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:

(WebCore::ApplePayPaymentHandler::didAuthorizePayment):

Created a PaymentResponse::DetailsFunction that converts the ApplePayPayment into a JSValue.

  • Modules/paymentrequest/PaymentRequest.cpp:

(WebCore::PaymentRequest::accept):

Passed detailsFunction into PaymentResponse::create().

  • Modules/paymentrequest/PaymentRequest.h:
  • Modules/paymentrequest/PaymentResponse.cpp:

(WebCore::PaymentResponse::PaymentResponse):

  • Modules/paymentrequest/PaymentResponse.h:
  • Modules/paymentrequest/PaymentResponse.idl:

Removed m_details and replaced it with a DetailsFunction and a cached JSValueInWrappedObject.
JSPaymentResponseCustom.cpp uses these values to implement the details attribute getter.

  • Sources.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • bindings/js/JSPaymentResponseCustom.cpp: Added.

(WebCore::JSPaymentResponse::details const):

Called PaymentResponse::detailsFunction() to cache a JSValue for the details attribute.

(WebCore::JSPaymentResponse::visitAdditionalChildren):

Visited PaymentResponse::cachedDetails().

  • bindings/js/JSServiceWorkerClientCustom.cpp:

Fixed a missing include issue that cropped up due to unified source shuffling.

LayoutTests:

  • fast/dom/reference-cycle-leaks.html:
  • http/tests/paymentrequest/payment-response-reference-cycle-leak.https-expected.txt: Added.
  • http/tests/paymentrequest/payment-response-reference-cycle-leak.https.html: Added.
12:39 PM Changeset in webkit [235855] by fred.wang@free.fr
  • 2 edits in trunk/LayoutTests

[CSSOM View] Handle the scrollingElement in Element::scroll(Left/Top/Width/Height/To)
https://bugs.webkit.org/show_bug.cgi?id=182230

Follow-up patch replacing document.body with document.scrollingElement in
fast-scroll-iframe-latched-mainframe.html. This fixes flaky behavior.

Patch by Frederic Wang <fwang@igalia.com> on 2018-09-10
Reviewed by Antonio Gomes.

  • tiled-drawing/scrolling/fast-scroll-iframe-latched-mainframe.html: Replace document.body

with document.scrollingElement since this document is in standard mode.

12:05 PM Changeset in webkit [235854] by graouts@webkit.org
  • 4 edits
    2 adds in trunk

[Web Animations] Positive delays of accelerated animations are not respected
https://bugs.webkit.org/show_bug.cgi?id=189411
<rdar://problem/44151416>

Reviewed by Dean Jackson.

Source/WebCore:

Test: webanimations/accelerated-animation-with-delay-and-seek.html

We were only accounting for negative delays for accelerated actions. We also were misbehaving
when seeking an animation with a delay (positive or negative) since we wouldn't reset the animation
begin time to be the current time when adjusting its time offset, while the begin time set when
first creating the animation would be set accounting for the time offset.

  • animation/KeyframeEffectReadOnly.cpp:

(WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions):

  • platform/graphics/ca/GraphicsLayerCA.cpp:

(WebCore::GraphicsLayerCA::seekCAAnimationOnLayer):

LayoutTests:

Add a test that checks that positive delays are accounted for during accelerated actions, including a seek.

  • webanimations/accelerated-animation-with-delay-and-seek-expected.html: Added.
  • webanimations/accelerated-animation-with-delay-and-seek.html: Added.
11:30 AM Changeset in webkit [235853] by timothy_horton@apple.com
  • 2 edits in trunk/Source/WebKit

Try to fix the build after r235850

  • UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
11:19 AM Changeset in webkit [235852] by yusukesuzuki@slowstart.org
  • 11 edits
    2 adds in trunk

[WTF] Add Markable<T, Traits>
https://bugs.webkit.org/show_bug.cgi?id=189231

Reviewed by Sam Weinig.

Source/WebCore:

Use Markable<Seconds> and Markable<WallTime> in ResourceResponseBase.
Since these fields are parsed results from http header fields, Seconds::nan() and WallTime::nan()
can be used as an empty value for these fields. Thus we can use Markable because it uses
these nan values as an empty values (they are configured by Seconds::MarkableTraits and WallTime::MarkableTraits).
This reduces the size of ResourceResponseBase from 448 to 416.

  • platform/network/ResourceResponseBase.h:

Source/WTF:

We can represent a value with nullopt by using std::optional<T>. However, std::optional<T> has storage efficiency
problem. It always has a bool indicating that the value is nullopt or not. If we have a following class,

class A {

std::optional<WallTime> m_timeA;
std::optional<WallTime> m_timeB;
std::optional<WallTime> m_timeC;

};

This class has significant amount of padding between m_timeA / m_timeB, m_timeB / m_timeC due to the above bool.

If we know that WallTime has a value that represents invalid, we can use it instead and save the storage.
This is very similar problem to our HashTable implementation. In our HashTable implementation, we need Deleted
and Empty value, which can represent Deleted and Empty values without sacrificing storage efficiency.

We should have similar mechanism here. In this patch, we have WTF::Markable<T, Traits>. Traits offers
Traits::isEmptyValue(value) and Traits::emptyValue(). Then, we use this empty value instead of having bool
flag. This way, we can make sizeof(WTF::Markable<T>) == sizeof(T).

This idea is inspired from https://github.com/akrzemi1/markable. But we would like to have WTF::Markable<T>
here instead of importing it since we would like to have (1) integrated interfaces with std::optional<T> and (2)
aligned function names to HashTraits' isEmptyValue and emptyValue.

  • WTF.xcodeproj/project.pbxproj:
  • wtf/CMakeLists.txt:
  • wtf/Markable.h: Added.

(WTF::std::underlying_type<EnumType>::type>::max): EnumMarkableTraits can be used as an MarkableTraits for enum
values. We can specify a constant value as an empty value.
(WTF::IntegralMarkableTraits::isEmptyValue):
(WTF::IntegralMarkableTraits::emptyValue): IntegralMarkableTraits can be used as an MarkableTraits for integral
types including int etc.
(WTF::Markable::Markable):
(WTF::Markable::operator bool const):
(WTF::Markable::reset):
(WTF::Markable::value const):
(WTF::Markable::value):
(WTF::Markable::operator-> const):
(WTF::Markable::operator->):
(WTF::Markable::operator* const):
(WTF::Markable::operator*):
(WTF::Markable::operator std::optional<T>):
(WTF::Markable::operator std::optional<T> const): This operator allows us to cast Markable<T> to
std::optional<T>.

  • wtf/MonotonicTime.h:

(WTF::MonotonicTime::MarkableTraits::isEmptyValue):
(WTF::MonotonicTime::MarkableTraits::emptyValue): MarkableTraits for MonotonicTime. MonotonicTime::nan() is used
as an empty value.

  • wtf/Seconds.h:

(WTF::Seconds::MarkableTraits::isEmptyValue):
(WTF::Seconds::MarkableTraits::emptyValue): MarkableTraits for Seconds. Seconds::nan() is used as an empty value.

  • wtf/WallTime.h:

(WTF::WallTime::nan):
(WTF::WallTime::MarkableTraits::isEmptyValue):
(WTF::WallTime::MarkableTraits::emptyValue): MarkableTraits for WallTime. WallTime::nan() is used as an empty value.

Tools:

Add tests for Markable.

  • TestWebKitAPI/CMakeLists.txt:
  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
  • TestWebKitAPI/Tests/WTF/Markable.cpp: Added.

(TestWebKitAPI::TEST):

11:16 AM Changeset in webkit [235851] by Simon Fraser
  • 5 edits in trunk

Before tracking Document leaks, clear all caches
https://bugs.webkit.org/show_bug.cgi?id=189459

Reviewed by Sam Weinig.
Source/WebKit:

It's not enough to clear the page and memory caches; font caches can reference Documents (for SVG fonts),
so just call WebCore::releaseMemory(), which empties caches including the page and memory caches, and
does the GC that we need to happen.

  • WebProcess/InjectedBundle/API/c/WKBundle.cpp:

(WKBundleReleaseMemory):
(WKBundleClearPageCache): Deleted.
(WKBundleClearMemoryCache): Deleted.

  • WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:

Tools:

It's not enough to clear the page and memory caches; font caches can reference Documents (for SVG fonts),
so just call WebCore::releaseMemory(), which empties caches including the page and memory caches, and
does the GC that we need to happen.

  • WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:

(WTR::InjectedBundle::didReceiveMessageToPage):

10:20 AM Changeset in webkit [235850] by mrajca@apple.com
  • 22 edits
    1 add in trunk

Source/WebCore:
Touch Bar displays an active PIP button for audio elements (and it doesn't do anything)
https://bugs.webkit.org/show_bug.cgi?id=189433
<rdar://problem/44186498> Touch Bar displays an active PIP button for audio elements (and it doesn't do anything)

Reviewed by Eric Carlson.

When playing an audio element, the media Touch Bar displays an active PIP button even though only
videos are PIP-able. Pressing it does not do anything. The issue is canTogglePictureInPicture is set
to YES unconditionally on the WebPlaybackControlsManager. It is then only updated based on whether or
not external playback is enabled.

This patch extends that logic such that the picture-in-picture Touch Bar button will be disabled for
audio elements. Since PlaybackSessionModelMediaElement today does not know whether we're dealing
with an audio or video element, a new isPictureInPictureSupported flag has been added (as well as
the plumbing necessary to get the state over from the web process).

An API test has been added that checks the value of the canTogglePictureInPicture and ensures it
is NO when audio elements are playing. To expose it to tests, a _canTogglePictureInPictureForTesting
property has been added to the WKTesting category.

  • platform/cocoa/PlaybackSessionModel.h:

(WebCore::PlaybackSessionModelClient::isPictureInPictureSupportedChanged):

  • platform/cocoa/PlaybackSessionModelMediaElement.h:
  • platform/cocoa/PlaybackSessionModelMediaElement.mm:

(WebCore::PlaybackSessionModelMediaElement::setMediaElement):
(WebCore::PlaybackSessionModelMediaElement::isPictureInPictureSupported const):

  • platform/mac/PlaybackSessionInterfaceMac.h:
  • platform/mac/PlaybackSessionInterfaceMac.mm:

(WebCore::PlaybackSessionInterfaceMac::isPictureInPictureSupportedChanged):
(WebCore::PlaybackSessionInterfaceMac::externalPlaybackChanged):
(WebCore::PlaybackSessionInterfaceMac::updatePlaybackControlsManagerCanTogglePictureInPicture):

Source/WebKit:
Touch Bar displays an active PIP button for audio elements (and it doesn't do anything)
https://bugs.webkit.org/show_bug.cgi?id=189433
<rdar://problem/44186498> Touch Bar displays an active PIP button for audio elements (and it doesn't do anything)

Reviewed by Eric Carlson.

When playing an audio element, the media Touch Bar displays an active PIP button even though only
videos are PIP-able. Pressing it does not do anything. The issue is canTogglePictureInPicture is set
to YES unconditionally on the WebPlaybackControlsManager. It is then only updated based on whether or
not external playback is enabled.

This patch extends that logic such that the picture-in-picture Touch Bar button will be disabled for
audio elements. Since PlaybackSessionModelMediaElement today does not know whether we're dealing
with an audio or video element, a new isPictureInPictureSupported flag has been added (as well as
the plumbing necessary to get the state over from the web process).

An API test has been added that checks the value of the canTogglePictureInPicture and ensures it
is NO when audio elements are playing. To expose it to tests, a _canTogglePictureInPictureForTesting
property has been added to the WKTesting category.

Source/WebKit:

  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView _canTogglePictureInPictureForTesting]):

  • UIProcess/API/Cocoa/WKWebViewPrivate.h:
  • UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
  • UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in:
  • UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:

(WebKit::PlaybackSessionModelContext::pictureInPictureSupportedChanged):
(WebKit::PlaybackSessionManagerProxy::pictureInPictureSupportedChanged):

  • UIProcess/Cocoa/WebViewImpl.h:
  • UIProcess/Cocoa/WebViewImpl.mm:

(WebKit::WebViewImpl::updateMediaTouchBar):
(WebKit::WebViewImpl::canTogglePictureInPictureForTesting):

  • UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
  • WebProcess/cocoa/PlaybackSessionManager.h:
  • WebProcess/cocoa/PlaybackSessionManager.mm:

(WebKit::PlaybackSessionInterfaceContext::isPictureInPictureSupportedChanged):
(WebKit::PlaybackSessionManager::isPictureInPictureSupportedChanged):

Tools:
https://bugs.webkit.org/show_bug.cgi?id=189433
<rdar://problem/44186498> Touch Bar displays an active PIP button for audio elements (and it doesn't do anything)

Reviewed by Eric Carlson.

An API test has been added that checks the value of the canTogglePictureInPicture and ensures it
is NO when audio elements are playing.

  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
  • TestWebKitAPI/Tests/WebKitCocoa/PictureInPictureDelegate.html:
  • TestWebKitAPI/Tests/WebKitCocoa/PictureInPictureDelegate.mm:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/WebKitCocoa/audio-with-controls.html: Added.
7:35 AM Changeset in webkit [235849] by pvollan@apple.com
  • 2 edits in trunk/LayoutTests

[Windows] Layout Test webanimations/accelerated-transition-interrupted-on-composited-element.html is failing
https://bugs.webkit.org/show_bug.cgi?id=189468

Unreviewed test gardening.

The test is timing out. Skip it on Windows.

  • platform/win/TestExpectations:
7:04 AM Changeset in webkit [235848] by aboya@igalia.com
  • 2 edits in trunk/Source/WebCore

[GStreamer] Fix overflow in buffered ranges
https://bugs.webkit.org/show_bug.cgi?id=189419

Reviewed by Philippe Normand.

Scale operations on big numbers (like media timestamps or durations)
should be made with GStreamer utility functions to avoid overflows.

This fixes an assertion when a 24 hour long fragmented MP4 file is
played.

  • platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:

(WebCore::MediaPlayerPrivateGStreamer::buffered const):

5:00 AM Changeset in webkit [235847] by fred.wang@free.fr
  • 2 edits in trunk/Source/WebCore

Refactor filter list checking code
https://bugs.webkit.org/show_bug.cgi?id=185087

Patch by Frederic Wang <fwang@igalia.com> on 2018-09-07
Reviewed by Yusuke Suzuki.

No new tests, behavior unchanged.

  • animation/KeyframeEffectReadOnly.h: Add missing forward-declaration FilterOperations.
2:10 AM Changeset in webkit [235846] by Philippe Normand
  • 5 edits in trunk

[GStreamer] Several media related tests timing out around the same revision
https://bugs.webkit.org/show_bug.cgi?id=189349

Reviewed by Carlos Garcia Campos.

Source/WebCore:

The timeouts were happening because the ended event was no
longer properly emitted. The change in playbackPosition also
ensures timeupdate event remains emitted in a... timely manner.

  • platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:

(WebCore::MediaPlayerPrivateGStreamer::playbackPosition const):
Reduce the position cache threshold to 200ms, which is a value
slightly lower than the 250ms defined in HTMLMediaElement.
(WebCore::MediaPlayerPrivateGStreamer::didEnd): Reset the cached
position value to ensure the following query will most likely
return the same value as reported by the duration query.

LayoutTests:

  • platform/gtk/TestExpectations: Unflag Timeout from now-unaffected tests.
1:57 AM Changeset in webkit [235845] by Fujii Hironori
  • 3 edits in trunk/Source/WebKit

[MSVC] X86Assembler.h(108): error C2666: 'WebCore::operator -': 7 overloads have similar conversions
https://bugs.webkit.org/show_bug.cgi?id=189467

Unreviewed build fix for WinCairo port.

MSVC reports compilation errors if certain JSC header files are
included after "using namespace" statements.

  • Sources.txt: Added @no-unify to InjectedBundleNodeHandle.cpp and InjectedBundleRangeHandle.cpp temporarily.
  • WebKit.xcodeproj/project.pbxproj: Compile InjectedBundleNodeHandle.cpp and InjectedBundleRangeHandle.cpp.
1:28 AM Changeset in webkit [235844] by commit-queue@webkit.org
  • 7 edits in trunk

XMLHttpRequest: overrideMimeType should not update the response's "Content-Type" header
https://bugs.webkit.org/show_bug.cgi?id=189465

Patch by Rob Buis <rbuis@igalia.com> on 2018-09-10
Reviewed by Frédéric Wang.

LayoutTests/imported/w3c:

  • web-platform-tests/xhr/overridemimetype-invalid-mime-type-expected.txt:

Source/WebCore:

The xhr spec changed [1, 2] so that overrideMimeType should not update the
response's "Content-Type" header anymore.

Behavior matches Firefox and Chrome.

[1] https://xhr.spec.whatwg.org/#dom-xmlhttprequest-overridemimetype
[2] https://github.com/whatwg/xhr/issues/157

Tests: http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header.html

web-platform-tests/xhr/overridemimetype-invalid-mime-type.htm

  • xml/XMLHttpRequest.cpp:

(WebCore::XMLHttpRequest::didReceiveResponse):

LayoutTests:

Change existing test to reflect new behavior.

  • http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header-expected.txt:
  • http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header.html:
12:13 AM Changeset in webkit [235843] by graouts@webkit.org
  • 4 edits
    2 adds in trunk

[Web Animations] Interrupting an accelerated CSS transition on a composited element in flight fails
https://bugs.webkit.org/show_bug.cgi?id=189405
<rdar://problem/43342639>

Reviewed by Simon Fraser.

Source/WebCore:

Test: webanimations/accelerated-transition-interrupted-on-composited-element.html

If we interrupt an animation on an element that is composited also outside of the duration of the animation,
the "stop" accelerated action would fail to be performed because we no longer had a resolved current time and
the accelerated animation applied to the layer would never be removed.

However, having a resolved current time is not necessary to stop an animation, only for the other types of
actions (play, pause and seek). So we now simply default to a 0s time for an unresolved current time for a
simple fix to this issue.

  • animation/KeyframeEffectReadOnly.cpp:

(WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions):

LayoutTests:

Add a new test that checks that interrupting a CSS transition targeting an accelerated property for an element
that is composited outside the duration of the transition correctly interrupts the animation and jumps straight
to the target value.

  • platform/win/TestExpectations:
  • webanimations/accelerated-transition-interrupted-on-composited-element-expected.html: Added.
  • webanimations/accelerated-transition-interrupted-on-composited-element.html: Added.

Sep 9, 2018:

10:37 PM Changeset in webkit [235842] by Fujii Hironori
  • 2 edits in trunk/Source/WebKit

Unreviewed, rolling out r235839.

Which breaks all Xcode based ports

Reverted changeset:

"[MSVC] X86Assembler.h(108): error C2666: 'WebCore::operator
-': 7 overloads have similar conversions"
https://bugs.webkit.org/show_bug.cgi?id=189467
https://trac.webkit.org/changeset/235839

10:20 PM Changeset in webkit [235841] by Fujii Hironori
  • 21 edits in trunk/Source

Add specialized template declarations of HashTraits and DefaultHash to detect misuse
https://bugs.webkit.org/show_bug.cgi?id=189044

Reviewed by Yusuke Suzuki.

Source/WebCore:

Some classes have a separate header for specializations of
WTF::HashTraits and WTF::DefaultHash to reduce the number of
header files included. For example, ColorHash.h and Color.h.

If someone is mistakenly using HashSet or HashMap without
including the specialization header, unexpected template
instantiation can cause subtle bugs. For example, MSVC linker
would silently produce an broken executable (Bug 188893).

By applying this change, I found three misuse cases in
DebugPageOverlays.cpp, AVVideoCaptureSource.h and WebPage.h. As
far as I analyzed, I concluded that these misuses don't introduce
any bugs at the moment, and they are not testable (Bug 189044 Comment 9),
except the MSVC issue (Bug 188893).

No new tests (Covered by existing tests).

  • Modules/webdatabase/SQLResultSetRowList.h: Removed unused #include <wtf/HashTraits.h>.
  • bindings/js/SerializedScriptValue.cpp: Ditto.
  • page/DebugPageOverlays.cpp: Added #include "ColorHash.h" to instantiate HashMap<String, Color>.
  • platform/URLHash.h: Added DefaultHash<URL> specialization definition.
  • platform/URL.h: Added specialized template declarations.
  • platform/graphics/Color.h: Ditto.
  • platform/graphics/FloatSize.h: Ditto.
  • platform/graphics/IntPoint.h: Ditto.
  • platform/graphics/IntSize.h: Ditto.
  • platform/network/ProtectionSpace.h: Ditto.
  • platform/network/ProtectionSpaceHash.h: Removed unnecessary DefaultHash declaration.
  • platform/mediastream/mac/AVVideoCaptureSource.h:

Added #include "IntSizeHash.h" to instantiate HashMap<String, IntSize>.

Source/WebKit:

  • WebProcess/WebPage/WebPage.h: Added #include <WebCore/IntPointHash.h> to instantiate HashMap<std::pair<IntSize, double>, IntPoint>.

Source/WTF:

  • wtf/BitVector.h: Removed unnecessary HashTraits declaration.
  • wtf/MetaAllocatorPtr.h: Ditto.
  • wtf/IndexSparseSet.h: Removed unused #include <wtf/HashTraits.h>.
  • wtf/LoggingHashMap.h: Removed unused #include <wtf/LoggingHashTraits.h>.
  • wtf/StackShot.h: Added #include <wtf/HashTraits.h> because this header uses SimpleClassHashTraits.

Removed unnecessary HashTraits declaration.

10:12 PM Changeset in webkit [235840] by Fujii Hironori
  • 3 edits in trunk/Source/WebCore

[Win][Clang] Add FloatRect(const RECT&) constructor
https://bugs.webkit.org/show_bug.cgi?id=189398

Reviewed by Alex Christensen.

While trying to build WebKit WinCairo port with the latest Clang
(Bug 171618), the following compilation errors were reported.

error: no viable conversion from returned value of type 'RECT' (aka 'tagRECT') to function return type 'WebCore::FloatRect'

No new tests (No behavior change).

  • platform/graphics/FloatRect.h:
  • platform/graphics/win/FloatRectDirect2D.cpp:

(WebCore::FloatRect::FloatRect): Added a new constructor taking a RECT as the argument.

9:54 PM Changeset in webkit [235839] by Fujii Hironori
  • 2 edits in trunk/Source/WebKit

[MSVC] X86Assembler.h(108): error C2666: 'WebCore::operator -': 7 overloads have similar conversions
https://bugs.webkit.org/show_bug.cgi?id=189467

Unreviewed build fix for WinCairo port.

MSVC reports compilation errors if certain JSC header files are
included after "using namespace" statements.

  • Sources.txt: Added @no-unify to InjectedBundleNodeHandle.cpp and InjectedBundleRangeHandle.cpp temporarily.
4:04 PM Changeset in webkit [235838] by bshafiei@apple.com
  • 1 copy in tags/Safari-606.2.100

Tag Safari-606.2.100.

10:55 AM Changeset in webkit [235837] by commit-queue@webkit.org
  • 22 edits in trunk/Tools

Unreviewed, rolling out r235832.
https://bugs.webkit.org/show_bug.cgi?id=189464

Broke WebKit2 tests (Requested by ap on #webkit).

Reverted changeset:

"[Cocoa] Turn on ARC for WebKitTestRunner"
https://bugs.webkit.org/show_bug.cgi?id=189228
https://trac.webkit.org/changeset/235832

Note: See TracTimeline for information about the timeline view.