2019-06-05 Antoine Quint [Pointer Events] Fire pointerout and pointerleave events after firing pointercancel https://bugs.webkit.org/show_bug.cgi?id=198560 Reviewed by Dean Jackson. The Pointer Events specification mandates that "pointerout" and "pointerleave" events must be dispatched immediately after dispatching a "pointercancel" event. Since we needed to determine the bubbling, cancelable and composed nature of those events in additional places, we now have static methods to determine this defined in PointerEvent.h such that both PointerEvent.cpp and PointerEventIOS.cpp may use them. This should guarantee consistency going forward. * dom/PointerEvent.cpp: (WebCore::PointerEvent::create): (WebCore::PointerEvent::PointerEvent): * dom/PointerEvent.h: * dom/ios/PointerEventIOS.cpp: (WebCore::pointerEventType): (WebCore::PointerEvent::create): (WebCore::PointerEvent::PointerEvent): (WebCore::phaseIsCancelable): Deleted. (WebCore::typeCanBubble): Deleted. * page/PointerCaptureController.cpp: (WebCore::PointerCaptureController::cancelPointer): 2019-06-05 Saam Barati [WHLSL] Implement loop expressions https://bugs.webkit.org/show_bug.cgi?id=195808 Reviewed by Myles Maxfield. This patch makes continue/break break for "do/while/for" loops in WHLSL. Because of the way we emit code where every expression turns into a Metal statement, it's not convenient to emit native Metal loop constructs. Instead, we model break/continue as if we had goto. For example, this WHLSL program: ``` for (INIT; COND; INC) { if (b) continue; if (b2) break; } ``` would become something like: ``` INIT; while (1) { if (!COND) break; if (b) goto increment; if (b2) goto exit; increment: INC; } exit: ``` However, Metal doesn't have goto, so we model goto using a run-once loop and a variable indicating if we should break out early. This "break out early" variable is initially set to false. We "should break out early" when executing a WHLSL "break" statement. "continue" is modeled as breaking out of the run-once loop, but not touching the "break out early" variable. "break" is modeled as setting the "break out early" variable to true, followed by breaking out of the run-once loop. The above WHLSL will turn into this Metal: ``` bool breakOutOfCurrentLoop = false; INIT; while (1) { if (!COND) break; do { if (b) { // WHLSL 'continue' break; } if (b2) { // WHLSL 'break' breakOutOfCurrentLoop = true; break; } } while (0); if (breakOutOfCurrentLoop) break; INC; } ``` This patch also found a bug with ForLoop where it held a Variant. This is invalid to do since we mutate the AST in place. This means some phase could replace VariableDeclarationsStatement with some other Statement, and we'd be breaking the C++ type system. So this patch migrates ForLoop to hold a statement instead. In general, AST nodes that point to other AST nodes should use broad types unless we know apriori that a certain type will never be replaced. Tests: webgpu/whlsl-do-while-loop-break.html webgpu/whlsl-do-while-loop-continue.html webgpu/whlsl-do-while-loop.html webgpu/whlsl-loops-break.html webgpu/whlsl-loops-continue.html webgpu/whlsl-loops.html webgpu/whlsl-nested-loop.html webgpu/whlsl-while-loop-break.html webgpu/whlsl-while-loop-continue.html * Modules/webgpu/WHLSL/AST/WHLSLForLoop.h: (WebCore::WHLSL::AST::ForLoop::ForLoop): (WebCore::WHLSL::AST::ForLoop::initialization): * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp: (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit): (WebCore::WHLSL::Metal::FunctionDefinitionWriter::emitLoop): * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp: (WebCore::WHLSL::ASTDumper::visit): * Modules/webgpu/WHLSL/WHLSLChecker.cpp: (WebCore::WHLSL::Checker::visit): * Modules/webgpu/WHLSL/WHLSLParser.cpp: (WebCore::WHLSL::Parser::parseForLoop): * Modules/webgpu/WHLSL/WHLSLPrepare.cpp: * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt: * Modules/webgpu/WHLSL/WHLSLVisitor.cpp: (WebCore::WHLSL::Visitor::visit): 2019-06-05 Wenson Hsieh Upstream content mode support into open source from WebKitAdditions https://bugs.webkit.org/show_bug.cgi?id=198484 Reviewed by Andy Estes. * Modules/modern-media-controls/media/media-controller.js: (MediaController.prototype.get layoutTraits): Adjust modern media controls code to use iOS-style controls on PLATFORM(IOS_FAMILY), instead of depending on the navigator's platform name or the presence of touch events. * page/Quirks.cpp: (WebCore::shouldSuppressAutocorrectionAndAutocaptializationInHiddenEditableAreasForHost): (WebCore::shouldEmulateUndoRedoInHiddenEditableAreasForHost): * page/SettingsBase.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::mediaControlsScript): 2019-06-05 Saam Barati [WHLSL] checkDuplicateFunctions() should not be O(n^2) https://bugs.webkit.org/show_bug.cgi?id=198155 Reviewed by Myles Maxfield. Originally, we filed this bug because we thought checkDuplicateFunctions() would take on the order of hundreds of milliseconds when using the full standard library. However, I was never able to reproduce that phase taking that long. I was seeing it take 3.5-4ms. Anyways, it makes sense to make this phase not be O(N^2), since the number of functions is a user controlled value. I am now seeing ~2.5ms to run this phase against the full standard library. On a microbenchmark I checked against, where there were 100,000 unique functions, this pass runs twice as fast as it used to, now taking 450ms instead of 900ms. * Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h: (WebCore::WHLSL::AST::ArrayReferenceType::ArrayReferenceType): * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h: * Modules/webgpu/WHLSL/AST/WHLSLPointerType.h: (WebCore::WHLSL::AST::PointerType::PointerType): * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h: * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h: * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h: * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp: (WebCore::WHLSL::DuplicateFunctionKey::DuplicateFunctionKey): (WebCore::WHLSL::DuplicateFunctionKey::isEmptyValue const): (WebCore::WHLSL::DuplicateFunctionKey::isHashTableDeletedValue const): (WebCore::WHLSL::DuplicateFunctionKey::hash const): (WebCore::WHLSL::DuplicateFunctionKey::operator== const): (WebCore::WHLSL::DuplicateFunctionKey::Hash::hash): (WebCore::WHLSL::DuplicateFunctionKey::Hash::equal): (WebCore::WHLSL::DuplicateFunctionKey::Traits::isEmptyValue): (WebCore::WHLSL::checkDuplicateFunctions): 2019-06-05 Zalan Bujtas [LFC][IFC] LineLayout::placeInlineItems should not apply float contraint. https://bugs.webkit.org/show_bug.cgi?id=198565 Reviewed by Antti Koivisto. This patch moves float constraint handling from placeInlineItems() to LineLayout::layout(). When placeInlineItems() is called by the preferred width computation, intruding floats should be ignored since they don't constrain the "min/max lines". * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineFormattingContextLineLayout.cpp: (WebCore::Layout::InlineFormattingContext::LineLayout::LineInput::HorizontalConstraint::HorizontalConstraint): (WebCore::Layout::InlineFormattingContext::LineLayout::LineInput::LineInput): (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const): (WebCore::Layout::InlineFormattingContext::LineLayout::layout const): (WebCore::Layout::constructLine): Deleted. 2019-06-05 Truitt Savell Unreviewed, rolling out r246052. Caused 3 webgpu/ failures. Reverted changeset: "[WHLSL] Parsing and lexing the standard library is slow" https://bugs.webkit.org/show_bug.cgi?id=192890 https://trac.webkit.org/changeset/246052 2019-06-05 Michael Catanzaro [GStreamer] Crash in MediaPlayerPrivateGStreamerBase::ensureGstGLContext https://bugs.webkit.org/show_bug.cgi?id=198567 Reviewed by Philippe Normand. MediaPlayerPrivateGStreamerBase::ensureGstGLContext is currently a guaranteed crash because it expects PlatformDisplay::sharedDisplayForCompositing() to return a PlatformDisplayLibWPE if compiled with USE(WPE_RENDERER), but PlatformDisplayLibWPE has lower precedence than PlatformDisplayX11 and PlatformDisplayWayland. When running our layout tests with run-webkit-tests --gtk, it's guaranteed to be a PlatformDisplayX11. I think Carlos was clearly expecting PlatformDisplayLibWPE, so I don't know what the ideal desired behavior is, but the crashes go away if we change the code to allow any type of PlatformDisplay. This should hopefully fix our bots, which are still exiting early. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext): 2019-06-05 Zalan Bujtas [LFC][IFC] Move inline item height computation to a dedicated function https://bugs.webkit.org/show_bug.cgi?id=198550 Reviewed by Antti Koivisto. The inlineItem height value is not available during preferred width computation (hence optional). * layout/inlineformatting/InlineFormattingContextLineLayout.cpp: (WebCore::Layout::UncommittedContent::add): (WebCore::Layout::inlineItemWidth): (WebCore::Layout::inlineItemHeight): (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const): * layout/inlineformatting/InlineLine.cpp: (WebCore::Layout::Line::appendInlineContainerStart): (WebCore::Layout::Line::appendInlineContainerEnd): (WebCore::Layout::Line::appendTextContent): (WebCore::Layout::Line::appendNonReplacedInlineBox): (WebCore::Layout::Line::appendReplacedInlineBox): * layout/inlineformatting/InlineLine.h: 2019-06-01 Antoine Quint [Pointer Events] Add support for chorded button interactions https://bugs.webkit.org/show_bug.cgi?id=198462 Reviewed by Dean Jackson. Pointer events differ from mouse events in that pressing a button on a mouse and then pressing a second button would yield two "mousedown" events but a single "pointerdown" event, for the first time we're transitioning from a state where no button is pressed at all, and then a "pointermove" event to indicate an additional button has been pressed. This is what the Pointer Events specification calls "chorded button interactions". See https://w3c.github.io/pointerevents/#chorded-button-interactions for the full details. To implement this, we no longer directly call PointerEvent::create() from Element::dispatchMouseEvent() but instead call the new PointerCaptureController::pointerEventForMouseEvent() which implements the required logic to determine for "mousedown" and "mouseup" mouse events, if we're transitioning from or to a state where no button is pressed at all. While that basic change is pretty small, a wider change was required to report the correct value for a PointerEvents' "button" property which should return "-1" when there is no change in pressed button state compared to any previous pointer event. Up until now, MouseEvent.button was an "unsigned short", as specified up to and including DOM Level 2 Events. But the UI Events spec says that property is a "short", and PointerEvent is the only interface where a "-1" value is used. This required some changes throughout our codebase since we used a "-1" value to specify that no button was pressed when dealing with NSEvent input and going through PlatformMouseEvent and eventually MouseEvent. So now we change the various NoButton enum values to be "-2" and use that value, which is not going to be used for any mouse button, as the value reflected as "0" through MouseEvent.button, as specified by UI Events. Furthermore, we identified another issue: MouseEvent.buttons would always return 0 in DRT and WKTR. We rely upon that value in PointerCaptureController::pointerEventForMouseEvent() and so we had to make that work for the relevant WPT test, web-platform-tests/pointerevents/pointerevent_mouse_capture_change_hover.html, to pass and show a correct implementation of chorded button interactions. The details of the work required for this is in Tools/ChangeLog. * dom/Element.cpp: (WebCore::Element::dispatchMouseEvent): * dom/MouseEvent.cpp: (WebCore::MouseEvent::create): (WebCore::MouseEvent::MouseEvent): (WebCore::MouseEvent::initMouseEvent): (WebCore::MouseEvent::initMouseEventQuirk): * dom/MouseEvent.h: (WebCore::MouseEvent::button const): * dom/MouseEvent.idl: * dom/MouseEventInit.h: * dom/MouseEventInit.idl: * dom/PointerEvent.cpp: (WebCore::PointerEvent::create): (WebCore::PointerEvent::PointerEvent): * dom/PointerEvent.h: * loader/NavigationAction.h: * page/PointerCaptureController.cpp: (WebCore::PointerCaptureController::pointerEventForMouseEvent): * page/PointerCaptureController.h: * platform/PlatformMouseEvent.h: 2019-06-05 Michael Catanzaro REGRESSION(r245796): [WPE][GTK] Web process crash on startup https://bugs.webkit.org/show_bug.cgi?id=198485 Reviewed by Chris Dumez. ResourceRequest's PageIdentifier may be unset, which causes coding to fail as ObjectIdentifiers are required to be valid (nonzero). We need to use Optional here. Previously, 0 was used to indicate unset page ID. This is clearer. * platform/network/soup/ResourceRequest.h: (WebCore::ResourceRequest::initiatingPageID const): (WebCore::ResourceRequest::decodeWithPlatformData): * platform/network/soup/ResourceRequestSoup.cpp: (WebCore::ResourceRequest::updateSoupRequest const): 2019-06-04 Ryosuke Niwa iPadOS: Google calendars new event picker moves and flickers in landscape with software keyboard https://bugs.webkit.org/show_bug.cgi?id=198556 Reviewed by Wenson Hsieh. Fix the issuse that it's really hard to create a new event using Google calendar on iPadOS with a software keyboard enabled because tapping on date brings up software keyboard and erratically shifts up/down the new event dialog/pane. Add a site specific quirk to pretend these input elements have inputmode=none for now. No new tests since this is a site specific quirk. * page/Quirks.cpp: (WebCore::Quirks::needsInputModeNoneImplicitly const): 2019-06-04 Zalan Bujtas [ContentChangeObserver] Gmail text editing controls require two taps https://bugs.webkit.org/show_bug.cgi?id=198541 Reviewed by Simon Fraser. When the animation completes we should also check if the newly visible content is also clickable and report it accordingly. When the animated content is not clickable, we need to proceed with click instead of stopping at hover. Test: fast/events/touch/ios/content-observation/100ms-delay-10ms-transition-on-mousemove-no-clickable.html * page/ios/ContentChangeObserver.cpp: (WebCore::isConsideredClickable): (WebCore::ContentChangeObserver::didFinishTransition): (WebCore::ContentChangeObserver::adjustObservedState): (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope): (WebCore::ContentChangeObserver::StyleChangeScope::isConsideredClickable const): Deleted. -> Turn it into a static function so that didFinishTransition could call it as well. * page/ios/ContentChangeObserver.h: 2019-06-04 Michael Catanzaro Fix miscellaneous build warnings https://bugs.webkit.org/show_bug.cgi?id=198544 Reviewed by Don Olmstead. Carefully silence -Wsign-compare warnings. * contentextensions/DFABytecodeCompiler.cpp: (WebCore::ContentExtensions::DFABytecodeCompiler::compile): * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::indexForData): * xml/XSLStyleSheetLibxslt.cpp: (WebCore::XSLStyleSheet::parseString): 2019-06-04 Keith Rollin Fix 64-bit vs 32-bit mismatch in ISOFairPlayStreamingPsshBox.cpp https://bugs.webkit.org/show_bug.cgi?id=198539 Reviewed by Alex Christensen. Both ISOFairPlayStreamingKeyAssetIdBox and ISOFairPlayStreamingKeyContextBox have Vector<> data members. The parse() members of these classes call Vector<>::resize() on these members. In both cases, the type of the parameter passed is a uint64_t. However, resize() takes a size_t. On some platforms, size_t is a 32-bit value, leading to a compile-time type mismatch error. Fix this by changing the type of the value passed to parse() into a size_t. No new tests -- no new functionality. * platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.cpp: (WebCore::ISOFairPlayStreamingKeyAssetIdBox::parse): (WebCore::ISOFairPlayStreamingKeyContextBox::parse): 2019-06-04 Keith Rollin Fix 64-bit vs 32-bit mismatch in TileController.cpp https://bugs.webkit.org/show_bug.cgi?id=198540 Reviewed by Alex Christensen. TileController::blankPixelCountForTiles calculates its result as a uint64_t, but returns it as an unsigned. The former is a 64-bit value, while the latter can be a 32-bit value on some platforms. This mismatch can lead to a compile-time error. Fix this by explicitly casting the 64-bit value to an "unsigned". No new tests -- no new functionality. * platform/graphics/ca/TileController.cpp: (WebCore::TileController::blankPixelCountForTiles): 2019-06-04 Chris Dumez Crash when calling XMLHttpRequest.setRequestHeader() in a worker https://bugs.webkit.org/show_bug.cgi?id=198534 Reviewed by Alex Christensen. Make sure the script execution context is a Document because calling document() to get the settings. Test: fast/workers/worker-xhr-setRequestHeader.html * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::setRequestHeader): 2019-06-04 Antti Koivisto Sticky positioning is jumpy in many overflow cases https://bugs.webkit.org/show_bug.cgi?id=198532 Reviewed by Simon Fraser. Tests: scrollingcoordinator/ios/sticky-overflow-no-stacking-context-no-stick-1.html scrollingcoordinator/ios/sticky-overflow-no-stacking-context-no-stick-2.html scrollingcoordinator/ios/sticky-overflow-no-stacking-context-stick-1.html scrollingcoordinator/ios/sticky-overflow-no-stacking-context-stick-2.html scrollingcoordinator/ios/sticky-overflow-stacking-context-no-stick.html scrollingcoordinator/ios/sticky-overflow-stacking-context-stick.html * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::notifyRelatedNodesAfterScrollPositionChange): (WebCore::ScrollingTree::notifyRelatedNodesRecursive): Simplify for relatedNodeScrollPositionDidChange removal. * page/scrolling/ScrollingTree.h: * page/scrolling/ScrollingTreeNode.cpp: (WebCore::ScrollingTreeNode::relatedNodeScrollPositionDidChange): Deleted. * page/scrolling/ScrollingTreeNode.h: * page/scrolling/cocoa/ScrollingTreeFixedNode.mm: (WebCore::ScrollingTreeFixedNode::applyLayerPositions): * page/scrolling/cocoa/ScrollingTreePositionedNode.h: * page/scrolling/cocoa/ScrollingTreePositionedNode.mm: (WebCore::ScrollingTreePositionedNode::scrollOffsetSinceLastCommit const): Factor into a function. (WebCore::ScrollingTreePositionedNode::applyLayerPositions): (WebCore::ScrollingTreePositionedNode::relatedNodeScrollPositionDidChange): Deleted. We can't bail out based on changed node as that makes us compute different positions based on what the change root is. Since all relatedNodeScrollPositionDidChange functions now always simply call applyLayerPositions we can remove the whole thing. * page/scrolling/cocoa/ScrollingTreeStickyNode.mm: (WebCore::ScrollingTreeStickyNode::applyLayerPositions): Implement taking into account that the containing scroller may not be our ancestor. 2019-06-04 Takashi Komori [WinCairo] Implement cpu and memory measuring functions. https://bugs.webkit.org/show_bug.cgi?id=198466 Reviewed by Don Olmstead. Tests: inspector/memory/tracking.html inspector/cpu-profiler/tracking.html * PlatformWinCairo.cmake: * page/ResourceUsageThread.h: * page/win/ResourceUsageOverlayWin.cpp: Copied from Tools/WebKitTestRunner/InjectedBundle/win/TestRunnerWin.cpp. (WebCore::ResourceUsageOverlay::platformInitialize): (WebCore::ResourceUsageOverlay::platformDestroy): * page/win/ResourceUsageThreadWin.cpp: Added. (WebCore::ResourceUsageThread::platformSaveStateBeforeStarting): (WebCore::fileTimeToUint64): (WebCore::getCurrentCpuTime): (WebCore::cpuUsage): (WebCore::memoryUsage): (WebCore::ResourceUsageThread::platformCollectCPUData): (WebCore::ResourceUsageThread::platformCollectMemoryData): 2019-06-04 Antoine Quint [Pointer Events] Only allow pointer capture if the pointer is in the active buttons state https://bugs.webkit.org/show_bug.cgi?id=198479 Reviewed by Dean Jackson. The Pointer Events specification says that pointer capture can only be engaged provided the pointer is in the active buttons state, which means that it has dispatched a "pointerdown" event more recently than it has a "pointerup" event. This is tested by web-platform-tests/pointerevents/pointerevent_setpointercapture_inactive_button_mouse.html. That test showed a few issues that this patch addresses. First, we would update the pointerIsPressed state to "true" only after a "pointerdown" event had been dispatched. This is incorrect since setPointerCapture() can, and is likely to, be called during handling of a "pointerdown" event. So we now call pointerEventWillBeDispatched() prior to dispatching a PointerEvent with a mouse type, which we only did previously for a PointerEvent with a touch or pen type. If the event is "pointerdown", we set "pointerIsPressed" to true on the CapturingData object matching the given pointer, and to false if the event is "pointerup". Finally, we must also ensure that "pointerIsPressed" is set to true when creating CapturingData for a PointerEvent with a touch or pen type since these types of pointer events implictly set capture. * page/PointerCaptureController.cpp: (WebCore::PointerCaptureController::setPointerCapture): (WebCore::PointerCaptureController::dispatchEvent): (WebCore::PointerCaptureController::pointerEventWillBeDispatched): (WebCore::PointerCaptureController::pointerEventWasDispatched): 2019-06-04 Keith Rollin Fix 32-bit/64-bit mismatch in PointerCaptureController::elementWasRemoved https://bugs.webkit.org/show_bug.cgi?id=198501 Reviewed by Chris Dumez. keyAndValue.key is assigned to pointerId. KeyAndValue.key is a int64_t, whereas pointerId is a PointerID, aka int32_t. This mismatch is normally just a warning, but breaks builds where warnings are treated as errors. This issue is not encountered in most builds because the warning is disabled in the majority of build configurations. But there are some where the warning is not disabled, and so those builds break. Address this conversion error/warning by explicitly casting keyAndValue.key to a PointerID (and adding a debug check to make sure the cast is OK). No new tests -- no new functionality. * page/PointerCaptureController.cpp: (WebCore::PointerCaptureController::elementWasRemoved): 2019-06-02 Antoine Quint [Pointer Events] Expose navigator.maxTouchPoints https://bugs.webkit.org/show_bug.cgi?id=198468 Reviewed by Chris Dumez. Expose the navigator.maxTouchPoints property when Pointer Events are enabled both at compile-time and run-time. We return a canned value for this on iOS touch-enabled devices that matches the number of simultaneous touches supported by the system, which is 5. In fact, iPad support more simultaneous touches, but it doesn't seem worthy to expose this level of granularity due to fingerprinting practices. In practice, what really matters is returning 0, 1 or more than 1 for this value to identify multi-touch support. Test: js/dom/navigator-maxtouchpoints.html * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * dom/NavigatorMaxTouchPoints.idl: Added. * page/Navigator.idl: * page/Navigator.h: (WebCore::Navigator::maxTouchPoints const): 2019-06-04 Zalan Bujtas [LFC][IFC] Decouple float placement and line shrinking https://bugs.webkit.org/show_bug.cgi?id=198528 Reviewed by Antti Koivisto. In LineLayout::placeInlineItems() float handling should be only about shrinking the current line, the actual float placement should happen later when we construct the the display boxes/runs. It enables the preferred width computation to call placeInlineItems() to gather line widths without accidentally mutating the layout context. * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineFormattingContextLineLayout.cpp: (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const): (WebCore::Layout::InlineFormattingContext::LineLayout::layout const): (WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const): (WebCore::Layout::InlineFormattingContext::LineLayout::handleFloat const): Deleted. * layout/inlineformatting/InlineItem.h: 2019-06-04 Zalan Bujtas [LFC][IFC] Add hard line break handling to LineBreaker https://bugs.webkit.org/show_bug.cgi?id=198503 Reviewed by Antti Koivisto. LineBreaker should simply return BreakingContext::Keep with the breaking opportunity of yes. * layout/inlineformatting/InlineFormattingContextLineLayout.cpp: (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const): * layout/inlineformatting/InlineLineBreaker.cpp: (WebCore::Layout::LineBreaker::breakingContext): (WebCore::Layout::LineBreaker::wordBreakingBehavior const): (WebCore::Layout::LineBreaker::isAtBreakingOpportunity): * layout/inlineformatting/InlineLineBreaker.h: 2019-06-04 Zalan Bujtas [LFC][IFC] Remove InlineItem::width https://bugs.webkit.org/show_bug.cgi?id=198502 Reviewed by Antti Koivisto. InlineItems are supposd to work across subsequent layouts (and in preferred width computation as well) so they should not hold on to layout information (run width). This would not work with split runs either. * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineFormattingContextLineLayout.cpp: (WebCore::Layout::UncommittedContent::runs): (WebCore::Layout::UncommittedContent::isEmpty const): (WebCore::Layout::UncommittedContent::size const): (WebCore::Layout::UncommittedContent::add): (WebCore::Layout::UncommittedContent::reset): (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const): (WebCore::Layout::InlineFormattingContext::LineLayout::computedIntrinsicWidth const): (WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const): (): Deleted. (WebCore::Layout::InlineFormattingContext::LineLayout::commitInlineItemToLine const): Deleted. * layout/inlineformatting/InlineItem.h: (WebCore::Layout::InlineItem::style const): (): Deleted. (WebCore::Layout::InlineItem::setWidth): Deleted. (WebCore::Layout::InlineItem::width const): Deleted. 2019-06-04 Zalan Bujtas [LFC][IFC] Move run width measuring out of LineBreaker https://bugs.webkit.org/show_bug.cgi?id=198491 Reviewed by Antti Koivisto. LineBreaker should not need to deal with measuring runs. This is also in preparation for removing InlineItem::width(). * layout/inlineformatting/InlineFormattingContextLineLayout.cpp: (WebCore::Layout::inlineItemWidth): (WebCore::Layout::InlineFormattingContext::LineLayout::placeInlineItems const): (WebCore::Layout::InlineFormattingContext::LineLayout::computedIntrinsicWidth const): * layout/inlineformatting/InlineLineBreaker.cpp: (WebCore::Layout::LineBreaker::breakingContext): (WebCore::Layout::LineBreaker::LineBreaker): Deleted. (WebCore::Layout::LineBreaker::runWidth const): Deleted. (WebCore::Layout::LineBreaker::textWidth const): Deleted. * layout/inlineformatting/InlineLineBreaker.h: 2019-06-04 Zalan Bujtas [LFC][IFC] Remove redundant InlineItem::width() calls. https://bugs.webkit.org/show_bug.cgi?id=198489 Reviewed by Antti Koivisto. This is in preparation for removing InlineItem::width(). * layout/inlineformatting/InlineFormattingContextLineLayout.cpp: (WebCore::Layout::InlineFormattingContext::LineLayout::handleFloat const): (WebCore::Layout::InlineFormattingContext::LineLayout::commitInlineItemToLine const): * layout/inlineformatting/InlineLine.cpp: (WebCore::Layout::Line::appendNonBreakableSpace): (WebCore::Layout::Line::appendInlineContainerStart): (WebCore::Layout::Line::appendInlineContainerEnd): * layout/inlineformatting/InlineLine.h: 2019-06-04 Antoine Quint The "mouseenter" and "pointerenter" events are fired from the bottom up https://bugs.webkit.org/show_bug.cgi?id=198036 Reviewed by Darin Adler. Ensure "mouseenter" and "pointerenter" events are dispatched from the bottom up to match the UI Events spec at https://w3c.github.io/uievents/#events-mouseevent-event-order. We also fix the issue where "pointerevent" and "pointerleave" events were dispatched as bubbling events on iOS which is not correct and was caught by the new iOS test. Tests: pointerevents/ios/enter-leave-order.html pointerevents/mouse/enter-leave-order.html * dom/ios/PointerEventIOS.cpp: (WebCore::typeCanBubble): (WebCore::PointerEvent::PointerEvent): * page/EventHandler.cpp: (WebCore::EventHandler::updateMouseEventTargetNode): * page/PointerCaptureController.cpp: (WebCore::PointerCaptureController::dispatchEventForTouchAtIndex): 2019-06-04 Cathie Chen JS wrapper of target in ResizeObserverEntry/ResizeObserver shouldn't get collected ahead https://bugs.webkit.org/show_bug.cgi?id=197457 Reviewed by Ryosuke Niwa. Add JSCustomMarkFunction to make sure JS wrappers wouldn't be collected when JSResizeObserverEntry live. For ResizeObserver, if targets are removed, it will get fired for the last time. We also need to keep these JS wrappers live. So add these targets to a GCReachableRef list once they're observed. Add element-leak.html to test the targets with `entry.target.myEntry = entry` could be released properly. Tests: resize-observer/element-leak.html resize-observer/resize-observer-entry-keeps-js-wrapper-of-target-alive.html resize-observer/resize-observer-keeps-js-wrapper-of-target-alive.html * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSResizeObserverEntryCustom.cpp: Added. (WebCore::JSResizeObserverEntry::visitAdditionalChildren): * page/ResizeObserver.cpp: (WebCore::ResizeObserver::observe): (WebCore::ResizeObserver::removeAllTargets): (WebCore::ResizeObserver::removeObservation): (WebCore::ResizeObserver::stop): * page/ResizeObserver.h: * page/ResizeObserverEntry.idl: 2019-06-03 Andy Estes [Apple Pay] Disable script injection when canMakePayment APIs are called and return true https://bugs.webkit.org/show_bug.cgi?id=198448 Reviewed by Alex Christensen. Previously, only an active Apple Pay session would disable script injection in restricted WKWebViews. However, this can result in websites rendering non-functional Apple Pay buttons due to the race between the hosting app calling -evaluateJavaScript:completionHandler: and the website calling canMakePayment APIs to determine whether to draw a button. This patch makes it so that, if a website calls ApplePaySession's canMakePayments or canMakePaymentsWithActiveCard, or PaymentRequest's canMakePayment, in a web view that has no injected scripts, and those calls return true, future script injections from the hosting app will be blocked. Also, this patch removes the restrictions on the openPaymentSetup, supportsVersion, and validatedPaymentNetwork APIs, since those APIs do not reveal transaction information and are not used to determine whether to draw buttons. Added new API tests. * Modules/applepay/PaymentCoordinator.cpp: (WebCore::PaymentCoordinator::supportsVersion const): (WebCore::PaymentCoordinator::canMakePayments): (WebCore::PaymentCoordinator::canMakePaymentsWithActiveCard): (WebCore::PaymentCoordinator::openPaymentSetup): (WebCore::PaymentCoordinator::beginPaymentSession): (WebCore::PaymentCoordinator::validatedPaymentNetwork const): (WebCore::PaymentCoordinator::setApplePayIsActiveIfAllowed const): (WebCore::PaymentCoordinator::shouldAllowUserAgentScripts const): (WebCore::PaymentCoordinator::shouldAllowApplePay const): Deleted. * Modules/applepay/PaymentCoordinator.h: * dom/Document.cpp: (WebCore::Document::isApplePayActive const): (WebCore::Document::setApplePayIsActive): (WebCore::Document::hasStartedApplePaySession const): Deleted. (WebCore::Document::setHasStartedApplePaySession): Deleted. * dom/Document.h: * testing/Internals.cpp: (WebCore::Internals::setApplePayIsActive): (WebCore::Internals::setHasStartedApplePaySession): Deleted. * testing/Internals.h: * testing/Internals.idl: 2019-06-03 Robin Morisset [WHLSL] Parsing and lexing the standard library is slow https://bugs.webkit.org/show_bug.cgi?id=192890 Reviewed by Myles Maxfield. The main idea is to avoid backtracking by instead peeking at the next token (and occasionally at the one after that). This implies a few things: - We can replace the stack of tokens by a trivial ring buffer of size 2 (holding the next token and the one after, or WTF::nullopt if we are at the end of the file). - We now have "completeFooExpression" functions, to avoid having to reparse the prefix of some expression, if we find half-way through what it is. I also fixed the following parser bug: - https://bugs.webkit.org/show_bug.cgi?id=198305 [WHLSL] Multiple variables with initializers in a declaration statement crashes the compiler which was due to a mistake I made in the grammar Finally I added two new macros: CONSUME_TYPE and PARSE to eliminate about 500 lines of error propagation boilerplate. There are still lots of ways of improving the parser and lexer, such as: - finishing the conversion of tokens in the lexer, not bothering with allocating string views - make two special tokens Invalid and EOF, to remove the overhead of Optional - make peekTypes and consumeTypes use templates to avoid constructing a Vector and calling find on it. - Turn the entire lexer into a proper automata, not going through the same characters again and again (this is certainly the largest win by far) - Remove the last few pieces of backtracking from the parser. The current patch is already enough to make parsing the full standard library (something like 85k lines) approximately 260ms. This is still longer than I would like, but nowhere near the bottleneck any longer because of some other parts of the compiler. * Modules/webgpu/WHLSL/WHLSLLexer.h: (WebCore::WHLSL::Lexer::Lexer): (WebCore::WHLSL::Lexer::consumeToken): (WebCore::WHLSL::Lexer::peek): (WebCore::WHLSL::Lexer::peekFurther): (WebCore::WHLSL::Lexer::state const): (WebCore::WHLSL::Lexer::setState): (WebCore::WHLSL::Lexer::unconsumeToken): Deleted. * Modules/webgpu/WHLSL/WHLSLParser.cpp: (WebCore::WHLSL::Parser::parse): (WebCore::WHLSL::Parser::peek): (WebCore::WHLSL::Parser::peekTypes): (WebCore::WHLSL::Parser::tryType): (WebCore::WHLSL::Parser::tryTypes): (WebCore::WHLSL::Parser::consumeTypes): (WebCore::WHLSL::Parser::parseConstantExpression): (WebCore::WHLSL::Parser::parseTypeArgument): (WebCore::WHLSL::Parser::parseTypeArguments): (WebCore::WHLSL::Parser::parseTypeSuffixAbbreviated): (WebCore::WHLSL::Parser::parseTypeSuffixNonAbbreviated): (WebCore::WHLSL::Parser::parseType): (WebCore::WHLSL::Parser::parseTypeDefinition): (WebCore::WHLSL::Parser::parseResourceSemantic): (WebCore::WHLSL::Parser::parseSpecializationConstantSemantic): (WebCore::WHLSL::Parser::parseStageInOutSemantic): (WebCore::WHLSL::Parser::parseSemantic): (WebCore::WHLSL::Parser::parseQualifiers): (WebCore::WHLSL::Parser::parseStructureElement): (WebCore::WHLSL::Parser::parseStructureDefinition): (WebCore::WHLSL::Parser::parseEnumerationDefinition): (WebCore::WHLSL::Parser::parseEnumerationMember): (WebCore::WHLSL::Parser::parseNativeTypeDeclaration): (WebCore::WHLSL::Parser::parseNumThreadsFunctionAttribute): (WebCore::WHLSL::Parser::parseAttributeBlock): (WebCore::WHLSL::Parser::parseParameter): (WebCore::WHLSL::Parser::parseParameters): (WebCore::WHLSL::Parser::parseFunctionDefinition): (WebCore::WHLSL::Parser::parseComputeFunctionDeclaration): (WebCore::WHLSL::Parser::parseVertexFragmentFunctionDeclaration): (WebCore::WHLSL::Parser::parseRegularFunctionDeclaration): (WebCore::WHLSL::Parser::parseOperatorFunctionDeclaration): (WebCore::WHLSL::Parser::parseFunctionDeclaration): (WebCore::WHLSL::Parser::parseNativeFunctionDeclaration): (WebCore::WHLSL::Parser::parseBlock): (WebCore::WHLSL::Parser::parseBlockBody): (WebCore::WHLSL::Parser::parseIfStatement): (WebCore::WHLSL::Parser::parseSwitchStatement): (WebCore::WHLSL::Parser::parseSwitchCase): (WebCore::WHLSL::Parser::parseForLoop): (WebCore::WHLSL::Parser::parseWhileLoop): (WebCore::WHLSL::Parser::parseDoWhileLoop): (WebCore::WHLSL::Parser::parseVariableDeclaration): (WebCore::WHLSL::Parser::parseVariableDeclarations): (WebCore::WHLSL::Parser::parseStatement): (WebCore::WHLSL::Parser::parseEffectfulExpression): (WebCore::WHLSL::Parser::parseEffectfulAssignment): (WebCore::WHLSL::Parser::parseExpression): (WebCore::WHLSL::Parser::parseTernaryConditional): (WebCore::WHLSL::Parser::completeTernaryConditional): (WebCore::WHLSL::Parser::parseAssignment): (WebCore::WHLSL::Parser::completeAssignment): (WebCore::WHLSL::Parser::parsePossibleTernaryConditional): (WebCore::WHLSL::Parser::parsePossibleLogicalBinaryOperation): (WebCore::WHLSL::Parser::completePossibleLogicalBinaryOperation): (WebCore::WHLSL::Parser::parsePossibleRelationalBinaryOperation): (WebCore::WHLSL::Parser::completePossibleRelationalBinaryOperation): (WebCore::WHLSL::Parser::parsePossibleShift): (WebCore::WHLSL::Parser::completePossibleShift): (WebCore::WHLSL::Parser::parsePossibleAdd): (WebCore::WHLSL::Parser::completePossibleAdd): (WebCore::WHLSL::Parser::parsePossibleMultiply): (WebCore::WHLSL::Parser::completePossibleMultiply): (WebCore::WHLSL::Parser::parsePossiblePrefix): (WebCore::WHLSL::Parser::parsePossibleSuffix): (WebCore::WHLSL::Parser::parseCallExpression): (WebCore::WHLSL::Parser::parseTerm): (WebCore::WHLSL::Parser::parseAddressSpaceType): Deleted. (WebCore::WHLSL::Parser::parseNonAddressSpaceType): Deleted. (WebCore::WHLSL::Parser::parseEntryPointFunctionDeclaration): Deleted. (WebCore::WHLSL::Parser::parseEffectfulPrefix): Deleted. (WebCore::WHLSL::Parser::parseEffectfulSuffix): Deleted. * Modules/webgpu/WHLSL/WHLSLParser.h: (WebCore::WHLSL::Parser::Error::dump const): 2019-06-03 Youenn Fablet Allow resizing of camera video feeds to very small resolutions https://bugs.webkit.org/show_bug.cgi?id=198421 Reviewed by Alex Christensen. Before the patch, the minimum capture resolution was set to 120. Since this is a bit arbitrary and there are some use cases for lower resolution, We now allow down to 1x1 resolution. Test: fast/mediastream/getUserMedia-video-rescaling.html * platform/mediastream/RealtimeVideoSource.cpp: (WebCore::RealtimeVideoSource::updateCapabilities): Allow 1x1 when computing min/max resolutions. (WebCore::RealtimeVideoSource::bestSupportedSizeAndFrameRate): In case width and height are provided, we pick the closest preset that matches and resize accordingly. If width or height is provided, we pick the closest preset tat matches and applies its aspect ratio. 2019-06-03 Wenson Hsieh Implement an internal switch to turn idempotent text autosizing and viewport rules off https://bugs.webkit.org/show_bug.cgi?id=198460 Reviewed by Tim Horton. Add a new WebCore setting for viewport shrink-to-fit-content heuristics; additionally, tweak the existing idempotent text autosizing setting to default to false (this is overridden by preferences at the WebKit layer). * page/Settings.yaml: 2019-06-03 Rob Buis Implement imagesrcset and imagesizes attributes on link rel=preload https://bugs.webkit.org/show_bug.cgi?id=192950 Reviewed by Youenn Fablet. Implement imagesrcset and imagesizes attributes for both Link header and link element. Tests: imported/w3c/web-platform-tests/preload/dynamic-adding-preload-imagesrcset.html imported/w3c/web-platform-tests/preload/link-header-preload-imagesrcset.html imported/w3c/web-platform-tests/preload/link-header-preload-nonce.html imported/w3c/web-platform-tests/preload/link-header-preload.html imported/w3c/web-platform-tests/preload/onload-event.html imported/w3c/web-platform-tests/preload/preload-with-type.html * html/HTMLAttributeNames.in: * html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::process): * html/HTMLLinkElement.idl: * loader/LinkHeader.cpp: (WebCore::paramterNameFromString): (WebCore::LinkHeader::setValue): (WebCore::LinkHeader::LinkHeader): * loader/LinkHeader.h: (WebCore::LinkHeader::imageSrcSet const): (WebCore::LinkHeader::imageSizes const): (WebCore::LinkHeader::isViewportDependent const): * loader/LinkLoader.cpp: (WebCore::LinkLoader::loadLinksFromHeader): (WebCore::LinkLoader::preloadIfNeeded): (WebCore::LinkLoader::loadLink): * loader/LinkLoader.h: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::linkPreloadResponsiveImagesEnabled const): (WebCore::RuntimeEnabledFeatures::setLinkPreloadResponsiveImagesEnabled): 2019-06-02 Andy Estes Memory-cached main resources continue to load after the client decides a content policy of PolicyAction::Download https://bugs.webkit.org/show_bug.cgi?id=198469 Reviewed by Youenn Fablet. When a document is loaded from the memory cache it does not have a main resource loader, but DocumentLoader::continueAfterContentPolicy relies on being able to call ResourceLoader::didFail on the main resource loader to cancel the provisional navigation when the client decides a content policy of PolicyAction::Download. This means that memory-cached main resources continue to load even after WebKit has started to download the main resource. The expected behavior is for the provisional navigation to fail once the download starts, like what happens when there is a main resource loader. This patch teaches DocumentLoader::continueAfterContentPolicy to call stopLoadingForPolicyChange() in the case of a null main resource loader. This will dispatch didFailProvisionalNavigation and remove the DocumentLoader as a client of its CachedRawResource to prevent it from delivering any cached data. Added a new API test. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::continueAfterContentPolicy): 2019-06-03 Timothy Hatcher Tweak the text and underline color for data detected text. https://bugs.webkit.org/show_bug.cgi?id=198487 rdar://problem/50667125 Reviewed by Devin Rousso. Tests: Color.RGBToHSL API tests * editing/cocoa/DataDetection.mm: (WebCore::DataDetection::detectContentInRange): Use currentcolor so semantic text colors work. Force the lightness of the underline color to the middle, and multiply the alpha by 38%, so the color will appear on light and dark backgrounds, since only one color can be specified. * platform/graphics/Color.cpp: (WebCore::Color::getHSL const): Return hue in [0...6) range to easily round-trip with makeRGBAFromHSLA(). 2019-06-03 Don Olmstead [CMake] Add WebKit::JavaScriptCore target https://bugs.webkit.org/show_bug.cgi?id=198403 Reviewed by Konstantin Tokarev. Use the WebKit::JavaScriptCore target. * CMakeLists.txt: 2019-06-03 Zan Dobersek [Nicosia] Disable async scrolling until implemented https://bugs.webkit.org/show_bug.cgi?id=198476 Unreviewed follow-up to r246033. * page/scrolling/ScrollingCoordinator.cpp: Expand the PLATFORM(IOS) guard to IOS_FAMILY. 2019-06-03 Darin Adler Finish cleanup of String::number for floating point https://bugs.webkit.org/show_bug.cgi?id=198471 Reviewed by Yusuke Suzuki. * css/CSSCursorImageValue.cpp: (WebCore::CSSCursorImageValue::customCSSText const): Use makeString instead of StringBuilder since it is more terse and possibly more efficient as well. * css/DOMMatrixReadOnly.cpp: (WebCore::DOMMatrixReadOnly::toString const): Ditto. * css/WebKitCSSMatrix.cpp: (WebCore::WebKitCSSMatrix::toString const): Ditto. * html/parser/HTMLParserIdioms.cpp: (WebCore::serializeForNumberType): Use String::number instead of String::numberToStringECMAScript since that is now the default. * html/shadow/MediaControlElementTypes.cpp: (WebCore::MediaControlVolumeSliderElement::setVolume): Ditto. * html/shadow/MediaControlElements.cpp: (WebCore::MediaControlTimelineElement::setPosition): Ditto. * platform/Decimal.cpp: (WebCore::Decimal::fromDouble): Ditto. * rendering/RenderListMarker.cpp: (WebCore::toRoman): Return a String instead of taking a StringBuilder argument. Use LetterCase enum instead of bool for the uppercase vs. lowercase argument, to be less mysterious at call sites. Use unsigned for string lengths since that's what WTF::String uses. (WebCore::toAlphabeticOrNumeric): Ditto. Also updated since SequenceType is now an enum class. (WebCore::toSymbolic): Use String::createUninitialized instead of StringBuilder. Return a String instead of taking a StringBuilder argument. Straighten out the algorithm so it's easier to understand. (WebCore::toAlphabetic): Updated since SequenceType is now an enum class. (WebCore::toNumeric): Ditto. (WebCore::toHebrew): Return a String instead of taking a StringBuilder argument. Use unsigned for string lengths since that's what WTF::String uses. (WebCore::toArmenianUnder10000): Use unsigned and the LetterCase enum class. (WebCore::toArmenian): Return a String instead of taking a StringBuilder argument. Also use unsigned for string lengths since that's what WTF::String uses. (WebCore::toGeorgian): Ditto. (WebCore::toCJKIdeographic): Ditto. (WebCore::listMarkerSuffix): Tweaked a comment. (WebCore::listMarkerText): Use String return values instead of StringBuilder. (WebCore::RenderListMarker::paint): Use String::createUninitialized instead of StringBuilder since it's a bit more efficient. Use makeString instead of turning single characters into strings since that's more efficient. * svg/SVGPathUtilities.cpp: (WebCore::buildStringFromPath): Use appendNumber instead of appendShortestFormNumber since that is now the default. 2019-06-03 Zan Dobersek [Nicosia] Disable async scrolling until implemented https://bugs.webkit.org/show_bug.cgi?id=198476 Reviewed by Antti Koivisto. Build ScrollingCoordinator::create() method on iOS or whenever ASYNC_SCROLLING is not enabled. Additionally, the USE(COORDINATED_GRAPHICS) build guards are removed throughout the async scrolling classes as they aren't required now and shouldn't be in the future. * page/scrolling/ScrollingCoordinator.cpp: * page/scrolling/ScrollingStateFixedNode.cpp: * page/scrolling/ScrollingStateFixedNode.h: * page/scrolling/ScrollingStateFrameHostingNode.cpp: * page/scrolling/ScrollingStateFrameHostingNode.h: * page/scrolling/ScrollingStateFrameScrollingNode.cpp: * page/scrolling/ScrollingStateFrameScrollingNode.h: * page/scrolling/ScrollingStateNode.cpp: * page/scrolling/ScrollingStateNode.h: * page/scrolling/ScrollingStateOverflowScrollingNode.cpp: * page/scrolling/ScrollingStateOverflowScrollingNode.h: * page/scrolling/ScrollingStatePositionedNode.cpp: * page/scrolling/ScrollingStatePositionedNode.h: * page/scrolling/ScrollingStateScrollingNode.cpp: * page/scrolling/ScrollingStateScrollingNode.h: * page/scrolling/ScrollingStateStickyNode.cpp: * page/scrolling/ScrollingStateStickyNode.h: * page/scrolling/ScrollingStateTree.cpp: * page/scrolling/ScrollingStateTree.h: 2019-06-03 Antoine Quint [Pointer Events] Check that capturing data managed by the PointerCaptureController gets cleared upon navigation https://bugs.webkit.org/show_bug.cgi?id=198191 Unreviewed post-commit review feedback suggested by Darin Adler. * page/PointerCaptureController.cpp: (WebCore::PointerCaptureController::reset): 2019-06-01 Simon Fraser [Async overflow scroll] Flashing content when scrolling async overflow with a negative z-index child https://bugs.webkit.org/show_bug.cgi?id=198458 Reviewed by Dean Jackson. Set the GraphicsLayerPaintOverflowContents phase on the foreground layer in a composited overflow scroller, which prevents clipping to the visible region, fixing scrolling flashes. Tested by compositing/overflow/stacking-context-composited-scroller-with-foreground-paint-phases.html * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updatePaintingPhases): 2019-06-01 Simon Fraser Async overflow scroll on iOS paints slowly if it has a negative z-index child https://bugs.webkit.org/show_bug.cgi?id=196508 rdar://problem/49532709 Reviewed by Dean Jackson. If a RenderLayerBacking had a foreground layer and a scrolled contents layer, every geometry update would change the size and offsetFromRenderer of the foreground layer between two states, triggering repaint. Fix by updating the fore- and background-layers last (nothing elese has dependencies on their geometry), and using GraphicsLayer::DontSetNeedsDisplay as we do for the scrolled contents layer. The test also revealed a bug where the shapeMaskLayer would get incorrect geometry when scrollbars were visible, because it would be squished by setting the wrong bounds, so fix that. Test: compositing/repaint/scroller-with-foreground-layer-repaints.html * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::updateClippingStrategy): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateGeometry): 2019-06-01 Simon Fraser Non-composited negative z-order children should not trigger creation of a foreground layer https://bugs.webkit.org/show_bug.cgi?id=198455 Reviewed by Sam Weinig. The existing code triggered creation of a foreground layer on RenderLayerBacking when the negative z-order list was non-empty. This isn't necessary; we can paint the negative z-order children just fine. We only need a foreground layer when the negative z-order layers are composited or have composited descendants. This will reduce backing store memory use in some cases. Test: compositing/layer-creation/composited-negative-z-subtree.html * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::computeCompositingRequirements): (WebCore::RenderLayerCompositor::updateBackingAndHierarchy): (WebCore::RenderLayerCompositor::needsContentsCompositingLayer const): 2019-06-01 Andy Estes [Apple Pay] Every PaymentCoordinator client should explicitly decide whether they support unrestricted Apple Pay https://bugs.webkit.org/show_bug.cgi?id=198449 Reviewed by Wenson Hsieh. Rather than having a default return value of true for PaymentCoordinatorClient::supportsUnrestrictedApplePay, make it pure virtual to force each subclass to implement an override and explicitly choose an appropriate return value. The only two clients that did not explicitly override were the empty client and WebKitLegacy's client, and Apple Pay was never enabled in those clients, so there is no change in behavior. * Modules/applepay/PaymentCoordinatorClient.h: (WebCore::PaymentCoordinatorClient::isAlwaysOnLoggingAllowed const): (WebCore::PaymentCoordinatorClient::supportsUnrestrictedApplePay const): Deleted. * loader/EmptyClients.cpp: 2019-05-31 Youenn Fablet Add an option to mute audio capture automatically when page is not visible https://bugs.webkit.org/show_bug.cgi?id=198307 Reviewed by Eric Carlson. Reuse video capture mechanism for audio capture. In case document gets in the background, interrupt the audio track if the audio factory requires it. CoreAudioCaptureSourceIOS requires the audio source be interrupted if the app has not the right background mode. It also allows interrupting the audio capture based on a runtime flag. Add a runtime flag to control this. Internals API is used to set it for test purposes, off by default. For regular cases, the runtime flag is set through web preferences. Test: platform/ios/mediastream/audio-muted-in-background-tab.html * dom/Document.cpp: (WebCore::Document::notifyMediaCaptureOfVisibilityChanged): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::interruptAudioOnPageVisibilityChangeEnabled const): (WebCore::RuntimeEnabledFeatures::setInterruptAudioOnPageVisibilityChangeEnabled): * platform/mediastream/RealtimeMediaSourceCenter.cpp: (WebCore::RealtimeMediaSourceCenter::RealtimeMediaSourceCenter): (WebCore::RealtimeMediaSourceCenter::initializeShouldInterruptAudioOnPageVisibilityChange): (WebCore::RealtimeMediaSourceCenter::setCapturePageState): (WebCore::RealtimeMediaSourceCenter::visibilityDidChange): * platform/mediastream/RealtimeMediaSourceCenter.h: (WebCore::RealtimeMediaSourceCenter::shouldInterruptAudioOnPageVisibilityChange): * platform/mediastream/RealtimeMediaSourceFactory.h: (WebCore::AudioCaptureFactory::setAudioCapturePageState): (WebCore::VideoCaptureFactory::setVideoCapturePageState): * platform/mediastream/ios/CoreAudioCaptureSourceIOS.h: * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm: (WebCore::CoreAudioCaptureSourceFactory::setAudioCapturePageState): (WebCore::CoreAudioCaptureSourceFactoryIOS::shouldInterruptAudioOnPageVisibilityChange): * platform/mediastream/mac/CoreAudioCaptureSource.h: * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp: (WebCore::RealtimeMediaSourceCenter::initializeShouldInterruptAudioOnPageVisibilityChange): * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): (WebCore::Internals::setShouldInterruptAudioOnPageVisibilityChange): * testing/Internals.h: * testing/Internals.idl: 2019-05-31 Geoffrey Garen Some WeakPtr typedef cleanup https://bugs.webkit.org/show_bug.cgi?id=198431 Reviewed by Chris Dumez. Use "using" instead of "typedef", since using is preferred in C++ for better compatibility with templates. * Modules/indexeddb/shared/InProcessIDBServer.h: * html/HTMLMediaElement.h: * platform/ScrollView.h: 2019-05-31 Andres Gonzalez Inserting a newline in contenteditable causes two characters to be added instead of one https://bugs.webkit.org/show_bug.cgi?id=197894 Reviewed by Chris Fleizach. No new test is necessary since this is a comment change. Removed radar reference from code. * editing/Editing.cpp: (WebCore::visiblePositionForIndexUsingCharacterIterator): 2019-05-31 Tim Horton Optionally respect device management restrictions when loading from the network https://bugs.webkit.org/show_bug.cgi?id=198318 Reviewed by Alex Christensen. * en.lproj/Localizable.strings: 2019-05-31 Simon Fraser Move code that sets compositing paint phases into a single function https://bugs.webkit.org/show_bug.cgi?id=198420 Reviewed by Zalan Bujtas. To compute the correct paint phases for the various GraphicsLayers in a RenderLayerBacking, we have to know which set of layers we've created (m_scrollContainerLayer, m_foregroundLayer etc). So move the code that sets phases into a single function which is called when that set of layers changes. The test dumps paint phases for a stacking-context-composited scroller with a negative z-index child. Also have GraphicsLayer::setPaintingPhase() trigger the necessary repaint when the paint phase changes. Test: compositing/overflow/stacking-context-composited-scroller-with-foreground-paint-phases.html * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::setPaintingPhase): * platform/graphics/GraphicsLayer.h: (WebCore::GraphicsLayer::setPaintingPhase): Deleted. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateConfiguration): (WebCore::RenderLayerBacking::updateForegroundLayer): (WebCore::RenderLayerBacking::updateBackgroundLayer): (WebCore::RenderLayerBacking::updateMaskingLayer): (WebCore::RenderLayerBacking::updateScrollingLayers): (WebCore::RenderLayerBacking::updatePaintingPhases): (WebCore::RenderLayerBacking::paintingPhaseForPrimaryLayer const): Deleted. * rendering/RenderLayerBacking.h: 2019-05-31 Saam Barati [WHLSL] Make sure we properly emit code for "&*x" https://bugs.webkit.org/show_bug.cgi?id=198198 Reviewed by Myles C. Maxfield. I ran into this when trying to test zero-filling code, so let's just fix it. The issue is that the property resolver ends up emitting code that looks like "&*x". The semantics of this are such that it should result in just x. However, we emitted Metal code in such a way where we'd end up with a pointer to a temporary value. To fix this, DereferenceExpression will emit code that results in a reference type. Then, MakePointerExpression will correctly return the pointer backing that reference type. Because of this, we also no longer need to pattern match the lhs of assignment expressions since we will now be assigning to a reference type. Test: webgpu/whlsl-store-to-property-updates-properly.html * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp: (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit): 2019-05-31 Simon Fraser [Async overflow scrolling] Flashes of missing layer backing store when scrolling an overflow https://bugs.webkit.org/show_bug.cgi?id=198363 Reviewed by Tim Horton. When the contents of an overflow:scroll did not use a tiled backing layer, GraphicsLayerCA::adjustCoverageRect() would do no coverage rect expansion for scrolling, which meant that backing store attachment for descendant layers would just use the visible rect from their scrolling ancestor which made it easy to scroll into view a layer whose backing store was not yet attached. Since this only affects non-tiled layers, re-use the generic TileController::adjustTileCoverageRect() code by moving it down to GraphicsLayer, and call it for a scrolled contents layer which does not have tiled backing. Tested by fast/scrolling/ios/reconcile-layer-position-recursive.html * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::adjustCoverageRectForMovement): * platform/graphics/GraphicsLayer.h: * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::adjustCoverageRect const): * platform/graphics/ca/TileController.cpp: (WebCore::TileController::adjustTileCoverageRect): 2019-05-31 Geoffrey Garen Some WeakPtr cleanup https://bugs.webkit.org/show_bug.cgi?id=198390 Reviewed by Chris Dumez. * Modules/indexeddb/shared/InProcessIDBServer.cpp: (WebCore::storageQuotaManagerGetter): Dereference the weak pointer directly instead of using a weak pointer to guard a raw pointer. It's safer and more idiomatic to use weak pointers directly. * Modules/indexeddb/shared/InProcessIDBServer.h: Use our base clase weakPtrFactory() definition instead of writing our own. Declare WeakValueType so we can dereference the weak pointer we create (above). 2019-05-31 Zalan Bujtas [LFC][IFC] InlineFormattingContext::LineLayout::processInlineItemsForLine should create and destroy Line. https://bugs.webkit.org/show_bug.cgi?id=198419 Reviewed by Antti Koivisto. This is in preparation for using "createInlineRunsForLine" logic when computing preferred width. 1. Line object is now constructed and destroyed in processInlineItemsForLine (caller does not need to know about Line). 2. processInlineItemsForLine returns a Line::Content instance. * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineFormattingContextLineLayout.cpp: (WebCore::Layout::InlineFormattingContext::LineLayout::LineInput::LineInput): (WebCore::Layout::constructLine): (WebCore::Layout::InlineFormattingContext::LineLayout::processInlineItemsForLine const): (WebCore::Layout::InlineFormattingContext::LineLayout::layout const): (WebCore::Layout::InlineFormattingContext::LineLayout::createDisplayRuns const): (WebCore::Layout::InlineFormattingContext::LineLayout::createLine const): Deleted. (WebCore::Layout::InlineFormattingContext::LineLayout::createInlineRunsForLine const): Deleted. (WebCore::Layout::InlineFormattingContext::LineLayout::processInlineRuns const): Deleted. 2019-05-31 Don Olmstead [CMake] Add WebKit::WTF target https://bugs.webkit.org/show_bug.cgi?id=198400 Reviewed by Konstantin Tokarev. Use the WebKit::WTF target. * PlatformWin.cmake: 2019-05-31 Joonghun Park Always min-width should win over max-width. https://bugs.webkit.org/show_bug.cgi?id=198032 Reviewed by Darin Adler. In the spec, https://www.w3.org/TR/CSS21/visudet.html#min-max-widths, the following algorithm describes how the two properties influence the used value of the 'width' property. 1. The tentative used width is calculated (without 'min-width' and 'max-width') following the rules under "Calculating widths and margins" above. 2. If the tentative used width is greater than 'max-width', the rules above are applied again, but this time using the computed value of 'max-width' as the computed value for 'width'. 3. If the resulting width is smaller than 'min-width', the rules above are applied again, but this time using the value of 'min-width' as the computed value for 'width'. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::computePreferredLogicalWidths): 2019-05-31 Ryan Haddad Unreviewed, rolling out r245946. Breaks the watchOS build. Reverted changeset: "Add an option to mute audio capture automatically when page is not visible" https://bugs.webkit.org/show_bug.cgi?id=198307 https://trac.webkit.org/changeset/245946 2019-05-31 Zalan Bujtas [LFC[IFC] Do not reuse the same Line object. https://bugs.webkit.org/show_bug.cgi?id=198366 Reviewed by Antti Koivisto. This is in preparation for constructing Line inside createInlineRunsForLine and return Line::Content. * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineFormattingContextLineLayout.cpp: (WebCore::Layout::InlineFormattingContext::LineLayout::createLine const): (WebCore::Layout::InlineFormattingContext::LineLayout::layout const): (WebCore::Layout::InlineFormattingContext::LineLayout::processInlineRuns const): (WebCore::Layout::InlineFormattingContext::LineLayout::initializeLine const): Deleted. * layout/inlineformatting/InlineLine.cpp: (WebCore::Layout::Line::Line): (WebCore::Layout::m_lineLogicalWidth): (WebCore::Layout::Line::close): (WebCore::Layout::Line::moveLogicalLeft): (WebCore::Layout::Line::appendNonBreakableSpace): (WebCore::Layout::Line::appendTextContent): (WebCore::Layout::Line::appendNonReplacedInlineBox): (WebCore::Layout::Line::appendHardLineBreak): (WebCore::Layout::Line::reset): Deleted. * layout/inlineformatting/InlineLine.h: (WebCore::Layout::Line::hasContent const): 2019-05-31 Zalan Bujtas [LFC][IFC] Move final runs to a dedicated class (Line::Content) https://bugs.webkit.org/show_bug.cgi?id=198360 Reviewed by Antti Koivisto. It decouples the line and the final line content. So when we process the runs after closing the line, LineContent should be able to answer all the content and geometry related questions. This is also in preparation for transfering the ownership of the line content when calling Line::close(). * WebCore.xcodeproj/project.pbxproj: * layout/inlineformatting/InlineFormattingContextLineLayout.cpp: (WebCore::Layout::InlineFormattingContext::LineLayout::processInlineRuns const): * layout/inlineformatting/InlineLine.cpp: (WebCore::Layout::Line::Content::isVisuallyEmpty const): (WebCore::Layout::Line::Content::Run::Run): (WebCore::Layout::Line::reset): (WebCore::Layout::Line::close): (WebCore::Layout::Line::moveLogicalLeft): (WebCore::Layout::Line::appendNonBreakableSpace): (WebCore::Layout::Line::appendTextContent): (WebCore::Layout::Line::appendNonReplacedInlineBox): (WebCore::Layout::Line::appendHardLineBreak): (WebCore::Layout::Line::LineItem::LineItem): Deleted. (WebCore::Layout::Line::hasContent const): Deleted. * layout/inlineformatting/InlineLine.h: (WebCore::Layout::Line::Content::runs const): (WebCore::Layout::Line::Content::isEmpty const): (WebCore::Layout::Line::Content::logicalTop const): (WebCore::Layout::Line::Content::logicalLeft const): (WebCore::Layout::Line::Content::logicalRight const): (WebCore::Layout::Line::Content::logicalBottom const): (WebCore::Layout::Line::Content::logicalWidth const): (WebCore::Layout::Line::Content::logicalHeight const): (WebCore::Layout::Line::Content::setLogicalRect): (WebCore::Layout::Line::Content::runs): (WebCore::Layout::Line::hasContent const): (WebCore::Layout::Line::availableWidth const): (WebCore::Layout::Line::contentLogicalRight const): (WebCore::Layout::Line::logicalTop const): (WebCore::Layout::Line::logicalBottom const): (WebCore::Layout::Line::logicalLeft const): (WebCore::Layout::Line::logicalRight const): (WebCore::Layout::Line::logicalWidth const): (WebCore::Layout::Line::logicalHeight const): (WebCore::Layout::Line::contentLogicalWidth const): * page/FrameViewLayoutContext.cpp: (WebCore::layoutUsingFormattingContext): 2019-05-31 Joonghun Park Unreviewed. Fix typo of |ComputedStyleExtractor::valueForPropertyInStyle| to follow camel case function naming style. No behavioral changes. * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::getKeyframes): * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): Deleted. * css/CSSComputedStyleDeclaration.h: * rendering/style/RenderStyle.cpp: (WebCore::changedCustomPaintWatchedProperty): 2019-05-31 Ali Juma REGRESSION (r245396): Page load time performance regression https://bugs.webkit.org/show_bug.cgi?id=198382 Reviewed by Simon Fraser. Delay the scheduling of a rendering update by 500ms when a new IntersectionObserver target is added during page load. This addresses a page load time regression from r245396, which immediately scheduled a rendering update when a target is added. Note that even with this change, if anything else triggers a rendering update before the 500ms delay expires, intersection observations will be updated during that rendering update. Covered by intersection-observer/initial-observation.html * dom/Document.cpp: (WebCore::Document::updateIntersectionObservations): (WebCore::Document::scheduleInitialIntersectionObservationUpdate): * dom/Document.h: * page/IntersectionObserver.cpp: (WebCore::IntersectionObserver::observe): 2019-05-30 Zan Dobersek Unreviewed. Suppress -Wunused-variable warnings for the unused static mousePointerID variable by making it a constexpr. * platform/PointerID.h: 2019-05-30 Simon Fraser Use an OptionSet<> for GraphicsLayerPaintingPhase https://bugs.webkit.org/show_bug.cgi?id=198404 Reviewed by Tim Horton. Replace GraphicsLayerPaintingPhase with OptionSet. No behavior change. * page/PageOverlayController.cpp: (WebCore::PageOverlayController::setPageOverlayNeedsDisplay): (WebCore::PageOverlayController::paintContents): (WebCore::PageOverlayController::notifyFlushRequired): * page/PageOverlayController.h: * page/linux/ResourceUsageOverlayLinux.cpp: * page/mac/ServicesOverlayController.h: * page/mac/ServicesOverlayController.mm: (WebCore::ServicesOverlayController::Highlight::paintContents): * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::dumpProperties const): * platform/graphics/GraphicsLayer.h: (WebCore::GraphicsLayer::paintingPhase const): (WebCore::GraphicsLayer::setPaintingPhase): * platform/graphics/GraphicsLayerClient.h: (WebCore::GraphicsLayerClient::paintContents): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateForegroundLayer): (WebCore::RenderLayerBacking::updateBackgroundLayer): (WebCore::RenderLayerBacking::updateMaskingLayer): (WebCore::RenderLayerBacking::updateChildClippingStrategy): (WebCore::RenderLayerBacking::updateScrollingLayers): (WebCore::RenderLayerBacking::paintingPhaseForPrimaryLayer const): (WebCore::RenderLayerBacking::paintIntoLayer): (WebCore::RenderLayerBacking::paintContents): * rendering/RenderLayerBacking.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::paintContents): * rendering/RenderLayerCompositor.h: 2019-05-30 Youenn Fablet Fix AVVideoCaptureSource::setFrameRateWithPreset logging https://bugs.webkit.org/show_bug.cgi?id=198392 Reviewed by Eric Carlson. Move logging from setFrameRateWithPreset to setSessionSizeAndFrameRate which does the actual job. This ensures to not log in case of preset being null. No change of behavior. * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::setFrameRateWithPreset): (WebCore::AVVideoCaptureSource::setSessionSizeAndFrameRate): 2019-05-30 Jer Noble Video playback in Safari should continue when CarPlay is plugged in https://bugs.webkit.org/show_bug.cgi?id=198345 Reviewed by Eric Carlson. Test: media/video-isplayingtoautomotiveheadunit.html * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction const): * platform/audio/PlatformMediaSessionManager.cpp: (WebCore::PlatformMediaSessionManager::setIsPlayingToAutomotiveHeadUnit): * platform/audio/PlatformMediaSessionManager.h: (WebCore::PlatformMediaSessionManager::isPlayingToAutomotiveHeadUnit const): * platform/audio/ios/MediaSessionManagerIOS.h: * platform/audio/ios/MediaSessionManagerIOS.mm: (WebCore::MediaSessionManageriOS::MediaSessionManageriOS): (WebCore::MediaSessionManageriOS::carPlayServerDied): (WebCore::MediaSessionManageriOS::updateCarPlayIsConnected): (-[WebMediaSessionHelper initWithCallback:]): (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]): (-[WebMediaSessionHelper interruption:]): (-[WebMediaSessionHelper applicationWillEnterForeground:]): (-[WebMediaSessionHelper applicationDidBecomeActive:]): (-[WebMediaSessionHelper applicationWillResignActive:]): (-[WebMediaSessionHelper wirelessRoutesAvailableDidChange:]): (-[WebMediaSessionHelper applicationDidEnterBackground:]): (-[WebMediaSessionHelper carPlayServerDied:]): (-[WebMediaSessionHelper carPlayIsConnectedDidChange:]): * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): (WebCore::Internals::setIsPlayingToAutomotiveHeadUnit): * testing/Internals.h: * testing/Internals.idl: 2019-05-30 Youenn Fablet Add an option to mute audio capture automatically when page is not visible https://bugs.webkit.org/show_bug.cgi?id=198307 Reviewed by Eric Carlson. Reuse video capture mechanism for audio capture. In case document gets in the background, interrupt the audio track if the audio factory requires it. CoreAudioCaptureSourceIOS requires the audio source be interrupted if the app has not the right background mode. It also allows interrupting the audio capture based on a runtime flag. Add a runtime flag to control this. Internals API is used to set it for test purposes, off by default. For regular cases, the runtime flag is set through web preferences. Test: platform/ios/mediastream/audio-muted-in-background-tab.html * dom/Document.cpp: (WebCore::Document::notifyMediaCaptureOfVisibilityChanged): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::interruptAudioOnPageVisibilityChangeEnabled const): (WebCore::RuntimeEnabledFeatures::setInterruptAudioOnPageVisibilityChangeEnabled): * platform/mediastream/RealtimeMediaSourceCenter.cpp: (WebCore::RealtimeMediaSourceCenter::RealtimeMediaSourceCenter): (WebCore::RealtimeMediaSourceCenter::initializeShouldInterruptAudioOnPageVisibilityChange): (WebCore::RealtimeMediaSourceCenter::setCapturePageState): (WebCore::RealtimeMediaSourceCenter::visibilityDidChange): * platform/mediastream/RealtimeMediaSourceCenter.h: (WebCore::RealtimeMediaSourceCenter::shouldInterruptAudioOnPageVisibilityChange): * platform/mediastream/RealtimeMediaSourceFactory.h: (WebCore::AudioCaptureFactory::setAudioCapturePageState): (WebCore::VideoCaptureFactory::setVideoCapturePageState): * platform/mediastream/ios/CoreAudioCaptureSourceIOS.h: * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm: (WebCore::CoreAudioCaptureSourceFactory::setAudioCapturePageState): (WebCore::CoreAudioCaptureSourceFactoryIOS::shouldInterruptAudioOnPageVisibilityChange): * platform/mediastream/mac/CoreAudioCaptureSource.h: * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp: (WebCore::RealtimeMediaSourceCenter::initializeShouldInterruptAudioOnPageVisibilityChange): * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): (WebCore::Internals::setShouldInterruptAudioOnPageVisibilityChange): * testing/Internals.h: * testing/Internals.idl: 2019-05-30 Saam Barati [WHLSL] Enforce variable lifetimes https://bugs.webkit.org/show_bug.cgi?id=195794 Reviewed by Myles C. Maxfield. In WHLSL, each variable has global lifetime. So returning a pointer to a local variable is a legitimate and well specified thing to do. Each local variable has a unique place in memory. So, for example: ``` thread int* ptr() { int local; return &local; } thread int* ptrPtr() { return ptr(); } ``` In the above program, ptr() must always return the same value as ptrPtr(). So, the following would print "42": ``` thread int* p = ptrPtr(); *ptr() = 42; print(*p); ``` To implement these semantics, this patch introduces a new pass which does the following transformations: - It notes every variable whose address is taken in the program. - Each such variable gets defined as a field in a struct. - Each function which is an entry point defines this struct. - Each non entry point takes a pointer to this struct as its final parameter. - Each call to a non-native function is rewritten to pass a pointer to the struct as the last call argument. - Each variable reference to "x", where "x" ends up in the struct, is modified to instead be "struct->x". We store to "struct->x" after declaring "x". If "x" is a function parameter, we store to "struct->x" as the first thing we do in the function body. Tests: webgpu/whlsl-ensure-proper-variable-lifetime-2.html webgpu/whlsl-ensure-proper-variable-lifetime-3.html webgpu/whlsl-ensure-proper-variable-lifetime.html webgpu/whlsl-return-local-variable.html * Modules/webgpu/WHLSL/AST/WHLSLAST.h: * Modules/webgpu/WHLSL/AST/WHLSLExpression.h: (WebCore::WHLSL::AST::Expression::Expression): (WebCore::WHLSL::AST::Expression::isGlobalVariableReference const): (WebCore::WHLSL::AST::Expression::origin const): Deleted. * Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h: (WebCore::WHLSL::AST::FunctionDeclaration::origin): * Modules/webgpu/WHLSL/AST/WHLSLGlobalVariableReference.h: Added. (WebCore::WHLSL::AST::GlobalVariableReference::GlobalVariableReference): (WebCore::WHLSL::AST::GlobalVariableReference::structField): (WebCore::WHLSL::AST::GlobalVariableReference::base): * Modules/webgpu/WHLSL/AST/WHLSLStatement.h: (WebCore::WHLSL::AST::Statement::Statement): (WebCore::WHLSL::AST::Statement::isStatementList const): (WebCore::WHLSL::AST::Statement::isWhileLoop const): * Modules/webgpu/WHLSL/AST/WHLSLStatementList.h: Added. (WebCore::WHLSL::AST::StatementList::StatementList): (WebCore::WHLSL::AST::StatementList::statements): * Modules/webgpu/WHLSL/AST/WHLSLValue.h: (WebCore::WHLSL::AST::Value::Value): (WebCore::WHLSL::AST::Value::origin const): * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h: (WebCore::WHLSL::AST::VariableDeclaration::VariableDeclaration): (WebCore::WHLSL::AST::VariableDeclaration::takeInitializer): (WebCore::WHLSL::AST::VariableDeclaration::origin const): Deleted. * Modules/webgpu/WHLSL/AST/WHLSLVariableReference.h: (WebCore::WHLSL::AST::VariableReference::wrap): * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp: (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit): * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp: (WebCore::WHLSL::ASTDumper::visit): * Modules/webgpu/WHLSL/WHLSLASTDumper.h: (WebCore::WHLSL::dumpASTNode): (WebCore::WHLSL::dumpAST): (WebCore::WHLSL::toString): Deleted. * Modules/webgpu/WHLSL/WHLSLPrepare.cpp: (WebCore::WHLSL::prepareShared): * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp: Added. (WebCore::WHLSL::EscapedVariableCollector::takeEscapedVariables): (WebCore::WHLSL::anonymousToken): (WebCore::WHLSL::PreserveLifetimes::PreserveLifetimes): (WebCore::WHLSL::PreserveLifetimes::makeStructVariableReference): (WebCore::WHLSL::preserveVariableLifetimes): * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.h: Added. * Modules/webgpu/WHLSL/WHLSLVisitor.cpp: (WebCore::WHLSL::Visitor::visit): * Modules/webgpu/WHLSL/WHLSLVisitor.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2019-05-30 Ryan Haddad Unreviewed, rolling out r245890, 245887. Breaks internal builds. Reverted changeset: "Video playback in Safari should continue when CarPlay is plugged in" https://bugs.webkit.org/show_bug.cgi?id=198345 https://trac.webkit.org/changeset/245887/webkit 2019-05-30 Dean Jackson Media documents on iPad are too wide in split screen https://bugs.webkit.org/show_bug.cgi?id=198405 Reviewed by Tim Horton. Media documents on iPad had a minimum width of 700px. This was fine in full-screen, but didn't work when then window was smaller, such as split screen or a link preview. Tests: media/modern-media-controls/media-documents/media-document-video-ipad-sizing.html media/modern-media-controls/media-documents/media-document-video-iphone-sizing.html * Modules/modern-media-controls/controls/media-document.css: Add a media query to detect small windows. * Modules/modern-media-controls/media/media-document-controller.js: 2019-05-30 Andres Gonzalez Inserting a newline in contenteditable causes two characters to be added instead of one https://bugs.webkit.org/show_bug.cgi?id=197894 Reviewed by Wenson Hsieh and Chris Fleizach. There were two issues with inserting a newline character at the end of a line that caused problems for accessibility: - the first '\n' inserted after text would result in two line breaks inserted instead of one. createFragmentFromText in markup.cpp was splitting the string "\n" into two empty strings and creating a
and a
respectively. Then the emission code would emit a '\n' for the empty div and another for the
. - the second problem is a consequence of and the workaround is the change in editing.cpp in the function visiblePositionForIndexUsingCharacterIterator, similar to what is done in VisibleUnits.cpp for nextBoundary. The rest of the changes in this patch are accessibility changes to execute the layout tests. Tests: accessibility/ios-simulator/set-selected-text-range-after-newline.html accessibility/set-selected-text-range-after-newline.html * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::setSelectedTextRange): * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper stringForRange:]): (-[WebAccessibilityObjectWrapper _accessibilitySelectedTextRange]): (-[WebAccessibilityObjectWrapper accessibilityReplaceRange:withText:]): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): * editing/Editing.cpp: (WebCore::visiblePositionForIndexUsingCharacterIterator): * editing/markup.cpp: (WebCore::createFragmentFromText): 2019-05-30 Justin Fan [Web GPU] Vertex Buffers/Input State API updates https://bugs.webkit.org/show_bug.cgi?id=194258 Reviewed by Myles C. Maxfield. The vertex buffer attributes model for GPURenderPipelines in the WebGPU API has been updated. Update our implementation to match. No new tests. Existing tests updated to match new behavior. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webgpu/GPUVertexAttributeDescriptor.idl: * Modules/webgpu/GPUVertexBufferDescriptor.idl: Renamed from Source/WebCore/Modules/webgpu/GPUInputStateDescriptor.idl. * Modules/webgpu/GPUVertexInputDescriptor.idl: * Modules/webgpu/WebGPURenderPipelineDescriptor.idl: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/gpu/GPURenderPipelineDescriptor.h: * platform/graphics/gpu/GPUVertexAttributeDescriptor.h: * platform/graphics/gpu/GPUVertexBufferDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPUInputStateDescriptor.h. * platform/graphics/gpu/GPUVertexInputDescriptor.h: * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: (WebCore::trySetVertexInput): Added. Populate Metal and WHLSL pipeline descriptors with vertex attribute metadata. (WebCore::trySetColorStates): Added. Populate Metal and WHLSL pipeline descriptors with color attachment metadata. (WebCore::convertLayout): Moved. (WebCore::trySetMetalFunctions): Moved. (WebCore::trySetFunctions): Added. WHLSL compilation to Metal SL happens here, then MSL functions are set on pipeline descriptor. (WebCore::convertRenderPipelineDescriptor): Repurposed. Convert a GPURenderPipelineDescriptor to Metal and WHLSL versions. (WebCore::tryCreateMtlRenderPipelineState): (WebCore::GPURenderPipeline::tryCreate): (WebCore::trySetMetalFunctionsForPipelineDescriptor): Deleted. (WebCore::trySetWHLSLFunctionsForPipelineDescriptor): Deleted. (WebCore::trySetFunctionsForPipelineDescriptor): Deleted. (WebCore::trySetInputStateForPipelineDescriptor): Deleted. (WebCore::setColorStatesForColorAttachmentArray): Deleted. 2019-05-30 Zalan Bujtas [iOS] Do not linkify telephone numbers inside elements. https://bugs.webkit.org/show_bug.cgi?id=198378 Reviewed by Chris Dumez. Phone number linkifying mutates the DOM in a potentially unexpected way triggering different kinds of failures with JS, CSS selectors etc. This patch tightens the linkifying rule so that content inside an element won't get linkified even when the has no valid href attribute. Test: fast/dom/linkify-phone-numbers.html * html/parser/HTMLTreeBuilder.cpp: (WebCore::disallowTelephoneNumberParsing): 2019-05-30 Truitt Savell Unreviewed, rolling out r245883. Caused 6 webgpu/ layout test failures. Reverted changeset: "[WHLSL] Parsing and lexing the standard library is slow" https://bugs.webkit.org/show_bug.cgi?id=192890 https://trac.webkit.org/changeset/245883 2019-05-30 Simon Fraser Move some HistoricalVelocityData code into the cpp file https://bugs.webkit.org/show_bug.cgi?id=198353 Reviewed by Tim Horton. Now that we have VelocityData.cpp put the non-trivial HistoricalVelocityData::velocityForNewData() into it. append() can become a lambda function. * platform/graphics/VelocityData.cpp: (WebCore::HistoricalVelocityData::velocityForNewData): * platform/graphics/VelocityData.h: (WebCore::HistoricalVelocityData::velocityForNewData): Deleted. (WebCore::HistoricalVelocityData::append): Deleted. 2019-05-30 Truitt Savell Fix the iOS build after r245887 https://bugs.webkit.org/show_bug.cgi?id=198345 Unreviewed build fix. * platform/audio/ios/MediaSessionManagerIOS.mm: (WebCore::MediaSessionManageriOS::updateCarPlayIsConnected): 2019-05-30 Jer Noble ASSERTION FAILED: m_scriptExecutionContext under WebCore::AudioContext::isPlayingAudioDidChange() https://bugs.webkit.org/show_bug.cgi?id=181597 Reviewed by Eric Carlson. Because document() is usually null-checked before using (and we can add null-checks where missing), there's no good reason to debug-assert that m_scriptExecutionContext is non-null before downcast<>ing to Document*. * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::constructCommon): (WebCore::AudioContext::stop): (WebCore::AudioContext::document const): (WebCore::AudioContext::visibilityStateChanged): (WebCore::AudioContext::willBeginPlayback): (WebCore::AudioContext::willPausePlayback): (WebCore::AudioContext::pageMutedStateDidChange): 2019-05-30 Jer Noble Video playback in Safari should continue when CarPlay is plugged in https://bugs.webkit.org/show_bug.cgi?id=198345 Reviewed by Eric Carlson. Test: media/video-isplayingtoautomotiveheadunit.html * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction const): * platform/audio/PlatformMediaSessionManager.cpp: (WebCore::PlatformMediaSessionManager::setIsPlayingToAutomotiveHeadUnit): * platform/audio/PlatformMediaSessionManager.h: (WebCore::PlatformMediaSessionManager::isPlayingToAutomotiveHeadUnit const): * platform/audio/ios/MediaSessionManagerIOS.h: * platform/audio/ios/MediaSessionManagerIOS.mm: (WebCore::MediaSessionManageriOS::MediaSessionManageriOS): (WebCore::MediaSessionManageriOS::carPlayServerDied): (WebCore::MediaSessionManageriOS::updateCarPlayIsConnected): (-[WebMediaSessionHelper initWithCallback:]): (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]): (-[WebMediaSessionHelper interruption:]): (-[WebMediaSessionHelper applicationWillEnterForeground:]): (-[WebMediaSessionHelper applicationDidBecomeActive:]): (-[WebMediaSessionHelper applicationWillResignActive:]): (-[WebMediaSessionHelper wirelessRoutesAvailableDidChange:]): (-[WebMediaSessionHelper applicationDidEnterBackground:]): (-[WebMediaSessionHelper carPlayServerDied:]): (-[WebMediaSessionHelper carPlayIsConnectedDidChange:]): * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): (WebCore::Internals::setIsPlayingToAutomotiveHeadUnit): * testing/Internals.h: * testing/Internals.idl: 2019-05-29 Robin Morisset [WHLSL] Parsing and lexing the standard library is slow https://bugs.webkit.org/show_bug.cgi?id=192890 Reviewed by Myles Maxfield. The main idea is to avoid backtracking by instead peeking at the next token (and occasionally at the one after that). This implies a few things: - We can replace the stack of tokens by a trivial ring buffer of size 2 (holding the next token and the one after, or WTF::nullopt if we are at the end of the file). - We now have "completeFooExpression" functions, to avoid having to reparse the prefix of some expression, if we find half-way through what it is. I also fixed the following parser bug: - https://bugs.webkit.org/show_bug.cgi?id=198305 [WHLSL] Multiple variables with initializers in a declaration statement crashes the compiler which was due to a mistake I made in the grammar Finally I added two new macros: CONSUME_TYPE and PARSE to eliminate about 500 lines of error propagation boilerplate. There are still lots of ways of improving the parser and lexer, such as: - finishing the conversion of tokens in the lexer, not bothering with allocating string views - make two special tokens Invalid and EOF, to remove the overhead of Optional - make peekTypes and consumeTypes use templates to avoid constructing a Vector and calling find on it. - Turn the entire lexer into a proper automata, not going through the same characters again and again (this is certainly the largest win by far) - Remove the last few pieces of backtracking from the parser. The current patch is already enough to make parsing the full standard library (something like 85k lines) approximately 260ms. This is still longer than I would like, but nowhere near the bottleneck any longer because of some other parts of the compiler. * Modules/webgpu/WHLSL/WHLSLLexer.h: (WebCore::WHLSL::Lexer::Lexer): (WebCore::WHLSL::Lexer::consumeToken): (WebCore::WHLSL::Lexer::peek): (WebCore::WHLSL::Lexer::peekFurther): (WebCore::WHLSL::Lexer::state const): (WebCore::WHLSL::Lexer::setState): (WebCore::WHLSL::Lexer::unconsumeToken): Deleted. * Modules/webgpu/WHLSL/WHLSLParser.cpp: (WebCore::WHLSL::Parser::parse): (WebCore::WHLSL::Parser::peek): (WebCore::WHLSL::Parser::peekTypes): (WebCore::WHLSL::Parser::tryType): (WebCore::WHLSL::Parser::tryTypes): (WebCore::WHLSL::Parser::consumeTypes): (WebCore::WHLSL::Parser::parseConstantExpression): (WebCore::WHLSL::Parser::parseTypeArgument): (WebCore::WHLSL::Parser::parseTypeArguments): (WebCore::WHLSL::Parser::parseTypeSuffixAbbreviated): (WebCore::WHLSL::Parser::parseTypeSuffixNonAbbreviated): (WebCore::WHLSL::Parser::parseType): (WebCore::WHLSL::Parser::parseTypeDefinition): (WebCore::WHLSL::Parser::parseResourceSemantic): (WebCore::WHLSL::Parser::parseSpecializationConstantSemantic): (WebCore::WHLSL::Parser::parseStageInOutSemantic): (WebCore::WHLSL::Parser::parseSemantic): (WebCore::WHLSL::Parser::parseQualifiers): (WebCore::WHLSL::Parser::parseStructureElement): (WebCore::WHLSL::Parser::parseStructureDefinition): (WebCore::WHLSL::Parser::parseEnumerationDefinition): (WebCore::WHLSL::Parser::parseEnumerationMember): (WebCore::WHLSL::Parser::parseNativeTypeDeclaration): (WebCore::WHLSL::Parser::parseNumThreadsFunctionAttribute): (WebCore::WHLSL::Parser::parseAttributeBlock): (WebCore::WHLSL::Parser::parseParameter): (WebCore::WHLSL::Parser::parseParameters): (WebCore::WHLSL::Parser::parseFunctionDefinition): (WebCore::WHLSL::Parser::parseComputeFunctionDeclaration): (WebCore::WHLSL::Parser::parseVertexFragmentFunctionDeclaration): (WebCore::WHLSL::Parser::parseRegularFunctionDeclaration): (WebCore::WHLSL::Parser::parseOperatorFunctionDeclaration): (WebCore::WHLSL::Parser::parseFunctionDeclaration): (WebCore::WHLSL::Parser::parseNativeFunctionDeclaration): (WebCore::WHLSL::Parser::parseBlock): (WebCore::WHLSL::Parser::parseBlockBody): (WebCore::WHLSL::Parser::parseIfStatement): (WebCore::WHLSL::Parser::parseSwitchStatement): (WebCore::WHLSL::Parser::parseSwitchCase): (WebCore::WHLSL::Parser::parseForLoop): (WebCore::WHLSL::Parser::parseWhileLoop): (WebCore::WHLSL::Parser::parseDoWhileLoop): (WebCore::WHLSL::Parser::parseVariableDeclaration): (WebCore::WHLSL::Parser::parseVariableDeclarations): (WebCore::WHLSL::Parser::parseStatement): (WebCore::WHLSL::Parser::parseEffectfulExpression): (WebCore::WHLSL::Parser::parseEffectfulAssignment): (WebCore::WHLSL::Parser::parseExpression): (WebCore::WHLSL::Parser::parseTernaryConditional): (WebCore::WHLSL::Parser::completeTernaryConditional): (WebCore::WHLSL::Parser::parseAssignment): (WebCore::WHLSL::Parser::completeAssignment): (WebCore::WHLSL::Parser::parsePossibleTernaryConditional): (WebCore::WHLSL::Parser::parsePossibleLogicalBinaryOperation): (WebCore::WHLSL::Parser::completePossibleLogicalBinaryOperation): (WebCore::WHLSL::Parser::parsePossibleRelationalBinaryOperation): (WebCore::WHLSL::Parser::completePossibleRelationalBinaryOperation): (WebCore::WHLSL::Parser::parsePossibleShift): (WebCore::WHLSL::Parser::completePossibleShift): (WebCore::WHLSL::Parser::parsePossibleAdd): (WebCore::WHLSL::Parser::completePossibleAdd): (WebCore::WHLSL::Parser::parsePossibleMultiply): (WebCore::WHLSL::Parser::completePossibleMultiply): (WebCore::WHLSL::Parser::parsePossiblePrefix): (WebCore::WHLSL::Parser::parsePossibleSuffix): (WebCore::WHLSL::Parser::parseCallExpression): (WebCore::WHLSL::Parser::parseTerm): (WebCore::WHLSL::Parser::parseAddressSpaceType): Deleted. (WebCore::WHLSL::Parser::parseNonAddressSpaceType): Deleted. (WebCore::WHLSL::Parser::parseEntryPointFunctionDeclaration): Deleted. (WebCore::WHLSL::Parser::parseEffectfulPrefix): Deleted. (WebCore::WHLSL::Parser::parseEffectfulSuffix): Deleted. * Modules/webgpu/WHLSL/WHLSLParser.h: (WebCore::WHLSL::Parser::Error::dump const): 2019-05-29 Jiewen Tan Unreviewed, update WebAuthN to "Supported In Preview" * features.json: 2019-05-29 Don Olmstead Remove ENABLE definitions from WebKit config files https://bugs.webkit.org/show_bug.cgi?id=197858 Reviewed by Simon Fraser. Sync FeatureDefines.xcconfig. * Configurations/FeatureDefines.xcconfig: 2019-05-29 Youenn Fablet Reestablish WebSWClientConnection in case of network process crash https://bugs.webkit.org/show_bug.cgi?id=198333 Reviewed by Alex Christensen. Refactor DocumentLoader to no longer take a ref to the SWClientConnection. Instead, store the sessionID and get the SWClientConnection from it. Remove unused code from ServiceWorkerContainer. Test: http/wpt/service-workers/service-worker-networkprocess-crash.html * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::registerTemporaryServiceWorkerClient): (WebCore::DocumentLoader::unregisterTemporaryServiceWorkerClient): * loader/DocumentLoader.h: * workers/service/ServiceWorkerContainer.cpp: * workers/service/ServiceWorkerContainer.h: * workers/service/ServiceWorkerJobClient.h: 2019-05-29 David Kilzer IndexedDatabase Server thread in com.apple.WebKit.Networking process leaks objects into an autoreleasePool that's never cleared Reviewed by Brent Fulgham. * Modules/indexeddb/server/IDBServer.cpp: (WebCore::IDBServer::IDBServer::IDBServer): - Pass AutodrainedPoolForRunLoop::Use when creating CrossThreadTaskHandler to fix the bug. 2019-05-29 Geoffrey Garen WeakPtr breaks vtables when upcasting to base classes https://bugs.webkit.org/show_bug.cgi?id=188799 Reviewed by Youenn Fablet. * Modules/encryptedmedia/MediaKeySession.cpp: (WebCore::MediaKeySession::MediaKeySession): * Modules/encryptedmedia/MediaKeySession.h: Adopted modern WeakPtr APIs. Removed redundant WeakPtrFactory. * css/CSSFontFace.cpp: (WebCore::CSSFontFace::existingWrapper): * css/CSSFontFace.h: Moved functions out of line to avoid #include explosion for .get(). * dom/ContainerNode.h: * dom/Document.h: * dom/Element.h: Moved CanMakeWeakPtr to ContainerNode because all subclasses except for DocumentFragment were already so, and we have code that uses WeakPtr, which, now that WeakPtr is type-safe, is awkward to do when ContainerNode isn't CanMakeWeakPtr. * dom/FullscreenManager.cpp: (WebCore::FullscreenManager::fullscreenRenderer const): * dom/FullscreenManager.h: (WebCore::FullscreenManager::fullscreenRenderer const): Deleted. * html/FormAssociatedElement.cpp: (WebCore::FormAssociatedElement::form const): * html/FormAssociatedElement.h: (WebCore::FormAssociatedElement::form const): Deleted. Moved functions out of line to avoid #include explosion for .get(). * html/HTMLMediaElement.h: It takes an extra using declaration to disambiguate multiple CanMakeWeakPtr base classes now. * loader/MediaResourceLoader.cpp: (WebCore::MediaResourceLoader::requestResource): Removed redundant .get(). * page/DOMWindowProperty.cpp: (WebCore::DOMWindowProperty::window const): * page/DOMWindowProperty.h: (WebCore::DOMWindowProperty::window const): Deleted. * page/FrameViewLayoutContext.cpp: (WebCore::FrameViewLayoutContext::subtreeLayoutRoot const): * page/FrameViewLayoutContext.h: (WebCore::FrameViewLayoutContext::subtreeLayoutRoot const): Deleted. * page/UndoItem.cpp: (WebCore::UndoItem::undoManager const): * page/UndoItem.h: (WebCore::UndoItem::undoManager const): Deleted. Moved functions out of line to avoid #include explosion for .get(). * platform/ScrollView.h: It takes an extra using declaration to disambiguate multiple CanMakeWeakPtr base classes now. * platform/Widget.cpp: (WebCore::Widget::parent const): * platform/Widget.h: (WebCore::Widget::parent const): Deleted. Moved functions out of line to avoid #include explosion for .get(). * platform/encryptedmedia/CDMInstanceSession.h: Made CDMInstanceSessionClient CanMakeWeakPtr because we use WeakPtr. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: CanMakeWeakPtr is inherited now. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): (WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmSession const): Deleted. (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::createWeakPtr): Deleted. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::CMTimebaseEffectiveRateChangedCallback): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::play): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pause): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmSession const): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): (WebCore::SourceBufferPrivateAVFObjC::setCDMSession): (WebCore::SourceBufferPrivateAVFObjC::flushVideo): (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): (WebCore::SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples): (WebCore::SourceBufferPrivateAVFObjC::setVideoLayer): (WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession): Modernized WeakPtr API usage. * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::multiColumnFlowSlowCase const): * rendering/RenderBlockFlow.h: (WebCore::RenderBlockFlow::multiColumnFlow const): * rendering/RenderMultiColumnFlow.cpp: (WebCore::RenderMultiColumnFlow::findColumnSpannerPlaceholder const): * rendering/RenderMultiColumnFlow.h: * rendering/RenderTable.cpp: (WebCore::RenderTable::header const): (WebCore::RenderTable::footer const): (WebCore::RenderTable::firstBody const): (WebCore::RenderTable::topSection const): * rendering/RenderTable.h: (WebCore::RenderTable::header const): Deleted. (WebCore::RenderTable::footer const): Deleted. (WebCore::RenderTable::firstBody const): Deleted. (WebCore::RenderTable::topSection const): Deleted. Moved functions out of line to avoid #include explosion for .get(). 2019-05-29 Antoine Quint [Pointer Events] toElement and fromElement should be null https://bugs.webkit.org/show_bug.cgi?id=198338 Reviewed by Dean Jackson. * dom/MouseEvent.h: * dom/PointerEvent.h: 2019-05-29 Ryan Haddad Unreviewed, rolling out r245857. Breaks internal builds. Reverted changeset: "WeakPtr breaks vtables when upcasting to base classes" https://bugs.webkit.org/show_bug.cgi?id=188799 https://trac.webkit.org/changeset/245857 2019-05-29 Keith Rollin Fix builds that don't use makeWindowFromView https://bugs.webkit.org/show_bug.cgi?id=198342 Reviewed by Wenson Hsieh. In some configurations, VideoFullscreenInterfaceAVKit.mm declares but does not use makeWindowFromView. Fix by conditionalizing the the declaration on the same symbol as point where it's used. No new tests -- no new functionality. * platform/ios/VideoFullscreenInterfaceAVKit.mm: 2019-05-28 Geoffrey Garen WeakPtr breaks vtables when upcasting to base classes https://bugs.webkit.org/show_bug.cgi?id=188799 Reviewed by Youenn Fablet. * Modules/encryptedmedia/MediaKeySession.cpp: (WebCore::MediaKeySession::MediaKeySession): * Modules/encryptedmedia/MediaKeySession.h: Adopted modern WeakPtr APIs. Removed redundant WeakPtrFactory. * css/CSSFontFace.cpp: (WebCore::CSSFontFace::existingWrapper): * css/CSSFontFace.h: Moved functions out of line to avoid #include explosion for .get(). * dom/ContainerNode.h: * dom/Document.h: * dom/Element.h: Moved CanMakeWeakPtr to ContainerNode because all subclasses except for DocumentFragment were already so, and we have code that uses WeakPtr, which, now that WeakPtr is type-safe, is awkward to do when ContainerNode isn't CanMakeWeakPtr. * dom/FullscreenManager.cpp: (WebCore::FullscreenManager::fullscreenRenderer const): * dom/FullscreenManager.h: (WebCore::FullscreenManager::fullscreenRenderer const): Deleted. * html/FormAssociatedElement.cpp: (WebCore::FormAssociatedElement::form const): * html/FormAssociatedElement.h: (WebCore::FormAssociatedElement::form const): Deleted. Moved functions out of line to avoid #include explosion for .get(). * html/HTMLMediaElement.h: It takes an extra using declaration to disambiguate multiple CanMakeWeakPtr base classes now. * loader/MediaResourceLoader.cpp: (WebCore::MediaResourceLoader::requestResource): Removed redundant .get(). * page/DOMWindowProperty.cpp: (WebCore::DOMWindowProperty::window const): * page/DOMWindowProperty.h: (WebCore::DOMWindowProperty::window const): Deleted. * page/FrameViewLayoutContext.cpp: (WebCore::FrameViewLayoutContext::subtreeLayoutRoot const): * page/FrameViewLayoutContext.h: (WebCore::FrameViewLayoutContext::subtreeLayoutRoot const): Deleted. * page/UndoItem.cpp: (WebCore::UndoItem::undoManager const): * page/UndoItem.h: (WebCore::UndoItem::undoManager const): Deleted. Moved functions out of line to avoid #include explosion for .get(). * platform/ScrollView.h: It takes an extra using declaration to disambiguate multiple CanMakeWeakPtr base classes now. * platform/Widget.cpp: (WebCore::Widget::parent const): * platform/Widget.h: (WebCore::Widget::parent const): Deleted. Moved functions out of line to avoid #include explosion for .get(). * platform/encryptedmedia/CDMInstanceSession.h: Made CDMInstanceSessionClient CanMakeWeakPtr because we use WeakPtr. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: CanMakeWeakPtr is inherited now. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): (WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmSession const): Deleted. (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::createWeakPtr): Deleted. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::CMTimebaseEffectiveRateChangedCallback): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::play): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pause): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmSession const): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): (WebCore::SourceBufferPrivateAVFObjC::setCDMSession): (WebCore::SourceBufferPrivateAVFObjC::flushVideo): (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): (WebCore::SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples): (WebCore::SourceBufferPrivateAVFObjC::setVideoLayer): (WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession): Modernized WeakPtr API usage. * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::multiColumnFlowSlowCase const): * rendering/RenderBlockFlow.h: (WebCore::RenderBlockFlow::multiColumnFlow const): * rendering/RenderMultiColumnFlow.cpp: (WebCore::RenderMultiColumnFlow::findColumnSpannerPlaceholder const): * rendering/RenderMultiColumnFlow.h: * rendering/RenderTable.cpp: (WebCore::RenderTable::header const): (WebCore::RenderTable::footer const): (WebCore::RenderTable::firstBody const): (WebCore::RenderTable::topSection const): * rendering/RenderTable.h: (WebCore::RenderTable::header const): Deleted. (WebCore::RenderTable::footer const): Deleted. (WebCore::RenderTable::firstBody const): Deleted. (WebCore::RenderTable::topSection const): Deleted. Moved functions out of line to avoid #include explosion for .get(). 2019-05-29 Antti Koivisto Scrolling node ordering wrong when a layer has both positioning and fixed/sticky node https://bugs.webkit.org/show_bug.cgi?id=198329 Reviewed by Darin Adler. Test: scrollingcoordinator/scrolling-tree/sticky-in-overflow.html With sticky positioning in non-stacking context overflow you currently get structure like FrameScrollingNode OverflowScrollingNode StickyNode PositionedNode where StickyNode and PositionedNode reference the same layer. Sticky doesn't get applied at all when the overflow moves. This patch reverses the order of sticky and positioned. It doesn't fix sticky positioning during scrolling yet, but it does make it less jumpy. It is a prerequisite for the full fix. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateScrollCoordinationForLayer): 2019-05-29 Ludovico de Nittis Prepend KEY_ to the last key alias in PlatformEventKeyboardGtk https://bugs.webkit.org/show_bug.cgi?id=198331 Reviewed by Michael Catanzaro. No behavior change. With the commit https://bugs.webkit.org/show_bug.cgi?id=198326 A gdk key slipped away from the renaming. * platform/gtk/PlatformKeyboardEventGtk.cpp: (WebCore::modifiersForGdkKeyEvent): 2019-05-29 Zalan Bujtas [LFC][IFC] Move Line class to a dedicated file https://bugs.webkit.org/show_bug.cgi?id=198332 Reviewed by Antti Koivisto. An upcoming refactoring requires the Line class to be in a .h. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/displaytree/DisplayRun.h: * layout/inlineformatting/InlineFormattingContextLineLayout.cpp: (WebCore::Layout::InlineFormattingContext::LineLayout::initializeLine const): (WebCore::Layout::InlineFormattingContext::LineLayout::computedIntrinsicWidth const): (WebCore::Layout::halfLeadingMetrics): Deleted. (WebCore::Layout::Line::availableWidth const): Deleted. (WebCore::Layout::Line::contentLogicalRight const): Deleted. (WebCore::Layout::Line::contentLogicalWidth const): Deleted. (WebCore::Layout::Line::logicalTop const): Deleted. (WebCore::Layout::Line::logicalLeft const): Deleted. (WebCore::Layout::Line::logicalRight const): Deleted. (WebCore::Layout::Line::logicalBottom const): Deleted. (WebCore::Layout::Line::logicalWidth const): Deleted. (WebCore::Layout::Line::logicalHeight const): Deleted. (WebCore::Layout::Line::LineItem::LineItem): Deleted. (WebCore::Layout::Line::Line): Deleted. (WebCore::Layout::Line::reset): Deleted. (WebCore::Layout::Line::close): Deleted. (WebCore::Layout::Line::removeTrailingTrimmableContent): Deleted. (WebCore::Layout::Line::moveLogicalLeft): Deleted. (WebCore::Layout::Line::moveLogicalRight): Deleted. (WebCore::Layout::isTrimmableContent): Deleted. (WebCore::Layout::Line::trailingTrimmableWidth const): Deleted. (WebCore::Layout::Line::hasContent const): Deleted. (WebCore::Layout::Line::appendNonBreakableSpace): Deleted. (WebCore::Layout::Line::appendInlineContainerStart): Deleted. (WebCore::Layout::Line::appendInlineContainerEnd): Deleted. (WebCore::Layout::Line::appendTextContent): Deleted. (WebCore::Layout::Line::appendNonReplacedInlineBox): Deleted. (WebCore::Layout::Line::appendReplacedInlineBox): Deleted. (WebCore::Layout::Line::appendHardLineBreak): Deleted. * layout/inlineformatting/InlineTextItem.h: * layout/inlineformatting/text/TextUtil.cpp: (WebCore::Layout::TextUtil::isTrimmableContent): * layout/inlineformatting/text/TextUtil.h: 2019-05-29 Ludovico de Nittis PlatformEventKeyboardGtk still uses old key aliases https://bugs.webkit.org/show_bug.cgi?id=198326 Reviewed by Carlos Garcia Campos. No behavior change. Use the new key names convention prepending "KEY_". * platform/gtk/PlatformKeyboardEventGtk.cpp: (WebCore::PlatformKeyboardEvent::keyIdentifierForGdkKeyCode): (WebCore::PlatformKeyboardEvent::windowsKeyCodeForGdkKeyCode): (WebCore::PlatformKeyboardEvent::singleCharacterString): (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): 2019-05-28 Yacine Bandou [MSE][GStreamer] update the readyState correctly in MediaPlayerPrivateGStreamerMSE https://bugs.webkit.org/show_bug.cgi?id=197834 Reviewed by Xabier Rodriguez-Calvar. The buffering state and the m_downloadFinished boolean aren't supported in the MSE case. When the readyState is already "HaveEnoughData", we don't want to revert it to "HaveFutureData", or else the MediaPlayer would send a "canplay" event instead of a "canplaythrough". Test: media/media-source/media-source-canplaythrough-event.html * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: (WebCore::MediaPlayerPrivateGStreamerMSE::updateStates): 2019-05-28 Fujii Hironori [WinCairo] ASSERTION FAILED: !m_preparingToPlay in MediaPlayerPrivateMediaFoundation::prepareToPlay https://bugs.webkit.org/show_bug.cgi?id=190747 Reviewed by Alex Christensen. HTMLMediaElement::prepareToPlay had a assertion ensuring that it was not called twice. However, it was called twice. The first from HTMLMediaElement::load, the second from MediaPlayerPrivateMediaFoundation::onTopologySet. prepareToPlay started loading. And, loading should be started after onTopologySet is called back. Covered by existing tests. * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp: (WebCore::MediaPlayerPrivateMediaFoundation::onTopologySet): Moved code from prepareToPlay. (WebCore::MediaPlayerPrivateMediaFoundation::prepareToPlay): Deleted and moved the code to onTopologySet. * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h: Removed prepareToPlay declaration. 2019-05-28 Fujii Hironori [WinCairo][MediaFoundation] Assertion failure in MediaPlayerPrivateMediaFoundation::Direct3DPresenter::presentSample https://bugs.webkit.org/show_bug.cgi?id=198290 Reviewed by Per Arne Vollan. Covered by existing tests. * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp: (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::presentSample): Call clear() of m_memSurface before assigning new value. 2019-05-28 Saam Barati [WHLSL] Type of dereference is the type of the thing we point to, not a pointer to that type https://bugs.webkit.org/show_bug.cgi?id=198321 Reviewed by Myles C. Maxfield. Consider this program: ``` thread int* x; *x = 42 ``` In the Checker, we were saying the type of "*x" was "int*" instead of "int". Test: webgpu/whlsl-dereference-pointer-should-type-check.html * Modules/webgpu/WHLSL/WHLSLChecker.cpp: (WebCore::WHLSL::Checker::visit): 2019-05-28 Wenson Hsieh [iOS] Respect NSItemProvider's registered types when dropping files that are loaded in-place https://bugs.webkit.org/show_bug.cgi?id=198315 Reviewed by Tim Horton. Currently, logic in PasteboardIOS.mm and WebContentReaderCocoa.mm attempts to deduce the content type from the file path when dropping attachments on iOS. Instead, we should be plumbing the content type through to the reader. Test: WKAttachmentTestsIOS.InsertDroppedImageWithNonImageFileExtension * editing/WebContentReader.h: * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::typeForAttachmentElement): Add a helper method to determine which type to use in attachment elements. This makes the paste (attachmentForData) and drop (attachmentForFilePaths) behave the same way, with respect to the type attribute used to represent the attachment. (WebCore::attachmentForFilePath): Use the content type, if specified; otherwise, fall back to deducing it from the file path. (WebCore::attachmentForData): (WebCore::WebContentReader::readFilePath): * platform/Pasteboard.h: (WebCore::PasteboardWebContentReader::readFilePath): Pass the highest fidelity representation's content type to the web content reader. * platform/ios/PasteboardIOS.mm: (WebCore::Pasteboard::readRespectingUTIFidelities): 2019-05-28 Myles C. Maxfield Move idempotent text autosizing to StyleTreeResolver https://bugs.webkit.org/show_bug.cgi?id=197808 Reviewed by Antti Koivisto. This patch migrates the idempotent text autosizing code to live inside style resolution. This is almost the same as the algorithm that uses the result of layout to calculate autosizing, but this version only operates on style (and thus doesn't require double layouts). Because it is being run in an environment with less information, autosizing is occurring in more places, so the curves have been adjusted to make autosizing not boost as much as the previous implementation did. The new algorithm is modelled after text-decorations-in-effect. I've claimed 4 of the unused bits in RenderStyle to contain the state of the autosizing algorithm. StyleResolver::adjustRenderStyle() is where the algorithm is implemented: - Look at the inherited bits - Interogate the element's RenderStyle - Compute new bits for the element, and set them in its RenderStyle - Based on the newly computed bits, determine whether we should increase the text size - If so, determine how much using the specified font size, and apply the result to the computed font size This works because StyleBuilderCustom::applyInheritFontSize() inherits from the specified font size, not the computed font size. This patch also will disable autosizing using the other methods (so there aren't two methods of autosizing fighting each other) and will honor text-size-adjust:none. However, it won't honor text-size-adjust:100%. If content says text-size-adjust:100%, we will disregard it and take this code path. Tests: fast/text-autosizing/ios/idempotentmode/css-exposure.html fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-skip.html fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-identity.html fast/text-autosizing/ios/idempotentmode/idempotent-autosizing.html * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSProperties.json: * css/StyleBuilderCustom.h: (WebCore::computeBaseSpecifiedFontSize): (WebCore::computeLineHeightMultiplierDueToFontSize): * css/StyleResolver.cpp: (WebCore::idempotentTextSize): (WebCore::hasTextChildren): (WebCore::StyleResolver::adjustRenderStyle): (WebCore::StyleResolver::checkForTextSizeAdjust): * page/FrameViewLayoutContext.cpp: (WebCore::FrameViewLayoutContext::applyTextSizingIfNeeded): * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::adjustComputedFontSizes): (WebCore::idempotentTextSize): Deleted. * rendering/RenderBlockFlow.h: * rendering/RenderElement.cpp: (WebCore::includeNonFixedHeight): (WebCore::RenderElement::adjustComputedFontSizesOnBlocks): (WebCore::RenderElement::resetTextAutosizing): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::RenderStyle): (WebCore::RenderStyle::autosizeStatus const): (WebCore::RenderStyle::setAutosizeStatus): * rendering/style/RenderStyle.h: * rendering/style/TextSizeAdjustment.cpp: Added. (WebCore::AutosizeStatus::AutosizeStatus): (WebCore::AutosizeStatus::contains const): (WebCore::AutosizeStatus::modifiedStatus const): (WebCore::AutosizeStatus::shouldSkipSubtree const): * rendering/style/TextSizeAdjustment.h: 2019-05-28 Simon Fraser Use scroll-velocity-based tile coverage for overflow:scroll https://bugs.webkit.org/show_bug.cgi?id=198294 rdar://problem/48942184 Reviewed by Tim Horton. Start using a velocity-based tile coverage computation on layers with Type::ScrolledContents, which is the content layers for overflow:scroll when they get big enough to get tiled. Move legacy macOS coverage code into adjustTileCoverageForDesktopPageScrolling() because I don't want to change its behavior in this patch. Use TileController::adjustTileCoverageRectForScrolling() for iOS and macOS overflow scrolling. Since only iOS page scrolling gets velocity data from the UI process, compute velocity in TileController using the visible rect top-left. For overflow scroll, we have to plumb horizontal and vertical coverage in from RenderLayerBacking. Tests: tiled-drawing/scrolling/overflow/overflow-scrolled-down-tile-coverage.html tiled-drawing/scrolling/overflow/overflow-scrolled-up-tile-coverage.html tiled-drawing/scrolling/overflow/overflow-tile-coverage.html * platform/graphics/TiledBacking.h: * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::adjustCoverageRect const): * platform/graphics/ca/PlatformCALayer.h: * platform/graphics/ca/TileController.cpp: (WebCore::TileController::setVelocity): (WebCore::TileController::adjustTileCoverageRect): (WebCore::TileController::adjustTileCoverageForDesktopPageScrolling const): (WebCore::TileController::adjustTileCoverageWithScrollingVelocity const): (WebCore::TileController::adjustTileCoverageRectForScrolling): (WebCore::expandRectWithinRect): Deleted. (WebCore::TileController::adjustTileCoverageRect const): Deleted. (WebCore::TileController::adjustTileCoverageRectForScrolling const): Deleted. * platform/graphics/ca/TileController.h: * rendering/RenderLayer.h: * rendering/RenderLayerBacking.cpp: (WebCore::computePageTiledBackingCoverage): (WebCore::computeOverflowTiledBackingCoverage): (WebCore::RenderLayerBacking::adjustTiledBackingCoverage): (WebCore::RenderLayerBacking::updateGeometry): 2019-05-28 Shawn Roberts Unreviewed, rolling out r245475. Newly imported test is flaky. Features need flags. Reverted changeset: "Implement imagesrcset and imagesizes attributes on link rel=preload" https://bugs.webkit.org/show_bug.cgi?id=192950 https://trac.webkit.org/changeset/245475 2019-05-28 Brent Fulgham Protect frames during style and layout changes https://bugs.webkit.org/show_bug.cgi?id=198047 Reviewed by Zalan Bujtas. Be more careful about the scope and lifetime of objects that participate in layout or style updates. If a method decides a layout or style update is needed, it needs to confirm that the elements it was operating on are still valid and needed in the current operation. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::getOrCreate): * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::accessibilityHitTest const): * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSComputedStyleDeclaration.h: * css/SVGCSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::svgPropertyValue): * dom/Document.cpp: (WebCore::Document::setFocusedElement): * editing/TypingCommand.cpp: (WebCore::TypingCommand::insertTextRunWithoutNewlines): (WebCore::TypingCommand::insertLineBreak): (WebCore::TypingCommand::insertParagraphSeparator): (WebCore::TypingCommand::insertParagraphSeparatorInQuotedContent): * editing/ios/EditorIOS.mm: (WebCore::Editor::setDictationPhrasesAsChildOfElement): * html/HTMLLabelElement.cpp: (WebCore::HTMLLabelElement::focus): * html/HTMLTextAreaElement.cpp: (WebCore::HTMLTextAreaElement::appendFormData): * html/ImageDocument.cpp: (WebCore::ImageDocument::imageClicked): * html/ValidationMessage.cpp: (WebCore::ValidationMessage::buildBubbleTree): * page/FrameView.cpp: (WebCore::FrameView::autoSizeIfEnabled): (WebCore::FrameView::trackedRepaintRectsAsText const): * page/PrintContext.cpp: (WebCore::PrintContext::pageProperty): (WebCore::PrintContext::numberOfPages): (WebCore::PrintContext::spoolAllPagesWithBoundaries): 2019-05-28 Antti Koivisto [async scrolling] Fixed positioning inside stacking context overflow scroll is jumpy https://bugs.webkit.org/show_bug.cgi?id=198292 Reviewed by Darin Adler. Tests: scrollingcoordinator/ios/fixed-in-stacking-context-overflow-scroll-2.html scrollingcoordinator/ios/fixed-in-stacking-context-overflow-scroll.html We were computing delta from the layout scroll position in ScrollingTree::notifyRelatedNodesAfterScrollPositionChange based on the passed in node only. If any other node had deltas they were not taken into account at all. This would occur frequently since the function is always invoked for the root node after layer tree commit. Fix by moving the delta computation (and fetching layoutViewport) to ScrollingTreeFixedNode. * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::applyLayerPositions): No need to pass offset and layoutViewport around anymore. (WebCore::ScrollingTree::applyLayerPositionsRecursive): (WebCore::ScrollingTree::notifyRelatedNodesAfterScrollPositionChange): Remove the offset and layoutViewport computations. (WebCore::ScrollingTree::notifyRelatedNodesRecursive): * page/scrolling/ScrollingTree.h: * page/scrolling/ScrollingTreeFrameHostingNode.cpp: (WebCore::ScrollingTreeFrameHostingNode::applyLayerPositions): * page/scrolling/ScrollingTreeFrameHostingNode.h: * page/scrolling/ScrollingTreeNode.cpp: (WebCore::ScrollingTreeNode::relatedNodeScrollPositionDidChange): * page/scrolling/ScrollingTreeNode.h: * page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::applyLayerPositions): * page/scrolling/ScrollingTreeScrollingNode.h: * page/scrolling/cocoa/ScrollingTreeFixedNode.h: * page/scrolling/cocoa/ScrollingTreeFixedNode.mm: (WebCore::ScrollingTreeFixedNode::applyLayerPositions): Compute them here instead, always taking all overflow scrollers up to the closest frame into account. * page/scrolling/cocoa/ScrollingTreePositionedNode.h: * page/scrolling/cocoa/ScrollingTreePositionedNode.mm: (WebCore::ScrollingTreePositionedNode::applyLayerPositions): (WebCore::ScrollingTreePositionedNode::relatedNodeScrollPositionDidChange): * page/scrolling/cocoa/ScrollingTreeStickyNode.h: * page/scrolling/cocoa/ScrollingTreeStickyNode.mm: (WebCore::ScrollingTreeStickyNode::applyLayerPositions): 2019-05-28 Zalan Bujtas [LFC][Verification] Add additional inline and block checks https://bugs.webkit.org/show_bug.cgi?id=198252 Reviewed by Antti Koivisto. Now we also test the geometry of the blocks with inline formatting contexts. * layout/Verification.cpp: (WebCore::Layout::checkForMatchingTextRuns): (WebCore::Layout::verifyAndOutputSubtree): 2019-05-28 Zalan Bujtas [LFC][IFC] Decouple line layout and processing inline runs. https://bugs.webkit.org/show_bug.cgi?id=198282 Reviewed by Antti Koivisto. This is in preparation for using "createInlineRunsForLine" logic when computing preferred width. * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineFormattingContextLineLayout.cpp: (WebCore::Layout::UncommittedContent::size const): (WebCore::Layout::InlineFormattingContext::LineLayout::createInlineRunsForLine const): (WebCore::Layout::InlineFormattingContext::LineLayout::layout const): (WebCore::Layout::InlineFormattingContext::LineLayout::processInlineRuns const): (WebCore::Layout::InlineFormattingContext::LineLayout::closeLine const): Deleted. * layout/inlineformatting/InlineFormattingState.h: (WebCore::Layout::InlineFormattingState::addInlineItem): * layout/inlineformatting/InlineTextItem.cpp: (WebCore::Layout::InlineTextItem::createAndAppendTextItems): 2019-05-28 Zalan Bujtas [LFC][IFC] Move intrinsic width computation from InlineFormattingContext to LineLayout https://bugs.webkit.org/show_bug.cgi?id=198258 Reviewed by Antti Koivisto. This is in preparation for sharing even more code between line layout and preferred width computation. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layout const): (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthConstraints const): * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineFormattingContextLineLayout.cpp: (WebCore::Layout::InlineFormattingContext::LineLayout::initializeLine const): (WebCore::Layout::InlineFormattingContext::LineLayout::layout const): (WebCore::Layout::InlineFormattingContext::LineLayout::computedIntrinsicWidth const): (WebCore::Layout::InlineFormattingContext::LineLayout::closeLine const): 2019-05-28 Zalan Bujtas [LFC[IFC] Ignore the initial strut's height when the line does not have any content. https://bugs.webkit.org/show_bug.cgi?id=198268 Reviewed by Antti Koivisto. The strut (https://www.w3.org/TR/CSS22/visudet.html#leading) defines the initial logical height for the line. This height should be ignored though when the line does not have any content. * layout/inlineformatting/InlineFormattingContextLineLayout.cpp: (WebCore::Layout::InlineFormattingContext::LineLayout::closeLine const): 2019-05-27 Antoine Quint [Pointer Events] Check that capturing data managed by the PointerCaptureController gets cleared upon navigation https://bugs.webkit.org/show_bug.cgi?id=198191 Reviewed by Dean Jackson. When the document of the page's main frame changes, make sure we clear all of the data accumulated for the previous document. I don't think this particular change is testable as none of the data contained in the PointerIdToCapturingDataMap maintained by the PointerCaptureController contains any data that could be inspected by the page due to other fixes landed to fix wkb.ug/198129, but I've checked that removing those fixes and using this patch correctly fixes that bug. * page/Page.cpp: (WebCore::Page::didChangeMainDocument): * page/PointerCaptureController.cpp: (WebCore::PointerCaptureController::PointerCaptureController): (WebCore::PointerCaptureController::reset): * page/PointerCaptureController.h: 2019-05-27 Carlos Garcia Campos [GTK] Use WPEBackend-fdo for accelerating compositing in Wayland instead of the nested compositor https://bugs.webkit.org/show_bug.cgi?id=197944 Reviewed by Michael Catanzaro. * PlatformGTK.cmake: * SourcesGTK.txt: * platform/graphics/GLContext.cpp: (WebCore::GLContext::createContextForWindow): Check current display is X11 before trying to create a GLX context. * platform/graphics/PlatformDisplay.cpp: (WebCore::PlatformDisplay::createPlatformDisplay): Use USE(WPE_RENDERER) instead of USE(LIBWPE). * platform/graphics/PlatformDisplay.h: * platform/graphics/egl/GLContextEGL.cpp: (WebCore::GLContextEGL::createWindowContext): Use USE(WPE_RENDERER) instead of PLATFORM(WPE). (WebCore::GLContextEGL::createContext): Ditto. (WebCore::GLContextEGL::createSharingContext): Ditto. (WebCore::GLContextEGL::~GLContextEGL): Ditto. * platform/graphics/egl/GLContextEGL.h: * platform/graphics/egl/GLContextEGLLibWPE.cpp: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext): Ditto. * platform/graphics/libwpe/PlatformDisplayLibWPE.cpp: (WebCore::PlatformDisplayLibWPE::PlatformDisplayLibWPE): In GTK port set the display as the shared one for compositing. * platform/graphics/libwpe/PlatformDisplayLibWPE.h: 2019-05-27 Takashi Komori [CURL] Fix crashing SocketStreamHandle. https://bugs.webkit.org/show_bug.cgi?id=197873 Reviewed by Fujii Hironori. When NetworkSocketStream was destructed SocketStreamHandleImple::platformClose was called wrongly times. This is because closed state is not set. Test: http/tests/websocket/tests/hybi/workers/close.html * platform/network/curl/SocketStreamHandleImpl.h: * platform/network/curl/SocketStreamHandleImplCurl.cpp: (WebCore::SocketStreamHandleImpl::platformSendInternal): (WebCore::SocketStreamHandleImpl::platformClose): (WebCore::SocketStreamHandleImpl::threadEntryPoint): (WebCore::SocketStreamHandleImpl::handleError): (WebCore::SocketStreamHandleImpl::callOnWorkerThread): (WebCore::SocketStreamHandleImpl::executeTasks): 2019-05-27 Oriol Brufau [css-grid] Preserve repeat() notation when serializing declared values https://bugs.webkit.org/show_bug.cgi?id=197840 Reviewed by Manuel Rego Casasnovas. Tests: fast/css-grid-layout/grid-element-auto-repeat-get-set.html fast/css-grid-layout/grid-repeat-calc.html fast/css-grid-layout/named-grid-line-get-set.html imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-support-repeat-002.html Before this change, a repeat() notation with an integral number of repetitions was expanded at parse time. This was observable when reading declared values using JS APIs. This patch makes the parser preserve that notation, like it was already happening when the number of repetitions was automatic and not integral. The resolved value in getComputedStyle() will still be expanded, though, as required by the spec. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSGridIntegerRepeatValue.cpp: Added. (WebCore::CSSGridIntegerRepeatValue::customCSSText const): (WebCore::CSSGridIntegerRepeatValue::equals const): * css/CSSGridIntegerRepeatValue.h: Added. * css/CSSValue.cpp: (WebCore::CSSValue::equals const): (WebCore::CSSValue::cssText const): (WebCore::CSSValue::destroy): * css/CSSValue.h: (WebCore::CSSValue::isGridIntegerRepeatValue const): * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::createGridTrackList): (WebCore::StyleBuilderConverter::convertGridTrackSizeList): * css/parser/CSSPropertyParser.cpp: (WebCore::consumeGridTrackRepeatFunction): 2019-05-27 Chris Dumez Use a strongly-typed identifier for pages https://bugs.webkit.org/show_bug.cgi?id=198206 Reviewed by Youenn Fablet. * WebCore/*: 2019-05-26 Simon Fraser Move GraphicsLayerCA::adjustTiledLayerVisibleRect() to TileController https://bugs.webkit.org/show_bug.cgi?id=198266 Reviewed by Zalan Bujtas. GraphicsLayerCA::adjustTiledLayerVisibleRect() was computing tile coverage for a TiledBacking, just like TileController::adjustTileCoverageRect(), so move the code into TileController as a first step to unifying more of this code. It's currently used for tiled compositing layers, including overflow:scroll, and tiled layers whose coverage may be affected by animations, so it's general-purpose. TileController::adjustTileCoverageRect() is used for scrollable things, so rename it to adjustTileCoverageRectForScrolling(). No behavior change. * platform/graphics/TiledBacking.h: * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::adjustCoverageRect const): (WebCore::GraphicsLayerCA::adjustTiledLayerVisibleRect): Deleted. * platform/graphics/ca/GraphicsLayerCA.h: * platform/graphics/ca/TileController.cpp: (WebCore::TileController::adjustTileCoverageRect const): (WebCore::TileController::adjustTileCoverageRectForScrolling const): * platform/graphics/ca/TileController.h: 2019-05-27 Simon Fraser Fix Apple Internal builds after r245788. * platform/PlatformScreen.h: (WebCore::screenHasTouchDevice): (WebCore::screenIsTouchPrimaryInputDevice): 2019-05-27 Zalan Bujtas [LFC][IFC] Ignore collapsed runs when setting the width on the associated display boxes. https://bugs.webkit.org/show_bug.cgi?id=198260 Reviewed by Antti Koivisto. Collapsed runs don't contribute to the logical width of their containers. Covered by existing tests. * layout/inlineformatting/InlineFormattingContextLineLayout.cpp: (WebCore::Layout::InlineFormattingContext::LineLayout::closeLine const): 2019-05-27 Carlos Garcia Campos Unreviewed. Fix GTK distcheck Move mac headers to platform specific makefile. * Headers.cmake: * PlatformMac.cmake: 2019-05-27 Carlos Garcia Campos Touch support is reported even when the device doesn't have a touch screen https://bugs.webkit.org/show_bug.cgi?id=139681 Reviewed by Michael Catanzaro. Add screenHasTouchDevice() and screenIsTouchPrimaryInputDevice() to PlatformScreen and use it to decide whether to expose touch events functionality or not. * bindings/js/WebCoreBuiltinNames.h: * css/MediaQueryEvaluator.cpp: (WebCore::hoverEvaluate): Use screenIsTouchPrimaryInputDevice() when touch events are enabled at build time. (WebCore::anyHoverEvaluate): Use screenHasTouchDevice() when touch events are enabled at build time. (WebCore::pointerEvaluate): Use screenIsTouchPrimaryInputDevice() when touch events are enabled at build time. (WebCore::anyPointerEvaluate): Use screenHasTouchDevice() when touch events are enabled at build time. * dom/GlobalEventHandlers.idl: Make touch event attributes enabled at runtime. * page/RuntimeEnabledFeatures.cpp: (WebCore::RuntimeEnabledFeatures::touchEventsEnabled const): Return whether touch events are enabled. * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setTouchEventsEnabled): Force touch events to be enabled or disabled. * platform/PlatformScreen.h: (WebCore::screenHasTouchDevice): Just return true when touch events are enabled at build time for non-gtk ports. (WebCore::screenIsTouchPrimaryInputDevice): Ditto. * platform/gtk/PlatformScreenGtk.cpp: (WebCore::screenHasTouchDevice): (WebCore::screenIsTouchPrimaryInputDevice): (WebCore::isTouchDevice): (WebCore::deviceAddedCallback): (WebCore::deviceRemovedCallback): 2019-05-26 Simon Fraser Move VelocityData to WebCore https://bugs.webkit.org/show_bug.cgi?id=198261 Reviewed by Antti Koivisto. Move VelocityData and HistoricalVelocityData to WebCore for future use in overflow scroll. VisibleContentRectUpdateInfo can now store a VelocityData (its timestamp is used as the timetamp for the entire update). No behavior change. * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * page/FrameView.cpp: (WebCore::FrameView::setScrollVelocity): * page/FrameView.h: * platform/graphics/TiledBacking.h: (WebCore::VelocityData::VelocityData): Deleted. (WebCore::VelocityData::velocityOrScaleIsChanging const): Deleted. * platform/graphics/ca/TileController.cpp: (WebCore::TileController::adjustTileCoverageRect const): * platform/graphics/ca/TileController.h: 2019-05-26 Simon Fraser Add a GraphicsLayer::Type for ScrolledContents https://bugs.webkit.org/show_bug.cgi?id=198257 Reviewed by Zalan Bujtas. This ScrolledContents layer type will be used to choose different tiling behaviors in a future patch. * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::supportsLayerType): * platform/graphics/GraphicsLayer.h: * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayer::supportsLayerType): (WebCore::GraphicsLayerCA::initialize): (WebCore::GraphicsLayerCA::adjustCoverageRect const): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateScrollingLayers): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::ensureRootLayer): 2019-05-26 John Wilander Resource Load Statistics: Downgrade document.referrer to the referrer's eTLD+1 if the page was navigated to with a prevalent resource referrer containing link decoration https://bugs.webkit.org/show_bug.cgi?id=198227 Reviewed by Alex Christensen. Test: http/tests/resourceLoadStatistics/downgraded-referrer-for-navigation-with-link-query-from-prevalent-resource.html * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * dom/Document.cpp: (WebCore::Document::referrer const): Now checks if the referrer has been overridden. (WebCore::Document::wasLoadedWithDataTransferFromPrevalentResource): (WebCore::Document::downgradeReferrerToRegistrableDomain): * dom/Document.h: * page/CrossSiteNavigationDataTransfer.h: Added. New option set for the growing number of navigational data transfers we care about. * platform/network/NetworkStorageSession.cpp: (WebCore::NetworkStorageSession::didCommitCrossSiteLoadWithDataTransferFromPrevalentResource): (WebCore::NetworkStorageSession::committedCrossSiteLoadWithLinkDecoration): Deleted. New name since we no longer only look for link decoration but also other means of navigational data transfer. * platform/network/NetworkStorageSession.h: 2019-05-26 Zalan Bujtas [LFC][Verification] Add areEssentiallyEqual for LayoutRect https://bugs.webkit.org/show_bug.cgi?id=198250 Reviewed by Antti Koivisto. WebKit's inline layout is a mix of int/float/LayoutUnit types, while LFC mostly uses LayoutUnit. When we compute the used size of a block container (based on the inline tree), the final value might go through a few conversions. * layout/Verification.cpp: (WebCore::Layout::areEssentiallyEqual): (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded): 2019-05-26 Wenson Hsieh [iOS] Dropped text, attachments, and images should animate into place https://bugs.webkit.org/show_bug.cgi?id=198243 Reviewed by Tim Horton. Add some hooks to notify the chrome client when an HTMLImageElement's image is finished loading. See WebKit changelog for more detail. Test: DragAndDropTests.DropPreviewForImageInEditableArea * loader/EmptyClients.h: * page/ChromeClient.h: * page/Page.cpp: (WebCore::Page::didFinishLoadingImageForElement): * page/Page.h: * rendering/RenderImage.cpp: (WebCore::RenderImage::notifyFinished): 2019-05-25 Zalan Bujtas [LFC][IFC] Introduce DisplayRun to display tree https://bugs.webkit.org/show_bug.cgi?id=197198 Reviewed by Antti Koivisto. Add a simple inline layout implementation. Now we've got DisplayBoxes for layout boxes and DisplayRuns for inline runs. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::contentHeightForFormattingContextRoot): * layout/Verification.cpp: (WebCore::Layout::areEssentiallyEqual): (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded): (WebCore::Layout::checkForMatchingNonTextRuns): (WebCore::Layout::checkForMatchingTextRuns): (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded): (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded): (WebCore::Layout::resolveForRelativePositionIfNeeded): Deleted. * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): * layout/displaytree/DisplayBox.cpp: (WebCore::Display::Box::marginBox const): (WebCore::Display::Box::nonCollapsedMarginBox const): (WebCore::Display::Box::borderBox const): (WebCore::Display::Box::paddingBox const): (WebCore::Display::Box::contentBox const): (WebCore::Display::Box::Rect::Rect): Deleted. * layout/displaytree/DisplayBox.h: (WebCore::Display::Box::rectWithMargin const): (WebCore::Display::Box::horizontalMargin const): (WebCore::Display::Box::Rect::intersects const): Deleted. (WebCore::Display::Box::Rect::invalidateTop): Deleted. (WebCore::Display::Box::Rect::invalidateLeft): Deleted. (WebCore::Display::Box::Rect::invalidateWidth): Deleted. (WebCore::Display::Box::Rect::invalidateHeight): Deleted. (WebCore::Display::Box::Rect::hasValidPosition const): Deleted. (WebCore::Display::Box::Rect::hasValidSize const): Deleted. (WebCore::Display::Box::Rect::hasValidGeometry const): Deleted. (WebCore::Display::Box::Rect::invalidatePosition): Deleted. (WebCore::Display::Box::Rect::setHasValidPosition): Deleted. (WebCore::Display::Box::Rect::setHasValidSize): Deleted. (WebCore::Display::Box::Rect::top const): Deleted. (WebCore::Display::Box::Rect::left const): Deleted. (WebCore::Display::Box::Rect::bottom const): Deleted. (WebCore::Display::Box::Rect::right const): Deleted. (WebCore::Display::Box::Rect::topLeft const): Deleted. (WebCore::Display::Box::Rect::bottomRight const): Deleted. (WebCore::Display::Box::Rect::size const): Deleted. (WebCore::Display::Box::Rect::width const): Deleted. (WebCore::Display::Box::Rect::height const): Deleted. (WebCore::Display::Box::Rect::setTopLeft): Deleted. (WebCore::Display::Box::Rect::setTop): Deleted. (WebCore::Display::Box::Rect::setLeft): Deleted. (WebCore::Display::Box::Rect::setWidth): Deleted. (WebCore::Display::Box::Rect::setHeight): Deleted. (WebCore::Display::Box::Rect::setSize): Deleted. (WebCore::Display::Box::Rect::shiftLeftTo): Deleted. (WebCore::Display::Box::Rect::shiftRightTo): Deleted. (WebCore::Display::Box::Rect::shiftTopTo): Deleted. (WebCore::Display::Box::Rect::shiftBottomTo): Deleted. (WebCore::Display::Box::Rect::moveHorizontally): Deleted. (WebCore::Display::Box::Rect::moveVertically): Deleted. (WebCore::Display::Box::Rect::expand): Deleted. (WebCore::Display::Box::Rect::clone const): Deleted. (WebCore::Display::Box::Rect::operator LayoutRect const): Deleted. * layout/displaytree/DisplayRect.h: Added. (WebCore::Display::Rect::expandHorizontally): (WebCore::Display::Rect::expandVertically): (WebCore::Display::Rect::intersects const): (WebCore::Display::Rect::invalidateTop): (WebCore::Display::Rect::invalidateLeft): (WebCore::Display::Rect::invalidateWidth): (WebCore::Display::Rect::invalidateHeight): (WebCore::Display::Rect::hasValidPosition const): (WebCore::Display::Rect::hasValidSize const): (WebCore::Display::Rect::hasValidGeometry const): (WebCore::Display::Rect::Rect): (WebCore::Display::Rect::invalidatePosition): (WebCore::Display::Rect::setHasValidPosition): (WebCore::Display::Rect::setHasValidSize): (WebCore::Display::Rect::top const): (WebCore::Display::Rect::left const): (WebCore::Display::Rect::bottom const): (WebCore::Display::Rect::right const): (WebCore::Display::Rect::topLeft const): (WebCore::Display::Rect::bottomRight const): (WebCore::Display::Rect::size const): (WebCore::Display::Rect::width const): (WebCore::Display::Rect::height const): (WebCore::Display::Rect::setTopLeft): (WebCore::Display::Rect::setTop): (WebCore::Display::Rect::setLeft): (WebCore::Display::Rect::setWidth): (WebCore::Display::Rect::setHeight): (WebCore::Display::Rect::setSize): (WebCore::Display::Rect::shiftLeftTo): (WebCore::Display::Rect::shiftRightTo): (WebCore::Display::Rect::shiftTopTo): (WebCore::Display::Rect::shiftBottomTo): (WebCore::Display::Rect::moveHorizontally): (WebCore::Display::Rect::moveVertically): (WebCore::Display::Rect::expand): (WebCore::Display::Rect::clone const): (WebCore::Display::Rect::operator LayoutRect const): * layout/displaytree/DisplayRun.h: Renamed from Source/WebCore/layout/inlineformatting/InlineRun.h. (WebCore::Display::Run::TextContext::start const): (WebCore::Display::Run::TextContext::end const): (WebCore::Display::Run::TextContext::length const): (WebCore::Display::Run::TextContext::expand): (WebCore::Display::Run::logicalTopLeft const): (WebCore::Display::Run::logicalLeft const): (WebCore::Display::Run::logicalRight const): (WebCore::Display::Run::logicalTop const): (WebCore::Display::Run::logicalBottom const): (WebCore::Display::Run::logicalWidth const): (WebCore::Display::Run::logicalHeight const): (WebCore::Display::Run::setLogicalWidth): (WebCore::Display::Run::setLogicalTop): (WebCore::Display::Run::setLogicalLeft): (WebCore::Display::Run::setLogicalRight): (WebCore::Display::Run::moveVertically): (WebCore::Display::Run::moveHorizontally): (WebCore::Display::Run::expandVertically): (WebCore::Display::Run::expandHorizontally): (WebCore::Display::Run::setTextContext): (WebCore::Display::Run::textContext): (WebCore::Display::Run::textContext const): (WebCore::Display::Run::Run): (WebCore::Display::Run::TextContext::TextContext): * layout/floats/FloatAvoider.cpp: (WebCore::Layout::FloatAvoider::rectInContainingBlock const): * layout/floats/FloatAvoider.h: (WebCore::Layout::FloatAvoider::rect const): * layout/floats/FloatBox.cpp: (WebCore::Layout::FloatBox::rect const): * layout/floats/FloatBox.h: * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatPair::intersects const): * layout/floats/FloatingState.h: (WebCore::Layout::FloatingState::FloatItem::rectWithMargin const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layout const): (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthConstraints const): (WebCore::Layout::InlineFormattingContext::initializeMarginBorderAndPaddingForGenericInlineBox const): (WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPaddingForInlineContainer const): (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFloatBox const): (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForInlineBlock const): (WebCore::Layout::InlineFormattingContext::computeHorizontalMargin const): (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const): (WebCore::Layout::InlineFormattingContext::collectInlineContent const): (WebCore::Layout::InlineFormattingContext::computeMargin const): Deleted. (WebCore::Layout::addDetachingRules): Deleted. (WebCore::Layout::createAndAppendInlineItem): Deleted. * layout/inlineformatting/InlineFormattingContext.h: (WebCore::Layout::InlineFormattingContext::LineLayout::layoutState const): * layout/inlineformatting/InlineFormattingContextLineLayout.cpp: (WebCore::Layout::halfLeadingMetrics): (WebCore::Layout::Line::availableWidth const): (WebCore::Layout::Line::contentLogicalRight const): (WebCore::Layout::Line::contentLogicalWidth const): (WebCore::Layout::Line::logicalTop const): (WebCore::Layout::Line::logicalLeft const): (WebCore::Layout::Line::logicalRight const): (WebCore::Layout::Line::logicalBottom const): (WebCore::Layout::Line::logicalWidth const): (WebCore::Layout::Line::logicalHeight const): (WebCore::Layout::Line::LineItem::LineItem): (WebCore::Layout::Line::Line): (WebCore::Layout::Line::reset): (WebCore::Layout::Line::close): (WebCore::Layout::Line::removeTrailingTrimmableContent): (WebCore::Layout::Line::moveLogicalLeft): (WebCore::Layout::Line::moveLogicalRight): (WebCore::Layout::isTrimmableContent): (WebCore::Layout::Line::trailingTrimmableWidth const): (WebCore::Layout::Line::hasContent const): (WebCore::Layout::Line::appendNonBreakableSpace): (WebCore::Layout::Line::appendInlineContainerStart): (WebCore::Layout::Line::appendInlineContainerEnd): (WebCore::Layout::Line::appendTextContent): (WebCore::Layout::Line::appendNonTextContent): (WebCore::Layout::Line::appendHardLineBreak): (WebCore::Layout::UncommittedContent::isEmpty const): (WebCore::Layout::UncommittedContent::width const): (WebCore::Layout::UncommittedContent::add): (WebCore::Layout::UncommittedContent::reset): (WebCore::Layout::InlineFormattingContext::LineLayout::LineLayout): (WebCore::Layout::InlineFormattingContext::LineLayout::initializeLine const): (WebCore::Layout::InlineFormattingContext::LineLayout::layout const): (WebCore::Layout::InlineFormattingContext::LineLayout::closeLine const): (WebCore::Layout::InlineFormattingContext::LineLayout::handleFloat const): (WebCore::Layout::InlineFormattingContext::LineLayout::commitInlineItemToLine const): (WebCore::Layout::horizontalAdjustmentForAlignment): (WebCore::Layout::InlineFormattingContext::LineLayout::alignRuns const): (WebCore::Layout::Line::isClosed const): Deleted. (WebCore::Layout::Line::isFirstLine const): Deleted. (WebCore::Layout::Line::runs): Deleted. (WebCore::Layout::Line::contentLogicalLeft const): Deleted. (WebCore::Layout::Line::lastRunType const): Deleted. (WebCore::Layout::Line::init): Deleted. (WebCore::Layout::Line::adjustLogicalLeft): Deleted. (WebCore::Layout::Line::adjustLogicalRight): Deleted. (WebCore::Layout::Line::appendContent): Deleted. (WebCore::Layout::InlineFormattingContext::LineLayout::initializeNewLine const): Deleted. (WebCore::Layout::InlineFormattingContext::LineLayout::splitInlineRunIfNeeded const): Deleted. (WebCore::Layout::InlineFormattingContext::LineLayout::createFinalRuns const): Deleted. (WebCore::Layout::InlineFormattingContext::LineLayout::postProcessInlineRuns const): Deleted. (WebCore::Layout::InlineFormattingContext::LineLayout::appendContentToLine const): Deleted. (WebCore::Layout::InlineFormattingContext::LineLayout::computeFloatPosition const): Deleted. (WebCore::Layout::InlineFormattingContext::LineLayout::placeInFlowPositionedChildren const): Deleted. (WebCore::Layout::adjustedLineLogicalLeft): Deleted. (WebCore::Layout::InlineFormattingContext::LineLayout::justifyRuns): Deleted. (WebCore::Layout::InlineFormattingContext::LineLayout::computeExpansionOpportunities const): Deleted. (WebCore::Layout::InlineFormattingContext::LineLayout::runWidth const): Deleted. * layout/inlineformatting/InlineFormattingState.h: (WebCore::Layout::InlineFormattingState::inlineItems): (WebCore::Layout::InlineFormattingState::lineBoxes): (WebCore::Layout::InlineFormattingState::addInlineItem): (WebCore::Layout::InlineFormattingState::addInlineRun): (WebCore::Layout::InlineFormattingState::addLineBox): (WebCore::Layout::InlineFormattingState::inlineContent): Deleted. (WebCore::Layout::InlineFormattingState::lastInlineItem const): Deleted. (WebCore::Layout::InlineFormattingState::appendInlineRun): Deleted. * layout/inlineformatting/InlineItem.h: (WebCore::Layout::InlineItem::type const): (WebCore::Layout::InlineItem::isText const): (WebCore::Layout::InlineItem::isBox const): (WebCore::Layout::InlineItem::isHardLineBreak const): (WebCore::Layout::InlineItem::isFloat const): (WebCore::Layout::InlineItem::isLineBreak const): (WebCore::Layout::InlineItem::isContainerStart const): (WebCore::Layout::InlineItem::isContainerEnd const): (WebCore::Layout::InlineItem::InlineItem): (WebCore::Layout::InlineItem::setWidth): (WebCore::Layout::InlineItem::width const): (WebCore::Layout::InlineItem::addDetachingRule): Deleted. (WebCore::Layout::InlineItem::detachingRules const): Deleted. (WebCore::Layout::InlineItem::nonBreakableStart const): Deleted. (WebCore::Layout::InlineItem::nonBreakableEnd const): Deleted. (WebCore::Layout::InlineItem::addNonBreakableStart): Deleted. (WebCore::Layout::InlineItem::addNonBreakableEnd): Deleted. (WebCore::Layout::InlineItem::textContent const): Deleted. * layout/inlineformatting/InlineLineBox.h: Copied from Source/WebCore/layout/floats/FloatBox.h. (WebCore::Layout::LineBox::logicalTopLeft const): (WebCore::Layout::LineBox::logicalLeft const): (WebCore::Layout::LineBox::logicalRight const): (WebCore::Layout::LineBox::logicalTop const): (WebCore::Layout::LineBox::logicalBottom const): (WebCore::Layout::LineBox::logicalWidth const): (WebCore::Layout::LineBox::logicalHeight const): (WebCore::Layout::LineBox::LineBox): * layout/inlineformatting/InlineLineBreaker.cpp: (WebCore::Layout::LineBreaker::LineBreaker): (WebCore::Layout::LineBreaker::breakingContext): (WebCore::Layout::LineBreaker::wordBreakingBehavior const): (WebCore::Layout::LineBreaker::runWidth const): (WebCore::Layout::LineBreaker::isAtBreakingOpportunity): (WebCore::Layout::LineBreaker::textWidth const): (WebCore::Layout::InlineLineBreaker::InlineLineBreaker): Deleted. (WebCore::Layout::InlineLineBreaker::nextRun): Deleted. (WebCore::Layout::InlineLineBreaker::isAtContentEnd const): Deleted. (WebCore::Layout::InlineLineBreaker::lineBreakingBehavior): Deleted. (WebCore::Layout::InlineLineBreaker::runWidth const): Deleted. (WebCore::Layout::InlineLineBreaker::textWidth const): Deleted. (WebCore::Layout::InlineLineBreaker::splitRun): Deleted. (WebCore::Layout::InlineLineBreaker::adjustSplitPositionWithHyphenation const): Deleted. * layout/inlineformatting/InlineLineBreaker.h: * layout/inlineformatting/InlineRunProvider.cpp: Removed. * layout/inlineformatting/InlineRunProvider.h: Removed. * layout/inlineformatting/InlineTextItem.cpp: Added. (WebCore::Layout::isWhitespaceCharacter): (WebCore::Layout::isSoftLineBreak): (WebCore::Layout::moveToNextNonWhitespacePosition): (WebCore::Layout::moveToNextBreakablePosition): (WebCore::Layout::InlineTextItem::createAndAppendTextItems): (WebCore::Layout::InlineTextItem::InlineTextItem): * layout/inlineformatting/InlineTextItem.h: Copied from Source/WebCore/layout/inlineformatting/text/TextUtil.h. (WebCore::Layout::InlineTextItem::start const): (WebCore::Layout::InlineTextItem::end const): (WebCore::Layout::InlineTextItem::length const): (WebCore::Layout::InlineTextItem::isWhitespace const): (WebCore::Layout::InlineTextItem::isCollapsed const): * layout/inlineformatting/text/TextUtil.cpp: (WebCore::Layout::TextUtil::hyphenPositionBefore): (WebCore::Layout::TextUtil::width): (WebCore::Layout::TextUtil::fixedPitchWidth): * layout/inlineformatting/text/TextUtil.h: * layout/layouttree/LayoutBox.h: * layout/layouttree/LayoutReplaced.cpp: (WebCore::Layout::Replaced::intrinsicRatio const): * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::accumulatedOffsetForInFlowPositionedContinuation): (WebCore::Layout::TreeBuilder::createSubTree): (WebCore::Layout::outputInlineRuns): (WebCore::Layout::outputLayoutBox): 2019-05-25 Wenson Hsieh [iOS] Respect -[NSItemProvider preferredPresentationSize] when dropping images https://bugs.webkit.org/show_bug.cgi?id=198242 Reviewed by Beth Dakin. Teach the web content reader to respect the -preferredPresentationSize when creating attachment-backed image elements. See below for more details. Test: WKAttachmentTestsIOS.InsertDroppedImageWithPreferredPresentationSize * editing/WebContentReader.h: * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::attachmentForFilePath): (WebCore::attachmentForData): When creating attachment-backed image elements, additionally set width and height attributes from the preferred presentation size, if specified. (WebCore::WebContentReader::readFilePath): Add a version of readFilePath that takes a single file path, and an optional preferred presentation size. (WebCore::WebContentReader::readFilePaths): Reimplement readFilePaths in terms of readFilePath. (WebCore::WebContentReader::readDataBuffer): Add more plumbing for preferredPresentationSize. * platform/Pasteboard.h: (WebCore::PasteboardWebContentReader::readFilePath): (WebCore::PasteboardWebContentReader::readDataBuffer): * platform/ios/PasteboardIOS.mm: (WebCore::Pasteboard::read): (WebCore::Pasteboard::readRespectingUTIFidelities): Forward PasteboardItemInfo's preferredPresentationSize to the web content reader. 2019-05-25 Antoine Quint Opt naver.com into simulated mouse events quirk on iOS https://bugs.webkit.org/show_bug.cgi?id=198248 Reviewed by Brent Fulgham. * page/Quirks.cpp: (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const): 2019-05-25 Youenn Fablet media/video-remote-control-playpause.html is timing out after r245712 https://bugs.webkit.org/show_bug.cgi?id=198238 Reviewed by Eric Carlson. Fix regression introduced in r245712. Covered by test no longer timing out. * platform/audio/PlatformMediaSessionManager.cpp: (WebCore::PlatformMediaSessionManager::sessionWillEndPlayback): 2019-05-25 Simon Fraser [Async overflow scrolling] Absolute positioned element inside async overflow scroll didn't get composited sometimes https://bugs.webkit.org/show_bug.cgi?id=198237 Reviewed by Antti Koivisto. The logic in requiresCompositingForIndirectReason() that decides if we need to do compositing for a layer that needs to move independently of its enclosing scroller was wrong. Instead of asking question about the enclosing compositing layer, it needs to ask whether it has different positioning behavior from the layer that it would otherwise paint into, which is its paint-order parent. "paintsIntoProvidedBacking" already does a containing-block check against the scroller, so we know we don't have to do the check in that case. Test: scrollingcoordinator/scrolling-tree/absolute-inside-stacking-in-scroller.html * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::computeCompositingRequirements): (WebCore::enclosingCompositedScrollingLayer): (WebCore::isScrolledByOverflowScrollLayer): (WebCore::isNonScrolledLayerInsideScrolledCompositedAncestor): (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const): * rendering/RenderLayerCompositor.h: 2019-05-25 Simon Fraser [macOS] Fix programmatic scroll in RTL overflow with async scrolling enabled https://bugs.webkit.org/show_bug.cgi?id=198226 Reviewed by Antti Koivisto. On macOS we need to use a scroll offset to set the layer position, not a scroll position. Test: scrollingcoordinator/mac/rtl-programmatic-overflow-scroll.html * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm: (WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionScrollingLayers): 2019-05-24 Joonghun Park Make computed width of non-replaced inline return computed style. https://bugs.webkit.org/show_bug.cgi?id=197814 Reviewed by Antti Koivisto. Currently, Computed width of non-replaced inline incorrectly returns "auto" instead of the computed value. This patch changes the behavior according to https://drafts.csswg.org/cssom/#resolved-value as below. 'If the property applies to the element or pseudo-element and the resolved value of the display property is not none or contents, then the resolved value is the used value. Otherwise the resolved value is the computed value.' * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): 2019-05-24 Myles C. Maxfield [WHLSL] Allow vertex attributes to have arbitrary names in the shader https://bugs.webkit.org/show_bug.cgi?id=198235 Reviewed by Dean Jackson and Justin Fan. Metal doesn't allow arbitrary vertex attribute IDs. If you try to create a vertex attribute > 16, the Metal validation layer will assert. So, we need to have a mapping from whatever the WebGPU API says the vertex attribute IDs should be to the internally-used vertex attribute IDs. Test: webgpu/whlsl-arbitrary-vertex-attribute-locations.html * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp: (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::VertexEntryPointScaffolding): * Modules/webgpu/WHLSL/WHLSLPipelineDescriptor.h: * Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp: (WebCore::WHLSL::matchVertexAttributes): * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: (WebCore::convertRenderPipelineDescriptor): (WebCore::trySetInputStateForPipelineDescriptor): 2019-05-24 Timothy Hatcher Refactor how showLetterpressedGlyphsWithAdvances gets the graphics context. https://bugs.webkit.org/show_bug.cgi?id=198225 Reviewed by Dean Jackson. * platform/graphics/cocoa/FontCascadeCocoa.mm: (WebCore::showLetterpressedGlyphsWithAdvances): (WebCore::FontCascade::drawGlyphs): 2019-05-24 Timothy Hatcher Plumb dark appearance down to GraphicsContext. https://bugs.webkit.org/show_bug.cgi?id=198224 rdar://problem/51068494 Reviewed by Dean Jackson. No test yet, as it is not testable until this gets used. * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContextStateChange::changesFromState const): (WebCore::GraphicsContextStateChange::accumulate): (WebCore::GraphicsContextStateChange::apply const): (WebCore::GraphicsContextStateChange::dump const): (WebCore::GraphicsContext::setUseDarkAppearance): * platform/graphics/GraphicsContext.h: (WebCore::GraphicsContext::useDarkAppearance const): * rendering/TextPaintStyle.cpp: (WebCore::TextPaintStyle::operator== const): (WebCore::computeTextPaintStyle): (WebCore::updateGraphicsContext): * rendering/TextPaintStyle.h: 2019-05-24 Youenn Fablet Make sure completion handler is always called in SWServer::startSuspension https://bugs.webkit.org/show_bug.cgi?id=198215 Reviewed by Alex Christensen. * workers/service/server/SWServer.cpp: (WebCore::SWServer::startSuspension): Make sure completion handler is called in case of no registration store. 2019-05-24 Ryosuke Niwa Asssertion failure in dispatchSubtreeModifiedEvent due to TextFieldInputType updating UA shadow tree inside Element::removedFromAncestor https://bugs.webkit.org/show_bug.cgi?id=198216 Reviewed by Brent Fulgham. The bug was caused by ListAttributeTargetObserver::idTargetChanged() updating the shadow tree of an input element within Element::removedFromAncestor via TextFieldInputType::createDataListDropdownIndicator(). Fixed it by supressing the assertions with ScriptDisallowedScope::EventAllowedScope since it's always safe to update UA shadow trees of input elements as it's not exposed to author scripts. Avoiding the creation of dropdown indicator in this particular scenario is a lot more involved and it's not particularly correct because there could be another datalist element which matches the ID specified in list content attribute after the removal of the old datalist element. Test: fast/forms/datalist/datalist-removal-assertion.html * html/TextFieldInputType.cpp: (WebCore::TextFieldInputType::createDataListDropdownIndicator): (WebCore::TextFieldInputType::createContainer): * html/shadow/DataListButtonElement.cpp: (WebCore::DataListButtonElement::DataListButtonElement): 2019-05-24 Saam barati [WHLSL] ReadModifyWriteExpression always has a result and new value expression https://bugs.webkit.org/show_bug.cgi?id=198079 Reviewed by Myles Maxfield. Let's not pretend it might not. * Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h: (WebCore::WHLSL::AST::ReadModifyWriteExpression::newValueExpression): (WebCore::WHLSL::AST::ReadModifyWriteExpression::resultExpression): (WebCore::WHLSL::AST::ReadModifyWriteExpression::takeNewValueExpression): (WebCore::WHLSL::AST::ReadModifyWriteExpression::takeResultExpression): * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp: (WebCore::WHLSL::ASTDumper::visit): * Modules/webgpu/WHLSL/WHLSLChecker.cpp: (WebCore::WHLSL::Checker::visit): * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp: (WebCore::WHLSL::PropertyResolver::visit): * Modules/webgpu/WHLSL/WHLSLVisitor.cpp: (WebCore::WHLSL::Visitor::visit): 2019-05-23 Simon Fraser With async overflow scrolling, programmatic scroll to a negative offset fails to clamp the scroll offset https://bugs.webkit.org/show_bug.cgi?id=198208 Reviewed by Zalan Bujtas. RenderLayer::scrollToOffset() needs to pass the clamped offset to scrollingCoordinator->requestScrollPositionUpdate(), otherwise the scrolling tree will round-trip a negative value and scrollLeft will end up negative. Test: fast/scrolling/programmatic-scroll-to-negative-offset.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::scrollToOffset): 2019-05-23 Devin Rousso Web Inspector: Overlay: rulers/guides should be shown whenever element selection is enabled https://bugs.webkit.org/show_bug.cgi?id=198088 Reviewed by Timothy Hatcher. When trying to "measure" the absolute position (to the viewport) or relative position (to another element) of a given element, often the easiest way is to enable Element Selection and Show Rulers at the same time. This can have the undesired "side-effect" of having the rulers be always present, even when not highlighting any nodes. The ideal functionality is to allow the rulers/guides to be shown when element selection is active and a node is hovered, regardless of whether "Show Rulers" is enabled. * inspector/InspectorOverlay.h: (WebCore::InspectorOverlay::setShowRulersDuringElementSelection): Added. * inspector/InspectorOverlay.cpp: (WebCore::InspectorOverlay::paint): (WebCore::InspectorOverlay::shouldShowOverlay): (WebCore::InspectorOverlay::drawNodeHighlight): (WebCore::InspectorOverlay::drawQuadHighlight): (WebCore::InspectorOverlay::drawElementTitle): If `showRulersDuringElementSelection` is enabled, draw rulers whenever any highlight bounds are calculated, but don't update the overlay if it's the only thing enabled (e.g. if there's no currently hovered node, the overlay will disappear). * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::willDestroyFrontendAndBackend): (WebCore::InspectorDOMAgent::inspect): (WebCore::InspectorDOMAgent::setInspectModeEnabled): (WebCore::InspectorDOMAgent::setSearchingForNode): Add an optional `showRulers` parameter to `DOM.setInspectModeEnabled` that supersedes the current value of `Page.setShowRulers` as to whether rulers/guides are shown. 2019-05-23 Devin Rousso Web Inspector: Overlay: rulers should switch sides if they intersect the highlighted node(s) so they don't obstruct any content https://bugs.webkit.org/show_bug.cgi?id=198165 Reviewed by Timothy Hatcher. If the highlighted node is against the top edge of the screen, the top ruler should shift to the bottom, unless the highlighted node is also against the bottom edge of the screen. If the highlighted node is against the left edge of the screen, the left ruler should shift to the right, unless the highlighted node is also against the right edge of the screen. This way, unless the node is very wide/tall, the rulers won't be drawn on top of anything being highlighted. * inspector/InspectorOverlay.h: * inspector/InspectorOverlay.cpp: (WebCore::InspectorOverlay::paint): (WebCore::InspectorOverlay::drawNodeHighlight): (WebCore::InspectorOverlay::drawQuadHighlight): (WebCore::InspectorOverlay::drawBounds): (WebCore::InspectorOverlay::drawRulers): Drive-by: create an alias for the type (`FloatRect`) used when calculating the bounds of everything that's highlighted. 2019-05-23 Saam barati [WHLSL] Make the AST dumper disambiguate expressions using parenthesis to represent AST construction https://bugs.webkit.org/show_bug.cgi?id=198199 Reviewed by Myles C. Maxfield. We would dump "*foo.bar" for "(*foo).bar", which is super confusing. We now dump "(*foo).bar". * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp: (WebCore::WHLSL::ASTDumper::visit): 2019-05-23 Saam barati [WHLSL] Don't wrap anonymous variables in parens in the AST dumper https://bugs.webkit.org/show_bug.cgi?id=198196 Reviewed by Myles C. Maxfield. This makes the dump of 'foo.bar.x = 42' go from ($(0x7f86d9d94440) = &foo, $(0x7f86d9d944e0) = operator.bar(*$(0x7f86d9d94440)), $(0x7f86d9d944e0) = operator.x=($(0x7f86d9d944e0), 42), *$(0x7f86d9d94440) = operator.bar=(*$(0x7f86d9d94440), $(0x7f86d9d944e0))); to: ($0x7f86d9d94440 = &foo, $0x7f86d9d944e0 = operator.bar(*$0x7f86d9d94440), $0x7f86d9d944e0 = operator.x=($0x7f86d9d944e0, 42), *$0x7f86d9d94440 = operator.bar=(*$0x7f86d9d94440, $0x7f86d9d944e0)); * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp: (WebCore::WHLSL::ASTDumper::visit): 2019-05-23 Myles C. Maxfield [WHLSL] Implement property resolver https://bugs.webkit.org/show_bug.cgi?id=195925 Unreviewed watchOS build fix. * Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h: (WebCore::WHLSL::AST::AssignmentExpression::AssignmentExpression): 2019-05-23 Saam barati [WHLSL] Property resolver needs to recurse to handle the base when simplifying rvalues https://bugs.webkit.org/show_bug.cgi?id=198193 Reviewed by Myles Maxfield. We were only transforming the top most node in the AST. So things like 'x = foo.bar' would work, but 'x = foo.bar.baz' would not. Test: webgpu/whlsl-nested-dot-expression-rvalue.html * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp: (WebCore::WHLSL::PropertyResolver::simplifyRightValue): 2019-05-22 Stephanie Lewis release builds of webkit cannot be used to generate a dyld shared cache https://bugs.webkit.org/show_bug.cgi?id=198150 Reviewed by Dan Bernstein. Restrict the -not_for_dyld_shared_cache linker flag to macosx * Configurations/WebCore.xcconfig: 2019-05-23 Zalan Bujtas [Hittest] Move hittesting from RenderView to Document https://bugs.webkit.org/show_bug.cgi?id=198192 Reviewed by Antti Koivisto. RenderView is not refcounted and may be destroyed in updateLayout(), so enter hit-testing from Document. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::press): * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::visiblePositionForPoint const): * dom/Document.cpp: (WebCore::FrameFlatteningLayoutDisallower::FrameFlatteningLayoutDisallower): (WebCore::FrameFlatteningLayoutDisallower::~FrameFlatteningLayoutDisallower): (WebCore::Document::scheduleStyleRecalc): (WebCore::Document::prepareMouseEvent): (WebCore::Document::hitTest): * dom/Document.h: (WebCore::Document::inHitTesting const): * dom/TreeScope.cpp: (WebCore::TreeScope::nodeFromPoint): (WebCore::TreeScope::elementsFromPoint): * editing/FrameSelection.cpp: (WebCore::FrameSelection::contains const): * html/HTMLPlugInElement.cpp: (WebCore::HTMLPlugInElement::isReplacementObscured): * html/MediaElementSession.cpp: (WebCore::isElementMainContentForPurposesOfAutoplay): * page/DragController.cpp: (WebCore::elementUnderMouse): * page/EventHandler.cpp: (WebCore::EventHandler::handleMouseDraggedEvent): (WebCore::EventHandler::eventMayStartDrag const): (WebCore::EventHandler::updateSelectionForMouseDrag): (WebCore::EventHandler::hitTestResultAtPoint const): (WebCore::EventHandler::updateCursor): (WebCore::EventHandler::isInsideScrollbar const): (WebCore::EventHandler::handleWheelEvent): (WebCore::EventHandler::hoverTimerFired): (WebCore::EventHandler::handleDrag): (WebCore::hitTestResultInFrame): * page/FrameViewLayoutContext.cpp: (WebCore::FrameViewLayoutContext::setNeedsLayoutAfterViewConfigurationChange): * rendering/RenderView.cpp: (WebCore::FrameFlatteningLayoutDisallower::FrameFlatteningLayoutDisallower): Deleted. (WebCore::FrameFlatteningLayoutDisallower::~FrameFlatteningLayoutDisallower): Deleted. (): Deleted. (WebCore::RenderView::hitTest): Deleted. * rendering/RenderView.h: * rendering/RenderWidget.cpp: (WebCore::RenderWidget::nodeAtPoint): * testing/Internals.cpp: (WebCore::Internals::nodesFromRect const): 2019-05-23 Youenn Fablet CacheStorageConnection callbacks should be completed on network connection close https://bugs.webkit.org/show_bug.cgi?id=195757 Reviewed by Alex Christensen. Move HashMap-based callbacks to WorkerCacheStorageConnection. Make CacheStorageConnection default API to implement use callbacks. This is used by WebKit layer to do AsyncReply IPC. Move DOMCacheEngine callbacks to CompletionHandler. Test: http/wpt/cache-storage/cache-storage-networkprocess-crash.html * Modules/cache/CacheStorageConnection.cpp: * Modules/cache/CacheStorageConnection.h: (WebCore::CacheStorageConnection::engineRepresentation): * Modules/cache/DOMCacheEngine.h: * Modules/cache/WorkerCacheStorageConnection.cpp: (WebCore::recordsDataFromRecords): (WebCore::recordsDataOrErrorFromRecords): (WebCore::recordsFromRecordsData): (WebCore::recordsOrErrorFromRecordsData): (WebCore::WorkerCacheStorageConnection::open): (WebCore::WorkerCacheStorageConnection::openOrRemoveCompleted): (WebCore::WorkerCacheStorageConnection::remove): (WebCore::WorkerCacheStorageConnection::retrieveCaches): (WebCore::WorkerCacheStorageConnection::retrieveCachesCompleted): (WebCore::WorkerCacheStorageConnection::retrieveRecords): (WebCore::WorkerCacheStorageConnection::retrieveRecordsCompleted): (WebCore::WorkerCacheStorageConnection::batchDeleteOperation): (WebCore::WorkerCacheStorageConnection::deleteRecordsCompleted): (WebCore::WorkerCacheStorageConnection::batchPutOperation): (WebCore::WorkerCacheStorageConnection::putRecordsCompleted): (WebCore::WorkerCacheStorageConnection::reference): (WebCore::WorkerCacheStorageConnection::dereference): (WebCore::WorkerCacheStorageConnection::clearPendingRequests): * Modules/cache/WorkerCacheStorageConnection.h: * page/CacheStorageProvider.h: (WebCore::CacheStorageProvider::createCacheStorageConnection): 2019-05-23 Youenn Fablet Multiple videos (with audios) with autoplay & playinline not working. Only one video play at a time. https://bugs.webkit.org/show_bug.cgi?id=193312 Reviewed by Jer Noble. Allow all MediaStream backed video elements to play together. Any non MediaStream backed video will stop all MediaStream backed video elements. Conversely, all non MediaStream backed videos will stop when playing one MediaStream backed video. Refactor PlatformMediaSessionManager as the way to iterate through sessions is not safe when pausing a session: if playing, the session will be moved in the array of sessions. To handle this, copy the list of sessions before iterating through them. For extra safety, make sessions WeakPtr. Add routines for the case of filtering with a predicate taking a const session. In that case, we do not copy the vector but iterate through it as a small optimization. Test: webrtc/concurrentVideoPlayback.html * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::bestMediaElementForShowingPlaybackControlsManager): (WebCore::HTMLMediaElement::hasMediaStreamSource const): * html/HTMLMediaElement.h: * platform/audio/PlatformMediaSession.cpp: (WebCore::PlatformMediaSession::activeAudioSessionRequired const): (WebCore::PlatformMediaSession::canPlayConcurrently const): (WebCore::PlatformMediaSession::activeAudioSessionRequired): Deleted. * platform/audio/PlatformMediaSession.h: (WebCore::PlatformMediaSessionClient::hasMediaStreamSource const): * platform/audio/PlatformMediaSessionManager.cpp: (WebCore::PlatformMediaSessionManager::has const): (WebCore::PlatformMediaSessionManager::activeAudioSessionRequired const): (WebCore::PlatformMediaSessionManager::canProduceAudio const): (WebCore::PlatformMediaSessionManager::count const): (WebCore::PlatformMediaSessionManager::beginInterruption): (WebCore::PlatformMediaSessionManager::endInterruption): (WebCore::PlatformMediaSessionManager::addSession): (WebCore::PlatformMediaSessionManager::removeSession): (WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback): (WebCore::PlatformMediaSessionManager::sessionWillEndPlayback): (WebCore::PlatformMediaSessionManager::setCurrentSession): (WebCore::PlatformMediaSessionManager::currentSession const): (WebCore::PlatformMediaSessionManager::applicationWillBecomeInactive): (WebCore::PlatformMediaSessionManager::applicationDidBecomeActive): (WebCore::PlatformMediaSessionManager::applicationDidEnterBackground): (WebCore::PlatformMediaSessionManager::applicationWillEnterForeground): (WebCore::PlatformMediaSessionManager::systemWillSleep): (WebCore::PlatformMediaSessionManager::systemDidWake): (WebCore::PlatformMediaSessionManager::stopAllMediaPlaybackForDocument): (WebCore::PlatformMediaSessionManager::stopAllMediaPlaybackForProcess): (WebCore::PlatformMediaSessionManager::suspendAllMediaPlaybackForDocument): (WebCore::PlatformMediaSessionManager::resumeAllMediaPlaybackForDocument): (WebCore::PlatformMediaSessionManager::suspendAllMediaBufferingForDocument): (WebCore::PlatformMediaSessionManager::resumeAllMediaBufferingForDocument): (WebCore::PlatformMediaSessionManager::currentSessionsMatching const): (WebCore::PlatformMediaSessionManager::forEachMatchingSession): (WebCore::PlatformMediaSessionManager::forEachMatchingSession const): (WebCore::PlatformMediaSessionManager::forEachSession): (WebCore::PlatformMediaSessionManager::anyOfSessions const): (): Deleted. (WebCore::PlatformMediaSessionManager::applicationWillBecomeInactive const): Deleted. (WebCore::PlatformMediaSessionManager::applicationDidBecomeActive const): Deleted. (WebCore::PlatformMediaSessionManager::applicationDidEnterBackground const): Deleted. (WebCore::PlatformMediaSessionManager::applicationWillEnterForeground const): Deleted. (WebCore::PlatformMediaSessionManager::forEachSession const): Deleted. (WebCore::PlatformMediaSessionManager::findSession const): Deleted. * platform/audio/PlatformMediaSessionManager.h: (WebCore::PlatformMediaSessionManager::anyOfSessions const): Deleted. * platform/audio/cocoa/MediaSessionManagerCocoa.mm: (MediaSessionManagerCocoa::updateSessionState): (MediaSessionManagerCocoa::beginInterruption): * platform/audio/ios/MediaSessionManagerIOS.mm: (WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring): (WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange): 2019-05-23 Saam barati [WHLSL] Add a helper for in-place AST mutation https://bugs.webkit.org/show_bug.cgi?id=198175 Reviewed by Myles Maxfield. This makes WHLSL AST mutation code a bit easier to read and write. Code that looked like: ``` static_assert(sizeof(AST::DereferenceExpression) <= sizeof(AST::DotExpression), "Dot expressions need to be able to become dereference expressions without updating backreferences"); void* location = &dotExpression; dotExpression.~DotExpression(); auto* dereferenceExpression = new (location) AST::DereferenceExpression(WTFMove(origin), WTFMove(callExpression)); ``` Can now be: ``` auto* dereferenceExpression = AST::replaceWith(dotExpression, WTFMove(origin), WTFMove(callExpression)); ``` * Modules/webgpu/WHLSL/AST/WHLSLNode.h: (WebCore::WHLSL::AST::replaceWith): * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp: (WebCore::WHLSL::NameResolver::visit): * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp: (WebCore::WHLSL::PropertyResolver::visit): (WebCore::WHLSL::PropertyResolver::simplifyRightValue): (WebCore::WHLSL::LeftValueSimplifier::visit): 2019-05-23 Eric Carlson [macOS,iOS] Add always-on logging for AVPlayerTimeControlStatus changes https://bugs.webkit.org/show_bug.cgi?id=197946 Reviewed by Jon Lee. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::convertEnumerationToString): (WTF::LogArgument::toString): (WebCore::MediaPlayerPrivateAVFoundationObjC::timeControlStatusDidChange): 2019-05-23 Antoine Quint [Pointer Events] Compatibility mouse events can only be prevented while the pointer is pressed https://bugs.webkit.org/show_bug.cgi?id=198178 Reviewed by Dean Jackson. Test: pointerevents/mouse/compatibility-mouse-events-prevention-mouse-released.html The Pointer Events spec, in https://www.w3.org/TR/pointerevents/#compatibility-mapping-with-mouse-events, says that "Mouse events can only be prevented when the pointer is down. Hovering pointers (e.g. a mouse with no buttons pressed) cannot have their mouse events prevented." We now track whether the pointer is pressed and clear the preventsCompatibilityMouseEvents when the pointer is moved and it is not pressed. * page/PointerCaptureController.cpp: (WebCore::PointerCaptureController::pointerEventWasDispatched): * page/PointerCaptureController.h: 2019-05-23 Simon Fraser Build fix after r245695. * dom/Element.cpp: 2019-05-23 Antoine Quint [Pointer Events] The mouseover, mouseout, mouseenter, and mouseleave events should not be prevented while the pointer is down https://bugs.webkit.org/show_bug.cgi?id=198177 Reviewed by Dean Jackson. Test: pointerevents/mouse/compatibility-mouse-events-prevention-mouse-pressed.html The Pointer Event spec, in https://www.w3.org/TR/pointerevents/#compatibility-mapping-with-mouse-events, says that "the mouseover, mouseout, mouseenter, and mouseleave events are never prevented (even if the pointer is down)." We add a new static function which indicates what is "compatibility" mouse event since those should be excluded, along with "click", which we already excluded. * dom/Element.cpp: (WebCore::isCompatibilityMouseEvent): (WebCore::Element::dispatchMouseEvent): 2019-05-23 Jon Davis Update feature status for shipped features https://bugs.webkit.org/show_bug.cgi?id=196783 Reviewed by Timothy Hatcher. Updated feature status for Beacon API, CSS Text Decoration Level 4, Intersection Observer, Conic Gradients, Datalist Element, and Web Share. * features.json: 2019-05-23 Simon Fraser Create scrolling tree nodes for descendants of position:absolute inside stacking-context overflow https://bugs.webkit.org/show_bug.cgi?id=198154 Reviewed by Antti Koivisto. There exists code that creates scrolling tree nodes for position:absolute when the containing block chain skips an enclosing scroller, but the compositing ancestor tree includes the scroller. However this code explicitly checked that the layer was position:absolute. This needed to be generalized for any layer whose containing block ancestor chain includes a position:absolute that skips the scroller, for example a transformed inside a position:absolute, so remove an explicit isAbsolutelyPositioned() check and some similar assertions. Test: scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow.html * rendering/RenderLayerCompositor.cpp: (WebCore::collectStationaryLayerRelatedOverflowNodes): (WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const): (WebCore::collectRelatedCoordinatedScrollingNodes): 2019-05-23 Adrian Perez de Castro Fix a few missing header inclusions often masked by by unified sources https://bugs.webkit.org/show_bug.cgi?id=198180 Reviewed by Eric Carlson. * editing/markup.h: Add missing "FloatSize.h" inclusion. * html/FeaturePolicy.cpp: Add missing "HTMLParserIdioms.h" inclusion. * platform/text/TextCodec.cpp: Add missing inclusion. 2019-05-23 Myles C. Maxfield [WHLSL] Implement property resolver https://bugs.webkit.org/show_bug.cgi?id=195925 Reviewed by Saam Barati and Robin Morisset. The property resolver is the thing that replaces dot expressions, index expressions, and read-modify-write expressions with calls to getters, setters, and anders. This patch doesn't fully implement the property resolver, but implements enough for simple dot expressions to work. This is enough for us to be able to test most of the rest of the compiler. Index expressions and read-modify-write expressions are not fully included in this patch, and will be finished in a follow-up patch. The property resolver may introduce anonymous variables in various places. In order to do this, after the property resolver runs, it will insert all these anonymous variables in the beginning of the function. However, this means that entries in the VariableDeclarations vector will all shift, which means VariableDeclarations have to be allocated on the heap so backreferences to them stay valid. This patch moves the storage associated with these values to living directly in the vector's storage to living in heap storage (via filling the vector with UniqueRefs). This patch also adds the third concept of value-ness. We now have right values, left values, and abstract left values (for things which have setters but have no address). This addition is required for the analysis the property resolver performs. This concept is also present in the spec. Test: webgpu/whlsl-dot-expressions.html * Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h: (WebCore::WHLSL::AST::TypeAnnotation::TypeAnnotation): (WebCore::WHLSL::AST::TypeAnnotation::leftAddressSpace const): (WebCore::WHLSL::AST::TypeAnnotation::isRightValue const): (WebCore::WHLSL::AST::TypeAnnotation::visit): * Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h: (WebCore::WHLSL::AST::AssignmentExpression::takeRight): * Modules/webgpu/WHLSL/AST/WHLSLConstantExpression.h: * Modules/webgpu/WHLSL/AST/WHLSLDotExpression.h: * Modules/webgpu/WHLSL/AST/WHLSLEntryPointType.h: * Modules/webgpu/WHLSL/AST/WHLSLExpression.h: (WebCore::WHLSL::AST::Expression::maybeResolvedType): (WebCore::WHLSL::AST::Expression::resolvedType): (WebCore::WHLSL::AST::Expression::maybeTypeAnnotation const): (WebCore::WHLSL::AST::Expression::typeAnnotation const): (WebCore::WHLSL::AST::Expression::setTypeAnnotation): (WebCore::WHLSL::AST::Expression::addressSpace const): Deleted. (WebCore::WHLSL::AST::Expression::setAddressSpace): Deleted. * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteral.h: (WebCore::WHLSL::AST::FloatLiteral::clone const): * Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h: * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.cpp: (WebCore::WHLSL::AST::IntegerLiteral::valueForSelectedType const): * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.h: (WebCore::WHLSL::AST::IntegerLiteral::clone const): * Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h: (WebCore::WHLSL::AST::MakeArrayReferenceExpression::MakeArrayReferenceExpression): (WebCore::WHLSL::AST::MakeArrayReferenceExpression::leftValue): (WebCore::WHLSL::AST::MakeArrayReferenceExpression::lValue): Deleted. * Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h: (WebCore::WHLSL::AST::MakePointerExpression::MakePointerExpression): (WebCore::WHLSL::AST::MakePointerExpression::leftValue): (WebCore::WHLSL::AST::MakePointerExpression::lValue): Deleted. * Modules/webgpu/WHLSL/AST/WHLSLNullLiteral.h: (WebCore::WHLSL::AST::NullLiteral::clone const): * Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h: (WebCore::WHLSL::AST::PropertyAccessExpression::possibleGetterOverloads): (WebCore::WHLSL::AST::PropertyAccessExpression::possibleSetterOverloads): (WebCore::WHLSL::AST::PropertyAccessExpression::possibleAnderOverloads): (WebCore::WHLSL::AST::PropertyAccessExpression::getterFunction): (WebCore::WHLSL::AST::PropertyAccessExpression::anderFunction): (WebCore::WHLSL::AST::PropertyAccessExpression::threadAnderFunction): (WebCore::WHLSL::AST::PropertyAccessExpression::setterFunction): (WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleGetterOverloads): (WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleAnderOverloads): (WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleSetterOverloads): (WebCore::WHLSL::AST::PropertyAccessExpression::setGetterFunction): (WebCore::WHLSL::AST::PropertyAccessExpression::setAnderFunction): (WebCore::WHLSL::AST::PropertyAccessExpression::setThreadAnderFunction): (WebCore::WHLSL::AST::PropertyAccessExpression::setSetterFunction): (WebCore::WHLSL::AST::PropertyAccessExpression::takeBase): (WebCore::WHLSL::AST::PropertyAccessExpression::possibleGetOverloads): Deleted. (WebCore::WHLSL::AST::PropertyAccessExpression::possibleSetOverloads): Deleted. (WebCore::WHLSL::AST::PropertyAccessExpression::possibleAndOverloads): Deleted. (WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleGetOverloads): Deleted. (WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleSetOverloads): Deleted. (WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleAndOverloads): Deleted. * Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h: (WebCore::WHLSL::AST::ReadModifyWriteExpression::oldVariableReference): (WebCore::WHLSL::AST::ReadModifyWriteExpression::newVariableReference): (WebCore::WHLSL::AST::ReadModifyWriteExpression::leftValue): (WebCore::WHLSL::AST::ReadModifyWriteExpression::takeLeftValue): (WebCore::WHLSL::AST::ReadModifyWriteExpression::takeOldValue): (WebCore::WHLSL::AST::ReadModifyWriteExpression::takeNewValue): (WebCore::WHLSL::AST::ReadModifyWriteExpression::takeNewValueExpression): (WebCore::WHLSL::AST::ReadModifyWriteExpression::takeResultExpression): (WebCore::WHLSL::AST::ReadModifyWriteExpression::ReadModifyWriteExpression): (WebCore::WHLSL::AST::ReadModifyWriteExpression::lValue): Deleted. * Modules/webgpu/WHLSL/AST/WHLSLResolvableType.h: (WebCore::WHLSL::AST::ResolvableType::maybeResolvedType const): (WebCore::WHLSL::AST::ResolvableType::resolvedType const): (WebCore::WHLSL::AST::ResolvableType::maybeResolvedType): (WebCore::WHLSL::AST::ResolvableType::resolvedType): * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp: (WebCore::WHLSL::AST::ResourceSemantic::isAcceptableType const): * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp: (WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableType const): * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp: (WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableType const): * Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h: (WebCore::WHLSL::AST::StructureDefinition::find): * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h: (WebCore::WHLSL::AST::TypeReference::maybeResolvedType const): (WebCore::WHLSL::AST::TypeReference::resolvedType const): * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.cpp: (WebCore::WHLSL::AST::UnsignedIntegerLiteral::valueForSelectedType const): * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.h: (WebCore::WHLSL::AST::UnsignedIntegerLiteral::clone const): * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h: * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclarationsStatement.h: (WebCore::WHLSL::AST::VariableDeclarationsStatement::VariableDeclarationsStatement): (WebCore::WHLSL::AST::VariableDeclarationsStatement::variableDeclarations): * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp: (WebCore::WHLSL::Metal::attributeForSemantic): (WebCore::WHLSL::Metal::EntryPointScaffolding::mangledInputPath): (WebCore::WHLSL::Metal::EntryPointScaffolding::unpackResourcesAndNamedBuiltIns): (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::helperTypes): (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::unpack): * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp: (WebCore::WHLSL::Metal::FunctionDeclarationWriter::visit): (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit): * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp: (WebCore::WHLSL::Metal::writeNativeFunction): * Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.cpp: (WebCore::WHLSL::Metal::writeNativeType): * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp: (WebCore::WHLSL::Metal::findInVector): (WebCore::WHLSL::Metal::TypeNamer::visit): (WebCore::WHLSL::Metal::TypeNamer::createNameNode): * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp: (WebCore::WHLSL::ASTDumper::visit): * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp: (WebCore::WHLSL::checkDuplicateFunctions): * Modules/webgpu/WHLSL/WHLSLChecker.cpp: (WebCore::WHLSL::resolveWithOperatorAnderIndexer): (WebCore::WHLSL::resolveWithOperatorLength): (WebCore::WHLSL::resolveWithReferenceComparator): (WebCore::WHLSL::resolveByInstantiation): (WebCore::WHLSL::checkOperatorOverload): (WebCore::WHLSL::Checker::assignTypes): (WebCore::WHLSL::commit): (WebCore::WHLSL::Checker::visit): (WebCore::WHLSL::Checker::recurseAndGetInfo): (WebCore::WHLSL::Checker::getInfo): (WebCore::WHLSL::Checker::assignType): (WebCore::WHLSL::Checker::forwardType): (WebCore::WHLSL::getUnnamedType): (WebCore::WHLSL::Checker::finishVisitingPropertyAccess): Deleted. (WebCore::WHLSL::Checker::recurseAndWrapBaseType): Deleted. * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp: (WebCore::WHLSL::Gatherer::takeEntryPointItems): (WebCore::WHLSL::Gatherer::visit): * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp: (WebCore::WHLSL::matchAndCommit): (WebCore::WHLSL::commit): (WebCore::WHLSL::inferTypesForCall): * Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.cpp: (WebCore::WHLSL::getNativeTypeDeclaration): * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp: (WebCore::WHLSL::NameResolver::visit): * Modules/webgpu/WHLSL/WHLSLParser.cpp: (WebCore::WHLSL::Parser::parseParameters): (WebCore::WHLSL::Parser::parseVariableDeclarations): * Modules/webgpu/WHLSL/WHLSLPipelineDescriptor.h: * Modules/webgpu/WHLSL/WHLSLPrepare.cpp: (WebCore::WHLSL::prepareShared): * Modules/webgpu/WHLSL/WHLSLPrepare.h: * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp: Added. (WebCore::WHLSL::PropertyResolver::visit): (WebCore::WHLSL::setterCall): (WebCore::WHLSL::getterCall): (WebCore::WHLSL::modify): (WebCore::WHLSL::PropertyResolver::simplifyRightValue): (WebCore::WHLSL::LeftValueSimplifier::visit): (WebCore::WHLSL::PropertyResolver::simplifyLeftValue): (WebCore::WHLSL::resolveProperties): * Modules/webgpu/WHLSL/WHLSLPropertyResolver.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLEntryPointType.h. * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp: (WebCore::WHLSL::RecursiveTypeChecker::visit): * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp: (WebCore::WHLSL::conversionCost): * Modules/webgpu/WHLSL/WHLSLResolvingType.h: (WebCore::WHLSL::ResolvingType::getUnnamedType): * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt: * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp: (WebCore::WHLSL::FindArrayTypes::takeArrayTypes): (WebCore::WHLSL::synthesizeArrayOperatorLength): * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp: (WebCore::WHLSL::FindAllTypes::takeUnnamedTypes): (WebCore::WHLSL::FindAllTypes::takeNamedTypes): (WebCore::WHLSL::synthesizeConstructors): * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp: (WebCore::WHLSL::synthesizeEnumerationFunctions): * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp: (WebCore::WHLSL::synthesizeStructureAccessors): * Modules/webgpu/WHLSL/WHLSLVisitor.cpp: (WebCore::WHLSL::Visitor::visit): * Modules/webgpu/WHLSL/WHLSLVisitor.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: (WebCore::trySetWHLSLFunctionsForPipelineDescriptor): 2019-05-22 Myles C. Maxfield font-optical-sizing applies the wrong variation value https://bugs.webkit.org/show_bug.cgi?id=197528 Reviewed by Antti Koivisto. The OpenType spec says in https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxistag_opsz "Scale interpretation: Values can be interpreted as text size, in points." It turns out that it means "typographic point size" which is equal to CSS pixels, not CSS points. There are two parts of the font that are sensitive to optical sizing: variation values and the trak table. We don't want to set the variation value directly because then the trak table won't be affected. Instead, we can use kCTFontOpticalSizeAttribute to set both of them together. We will only do this when the CSS says text-rendering:optimizeLegibility or when the font has an opsz axis but no STAT table. Otherwise, we won't do anything special, which lets CoreText handle the default behavior for us. This gives us the same default behavior as the rest of the system. Tests: fast/text/variations/optical-sizing-trak-2.html fast/text/variations/optical-sizing-trak.html fast/text/variations/optical-sizing-units-2.html fast/text/variations/optical-sizing-units.html * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::FontType::FontType): (WebCore::preparePlatformFont): (WebCore::fontWithFamily): (WebCore::FontCache::systemFallbackForCharacters): * platform/graphics/cocoa/FontCacheCoreText.h: * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp: (WebCore::FontFamilySpecificationCoreText::fontRanges const): * platform/graphics/mac/FontCustomPlatformData.cpp: (WebCore::FontCustomPlatformData::fontPlatformData): 2019-05-22 Antti Koivisto Subselectors not searched when determining property whitelist for selector https://bugs.webkit.org/show_bug.cgi?id=198147 Reviewed by Zalan Bujtas. This can cause marker elements get style they shouldn't. Test: fast/lists/marker-style-subselector-whitelist.html * css/RuleSet.cpp: (WebCore::determinePropertyWhitelistType): Check subselectors too. 2019-05-22 Saam barati WHLSL: fix enum parsing https://bugs.webkit.org/show_bug.cgi?id=198087 Reviewed by Myles Maxfield. This fixes two bugs: 1. We were using a String by reference after moving the underlying owner of the string. This would lead to the String becoming the empty value, and crashing when used as a key in a hash map. 2. We were incorrectly producing a syntax error for enum declarations by saying it's invalid if an enum value was added to a hash map for the first time. This logic should be negated. We need to error when it's added for the second time and onwards. Test: webgpu/whlsl-dont-crash-parsing-enum.html * Modules/webgpu/WHLSL/AST/WHLSLAST.h: Replaced. * Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h: (WebCore::WHLSL::AST::EnumerationDefinition::add): * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h: (WebCore::WHLSL::AST::EnumerationMember::name): * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp: Replaced. (WebCore::WHLSL::ASTDumper::visit): * Modules/webgpu/WHLSL/WHLSLASTDumper.h: Replaced. 2019-05-22 Simon Fraser Fix scrolling tree state for more obscure combinations of positioning and paint order https://bugs.webkit.org/show_bug.cgi?id=198139 Reviewed by Antti Koivisto. There were three places in RenderLayerCompositor that used a version of ancestor layer traversal looking at containing blocks, and all three had issues. So make a shared function to do the ancestor walk, and use it thrice. isScrolledByOverflowScrollLayer() fumbled containingBlockCanSkipLayers, so failed to create a scrolling tree node for a composited layer inside position:fixed in overflow (tested by composited-in-absolute-in-overflow.html). collectStationaryLayerRelatedOverflowNodes() failed to handle nested overflow:scroll; it needs to find all the composited scrollers that affect the position of the given layer relative to its compositing ancestor, which may be the scroller, or a descendant of the scroller. However, it didn't walk up far enough and find more that one ancestor. Tested by absolute-in-nested-sc-scrollers.html. enclosingClippingScopes() was OK but now uses the share function. Tests: scrollingcoordinator/scrolling-tree/absolute-in-nested-sc-scrollers.html scrollingcoordinator/scrolling-tree/composited-in-absolute-in-overflow.html * rendering/RenderLayerCompositor.cpp: (WebCore::traverseAncestorLayers): (WebCore::enclosingClippingScopes): (WebCore::isScrolledByOverflowScrollLayer): (WebCore::collectStationaryLayerRelatedOverflowNodes): (WebCore::collectRelatedCoordinatedScrollingNodes): 2019-05-22 Simon Fraser Inner scroller of nested overflow:scrolls jitters when scrolling https://bugs.webkit.org/show_bug.cgi?id=198131 Reviewed by Antti Koivisto. enclosingCompositedScrollingLayer(layer) would return the layer itself, rather than its scrolling ancestor, which meant that a composited scroller nested inside another scroller would fail to get a "Moves" scrolling tree node, and therefore jitter when scrolling. Test: scrollingcoordinator/scrolling-tree/nested-overflow-scroll.html * rendering/RenderLayerCompositor.cpp: (WebCore::enclosingCompositedScrollingLayer): 2019-05-22 Ryan Haddad Unreviewed, rolling out r245598. Breaks watchOS build. Reverted changeset: "font-optical-sizing applies the wrong variation value" https://bugs.webkit.org/show_bug.cgi?id=197528 https://trac.webkit.org/changeset/245598 2019-05-22 Daniel Bates WebKit does not generate an ESC key event for CMD+. https://bugs.webkit.org/show_bug.cgi?id=198137 Reviewed by Brent Fulgham. This patch maps the Command + '.' keystroke to the 'Escape'. This also requires a change to UIKit to properly pass the key state to WebKit (see ). * platform/ios/WebEvent.mm: (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]): 2019-05-22 Ali Juma Intersection Observer: bounding client rect is wrong for an inline element https://bugs.webkit.org/show_bug.cgi?id=198009 Reviewed by Simon Fraser. Make target rect computation for inline elements share logic with the computation of bounding client rects. Test: imported/w3c/web-platform-tests/intersection-observer/inline-with-block-child-client-rect.html * dom/Document.cpp: (WebCore::computeIntersectionState): * dom/Element.cpp: (WebCore::Element::boundingAbsoluteRectWithoutLayout): (WebCore::Element::boundingClientRect): * dom/Element.h: 2019-05-22 Antoine Quint [iOS] Compatibility mouse events aren't prevented by calling preventDefault() on pointerdown https://bugs.webkit.org/show_bug.cgi?id=198124 Reviewed by Tim Horton. This fix builds atop the one made for wkb.ug/198072 which fixes this bug on macOS alone. In order to correctly prevent "compatibility" mouse events from being dispatched when the initial "pointerdown" event had preventDefault() called while handled, we need to pass the PointerID for the touch that triggered a tap gesture in the UI process down in the Web process and into the resulting PlatformMouseEvent. This will allow upon dispatch of a PlatformMouseEvent to call into PointerCaptureController to identify if the dispatch of mouse events is allowed for the event's PointerID. To support this, some refactoring was required. The PointerID header is now under platform/ such that PlatformMouseEvent may safely use it. Additionally, PointerEvent::defaultMousePointerIdentifier() is now a global mousePointerID defined in PointerID.h. Finally, PointerCaptureController::touchEndedOrWasCancelledForIdentifier() has been renamed to PointerCaptureController::touchWithIdentifierWasRemoved() and has WEBCORE_EXPORT such that it may be called from WebKit as the indication that a pointer is no longer active will now be initiated in WebKit on the UI process side. Testing is covered by the pre-existing imported/w3c/web-platform-tests/pointerevents/pointerevent_suppress_compat_events_on_click.html which will now run on iOS through a change to WebKitAdditions. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * dom/Element.cpp: (WebCore::Element::dispatchMouseEvent): When dealing with a mouse event on iOS, check whether the mouse event's PointerID allows for compatibility mouse events to be dispatched using PointerCaptureController::preventsCompatibilityMouseEventsForIdentifier(). The "click" event is not a compatibility mouse event. * dom/PointerEvent.h: * page/PointerCaptureController.cpp: (WebCore::PointerCaptureController::PointerCaptureController): (WebCore::PointerCaptureController::touchWithIdentifierWasRemoved): (WebCore::PointerCaptureController::touchEndedOrWasCancelledForIdentifier): Deleted. * page/PointerCaptureController.h: * platform/PlatformMouseEvent.h: (WebCore::PlatformMouseEvent::PlatformMouseEvent): (WebCore::PlatformMouseEvent::pointerId const): * platform/PointerID.h: Renamed from Source/WebCore/dom/PointerID.h. (WebCore::mousePointerID): 2019-05-22 Jiewen Tan [WebAuthN] Support Attestation Conveyance Preference https://bugs.webkit.org/show_bug.cgi?id=192722 Reviewed by Brent Fulgham. This patch implements https://www.w3.org/TR/webauthn/#enumdef-attestationconveyancepreference, together with Step 20 with regard to AttestationConveyancePreference of https://www.w3.org/TR/webauthn/#createCredential. Few notes with regard to Step 20: 1) We treat indirect attestation as direct attestation as we don't MITM the attestation process; 2) We won't distinguish self attestation and return it to keep consistency between the response and the request. If callers want none attestation, they will very likely ignore fmt and attStmt of the attestation object, and therefore it is meaningless to return self attestation. Covered by new tests within existing files. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Headers.cmake: * Modules/webauthn/AttestationConveyancePreference.h: Copied from Source/WebCore/Modules/webauthn/WebAuthenticationUtils.h. * Modules/webauthn/AttestationConveyancePreference.idl: Copied from Source/WebCore/Modules/webauthn/WebAuthenticationUtils.h. * Modules/webauthn/PublicKeyCredentialCreationOptions.h: (WebCore::PublicKeyCredentialCreationOptions::encode const): (WebCore::PublicKeyCredentialCreationOptions::decode): * Modules/webauthn/PublicKeyCredentialCreationOptions.idl: * Modules/webauthn/WebAuthenticationConstants.h: * Modules/webauthn/WebAuthenticationUtils.cpp: (WebCore::buildAttestationObject): * Modules/webauthn/WebAuthenticationUtils.h: * Modules/webauthn/fido/DeviceResponseConverter.cpp: (fido::readCTAPMakeCredentialResponse): * Modules/webauthn/fido/DeviceResponseConverter.h: * Modules/webauthn/fido/FidoConstants.h: noneAttestationValue is moved to WebAuthenticationConstants.h. * Modules/webauthn/fido/U2fResponseConverter.cpp: (fido::readU2fRegisterResponse): * Modules/webauthn/fido/U2fResponseConverter.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2019-05-22 Zalan Bujtas [Paste] Add support for preferred presentation size when pasting an image https://bugs.webkit.org/show_bug.cgi?id=198132 Reviewed by Wenson Hsieh. Set the pasted width/height attributes when the preferred presentation size is available. * editing/WebContentReader.h: * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::createFragmentForImageAttachment): (WebCore::WebContentReader::readImage): * editing/markup.cpp: (WebCore::createFragmentForImageAndURL): * editing/markup.h: * platform/Pasteboard.h: (WebCore::PasteboardWebContentReader::readImage): * platform/PasteboardItemInfo.h: (WebCore::PasteboardItemInfo::encode const): (WebCore::PasteboardItemInfo::decode): * platform/ios/PasteboardIOS.mm: (WebCore::Pasteboard::readPasteboardWebContentDataForType): (WebCore::Pasteboard::read): (WebCore::Pasteboard::readRespectingUTIFidelities): * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::informationForItemAtIndex): 2019-05-22 Jer Noble Hide MediaCapabilities.encodingInfo() when the platform does not support it. https://bugs.webkit.org/show_bug.cgi?id=197476 Reviewed by Eric Carlson. Test: platform/mac/media/mediacapabilities/mediacapabilities-encodingInfo-undefined.html Add a new IDL attribute, CustomEnabled, which allows non Settings-based enabling of attributes and objects. * Modules/mediacapabilities/MediaCapabilities.idl: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSMediaCapabilitiesCustom.h: Copied from Source/WebCore/Modules/mediacapabilities/MediaCapabilities.idl. (WebCore::JSMediaCapabilitiesEncodingInfoIsEnabled): * bindings/scripts/CodeGeneratorJS.pm: (NeedsRuntimeCheck): (GenerateRuntimeEnableConditionalString): * bindings/scripts/IDLAttributes.json: * bindings/scripts/preprocess-idls.pl: (GenerateConstructorAttributes): * platform/mediacapabilities/MediaEngineConfigurationFactory.cpp: (WebCore::MediaEngineConfigurationFactory::hasDecodingConfigurationFactory): (WebCore::MediaEngineConfigurationFactory::hasEncodingConfigurationFactory): * platform/mediacapabilities/MediaEngineConfigurationFactory.h: 2019-05-22 Youenn Fablet Implement Feature policy self/none/* parsing https://bugs.webkit.org/show_bug.cgi?id=198078 Reviewed by Eric Carlson. Start to implement https://w3c.github.io/webappsec-feature-policy/#algo-parse-policy-directive 'src' is not supported yet. Apply the rules to getUserMedia. Update getDisplayMedia keyword from 'display' to 'display-capture' as per spec. Test: imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-feature-policy-none.https.html * Headers.cmake: * Modules/mediastream/UserMediaController.cpp: (WebCore::isSecure): (WebCore::isAllowedByFeaturePolicy): (WebCore::isAllowedToUse): * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * html/FeaturePolicy.cpp: Added. (WebCore::isAllowedByFeaturePolicy): (WebCore::processOriginItem): (WebCore::updateList): (WebCore::FeaturePolicy::parse): (WebCore::FeaturePolicy::allows const): * html/FeaturePolicy.h: Added. * html/HTMLIFrameElement.cpp: (WebCore::HTMLIFrameElement::featurePolicy const): * html/HTMLIFrameElement.h: 2019-05-21 Jer Noble Media controls don't show in WK2 video fullscreen sometimes https://bugs.webkit.org/show_bug.cgi?id=198094 Reviewed by Tim Horton. Ensure that the WebAVPlayerLayer never allows hit testing, as this keeps touches from reaching AVKit's controls. * platform/ios/VideoFullscreenInterfaceAVKit.mm: (-[WebAVPlayerLayer init]): 2019-05-21 Saam barati WHLSL: Add an AST dumper https://bugs.webkit.org/show_bug.cgi?id=198059 Reviewed by Myles Maxfield. This patch makes it so we can dump the WHLSL program's AST. This will become useful when we're debugging passes that transform the AST. The dumper mostly prints in a style where the dump is almost valid WHLSL code. E.g, this WHLSL program: ``` int foo(int arg) { return arg + 1; } ``` gets dumped as: ``` int foo(int arg) { return operator+(arg, 1); } ``` This patch also adds a way to dump between each pass, after parsing, or at the end of all passes. Currently, this is controlled by a static variable. I'll make these runtime configurable in a follow up: https://bugs.webkit.org/show_bug.cgi?id=198097 No new tests because this is used for logging. * Modules/webgpu/WHLSL/AST/WHLSLAST.h: Added. * Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h: (WebCore::WHLSL::AST::toString): * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h: (WebCore::WHLSL::AST::BuiltInSemantic::toString const): * Modules/webgpu/WHLSL/AST/WHLSLEntryPointType.h: (WebCore::WHLSL::AST::toString): * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h: (WebCore::WHLSL::AST::ResourceSemantic::toString): * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp: (WebCore::WHLSL::Metal::toString): Deleted. * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp: Added. (WebCore::WHLSL::ASTDumper::visit): * Modules/webgpu/WHLSL/WHLSLASTDumper.h: Added. (WebCore::WHLSL::ASTDumper::toString): (WebCore::WHLSL::ASTDumper::Indent::Indent): (WebCore::WHLSL::ASTDumper::bumpIndent): (WebCore::WHLSL::toString): (WebCore::WHLSL::dumpAST): * Modules/webgpu/WHLSL/WHLSLPrepare.cpp: (WebCore::WHLSL::dumpASTIfNeeded): (WebCore::WHLSL::dumpASTAfterParsingIfNeeded): (WebCore::WHLSL::dumpASTBetweenEachPassIfNeeded): (WebCore::WHLSL::dumpASTAtEndIfNeeded): (WebCore::WHLSL::prepareShared): * Modules/webgpu/WHLSL/WHLSLVisitor.cpp: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2019-05-21 Saam barati WHLSL: Parsing negative int literals parses the positive value instead https://bugs.webkit.org/show_bug.cgi?id=198096 Reviewed by Dean Jackson. I also made the code around < INT_MIN a bit easier to follow along with. No new tests because we haven't imported WHLSL test suite yet. Verified this works using the AST dumper. * Modules/webgpu/WHLSL/WHLSLParser.cpp: (WebCore::WHLSL::intLiteralToInt): 2019-05-21 Myles C. Maxfield font-optical-sizing applies the wrong variation value https://bugs.webkit.org/show_bug.cgi?id=197528 Reviewed by Antti Koivisto. The OpenType spec says in https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxistag_opsz "Scale interpretation: Values can be interpreted as text size, in points." It turns out that it means "typographic point size" which is equal to CSS pixels, not CSS points. There are two parts of the font that are sensitive to optical sizing: variation values and the trak table. We don't want to set the variation value directly because then the trak table won't be affected. Instead, we can use kCTFontOpticalSizeAttribute to set both of them together. We will only do this when the CSS says text-rendering:optimizeLegibility or when the font has an opsz axis but no STAT table. Otherwise, we won't do anything special, which lets CoreText handle the default behavior for us. This gives us the same default behavior as the rest of the system. Tests: fast/text/variations/optical-sizing-trak-2.html fast/text/variations/optical-sizing-trak.html fast/text/variations/optical-sizing-units.html fast/text/variations/optical-sizing-units-2.html * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::FontType::FontType): (WebCore::preparePlatformFont): (WebCore::fontWithFamily): (WebCore::FontCache::systemFallbackForCharacters): * platform/graphics/cocoa/FontCacheCoreText.h: * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp: (WebCore::FontFamilySpecificationCoreText::fontRanges const): * platform/graphics/mac/FontCustomPlatformData.cpp: (WebCore::FontCustomPlatformData::fontPlatformData): 2019-05-21 Simon Fraser Layer flashing and poor perf during scrolling of message list on gmail.com and hotmail.com - overlap testing needs to constrained to clipping scopes https://bugs.webkit.org/show_bug.cgi?id=198091 Reviewed by Antti Koivisto. When overflow:scroll is scrolled asynchronously, we need to have already created compositing layers where necessary for clipped-out layers in the scrolled content so that we have something to reveal. We also have ensure that layers inside the scroller (but scrolled out of view) don't trigger overlap with layers outside the scroller. All this has to work when the containing block hierarchy (clipping/scrolling) doesn't match the paint order hierarchy (structure of the z-order and compositing trees). Overlap testing previously simply used a list of rectangles per compositing container (OverlapMapContainer). This is a series of layer bounds, built up as we traver the layer tree in z-order. Layers contribute to container N-2, and test against container N-1. To handle overlap with non-stacking-context scrollers, introduce the concept of a ClippingScope, which encompasses a set of layers sharing the same composited-scrolling containing-block ancestor. Within a ClippingScope, layer bounds are computed unclipped. Between them, bounds are tested clipped. Conceptually, each OverlapMapContainer has a tree of ClippingScopes (reflecting the containing-block order tree of composited overflow scroll), and rects are added to the appropriate ClippingScope. This tree is currently always root-relative; the root node is the RenderView's RenderLayer, and will accumulate the bounds of layers not inside composited overflow scroll (just like the old code). When a OverlapMapContainer is popped, the list of rectangles in its ClippingScope tree is merged with that of the previous container. Tests: compositing/layer-creation/clipping-scope/nested-scroller-overlap.html compositing/layer-creation/clipping-scope/overlap-constrained-inside-scroller.html compositing/layer-creation/clipping-scope/overlap-constrained-inside-stacking-context-scroller.html compositing/layer-creation/clipping-scope/scroller-with-negative-z-children.html compositing/layer-creation/clipping-scope/shared-layers-in-scroller.html * rendering/LayerOverlapMap.cpp: (WebCore::operator<<): (WebCore::OverlapMapContainer::OverlapMapContainer): (WebCore::OverlapMapContainer::ClippingScope::ClippingScope): (WebCore::OverlapMapContainer::ClippingScope::childWithLayer const): (WebCore::OverlapMapContainer::ClippingScope::addChildWithLayerAndBounds): (WebCore::OverlapMapContainer::ClippingScope::addChild): (WebCore::OverlapMapContainer::ClippingScope::appendRect): (WebCore::OverlapMapContainer::clippingScopeContainingLayerChildRecursive): (WebCore::OverlapMapContainer::scopeContainingLayer const): (WebCore::OverlapMapContainer::rootScope const): (WebCore::OverlapMapContainer::rootScope): (WebCore::OverlapMapContainer::add): (WebCore::OverlapMapContainer::overlapsLayers const): (WebCore::OverlapMapContainer::mergeClippingScopesRecursive): (WebCore::OverlapMapContainer::append): (WebCore::OverlapMapContainer::ensureClippingScopeForLayers): (WebCore::OverlapMapContainer::findClippingScopeForLayers const): (WebCore::OverlapMapContainer::recursiveOutputToStream const): (WebCore::OverlapMapContainer::dump const): (WebCore::LayerOverlapMap::LayerOverlapMap): (WebCore::LayerOverlapMap::add): (WebCore::LayerOverlapMap::overlapsLayers const): (WebCore::LayerOverlapMap::pushCompositingContainer): (WebCore::LayerOverlapMap::popCompositingContainer): (WebCore::OverlapMapContainer::unite): Deleted. (WebCore::OverlapMapContainer::rectList const): Deleted. * rendering/LayerOverlapMap.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::BackingSharingState::appendSharingLayer): (WebCore::RenderLayerCompositor::BackingSharingState::updateBeforeDescendantTraversal): (WebCore::RenderLayerCompositor::updateCompositingLayers): (WebCore::RenderLayerCompositor::computeCompositingRequirements): (WebCore::RenderLayerCompositor::traverseUnchangedSubtree): (WebCore::RenderLayerCompositor::computeExtent const): (WebCore::createsClippingScope): (WebCore::enclosingClippingScopes): (WebCore::RenderLayerCompositor::addToOverlapMap const): (WebCore::RenderLayerCompositor::updateOverlapMap const): (WebCore::RenderLayerCompositor::layerOverlaps const): * rendering/RenderLayerCompositor.h: 2019-05-21 Antoine Quint [macOS] Compatibility mouse events aren't prevented by calling preventDefault() on pointerdown https://bugs.webkit.org/show_bug.cgi?id=198072 Reviewed by Dean Jackson. The Pointer Events spec says that "compatibility" mouse events, which means all mouse events save for "click", should not be dispatched for a given pointer if preventDefault() was called during the dispatch of the "pointerdown" event. Additionally, calling preventDefault() during the dispatch of "pointerup" has no effect. * dom/Element.cpp: (WebCore::Element::dispatchMouseEvent): * page/PointerCaptureController.cpp: (WebCore::PointerCaptureController::preventsCompatibilityMouseEventsForIdentifier): (WebCore::PointerCaptureController::pointerEventWasDispatched): * page/PointerCaptureController.h: 2019-05-21 Antti Koivisto RTL/overflow scroll tests fail with async overflow enabled https://bugs.webkit.org/show_bug.cgi?id=196013 Reviewed by Simon Fraser. Test: compositing/ios/rtl-overflow-scrolling-2.html This patch makes the basic RTL cases work in the scrolling tree. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll): * page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::minimumScrollPosition const): (WebCore::ScrollingTreeScrollingNode::maximumScrollPosition const): Add missing scroll offset <-> scroll position conversions. 2019-05-21 Carlos Garcia Campos [WPE] Add initial accessibility support using ATK https://bugs.webkit.org/show_bug.cgi?id=197413 Reviewed by Michael Catanzaro. Use USE(ATK) instead of PLATFORM(GTK) for ATK related code and use ATK when available for WPE port too. * PlatformWPE.cmake: * SourcesWPE.txt: * accessibility/AXObjectCache.h: * accessibility/AccessibilityList.cpp: (WebCore::AccessibilityList::childHasPseudoVisibleListItemMarkers): * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::canSetValueAttribute const): * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::textIteratorBehaviorForTextRange const): * accessibility/AccessibilityObject.h: * accessibility/AccessibilityObjectInterface.h: * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::indexForVisiblePosition const): (WebCore::AccessibilityRenderObject::shouldNotifyActiveDescendant const): * accessibility/AccessibilityTableColumn.cpp: (WebCore::AccessibilityTableColumn::computeAccessibilityIsIgnored const): * accessibility/AccessibilityTableHeaderContainer.cpp: (WebCore::AccessibilityTableHeaderContainer::computeAccessibilityIsIgnored const): * accessibility/atk/WebKitAccessible.cpp: (webkitAccessibleGetAttributes): * accessibility/wpe/AXObjectCacheWPE.cpp: Removed. * accessibility/wpe/AccessibilityObjectWPE.cpp: Removed. * editing/FrameSelection.h: 2019-05-20 Ross Kirsling Make lossy LayoutUnit constructors explicit https://bugs.webkit.org/show_bug.cgi?id=191811 Reviewed by Antti Koivisto. * platform/LayoutUnit.h: Make lossy unary constructors explicit. For ergonomics, give float overloads to copy constructor and round/floor/ceil functions. * css/LengthFunctions.h: * platform/graphics/LayoutPoint.h: * platform/graphics/LayoutRect.h: * platform/graphics/LayoutSize.h: * rendering/RenderBox.h: * rendering/RenderElement.h: Templatize common functions to allow LayoutUnit itself to dictate which types it allows. * html/shadow/SliderThumbElement.cpp: * page/FrameView.cpp: * page/Page.cpp: * page/SpatialNavigation.cpp: * page/scrolling/AxisScrollSnapOffsets.cpp: * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: * layout/FormattingContextGeometry.cpp: * layout/FormattingContextQuirks.cpp: * layout/LayoutState.cpp: * layout/displaytree/DisplayBox.h: * layout/inlineformatting/InlineFormattingContextLineLayout.cpp: * layout/layouttree/LayoutReplaced.cpp: * platform/animation/AnimationUtilities.h: * platform/cocoa/ScrollSnapAnimatorState.mm: * rendering/BorderEdge.cpp: * rendering/EllipsisBox.cpp: * rendering/FixedTableLayout.cpp: * rendering/InlineBox.cpp: * rendering/InlineFlowBox.cpp: * rendering/InlineFlowBox.h: * rendering/InlineTextBox.cpp: * rendering/RenderBlock.cpp: * rendering/RenderBlockFlow.cpp: * rendering/RenderBlockLineLayout.cpp: * rendering/RenderBox.cpp: * rendering/RenderBoxModelObject.cpp: * rendering/RenderBoxModelObject.h: * rendering/RenderDeprecatedFlexibleBox.cpp: * rendering/RenderElement.cpp: * rendering/RenderImage.cpp: * rendering/RenderInline.cpp: * rendering/RenderLineBreak.cpp: * rendering/RenderListMarker.cpp: * rendering/RenderMultiColumnSet.cpp: * rendering/RenderMultiColumnSet.h: * rendering/RenderObject.cpp: * rendering/RenderReplaced.cpp: * rendering/RenderTable.cpp: * rendering/RenderTableCell.cpp: * rendering/RenderTableSection.cpp: * rendering/RenderText.cpp: * rendering/RenderTextControlMultiLine.cpp: * rendering/RenderThemeMac.mm: * rendering/RenderVTTCue.cpp: * rendering/RenderView.cpp: * rendering/RootInlineBox.cpp: * rendering/SimpleLineLayoutFunctions.cpp: * rendering/SimpleLineLayoutPagination.cpp: * rendering/SimpleLineLayoutResolver.cpp: * rendering/line/LineWidth.cpp: * rendering/mathml/MathOperator.cpp: * rendering/mathml/RenderMathMLBlock.cpp: * rendering/mathml/RenderMathMLBlock.h: * rendering/mathml/RenderMathMLFencedOperator.h: * rendering/mathml/RenderMathMLFraction.cpp: * rendering/mathml/RenderMathMLMenclose.cpp: * rendering/mathml/RenderMathMLOperator.cpp: * rendering/mathml/RenderMathMLRoot.cpp: * rendering/mathml/RenderMathMLScripts.cpp: * rendering/mathml/RenderMathMLToken.cpp: * rendering/shapes/BoxShape.cpp: * rendering/shapes/ShapeOutsideInfo.cpp: * rendering/style/CollapsedBorderValue.h: * rendering/style/NinePieceImage.cpp: * rendering/style/NinePieceImage.h: * rendering/style/RenderStyle.cpp: * rendering/style/RenderStyle.h: * rendering/svg/RenderSVGText.cpp: * rendering/svg/SVGInlineTextBox.cpp: Make usage of LayoutUnit(float) and LayoutUnit(double) explicit where needed. 2019-05-20 Jer Noble Provide an explicit UIModalPresentation style when creating an AVPlayerViewController for fullscreen. https://bugs.webkit.org/show_bug.cgi?id=198052 Reviewed by Tim Horton. Make sure AVPlayerViewController has an "overFullScreen" modal style. * platform/ios/VideoFullscreenInterfaceAVKit.mm: (-[WebAVPlayerViewController initWithFullscreenInterface:]): 2019-05-20 Chris Dumez Fix security check in ScriptController::canAccessFromCurrentOrigin() https://bugs.webkit.org/show_bug.cgi?id=196730 Reviewed by Ryosuke Niwa. Fix security check in ScriptController::canAccessFromCurrentOrigin() when there is no current JS exec state. Instead of returning true unconditionally, we now fall back to using the accessing document's origin for the security check. The new behavior is aligned with Blink: https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/html/html_frame_element_base.cc?rcl=d3f22423d512b45466f1694020e20da9e0c6ee6a&l=62 This fix is based on a patch from Sergei Glazunov . Test: http/tests/security/showModalDialog-sync-cross-origin-page-load2.html * bindings/js/ScriptController.cpp: (WebCore::ScriptController::canAccessFromCurrentOrigin): * bindings/js/ScriptController.h: * html/HTMLFrameElementBase.cpp: (WebCore::HTMLFrameElementBase::isURLAllowed const): 2019-05-20 Gabe Giosia Range getBoundingClientRect returning zero rect on simple text node with
before it https://bugs.webkit.org/show_bug.cgi?id=182181 Reviewed by Antti Koivisto. Correct rect of RenderText in a block element when used in a Range over a line break element. The end offset was miscalculated. Addded line-break case to fast/dom/Range/getBoundingClientRect.html * rendering/SimpleLineLayoutFunctions.cpp: (WebCore::SimpleLineLayout::collectAbsoluteQuadsForRange): * rendering/SimpleLineLayoutResolver.cpp: (WebCore::SimpleLineLayout::RunResolver::rangeForRendererWithOffsets const): 2019-05-19 Brent Fulgham Unreviewed build fix after r245508. * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: Don't use an 'import' directive in a C++ file. 2019-05-19 Brent Fulgham Wait to get frame until after layout has been run https://bugs.webkit.org/show_bug.cgi?id=197999 Reviewed by Alex Christensen. The current frame can change when layout runs, so don't bother retrieving the frame until the final layout pass is complete. Test: fast/dom/window-inner-width-crash.html * page/DOMWindow.cpp: (WebCore::DOMWindow::innerHeight const): Move frame access past the layout operation. (WebCore::DOMWindow::innerWidth const): Ditto. (WebCore::DOMWindow::scrollX const): Ditto. (WebCore::DOMWindow::scrollY const): Ditto. 2019-05-19 Brent Fulgham Unreviewed build fix Attempting to build with only Open Source sources on shipping software with ASan enabled triggers build failures due to missing includes. This patch adds the necessary includes to cleanly build WebCore. * Modules/applepay/ApplePaySession.cpp: * Modules/applepay/PaymentSession.cpp: * Modules/mediastream/UserMediaController.cpp: * bindings/js/ScriptController.cpp: * contentextensions/ContentExtensionsBackend.cpp: * dom/Document.cpp: * dom/ScriptedAnimationController.cpp: * editing/cocoa/EditorCocoa.mm: * editing/cocoa/HTMLConverter.mm: * editing/cocoa/WebContentReaderCocoa.mm: * editing/markup.cpp: * history/CachedFrame.cpp: * html/HTMLDocument.cpp: * html/HTMLHtmlElement.cpp: * html/HTMLMediaElement.cpp: * html/ImageDocument.cpp: * html/MediaDocument.cpp: * html/PluginDocument.cpp: * html/parser/HTMLDocumentParser.cpp: * html/parser/XSSAuditor.cpp: * inspector/InspectorInstrumentation.cpp: * inspector/agents/InspectorApplicationCacheAgent.cpp: * inspector/agents/InspectorNetworkAgent.cpp: * inspector/agents/InspectorPageAgent.cpp: * inspector/agents/page/PageNetworkAgent.cpp: * loader/ApplicationManifestLoader.cpp: * loader/FrameLoader.cpp: * loader/LoadTiming.cpp: * loader/NetscapePlugInStreamLoader.cpp: * loader/ResourceLoader.cpp: * loader/SubresourceLoader.cpp: * loader/appcache/ApplicationCacheHost.cpp: * loader/archive/cf/LegacyWebArchive.cpp: * loader/icon/IconLoader.cpp: * page/ContextMenuController.cpp: * page/FrameView.cpp: * page/Page.cpp: * page/Performance.cpp: * page/PerformanceNavigation.cpp: * page/Quirks.cpp: * page/UserContentProvider.cpp: * page/csp/ContentSecurityPolicy.cpp: * page/mac/PageMac.mm: * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: * svg/graphics/SVGImage.cpp: * testing/Internals.cpp: 2019-05-19 Antoine Quint [Pointer Events] Listening to a "pointerover", "pointerenter", "pointerout" or "pointerleave" event alone does not fire the event on iOS https://bugs.webkit.org/show_bug.cgi?id=197882 Reviewed by Dean Jackson. Tests: pointerevents/ios/pointerenter-alone.html pointerevents/ios/pointerleave-alone.html pointerevents/ios/pointerout-alone.html pointerevents/ios/pointerover-alone.html * dom/EventNames.h: (WebCore::EventNames::isTouchRelatedEventType const): (WebCore::EventNames::touchRelatedEventNames const): (WebCore::EventNames::extendedTouchRelatedEventNames const): 2019-05-19 Antoine Quint [Pointer Events] A pointer should be marked as primary for all of its events https://bugs.webkit.org/show_bug.cgi?id=197909 Reviewed by Dean Jackson. Add an ivar for EventHandler which we'll use in WebKitAdditions code to track the touch identifier of the very first touch to start in a given sequence. * page/EventHandler.h: 2019-05-19 Darin Adler Change String::number to use "shortest" instead of "fixed precision 6 digits" https://bugs.webkit.org/show_bug.cgi?id=178319 Reviewed by Sam Weinig. * accessibility/atk/WebKitAccessibleInterfaceValue.cpp: (webkitAccessibleSetNewValue): Use String::numberToStringFixedPrecision instead of String::number to be explicit about the fact that it's fixed precision. * page/linux/ResourceUsageOverlayLinux.cpp: (gcTimerString): Ditto. * platform/graphics/ca/win/PlatformCALayerWin.cpp: (printTransform): Use appendFixedPrecisionNumber instead of appendNumber to be explicit about the fact that it's fixed precision. (printLayer): Ditto. (WebCore::PlatformCALayerWin::layerTreeAsString const): Ditto. * platform/graphics/freetype/FontCacheFreeType.cpp: (buildVariationSettings): Ditto. * svg/SVGNumberList.h: Use appendFixedPrecisionNumber instead of appendNumber to be explicit about the fact that it's fixed precision. We'll consider moving to shortest later. * svg/SVGPathUtilities.cpp: (WebCore::buildStringFromPath): Use appendNumberShortest instead of appendNumberECMAScript since these are single-precision. * svg/SVGPointList.h: Use appendFixedPrecisionNumber instead of appendNumber to be explicit about the fact that it's fixed precision. We'll consider moving to shortest later. * svg/SVGTransformValue.h: Ditto. 2019-05-19 Simon Fraser Layers painting into shared backing need to contribute to overlap https://bugs.webkit.org/show_bug.cgi?id=198021 Reviewed by Zalan Bujtas. Layers that paint into a composited (non-root) layer get added to the overlap map so that later layers correct overlap them; this is done via the test against currentState.compositingAncestor. We need the same logic for layers that paint into shared backing; they need to behave the same way in terms of how they contribute to overlap. We already had currentState.backingSharingAncestor which was unused, but now use it for this, and correctly null it out when a layer composites. Bug was noticed during testing, and not known to affect any websites (though it probably does). Also move the overlap container popping into updateOverlapMap() so the two callers can share the code, and more explicitly track whether a container was pushed. Test: compositing/shared-backing/sharing-child-contributes-to-overlap.html * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::computeCompositingRequirements): (WebCore::RenderLayerCompositor::traverseUnchangedSubtree): (WebCore::RenderLayerCompositor::updateOverlapMap const): * rendering/RenderLayerCompositor.h: 2019-05-17 Joonghun Park Implement CSS `display: flow-root` (modern clearfix) https://bugs.webkit.org/show_bug.cgi?id=165603 Reviewed by Zalan Bujtas. This change follows https://drafts.csswg.org/css-display-3/#valdef-display-flow-root as below. 'display: flow-root' generates a block container box, and lays out its contents using flow layout. It always establishes a new block formatting context for its contents. * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): * css/CSSValueKeywords.in: * css/StyleResolver.cpp: (WebCore::equivalentBlockDisplay): * css/parser/CSSParserFastPaths.cpp: (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue): * rendering/RenderBox.cpp: (WebCore::RenderBox::createsNewFormattingContext const): * rendering/RenderElement.cpp: (WebCore::RenderElement::createFor): * rendering/style/RenderStyleConstants.h: 2019-05-17 Don Olmstead [CMake] Use builtin FindICU https://bugs.webkit.org/show_bug.cgi?id=197934 Reviewed by Michael Catanzaro. Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES. * CMakeLists.txt: * PlatformPlayStation.cmake: * PlatformWPE.cmake: 2019-05-17 Alex Christensen Enable legacy EME for iOS WKWebView https://bugs.webkit.org/show_bug.cgi?id=197964 Reviewed by Wenson Hsieh. This was attempted unsuccessfully in r230169. Verified manually that it works as desired. * page/RuntimeEnabledFeatures.h: 2019-05-17 Sihui Liu ASSERTION FAILED: !m_backingStore in WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore(uint64_t) https://bugs.webkit.org/show_bug.cgi?id=197741 Reviewed by Youenn Fablet. If an open request is made before a delete request, open task should be performed before delete task on the database thread. After r242911, open request needs to wait decision of StorageQuotaManager before posting task to database thread, while delete request needs not. This makes deletion happen before open. We need to make sure tasks are in correct order by not starting next open or delete request when database is in the middle of open or deletion. * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation): (WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations): 2019-05-17 Antoine Quint Add a website policy to disable the legacy -webkit-overflow-scrolling:touch behavior https://bugs.webkit.org/show_bug.cgi?id=197943 Reviewed by Brent Fulgham. Tests: fast/scrolling/ipad/overflow-scrolling-touch-enabled-stacking-modern-compatibility-mode.html platform/ipad/fast/css/webkit-overflow-scrolling-parsing-modern-compatibility-mode.html * css/parser/CSSParserContext.cpp: (WebCore::CSSParserContext::CSSParserContext): * loader/DocumentLoader.h: (WebCore::DocumentLoader::legacyOverflowScrollingTouchPolicy const): (WebCore::DocumentLoader::setLegacyOverflowScrollingTouchPolicy): 2019-05-17 Alex Christensen Add SPI to set a list of hosts to which to send custom header fields cross-origin https://bugs.webkit.org/show_bug.cgi?id=197397 Reviewed by Geoff Garen. In r223001 I added the ability to send custom headers, but with a restriction that they will not be sent except to the origin of the main document. We need the ability to specify what origins to send these headers to even if they are not first party requests. We get this information in a list of strings which are the hosts to send the headers to. Some of the strings have an asterisk at the beginning, indicating that the headers are to be sent to all subdomains. I repurposed some ObjC SPI that was never adopted, but I keep testing the C API that was to verify no regression. I also added some new API tests for the new behavior. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * loader/CustomHeaderFields.cpp: Added. (WebCore::CustomHeaderFields::thirdPartyDomainsMatch const): * loader/CustomHeaderFields.h: Added. (WebCore::CustomHeaderFields::encode const): (WebCore::CustomHeaderFields::decode): * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::setCustomHeaderFields): Deleted. * loader/DocumentLoader.h: (WebCore::DocumentLoader::setCustomHeaderFields): (WebCore::DocumentLoader::customHeaderFields const): (WebCore::DocumentLoader::customHeaderFields): Deleted. * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::requestResource): 2019-05-17 Youenn Fablet Make AVVideoCaptureSource more robust to configuration failures https://bugs.webkit.org/show_bug.cgi?id=197997 rdar://problem/50875662 Reviewed by Eric Carlson. Covered by manual testing. * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::setSessionSizeAndFrameRate): Make sure to commit configuration once calling beginConfiguration. In case of error in setting frame rate, log the error but continue capturing. 2019-05-17 Rob Buis Implement imagesrcset and imagesizes attributes on link rel=preload https://bugs.webkit.org/show_bug.cgi?id=192950 Reviewed by Youenn Fablet. Implement imagesrcset and imagesizes attributes for both Link header and link element. Tests: imported/w3c/web-platform-tests/preload/dynamic-adding-preload-imagesrcset.html imported/w3c/web-platform-tests/preload/link-header-preload-delay-onload.html imported/w3c/web-platform-tests/preload/link-header-preload-imagesrcset.html imported/w3c/web-platform-tests/preload/link-header-preload-nonce.html imported/w3c/web-platform-tests/preload/link-header-preload.html imported/w3c/web-platform-tests/preload/onload-event.html imported/w3c/web-platform-tests/preload/preload-with-type.html * html/HTMLAttributeNames.in: * html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::process): * html/HTMLLinkElement.idl: * loader/LinkHeader.cpp: (WebCore::paramterNameFromString): (WebCore::LinkHeader::setValue): (WebCore::LinkHeader::LinkHeader): * loader/LinkHeader.h: (WebCore::LinkHeader::imageSrcSet const): (WebCore::LinkHeader::imageSizes const): (WebCore::LinkHeader::isViewportDependent const): * loader/LinkLoader.cpp: (WebCore::LinkLoader::loadLinksFromHeader): (WebCore::LinkLoader::preloadIfNeeded): (WebCore::LinkLoader::loadLink): * loader/LinkLoader.h: 2019-05-17 Keith Rollin Re-enable generate-xcfilelists https://bugs.webkit.org/show_bug.cgi?id=197933 Reviewed by Jonathan Bedard. The following two tasks have been completed, and we can re-enable generate-xcfilelists: Bug 197619 Temporarily disable generate-xcfilelists (197619) Bug 197622 Rewrite generate-xcfilelists in Python (197622) No new tests -- no change in user-visible functionality. * Scripts/check-xcfilelists.sh: 2019-05-17 Wenson Hsieh Fix a typo in some user agent string logic https://bugs.webkit.org/show_bug.cgi?id=197992 Reviewed by Brent Fulgham. Adjust the major version number for the desktop user agent string. * platform/ios/UserAgentIOS.mm: (WebCore::standardUserAgentWithApplicationName): 2019-05-17 Simon Fraser REGRESSION (r245170): gmail.com inbox table header flickers https://bugs.webkit.org/show_bug.cgi?id=198005 Reviewed by Antti Koivisto. When a layer started as painting into shared backing, but then became independently composited (e.g. by having to clip composited children), it wouldn't have the "overlap" indirect compositing reason. This allowed requiresOwnBackingStore() to say that it could paint into some ancestor, but this breaks overlap. So in this code path, put IndirectCompositingReason::Overlap back on the layer which restores the previous behavior. Make some logging changes to help diagnose things like this. Test: compositing/shared-backing/overlap-after-end-sharing.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::calculateClipRects const): (WebCore::outputPaintOrderTreeLegend): (WebCore::outputPaintOrderTreeRecursive): * rendering/RenderLayer.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::computeCompositingRequirements): (WebCore::RenderLayerCompositor::updateBacking): (WebCore::RenderLayerCompositor::requiresOwnBackingStore const): (WebCore::RenderLayerCompositor::reasonsForCompositing const): (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const): * rendering/RenderLayerCompositor.h: 2019-05-17 Simon Fraser REGRESSION (r245170): gmail.com header flickers when hovering over the animating buttons https://bugs.webkit.org/show_bug.cgi?id=197975 Reviewed by Antti Koivisto. When computeCompositingRequirements() determined that a layer could paint into shared backing, it pushed an overlap container. If that layer then converted to normal composting, we'd push a second overlap container, which left the overlap map in a bad state for the rest of the compositing traversal, causing layers to not get composited when necessary. Test: compositing/shared-backing/overlap-after-shared-to-composited.html * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::computeCompositingRequirements): 2019-05-17 Commit Queue Unreviewed, rolling out r245401. https://bugs.webkit.org/show_bug.cgi?id=197990 Causing internal build failures (Requested by ShawnRoberts on #webkit). Reverted changeset: "Add SPI to set a list of hosts to which to send custom header fields cross-origin" https://bugs.webkit.org/show_bug.cgi?id=197397 https://trac.webkit.org/changeset/245401 2019-05-16 Said Abou-Hallawa SVGElement should detach itself from all its properties before it is deleted https://bugs.webkit.org/show_bug.cgi?id=197954 Reviewed by Simon Fraser. Before deleting the SVGElement node, SVGElement::detachAllProperties() needs to be called. This will make the properties be detached objects which means no change will be committed unless these properties are attached to another owner. Test: svg/dom/svg-properties-detach-change.html * dom/Node.cpp: (WebCore::Node::removedLastRef): * svg/SVGElement.h: (WebCore::SVGElement::detachAllProperties): 2019-05-17 Eric Carlson Allow sequential playback of media files when initial playback started with a user gesture https://bugs.webkit.org/show_bug.cgi?id=197959 Reviewed by Youenn Fablet. Test: media/playlist-inherits-user-gesture.html * dom/Document.cpp: (WebCore::Document::processingUserGestureForMedia const): Return true if it is within one second of the last HTMLMediaElement 'ended' event. * dom/Document.h: (WebCore::Document::mediaFinishedPlaying): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::parseAttribute): removeBehaviorsRestrictionsAfterFirstUserGesture -> removeBehaviorRestrictionsAfterFirstUserGesture. (WebCore::HTMLMediaElement::load): Ditto. Don't call removeBehaviorsRestrictionsAfterFirstUserGesture, it will be done in prepareForLoad. (WebCore::HTMLMediaElement::prepareForLoad): removeBehaviorsRestrictionsAfterFirstUserGesture -> removeBehaviorRestrictionsAfterFirstUserGesture. (WebCore::HTMLMediaElement::audioTrackEnabledChanged): Ditto. (WebCore::HTMLMediaElement::play): Ditto. (WebCore::HTMLMediaElement::pause): Ditto. (WebCore::HTMLMediaElement::setVolume): Ditto. (WebCore::HTMLMediaElement::setMuted): Ditto. (WebCore::HTMLMediaElement::webkitShowPlaybackTargetPicker): Ditto. (WebCore::HTMLMediaElement::dispatchEvent): Call document().mediaFinishedPlaying() when dispatching the 'ended' event. (WebCore::HTMLMediaElement::removeBehaviorRestrictionsAfterFirstUserGesture): Rename. Set m_removedBehaviorRestrictionsAfterFirstUserGesture. (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture): Deleted. * html/HTMLMediaElement.h: * html/HTMLVideoElement.cpp: (WebCore:HTMLVideoElement::nativeImageForCurrentTime): Convert to runtime logging. (WebCore:HTMLVideoElement::webkitEnterFullscreen): Ditto. (WebCore:HTMLVideoElement::webkitSetPresentationMode): Ditto. (WebCore:HTMLVideoElement::fullscreenModeChanged): Ditto. * html/MediaElementSession.cpp: (WebCore::MediaElementSession::removeBehaviorRestriction): Update log message. 2019-05-17 Brent Fulgham Hardening: Prevent FrameLoader crash due to SetForScope https://bugs.webkit.org/show_bug.cgi?id=197458 Reviewed by Chris Dumez. Since SetForScope takes action during a function returns, it might cause a crash if its scope is broader than the value it is resetting. * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadDifferentDocumentItem): 2019-05-16 Carlos Garcia Campos [GTK] Need WebKitContextMenuItemType to open emoji picker https://bugs.webkit.org/show_bug.cgi?id=176760 Reviewed by Michael Catanzaro. Add a new context menu item to insert an emoji. * loader/EmptyClients.cpp: Empty implementation of ContextMenuClient::insertEmoji(). * page/ContextMenuClient.h: Add insertEmoji for GTK port. * page/ContextMenuController.cpp: (WebCore::ContextMenuController::contextMenuItemSelected): Handle insert emoji action. (WebCore::ContextMenuController::populate): Add insert emoji item after select all. (WebCore::ContextMenuController::checkOrEnableIfNeeded const): Handle insert emoji action. * platform/ContextMenuItem.h: Add insert emoji action. * platform/LocalizedStrings.h: * platform/gtk/LocalizedStringsGtk.cpp: (WebCore::contextMenuItemTagInsertEmoji): 2019-05-16 Greg Doolittle AX: Unship some ARIA string reflectors that are to-be-replaced by element reflection https://bugs.webkit.org/show_bug.cgi?id=197764 Reviewed by Chris Fleizach. Specifically these: - ariaActiveDescendant - ariaControls - ariaDescribedBy - ariaDetails - ariaErrorMessage - ariaFlowTo - ariaLabelledBy - ariaOwns Test: LayoutTests/accessibility/ARIA-reflections.html (updated) * accessibility/AriaAttributes.idl: 2019-05-16 Youenn Fablet CoreAudioCaptureSource should be marked as an audio capture track https://bugs.webkit.org/show_bug.cgi?id=197953 Reviewed by Eric Carlson. Manually tested. * platform/mediastream/mac/CoreAudioCaptureSource.h: Mark it as microphone so that it can get muted properly. 2019-05-16 Alex Christensen Add SPI to set a list of hosts to which to send custom header fields cross-origin https://bugs.webkit.org/show_bug.cgi?id=197397 Reviewed by Geoff Garen. In r223001 I added the ability to send custom headers, but with a restriction that they will not be sent except to the origin of the main document. We need the ability to specify what origins to send these headers to even if they are not first party requests. We get this information in a list of strings which are the hosts to send the headers to. Some of the strings have an asterisk at the beginning, indicating that the headers are to be sent to all subdomains. I repurposed some ObjC SPI that was never adopted, but I keep testing the C API that was to verify no regression. I also added some new API tests for the new behavior. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * loader/CustomHeaderFields.cpp: Added. (WebCore::CustomHeaderFields::thirdPartyDomainsMatch const): * loader/CustomHeaderFields.h: Added. (WebCore::CustomHeaderFields::encode const): (WebCore::CustomHeaderFields::decode): * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::setCustomHeaderFields): Deleted. * loader/DocumentLoader.h: (WebCore::DocumentLoader::setCustomHeaderFields): (WebCore::DocumentLoader::customHeaderFields const): (WebCore::DocumentLoader::customHeaderFields): Deleted. * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::requestResource): 2019-05-16 Ali Juma [IntersectionObserver] Regression: No initial observation when nothing else triggers rendering https://bugs.webkit.org/show_bug.cgi?id=197891 Reviewed by Simon Fraser. Schedule a rendering update whenever a new IntersectionObserver target is added. Test: intersection-observer/initial-observation.html * page/IntersectionObserver.cpp: (WebCore::IntersectionObserver::observe): 2019-05-16 Carlos Garcia Campos [FreeType] Some character sequences with a variation selector are not rendered https://bugs.webkit.org/show_bug.cgi?id=197838 Reviewed by Michael Catanzaro. We get the invalid glyph instead. See http://mts.io/2015/04/21/unicode-symbol-render-text-emoji/. In the table at the end the Emoji and Text columns are not correctly rendered. It happens also when copying an emoji from GtkEmojiChooser and pasting in WebKit text field, because GTK appends U+FE0F to all emojis to force the emoji style. We need to take into account the variation selector when checking if a font can render a combining sequence, using FT_Face_GetCharVariantIndex to get the right glyph in case of variation character present. * platform/graphics/Font.cpp: (WebCore::Font::platformSupportsCodePoint const): Add optional variation parameter. (WebCore::Font::canRenderCombiningCharacterSequence const): Take into account variation selector characters * platform/graphics/Font.h: * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp: (WebCore::FontCascade::fontForCombiningCharacterSequence const): Check variation selectors 0xFE0E and 0xFE0F to decide whether to use the emoji or text style. * platform/graphics/cocoa/FontCocoa.mm: (WebCore::Font::platformSupportsCodePoint const): Return false when a variation character is passed so that characters are checked individually. * platform/graphics/freetype/SimpleFontDataFreeType.cpp: (WebCore::Font::platformSupportsCodePoint const): Use FT_Face_GetCharVariantIndex when a variation character is passed. * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp: (WebCore::harfBuzzFontFunctions): Do not return true when FT_Face_GetCharVariantIndex returns 0. 2019-05-16 Greg Hughes Updated screenHasInvertedColors to use AppKit when available https://bugs.webkit.org/show_bug.cgi?id=197935 Reviewed by Chris Fleizach. * platform/mac/PlatformScreenMac.mm: (WebCore::collectScreenProperties): (WebCore::screenHasInvertedColors): 2019-05-15 Simon Fraser Avoid a recursive descendants layer walk sometimes https://bugs.webkit.org/show_bug.cgi?id=197939 Reviewed by Zalan Bujtas. If a layer got composited post-descendants because it needs to clip, for example, we'd do a recursive descendant tree walk to add layers to the overlap map. However, all the descendants would already have contributed to the overlap map if some non-root ancestor was already composited. So we can skip the addDescendantsToOverlapMapRecursive() if we know, before descendants, whether there's a non-root composited ancestor. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::CompositingState::hasNonRootCompositedAncestor const): (WebCore::RenderLayerCompositor::computeCompositingRequirements): 2019-05-15 Simon Fraser Clean up code related to compositing overlap map maintenance https://bugs.webkit.org/show_bug.cgi?id=197936 Reviewed by Zalan Bujtas. Clarify the logic around updating the overlap map: When a layer becomes composited, or paints into a non-root composited layer, we add it to the overlap map after traversing descendants (since it only affets layers later in traversal). If a layer became composited after traversing descendants, we need to go back and add all the descendants to the overlap map with a recursive traversal. We can do all this near the end of computeCompositingRequirements/traverseUnchangedSubtree because we only check overlap when we enter this function on later layers. Add a CompositingOverlap log channel and use it to log the state of the overlap map. * platform/Logging.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::computeCompositingRequirements): (WebCore::RenderLayerCompositor::traverseUnchangedSubtree): (WebCore::RenderLayerCompositor::addToOverlapMap const): (WebCore::RenderLayerCompositor::addDescendantsToOverlapMapRecursive const): (WebCore::RenderLayerCompositor::updateOverlapMap const): (WebCore::RenderLayerCompositor::addToOverlapMap): Deleted. (WebCore::RenderLayerCompositor::addToOverlapMapRecursive): Deleted. * rendering/RenderLayerCompositor.h: 2019-05-15 Timothy Hatcher REGRESSION (r245072): Missing code in Document::styleColorOptions to propagate StyleColor::Options::UseInactiveAppearance https://bugs.webkit.org/show_bug.cgi?id=197930 rdar://problem/49833954 Reviewed by Wenson Hsieh and Megan Gardner. Add some code that was missing from Document in my original patch for r245072. * dom/Document.cpp: (WebCore::Document::useSystemAppearance const): Drive-by fix code style. (WebCore::Document::useInactiveAppearance const): Added. (WebCore::Document::styleColorOptions const): Add StyleColor::Options::UseInactiveAppearance. * dom/Document.h: Added useInactiveAppearance(). 2019-05-15 Devin Rousso Web Inspector: user gesture toggle should also force user interaction flag https://bugs.webkit.org/show_bug.cgi?id=197269 Reviewed by Joseph Pecoraro. Test: inspector/runtime/evaluate-userGestureEmulation-userIsInteracting.html * inspector/agents/page/PageRuntimeAgent.cpp: (WebCore::PageRuntimeAgent::evaluate): * page/ChromeClient.h: (WebCore::ChromeClient::userIsInteracting const): Added. (WebCore::ChromeClient::setUserIsInteracting): Added. * testing/Internals.idl: * testing/Internals.h: * testing/Internals.cpp: (WebCore::Internals::userIsInteracting): Added. 2019-05-15 Zalan Bujtas Do not create a shape object outside of the layout context https://bugs.webkit.org/show_bug.cgi?id=197926 Reviewed by Simon Fraser. ShapeOutside objects are used to compute line constrains during layout (in a strict sense, they are part of the layout context and should only be mutated during layout). If we don't create one during layout, we probably don't need to know its geometry during paint (or any other non-layout activity) either. Test: fast/block/float/float-with-shape-outside-crash.html * rendering/FloatingObjects.cpp: (WebCore::ComputeFloatOffsetForLineLayoutAdapter::updateOffsetIfNeeded): (WebCore::ComputeFloatOffsetForLineLayoutAdapter::updateOffsetIfNeeded): * rendering/shapes/ShapeOutsideInfo.cpp: (WebCore::ShapeOutsideInfo::computeDeltasForContainingBlockLine): 2019-05-15 Youenn Fablet Mark beacon and ping loads as low priority https://bugs.webkit.org/show_bug.cgi?id=197919 Reviewed by Alex Christensen. No JS observable change of behavior. * Modules/beacon/NavigatorBeacon.cpp: (WebCore::NavigatorBeacon::sendBeacon): * loader/PingLoader.cpp: (WebCore::PingLoader::sendPing): 2019-05-15 Simon Fraser Clean up RenderLayerCompositor::computeCompositingRequirements() and traverseUnchangedSubtree() https://bugs.webkit.org/show_bug.cgi?id=197931 Reviewed by Zalan Bujtas. These functions have grown and become hard to maintain, so try to undo some technical debt. Rename "childState" to "currentState" since it's the state we pass to children, but also is state we change when the current layer becomes composited. Separate the layerWillComposite() lambda from layerWillCompositePostDescendants(). Group the chunks of code at end of the functions into: - updating bits on RenderLayer - updating compositingState with changes from children and our state - doing post-traversal work on overlapMap and backingSharingState Code shared between the two functions is pushed into CompositingState::updateWithDescendantStateAndLayer(). This moves code around but should not cause any behavior change. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateConfiguration): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::OverlapExtent::knownToBeHaveExtentUncertainty const): (WebCore::RenderLayerCompositor::CompositingState::updateWithDescendantStateAndLayer): (WebCore::RenderLayerCompositor::computeCompositingRequirements): (WebCore::RenderLayerCompositor::traverseUnchangedSubtree): (WebCore::RenderLayerCompositor::clipsCompositingDescendants): (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildren): Deleted. (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildrenForUnchangedSubtree): Deleted. (WebCore::RenderLayerCompositor::clipsCompositingDescendants const): Deleted. * rendering/RenderLayerCompositor.h: 2019-05-15 Simon Fraser Make LayerOverlapMap able to output to a TextStream https://bugs.webkit.org/show_bug.cgi?id=197923 Reviewed by Zalan Bujtas. Make it possible output LayerOverlapMap to a TextStream for logging. * rendering/LayerOverlapMap.cpp: (WebCore::OverlapMapContainer::rectList const): (WebCore::operator<<): * rendering/LayerOverlapMap.h: (WebCore::LayerOverlapMap::overlapStack const): 2019-05-15 Youenn Fablet getUserMedia sandbox extensions should not be revoked when a getUserMedia allowed request is being processed https://bugs.webkit.org/show_bug.cgi?id=197851 Reviewed by Alex Christensen. Add a completion handler to create a new capture stream. This is used by WK2 layer to acknowledge the pending capture request is completed. Just after the completion handler, make sure to update the document media state. This is done to ensure that, should capture failing, the UIProcess knows about it and can manage proper sandbox extension revocation. Test: fast/mediastream/gum-stop-track.html * Modules/mediastream/UserMediaRequest.cpp: (WebCore::UserMediaRequest::allow): (WebCore::UserMediaRequest::PendingActivationMediaStream::PendingActivationMediaStream): (WebCore::UserMediaRequest::PendingActivationMediaStream::~PendingActivationMediaStream): * Modules/mediastream/UserMediaRequest.h: (WebCore::UserMediaRequest::PendingActivationMediaStream::create): * platform/mock/MockRealtimeMediaSourceCenter.cpp: (WebCore::MockRealtimeMediaSourceCenter::mockRealtimeMediaSourceCenterEnabled): * platform/mock/MockRealtimeMediaSourceCenter.h: 2019-05-15 Simon Fraser Make LOG_WITH_STREAM more efficient https://bugs.webkit.org/show_bug.cgi?id=197905 Reviewed by Alex Christensen. No longer need to conditionalize ClipRects logging on the channel being enabled since LOG_WITH_STREAM fix the performance problem. Convert some RenderLayerCompositor logging to use LOG_WITH_STREAM. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::calculateClipRects const): (WebCore::clipRectsLogEnabled): Deleted. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::computeCompositingRequirements): (WebCore::RenderLayerCompositor::traverseUnchangedSubtree): 2019-05-15 Simon Fraser Move RenderLayerCompositor's OverlapMap to its own file https://bugs.webkit.org/show_bug.cgi?id=197915 Reviewed by Alex Christensen. Move OverlapMap to its own file. Make use of RectList, which was in the file but unused! Allocate OverlapMapContainer on the heap both to avoid header pollution of internals, and because they will get bigger in future. No behavior change. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * rendering/LayerOverlapMap.cpp: Added. (WebCore::RectList::append): (WebCore::RectList::intersects const): (WebCore::OverlapMapContainer::add): (WebCore::OverlapMapContainer::overlapsLayers const): (WebCore::OverlapMapContainer::unite): (WebCore::LayerOverlapMap::LayerOverlapMap): (WebCore::LayerOverlapMap::add): (WebCore::LayerOverlapMap::overlapsLayers const): (WebCore::LayerOverlapMap::pushCompositingContainer): (WebCore::LayerOverlapMap::popCompositingContainer): * rendering/LayerOverlapMap.h: Added. (WebCore::LayerOverlapMap::isEmpty const): (WebCore::LayerOverlapMap::geometryMap const): (WebCore::LayerOverlapMap::geometryMap): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateCompositingLayers): (WebCore::RenderLayerCompositor::computeCompositingRequirements): (WebCore::RenderLayerCompositor::traverseUnchangedSubtree): (WebCore::RenderLayerCompositor::computeExtent const): (WebCore::RenderLayerCompositor::addToOverlapMap): (WebCore::RenderLayerCompositor::addToOverlapMapRecursive): (WebCore::OverlapMapContainer::add): Deleted. (WebCore::OverlapMapContainer::overlapsLayers const): Deleted. (WebCore::OverlapMapContainer::unite): Deleted. (WebCore::RenderLayerCompositor::OverlapMap::OverlapMap): Deleted. (WebCore::RenderLayerCompositor::OverlapMap::add): Deleted. (WebCore::RenderLayerCompositor::OverlapMap::overlapsLayers const): Deleted. (WebCore::RenderLayerCompositor::OverlapMap::isEmpty const): Deleted. (WebCore::RenderLayerCompositor::OverlapMap::pushCompositingContainer): Deleted. (WebCore::RenderLayerCompositor::OverlapMap::popCompositingContainer): Deleted. (WebCore::RenderLayerCompositor::OverlapMap::geometryMap const): Deleted. (WebCore::RenderLayerCompositor::OverlapMap::geometryMap): Deleted. (WebCore::RenderLayerCompositor::OverlapMap::RectList::append): Deleted. (WebCore::RenderLayerCompositor::OverlapMap::RectList::intersects const): Deleted. * rendering/RenderLayerCompositor.h: 2019-05-15 Devin Rousso Web Automation: elements larger than the viewport have incorrect in-view center point https://bugs.webkit.org/show_bug.cgi?id=195696 Reviewed by Simon Fraser. Original patch by Brian Burg . Some conversion methods do not exist for `FloatRect`/`FloatPoint`. Fill them in as needed, and export some symbols used by WebDriver code to compute an element's in-view center point in various coordinate systems. * dom/TreeScope.h: * dom/TreeScope.cpp: (WebCore::TreeScope::elementsFromPoint): Added. * page/FrameView.h: * page/FrameView.cpp: (WebCore::FrameView::absoluteToLayoutViewportPoint const): Added. (WebCore::FrameView::layoutViewportToAbsoluteRect const): Added. (WebCore::FrameView::absoluteToLayoutViewportRect const): Added. * platform/ScrollView.h: * platform/ScrollView.cpp: (WebCore::ScrollView::viewToContents const): Added. (WebCore::ScrollView::contentsToView const): Added. (WebCore::ScrollView::contentsToRootView const): Added. * platform/Widget.h: * platform/Widget.cpp: (WebCore::Widget::convertToRootView const): Added. (WebCore::Widget::convertFromRootView const): Added. (WebCore::Widget::convertToContainingView const): Added. (WebCore::Widget::convertFromContainingView const): Added. 2019-05-14 Wenson Hsieh Missing cursor/caret showing in search field on google.com https://bugs.webkit.org/show_bug.cgi?id=197862 Reviewed by Simon Fraser. In this bug, the search field is inside of a fixed position container, which is inside of an empty "overflow: hidden" form element (the new layout test demonstrates a simple version of this). The layer of the fixed position container's renderer has an overflow clipping layer of itself, and its clipping rect is non-empty, so the heuristic initially identifies the layer as not fully clipped. However, as the heuristic ascends the RenderLayer tree, it then finds the layer for the "overflow: hidden" form element's renderer; this layer is completely clipped, which causes the heuristic to incorrectly believe that the editable element is completely clipped. To fix the bug, this patch reworks the clipping portion of the heuristic, such that we no longer need to ascend the layer tree. Instead of computing the clip rect relative to the nearest ancestor that has an overflow clip and then walking up the layer tree repeating this process, simply compute the clip rect relative to RenderView's layer, and then walk up to the parent frame and repeat if necessary. Test: editing/selection/ios/do-not-hide-selection-in-visible-field.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::isTransparentOrFullyClippedRespectingParentFrames const): 2019-05-14 Andy Estes [Apple Pay] Payment APIs should be completely disabled in web views into which clients have injected user scripts https://bugs.webkit.org/show_bug.cgi?id=197751 Reviewed by Alex Christensen. In r243324, when a document has had user agent scripts injected into it, payment APIs were disabled at runtime by having all entry points return falsy values or throw exceptions (e.g., ApplePaySession.canMakePayments() returns false). In the case of user scripts in particular (e.g., WKUserScript), since we know whether these exist at the time we create a document's DOMWindow, we can do better than r243324 by completely disabling the payment APIs in the presence of user scripts. To achieve this, this change introduces the 'EnabledByContext' extended attribute for interfaces, which instructs the bindings generator to add a conjunct to the payment API constructors that asks the interface's implementation class whether it should be enabled for a given ScriptExecutionContext. The PaymentRequest and ApplePaySession interfaces adopt this new extended attribute to implement the new user script check. Added new API tests. * Modules/applepay/ApplePaySession.idl: * Modules/applepay/PaymentCoordinator.cpp: (WebCore::PaymentCoordinator::shouldEnableApplePayAPIs const): * Modules/applepay/PaymentCoordinator.h: * Modules/applepay/PaymentSession.cpp: (WebCore::PaymentSession::enabledForContext): * Modules/applepay/PaymentSession.h: * Modules/paymentrequest/PaymentHandler.cpp: (WebCore::PaymentHandler::enabledForContext): * Modules/paymentrequest/PaymentHandler.h: * Modules/paymentrequest/PaymentRequest.cpp: (WebCore::PaymentRequest::enabledForContext): * Modules/paymentrequest/PaymentRequest.h: * Modules/paymentrequest/PaymentRequest.idl: * bindings/scripts/CodeGeneratorJS.pm: (NeedsRuntimeCheck): (GenerateRuntimeEnableConditionalString): * bindings/scripts/IDLAttributes.json: * bindings/scripts/preprocess-idls.pl: (GenerateConstructorAttributes): * bindings/scripts/test/JS/JSTestEnabledForContext.cpp: Added. * bindings/scripts/test/JS/JSTestEnabledForContext.h: Added. * bindings/scripts/test/JS/JSTestGlobalObject.cpp: (WebCore::JSTestGlobalObject::finishCreation): (WebCore::jsTestGlobalObjectTestEnabledForContextConstructorGetter): (WebCore::jsTestGlobalObjectTestEnabledForContextConstructor): (WebCore::setJSTestGlobalObjectTestEnabledForContextConstructorSetter): (WebCore::setJSTestGlobalObjectTestEnabledForContextConstructor): * bindings/scripts/test/TestEnabledForContext.idl: Added. 2019-05-14 Robin Morisset [WHLSL] parseEffectfulSuffix() is never called https://bugs.webkit.org/show_bug.cgi?id=195864 Reviewed by Myles C. Maxfield. The fix is trivial: when parseEffectfulPrefix does not see a ++ or --, it must call parseEffectfulSuffix. No test yet, as it is not testable until the property resolver is finished. It will be tested with the rest of the compiler, when we port the testsuite from the js implementation (it already covers this case). * Modules/webgpu/WHLSL/WHLSLParser.cpp: (WebCore::WHLSL::Parser::parseEffectfulPrefix): 2019-05-14 Robin Morisset [WHLSL] parseEffectfulAssignment should not call parseCallExpression directly https://bugs.webkit.org/show_bug.cgi?id=197890 Reviewed by Myles Maxfield. callExpression already appears in effSuffix which is in effPrefix which is in effAssignment, so having it directly in effAssignment as well is useless (and ambiguous). I've already fixed the grammar (https://github.com/gpuweb/WHLSL/commit/a07005f4d692fe3370618dca5db218992b362049), the grammar was always good, this patch is fixing the parser. * Modules/webgpu/WHLSL/WHLSLParser.cpp: (WebCore::WHLSL::Parser::parseEffectfulAssignment): 2019-05-14 Ross Kirsling Unreviewed restoration of non-unified build. * Modules/cache/DOMCache.cpp: * bindings/js/JSLazyEventListener.h: * loader/NavigationScheduler.h: * page/Quirks.cpp: * page/Quirks.h: * rendering/ClipRect.cpp: 2019-05-14 Zalan Bujtas Do not try to issue repaint while the render tree is being destroyed. https://bugs.webkit.org/show_bug.cgi?id=197461 Reviewed by Simon Fraser. Test: http/tests/svg/crash-on-reload-with-filter.html We don't need to compute repaint rects when the render tree is getting torn down. We'll issue a full repaint at some point. Also during full render tree destruction the inline tree state is undefined. We should avoid accessing it. * rendering/svg/RenderSVGResourceContainer.cpp: (WebCore::RenderSVGResourceContainer::markAllClientLayersForInvalidation): 2019-05-14 Youenn Fablet A service worker process should app nap when all its clients app nap https://bugs.webkit.org/show_bug.cgi?id=185626 Reviewed by Alex Christensen. Update RegistrableDomain to work with SecurityOriginData. Add internal API to enable accessing to service worker process throttle state. Test: http/wpt/service-workers/mac/processSuppression.https.html * platform/RegistrableDomain.h: (WebCore::RegistrableDomain::RegistrableDomain): (WebCore::RegistrableDomain::matches const): (WebCore::RegistrableDomain::registrableDomainFromHost): * testing/ServiceWorkerInternals.cpp: (WebCore::ServiceWorkerInternals::isThrottleable const): * testing/ServiceWorkerInternals.h: * testing/ServiceWorkerInternals.idl: * workers/service/SWClientConnection.h: * workers/service/context/SWContextManager.cpp: * workers/service/context/SWContextManager.h: * workers/service/server/SWServer.cpp: (WebCore::SWServer::serverToContextConnectionCreated): * workers/service/server/SWServer.h: (WebCore::SWServer::Connection::server const): (WebCore::SWServer::connections const): * workers/service/server/SWServerToContextConnection.h: 2019-05-14 Youenn Fablet getUserMedia capture changes on iOS after homing out https://bugs.webkit.org/show_bug.cgi?id=197707 Reviewed by Eric Carlson. In case of muting an AVVideoCaptureSource on iOS, the session is cleared. We need to store the preset information, to setup the new session on unnmuting correctly. Manually tested. * platform/mediastream/mac/AVVideoCaptureSource.h: * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset): (WebCore::AVVideoCaptureSource::setSessionSizeAndFrameRate): (WebCore::AVVideoCaptureSource::setupCaptureSession): 2019-05-14 Oriol Brufau [css-grid] Update grid when changing auto repeat type https://bugs.webkit.org/show_bug.cgi?id=197849 Reviewed by Javier Fernandez. Test: imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-change-auto-repeat-tracks.html This patch makes two 'repeat()' values for 'grid-template' be considered to be different if one uses 'auto-fill' and the other 'auto-fit'. Previously, they were considered to be equal if the repeated values were the same, without comparing the repeat type. Therefore, the grid was not updated when setting both values one after the other. * css/CSSGridAutoRepeatValue.cpp: (WebCore::CSSGridAutoRepeatValue::equals const): * css/CSSGridAutoRepeatValue.h: 2019-05-14 Antti Koivisto Event region computation should respect transforms https://bugs.webkit.org/show_bug.cgi?id=197836 Reviewed by Darin Adler. * platform/graphics/transforms/AffineTransform.cpp: (WebCore::AffineTransform::mapRegion const): Add support for transforming regions. Non-rectlinear results use enclosing rects. * platform/graphics/transforms/AffineTransform.h: * rendering/EventRegion.cpp: (WebCore::EventRegionContext::EventRegionContext): (WebCore::EventRegionContext::pushTransform): (WebCore::EventRegionContext::popTransform): (WebCore::EventRegionContext::unite): (WebCore::EventRegionContext::contains const): Add a context object that holds the current transform. * rendering/EventRegion.h: (WebCore::EventRegion::makeContext): * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paint): * rendering/PaintInfo.h: Replace the region object with the context. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::paintObject): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paintLayerByApplyingTransform): Apply transforms to regions if needed. (WebCore::RenderLayer::collectEventRegionForFragments): * rendering/RenderLayer.h: * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateEventRegion): * rendering/SimpleLineLayoutFunctions.cpp: (WebCore::SimpleLineLayout::paintFlow): 2019-05-14 Youenn Fablet Video frame resizing should be using Trim https://bugs.webkit.org/show_bug.cgi?id=197722 Reviewed by Eric Carlson. Move from letter box to trim mode for resizing. This ensures no black stripes are present when rendering the stream. Test: fast/mediastream/resize-trim.html * platform/cocoa/VideoToolboxSoftLink.cpp: * platform/cocoa/VideoToolboxSoftLink.h: * platform/graphics/cv/ImageTransferSessionVT.mm: (WebCore::ImageTransferSessionVT::ImageTransferSessionVT): 2019-05-14 Yusuke Suzuki [JSC] Shrink sizeof(UnlinkedFunctionExecutable) more https://bugs.webkit.org/show_bug.cgi?id=197833 Reviewed by Darin Adler. * testing/Internals.cpp: (WebCore::Internals::parserMetaData): 2019-05-14 Antoine Quint [Pointer Events] The pointerenter and pointerleave events target the wrong element on iOS https://bugs.webkit.org/show_bug.cgi?id=197881 Reviewed by Dean Jackson. Test: pointerevents/ios/enter-leave-target.html The "pointerenter" and "pointerleave" should target the element on which the event listener was added and not the element that would otherwise hit test. This matches the behavior of "mouseenter" and "mouseleave" on macOS. * page/PointerCaptureController.cpp: (WebCore::PointerCaptureController::dispatchEventForTouchAtIndex): 2019-05-14 Said Abou-Hallawa [CG] Adding support for HEIF-sequence ('public.heics') images https://bugs.webkit.org/show_bug.cgi?id=197384 Reviewed by Simon Fraser. -- Get the image repetitionCount and the frame duration. -- Add a new function setAdditionalSupportedImageTypesForTesting() which takes a delimited String. -- Add internal APIs to retrive the image frame count and the frame duration. Tests: fast/images/animated-heics-draw.html fast/images/animated-heics-verify.html * platform/graphics/ImageSource.h: * platform/graphics/cg/ImageDecoderCG.cpp: (WebCore::animationPropertiesFromProperties): (WebCore::animationHEICSPropertiesFromProperties): (WebCore::ImageDecoderCG::repetitionCount const): (WebCore::ImageDecoderCG::frameDurationAtIndex const): * platform/graphics/cg/UTIRegistry.cpp: (WebCore::setAdditionalSupportedImageTypesForTesting): * platform/graphics/cg/UTIRegistry.h: * testing/Internals.cpp: (WebCore::Internals::imageFrameCount): (WebCore::Internals::imageFrameDurationAtIndex): * testing/Internals.h: * testing/Internals.idl: * testing/js/WebCoreTestSupport.cpp: (WebCoreTestSupport::setAdditionalSupportedImageTypesForTesting): * testing/js/WebCoreTestSupport.h: 2019-05-14 Manuel Rego Casasnovas [css-grid] Use max size to compute auto repeat tracks https://bugs.webkit.org/show_bug.cgi?id=197854 Reviewed by Javier Fernandez. When available size is indefinite we should use max size to compute the number of auto repeat tracks. The spec text is very clear (https://drafts.csswg.org/css-grid/#auto-repeat): > When auto-fill is given as the repetition number, if the grid container > has a definite size or **max size** in the relevant axis... So far we were not doing that for widths, in this patch we modify RenderGrid::computeAutoRepeatTracksCount() to do the same than for heights. We also take advantage to fix problems related to min|max sizes and box-sizing property, that were inconsistent for columns and rows. Tests: imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-001.html imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-002.html imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-max-size-001.html imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-size-001.html imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-size-002.html * rendering/RenderGrid.cpp: (WebCore::RenderGrid::computeAutoRepeatTracksCount const): 2019-05-14 Joonghun Park Implement page-break-* and -webkit-column-break-* as legacy-shorthands. https://bugs.webkit.org/show_bug.cgi?id=197656 Reviewed by Darin Adler. According to https://drafts.csswg.org/css-cascade-4/#legacy-shorthand, implement page-break-* and -webkit-column-break-* as legacy-shorthands for break-*. This change also serialize page-break-* properties to CSSStyleDeclaration, per https://drafts.csswg.org/css-break/#page-break-properties. * css/CSSProperties.json: * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertFontSynthesis): (WebCore::StyleBuilderConverter::convertPageBreakBetween): Deleted. (WebCore::StyleBuilderConverter::convertPageBreakInside): Deleted. (WebCore::StyleBuilderConverter::convertColumnBreakBetween): Deleted. (WebCore::StyleBuilderConverter::convertColumnBreakInside): Deleted. * css/StyleProperties.cpp: (WebCore::StyleProperties::getPropertyValue const): (WebCore::StyleProperties::pageBreakPropertyValue const): * css/StyleProperties.h: * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseValueStart): (WebCore::mapFromPageBreakBetween): (WebCore::CSSPropertyParser::parseShorthand): (WebCore::isLegacyBreakProperty): Deleted. 2019-05-14 Javier Fernandez Implement "line-break: anywhere" https://bugs.webkit.org/show_bug.cgi?id=181169 Reviewed by Myles C. Maxfield. The CSS WG resolved [1] to add a new value 'anywhere' to the 'line-break' CSS property in order to allow additional breaking opportunities not considered in the definition of the 'word-break: break-all'. [1] https://github.com/w3c/csswg-drafts/issues/1171 Tests: imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-003.html imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-004.html imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-005.html imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-006.html imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-007.html imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-008.html imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-009.html imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-010.html imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-011.html imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-012.html imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-016.html imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-017.html imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-018.html imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-019.html imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-021.html imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-022.html imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-023.html imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-024.html * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator LineBreak const): * css/CSSProperties.json: * css/CSSValueKeywords.in: * css/parser/CSSParserFastPaths.cpp: (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue): * rendering/BreakLines.h: (WebCore::nextBreakablePositionBreakCharacter): (WebCore::isBreakable): * rendering/RenderText.cpp: (WebCore::mapLineBreakToIteratorMode): (WebCore::RenderText::computePreferredLogicalWidths): * rendering/line/BreakingContext.h: (WebCore::BreakingContext::handleText): * rendering/style/RenderStyleConstants.h: 2019-05-13 Yusuke Suzuki Unreviewed, build fix after 245258, missing ThreadSpecific.h include https://bugs.webkit.org/show_bug.cgi?id=197146 * platform/ios/wak/WebCoreThread.mm: 2019-05-13 Yusuke Suzuki [WTF] Simplify GCThread and CompilationThread flags by adding them to WTF::Thread https://bugs.webkit.org/show_bug.cgi?id=197146 Reviewed by Saam Barati. * Modules/indexeddb/IDBDatabase.cpp: (WebCore::IDBDatabase::hasPendingActivity const): * Modules/indexeddb/IDBRequest.cpp: (WebCore::IDBRequest::hasPendingActivity const): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::hasPendingActivity const): 2019-05-13 Geoffrey Garen Downgrade RELEASE_ASSERT TO RELEASE_LOG_FAULT for SQLite Class A files https://bugs.webkit.org/show_bug.cgi?id=197760 Reviewed by Jer Noble. Only makeSafeToUseMemoryMapForPath() if needed. (Fixed missing brace.) * platform/sql/SQLiteDatabase.cpp: (WebCore::SQLiteDatabase::open): 2019-05-13 Tadeu Zagallo JSObject::getOwnPropertyDescriptor is missing an exception check https://bugs.webkit.org/show_bug.cgi?id=197693 Reviewed by Saam Barati. JSObject::getOwnPropertyDescriptor assumes that getOwnPropertySlot returns false if an exception is thrown, but that was not true for JSLocation::getOwnPropertySlotCommon. This is already covered by http/tests/security/cross-frame-access-getOwnPropertyDescriptor.html * bindings/js/JSLocationCustom.cpp: (WebCore::getOwnPropertySlotCommon): (WebCore::JSLocation::getOwnPropertySlot): (WebCore::JSLocation::getOwnPropertySlotByIndex): 2019-05-13 Antti Koivisto REGRESSION (r245208): compositing/shared-backing/sharing-bounds-non-clipping-shared-layer.html asserts https://bugs.webkit.org/show_bug.cgi?id=197818 Reviewed by Simon Fraser. Tests: fast/scrolling/ios/event-region-scale-transform-shared.html fast/scrolling/ios/event-region-translate-transform-shared.html This fixes the assert. However the added tests demonstrate that transform is not taken into account when computing the event region, https://bugs.webkit.org/show_bug.cgi?id=197836. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateEventRegion): 2019-05-13 Wenson Hsieh [macOS] Font formatting options don't work when composing a message in Yahoo mail https://bugs.webkit.org/show_bug.cgi?id=197813 Reviewed by Darin Adler. The bug happens because on mousedown, the "Aa Font" menu item's event handler hides itself before changing the font at the text selection. This causes us to clear the selection in FocusController::setFocusedElement. There is existing logic in clearSelectionIfNeeded that would normally prevent us from clearing the selection due to the mousePressNode not being able to start a selection. However, since the clickable element in this case is hidden during mousedown, it is missing a renderer, and we bail from the `mousePressNode->renderer() && !mousePressNode->canStartSelection()` check as a result. This check was orginally added in https://trac.webkit.org/r24334 to avoid clearing the selection when clicking a button; the intention appears to have been making it so that clicking on something that could not start a selection (back then, synonymous with -webkit-user-select: ignore;) would not clear the current selection; to this end, it seems odd to additionally require that the thing being clicked should still have a renderer, so it seems safe to remove this requirement. Test: editing/selection/preserve-selection-when-clicking-button.html * page/FocusController.cpp: (WebCore::clearSelectionIfNeeded): 2019-05-13 Eric Carlson https://bugs.webkit.org/show_bug.cgi?id=197793 Unreviewed, build fix after r245199. * platform/audio/ios/MediaSessionManagerIOS.mm: (WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange): 2019-05-13 Darin Adler WHLSLPrepare.cpp always recompiles, even if nothing was changed https://bugs.webkit.org/show_bug.cgi?id=197151 Reviewed by Dan Bernstein and Keith Rollin. * DerivedSources-input.xcfilelist: Script updated this automatically after DerivedSources.make was corrected. * DerivedSources-output.xcfilelist: Ditto, although I had to manually remove one bogus leftover reference to WHLSLStandardLibrary.cpp. * DerivedSources.make: Updated the rule that builds WHSLStandardLibrary.h to no longer refer to nonexistent WHLSLStandardLibrary.cpp. Because the dependency was on a file that was never created, the rule to regenerate WHSLStandardLibrary.h was running on every build, instead of only when one of the dependencies changed. 2019-05-12 Simon Fraser When the set of backing-sharing layers changes, we need to issue a repaint https://bugs.webkit.org/show_bug.cgi?id=197825 Reviewed by Zalan Bujtas. If the set of layers painting into a shared backing store changes, we need to repaint that backing store. This happens when scrolling as shared layers enter the visible area. Test: compositing/shared-backing/overflow-scroll/repaint-shared-on-scroll.html * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::setBackingSharingLayers): 2019-05-02 Simon Fraser Add logging for RenderLayer clip rects https://bugs.webkit.org/show_bug.cgi?id=197547 Reviewed by Zalan Bujtas. Add a ClipRects log channel, and stream output for ClipRect and ClipRects. The ClipRect code is performance sensitive, even in debug, so guard the log sites with clipRectsLogEnabled() because the macro still evaluates its arguments even if the channel is disabled (we need some better way to log that doesn't do this). * platform/Logging.h: * rendering/ClipRect.cpp: (WebCore::operator<<): * rendering/ClipRect.h: * rendering/RenderLayer.cpp: (WebCore::operator<<): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayer.h: 2019-05-12 Simon Fraser Refactor composited backing-sharing code https://bugs.webkit.org/show_bug.cgi?id=197824 Reviewed by Zalan Bujtas. Clean up the backing-sharing code to share more code, and make it easier to understand. Moves more logic into member functions on BackingSharingState, which are named to make their functions clearer: startBackingSharingSequence/endBackingSharingSequence. computeCompositingRequirements() and traverseUnchangedSubtree() now just call updateBeforeDescendantTraversal/updateAfterDescendantTraversal. No behavior change. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::willBeDestroyed): (WebCore::RenderLayerBacking::setBackingSharingLayers): Remove the early return, since we need to call setBackingProviderLayer() on the sharing layers in both code paths. (WebCore::RenderLayerBacking::removeBackingSharingLayer): (WebCore::RenderLayerBacking::clearBackingSharingLayers): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::BackingSharingState::backingProviderCandidate const): (WebCore::RenderLayerCompositor::BackingSharingState::appendSharingLayer): (WebCore::RenderLayerCompositor::BackingSharingState::startBackingSharingSequence): (WebCore::RenderLayerCompositor::BackingSharingState::endBackingSharingSequence): (WebCore::RenderLayerCompositor::BackingSharingState::updateBeforeDescendantTraversal): (WebCore::RenderLayerCompositor::BackingSharingState::updateAfterDescendantTraversal): (WebCore::RenderLayerCompositor::computeCompositingRequirements): (WebCore::RenderLayerCompositor::traverseUnchangedSubtree): (WebCore::RenderLayerCompositor::BackingSharingState::resetBackingProviderCandidate): Deleted. * rendering/RenderLayerCompositor.h: 2019-05-12 Youenn Fablet Use clampTo in AVVideoCaptureSource::setSizeAndFrameRateWithPreset https://bugs.webkit.org/show_bug.cgi?id=197704 Reviewed by Alex Christensen. Use clampTo as suggested in bug 196214 review. No change of behavior. * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset): 2019-05-12 Youenn Fablet Use the main screen for screen capture https://bugs.webkit.org/show_bug.cgi?id=197804 Reviewed by Eric Carlson. If the main screen, i.e. the screen that has focus at the time of selection of the screen to capture, is capturable, add it to the list of screen devices, but do not add any other screen. This will make sure the main screen is selected. Manually tested. * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm: (WebCore::ScreenDisplayCaptureSourceMac::screenCaptureDevices): 2019-05-12 Takashi Komori [Curl] Suppress extra didReceiveAuthenticationChallenge call when accessing a server which checks basic auth. https://bugs.webkit.org/show_bug.cgi?id=197650 Reviewed by Fujii Hironori. When Curl port accesses a page which checks Basic Authentication credential and server trust challenge occurs, Curl port calls extra didReceiveAuthenticationChallenge unnecessarily. This is because Curl port discards information about allowed server trust challenge before in NetworkDataTaskCurl::restartWithCredential. Test: http/tests/ssl/curl/certificate-and-authentication.html * platform/network/curl/CurlRequest.h: (WebCore::CurlRequest::isServerTrustEvaluationDisabled): 2019-05-11 Simon Fraser Overflow scroll that becomes non-scrollable should stop being composited https://bugs.webkit.org/show_bug.cgi?id=197817 Reviewed by Antti Koivisto. Remove the iOS-specific #ifdef around code that triggers a compositing re-evaluation when scrolling state changes. Test: compositing/scrolling/async-overflow-scrolling/become-non-scrollable.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateScrollInfoAfterLayout): 2019-05-11 Simon Fraser Layer bounds are incorrect for sharing layers that paint with transforms https://bugs.webkit.org/show_bug.cgi?id=197768 Reviewed by Zalan Bujtas. We don't need to traverse shared layers if the backing-provider has overflow clip, because we know they are containing-block descendants and therefore clipped. Note tha the CSS "clip" property doesn't guarantee this, because the clip rect can be larger than the element, so in that case we just traverse shared layers. Tests: compositing/shared-backing/sharing-bounds-clip.html compositing/shared-backing/sharing-bounds-non-clipping-shared-layer.html compositing/shared-backing/sharing-bounds-transformed-sharing-layer.html compositing/shared-backing/sharing-bounds.html * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateCompositedBounds): 2019-05-11 Simon Fraser Translucent gradient rendering bug due to will-change transform https://bugs.webkit.org/show_bug.cgi?id=197654 Reviewed by Dean Jackson. We failed to re-evaluate 'contentsOpaque' when a background changed, because this happened in updateGeometry() and that doesn't run for background changes. However, 'contentsOpaque' also requires knowing about geometry because we have to turn it off when there's subpixel positioning, and updateConfiguration() runs before updateGeometry(). So compute m_hasSubpixelRounding in updateGeometry() and set contentsOpaque in updateAfterDescendants(). Test: compositing/contents-opaque/background-change-to-transparent.html * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateConfiguration): (WebCore::RenderLayerBacking::updateGeometry): (WebCore::RenderLayerBacking::updateAfterDescendants): * rendering/RenderLayerBacking.h: 2019-05-11 Simon Fraser When the scroller hosting a shared layer becomes non-scrollable, content disappears https://bugs.webkit.org/show_bug.cgi?id=197766 Reviewed by Zalan Bujtas. RenderLayerCompositor::requiresOwnBackingStore() should return true for a layer that shares its backing store. We always made backing for overlap layers, so even if the sharing layers have no painted content, this should rarely be a backing store memory regression. Test: compositing/shared-backing/overflow-scroll/sharing-layer-becomes-non-scrollable.html * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::requiresOwnBackingStore const): 2019-05-11 Simon Fraser Backing-sharing layers with transforms render incorrectly https://bugs.webkit.org/show_bug.cgi?id=197692 Reviewed by Antti Koivisto. Layers that paint into shared backing need to enter the RenderLayer painting code in a way that paints the filters, transforms, opacity and blending. RenderLayerBacking::paintIntoLayer() normally enters at paintLayerContents(), because the effects are rendered via the GraphicsLayer, but shared layers will paint effects. Note that if the backing-provider has effects, it will be the stacking context for the shared layers, so it's correct that sharing layers are impacted by effects on the backing-provider. In addition, we have to ensure that we don't over-eagerly make layers shared. Consider:
Here "clipping" is the provider layer, "sharing" paints into shared backing, but we don't want to also mark "inner" as sharing, since "sharing" will just paint it. This is akin to avoiding unnecessary compositing of z-order descendants when they can just paint. To do this we need to ensure that sharing layers are treated like compositing layers in the overlap map, i.e. when a layer is sharing, we call overlapMap.pushCompositingContainer(), and later overlapMap.popCompositingContainer(). Tests: compositing/shared-backing/nested-shared-layers-with-opacity.html compositing/shared-backing/shared-layer-has-blending.html compositing/shared-backing/shared-layer-has-filter.html compositing/shared-backing/shared-layer-has-opacity.html compositing/shared-backing/shared-layer-has-reflection.html compositing/shared-backing/shared-layer-has-transform.html compositing/shared-backing/shared-layer-isolates-blending.html compositing/shared-backing/shared-transformed-layer-bounds.html compositing/shared-backing/sharing-layer-becomes-non-scrollable.html compositing/shared-backing/sharing-layer-has-effect.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paintLayer): (WebCore::RenderLayer::paintLayerWithEffects): * rendering/RenderLayer.h: * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::paintIntoLayer): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::CompositingState::stateForPaintOrderChildren const): (WebCore::backingProviderLayerCanIncludeLayer): (WebCore::RenderLayerCompositor::computeCompositingRequirements): (WebCore::RenderLayerCompositor::traverseUnchangedSubtree): 2019-05-10 Youenn Fablet A service worker instance should be terminated when its SWServer is destroyed https://bugs.webkit.org/show_bug.cgi?id=197801 Reviewed by Chris Dumez. On session destruction, the SWServer is destroyed. At that time, it should terminate all its running service workers. Covered by updated API test. * workers/service/server/SWServer.cpp: (WebCore::SWServer::~SWServer): 2019-05-10 Eric Carlson [iOS] HTMLMediaElement sometimes doesn't send 'webkitplaybacktargetavailabilitychanged' event https://bugs.webkit.org/show_bug.cgi?id=197793 Reviewed by Jer Noble. * html/MediaElementSession.cpp: (WebCore::MediaElementSession::MediaElementSession): Initialize m_hasPlaybackTargets. * platform/audio/ios/MediaSessionManagerIOS.mm: (WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange): Log target availability. (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]): Call the client externalOutputDeviceAvailableDidChange method after the AVRouteDetector is available. 2019-05-09 Geoffrey Garen Downgrade RELEASE_ASSERT TO RELEASE_LOG_FAULT for SQLite Class A files https://bugs.webkit.org/show_bug.cgi?id=197760 Reviewed by Jer Noble. We have all the data we need, and this crash is happening more than expected. * platform/sql/SQLiteDatabase.cpp: (WebCore::SQLiteDatabase::open): 2019-05-10 Zalan Bujtas [iOS] baidu.com: Synthetic bold renders too far apart, appears doubled. https://bugs.webkit.org/show_bug.cgi?id=197781 Reviewed by Simon Fraser. Synthetic bold is essentially two regular glyphs painted with an offset. While on macOS this offset is always 1px (CSS), on iOS larger font produces higher offset value. At paint time, this offset value (in CSS px unit) get converted to a device pixel value taking context scale into account. This conversion ensures that the gap between the 2 regular glyphs won't get wider (in device pixels) as the user pinch zooms in. This works as long as the scale on the context is >= 1. This patch ensures that a scaled down context won't blow up this gap. Test: fast/text/large-synthetic-bold-with-scale-transform.html * platform/graphics/cocoa/FontCascadeCocoa.mm: (WebCore::FontCascade::drawGlyphs): 2019-05-10 Brent Fulgham Gracefully handle inaccessible font face data https://bugs.webkit.org/show_bug.cgi?id=197762 Reviewed by Per Arne Vollan. Make sure CSS Font Face handling gracefully recovers from missing font data. Test: fast/text/missing-font-crash.html * css/CSSFontFace.cpp: (WebCore::CSSFontFace::fontLoadEventOccurred): (WebCore::CSSFontFace::timeoutFired): (WebCore::CSSFontFace::fontLoaded): (WebCore::CSSFontFace::font): 2019-05-10 Simon Fraser ASSERT(isSelfPaintingLayer() || hasSelfPaintingLayerDescendant()) on nytimes.com after r245170 https://bugs.webkit.org/show_bug.cgi?id=197776 Reviewed by Zalan Bujtas. Only try to paint into shared backing for layers that are able to be composited. This avoids trying to do sharing for non-self-painting layers, which doesn't make sense. Test: compositing/shared-backing/overflow-scroll/non-self-painting-layer-should-not-share.html * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::computeCompositingRequirements): 2019-05-10 Michael Catanzaro Fix a bunch of compiler warnings https://bugs.webkit.org/show_bug.cgi?id=197785 Reviewed by Don Olmstead. * CMakeLists.txt: WebCoreTestSupport should accept extra SYSTEM includes. * PlatformGTK.cmake: GTK includes should be added to SYSTEM headers to avoid warnings. * inspector/InspectorCanvas.cpp: Add preprocessor guards to fix unused function warning. * rendering/RenderLayer.cpp: Fix unused variable warning. (WebCore::RenderLayer::updateClipRects): 2019-05-10 Antti Koivisto Event region generation needs to know about backing-sharing https://bugs.webkit.org/show_bug.cgi?id=197694 Reviewed by Simon Fraser. Test: pointerevents/ios/touch-action-region-backing-sharing.html * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateEventRegion): Gather event region from backing sharing layers too. 2019-05-10 Michael Catanzaro [WPE][GTK] Add WebKitWebPage::did-associate-form-controls-for-frame and deprecate original did-associate-form-controls https://bugs.webkit.org/show_bug.cgi?id=197271 Reviewed by Youenn Fablet. * dom/Document.cpp: (WebCore::Document::didAssociateFormControlsTimerFired): * loader/EmptyClients.h: * page/ChromeClient.h: 2019-05-09 Simon Fraser Implement backing-sharing in compositing layers, allowing overlap layers to paint into the backing store of another layer https://bugs.webkit.org/show_bug.cgi?id=197561 Reviewed by Antti Koivisto. This change introduces the concept of layers that share backing store for compositing. A layer which is sharing its backing store first paints itself, and then some set of layers which come later in paint order in the same stacking context. This reduces the composited layer count in some overflow scrolling scenarios, thereby also simplifying the scrolling tree. A backing-shared layer stores a vector of "sharing" RenderLayer* in its RenderLayerBacking. At paint time, the owning layer is painted, then the sharing layers, setting the owning layer as the painting root so that positioning and clipping just work. Sharing layer relationships are constructed in RenderLayerCompositor::computeCompositingRequirements(). We track the last layer which was composited in paint order as a shared candidate. If a later layer would composite for overlap (and no other reasons), then we allow it to share with the candidate if the candidate is in its ancestor containing block chain. Sharing is currently limited to layers in the same stacking context. isComposited() returns false for sharing layers, but they are like composited layers in that they behave as painting boundaries, so RenderLayer::paintLayer() needs to stop at them, and repaints in shared layers have to be directed to their shared layer, hence changes to RenderLayer::clippingRootForPainting() and RenderLayer::enclosingCompositingLayerForRepaint(). The clipping boundary logic in RenderLayer::backgroundClipRect() needed to be generalized so that all calls to RenderLayer::parentClipRects() check for crossing painting boundaries and use TemporaryClipRects in that case. Tests: compositing/shared-backing/overflow-scroll/absolute-in-stacking-relative-in-scroller.html compositing/shared-backing/overflow-scroll/composited-absolute-in-absolute-in-relative-in-scroller.html compositing/shared-backing/overflow-scroll/nested-absolute-with-clipping-in-stacking-overflow.html compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness.html compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping.html compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-relative-clipping.html compositing/shared-backing/overflow-scroll/relative-in-div-in-overflow-scroll.html compositing/shared-backing/overflow-scroll/scrolled-contents-has-painted-content.html compositing/shared-backing/overflow-scroll/scrolled-contents-unconstrained-clip.html compositing/shared-backing/overflow-scroll/shared-layer-clipping.html compositing/shared-backing/overflow-scroll/shared-layer-composited-bounds.html compositing/shared-backing/overflow-scroll/shared-layer-nested-relative-stacking.html compositing/shared-backing/overflow-scroll/shared-layer-repaint.html compositing/shared-backing/partial-compositing-update.html compositing/shared-backing/partial-compositing-update2.html compositing/shared-backing/remove-sharing-layer.html compositing/shared-backing/sharing-cached-clip-rects.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::~RenderLayer): (WebCore::RenderLayer::ancestorLayerIsInContainingBlockChain const): (WebCore::RenderLayer::setBackingProviderLayer): (WebCore::RenderLayer::disconnectFromBackingProviderLayer): (WebCore::RenderLayer::enclosingCompositingLayerForRepaint const): (WebCore::RenderLayer::clippingRootForPainting const): (WebCore::RenderLayer::clipToRect): (WebCore::RenderLayer::paintLayer): (WebCore::RenderLayer::updateClipRects): (WebCore::RenderLayer::clipCrossesPaintingBoundary const): (WebCore::RenderLayer::calculateClipRects const): (WebCore::outputPaintOrderTreeLegend): (WebCore::outputPaintOrderTreeRecursive): (WebCore::inContainingBlockChain): Deleted. * rendering/RenderLayer.h: * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::willBeDestroyed): (WebCore::clearBackingSharingLayerProviders): (WebCore::RenderLayerBacking::setBackingSharingLayers): (WebCore::RenderLayerBacking::removeBackingSharingLayer): (WebCore::RenderLayerBacking::clearBackingSharingLayers): (WebCore::RenderLayerBacking::updateCompositedBounds): (WebCore::RenderLayerBacking::updateDrawsContent): (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer const): (WebCore::RenderLayerBacking::paintIntoLayer): (WebCore::RenderLayerBacking::paintContents): * rendering/RenderLayerBacking.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::CompositingState::stateForPaintOrderChildren const): (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildren): (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildrenForUnchangedSubtree): (WebCore::RenderLayerCompositor::BackingSharingState::resetBackingProviderCandidate): (WebCore::RenderLayerCompositor::updateCompositingLayers): (WebCore::backingProviderLayerCanIncludeLayer): (WebCore::RenderLayerCompositor::computeCompositingRequirements): (WebCore::RenderLayerCompositor::traverseUnchangedSubtree): (WebCore::RenderLayerCompositor::updateBacking): (WebCore::RenderLayerCompositor::layerWillBeRemoved): (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const): * rendering/RenderLayerCompositor.h: * rendering/RenderTreeAsText.cpp: 2019-05-09 Daniel Bates [iOS] Right command key has wrong value for property code https://bugs.webkit.org/show_bug.cgi?id=193876 Reviewed by Brent Fulgham. We're looking for the wrong Windows virtual key code for the right command key. Substitute VK_APPS for VK_RWIN so we can identify the right command key and return the correct value for the code property of the DOM key event. * platform/ios/PlatformEventFactoryIOS.mm: (WebCore::codeForKeyEvent): 2019-05-09 Daniel Bates [iOS] Numpad comma key has incorrect keyIdentifier property https://bugs.webkit.org/show_bug.cgi?id=197753 Reviewed by Brent Fulgham. Map the Numpad Comma HID usage code to its Window virtual key code, VK_SEPARATOR, so that can compute the keyIdentifier property for the Numpad Comma key. Also consider this key as a keypad key just like we do on Mac. There is no discernable difference for doing so on iOS because the non-keypad code path computes the same result due to GraphicsServices having fixed up the input string for the Numpad Comma to be ",", which is want. * platform/ios/KeyEventIOS.mm: (WebCore::windowsKeyCodeForKeyCode): Map kHIDUsage_KeypadComma to VK_SEPARATOR. * platform/ios/PlatformEventFactoryIOS.mm: (WebCore::codeForKeyEvent): Add a comment to explain that this key is only on JIS keyboards. (WebCore::isKeypadEvent): Return true for the Numpad Comma key. 2019-05-09 Zalan Bujtas Do not mix inline and block level boxes. https://bugs.webkit.org/show_bug.cgi?id=197462 Reviewed by Antti Koivisto. This patch tightens the remove-anonymous-wrappers logic by checking if the removal would produce an inline-block sibling mix. When a block level box is removed from the tree, we check if after the removal the anonymous sibling block boxes are still needed or whether we can removed them as well (and have only inline level child boxes). In addition to checking if the container is anonymous and is part of a continuation, we also need to check if collapsing it (and by that moving its children one level up) would cause a inline-block box mix. Test: fast/ruby/continuation-and-column-spanner-crash.html * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::removeAnonymousWrappersForInlineChildrenIfNeeded): * rendering/updating/RenderTreeBuilderContinuation.cpp: (WebCore::RenderTreeBuilder::Continuation::cleanupOnDestroy): 2019-05-09 Eric Carlson Refine AudioSession route sharing policy https://bugs.webkit.org/show_bug.cgi?id=197742 Reviewed by Darin Adler. No new tests, updated AVAudioSessionRouteSharingPolicy API test. * platform/audio/cocoa/MediaSessionManagerCocoa.mm: (MediaSessionManagerCocoa::updateSessionState): 2019-05-09 Simon Fraser fast/hidpi/video-controls-in-hidpi.html sometimes asserts in WK1 https://bugs.webkit.org/show_bug.cgi?id=197695 Reviewed by Zalan Bujtas. With the backing-sharing changes that landed in r245058, some WebKit1 tests with media controls asserted in RenderLayerBacking::computeParentGraphicsLayerRect() because a layer would have a m_ancestorClippingLayer, but backgroundClipRect() would return an infinite rect. This happened when a layer tree change caused the layer's compositing ancestor to no longer isolate composited blending (which affects the behavior of RenderLayerCompositor:clippedByAncestor()), but we failed to mark its composited children as needing the configuration update which would eliminate their m_ancestorClippingLayers. The fix is to call setChildrenNeedCompositingGeometryUpdate() when isolatesCompositedBlending changes. We don't haev setChildrenNeedCompositingConfigurationUpdate(), but setChildrenNeedCompositingGeometryUpdate() has the desired side-effect. I was unable to make a standalone test case for this, but the code is exercised by media control tests. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::computeCompositingRequirements): 2019-05-09 Brent Fulgham Correct delayed load event handling https://bugs.webkit.org/show_bug.cgi?id=197679 Reviewed by Alex Christensen. We need to properly account for the fact that JavaScript might run while performing loads. * dom/Document.cpp: (WebCore::Document::loadEventDelayTimerFired): 2019-05-09 Antti Koivisto Elements with "display: inline-block" don't have a touch-action region https://bugs.webkit.org/show_bug.cgi?id=197281 Reviewed by Antoine Quint. Test: pointerevents/ios/touch-action-region-inline-block.html PaintPhase::EventRegion failed to traverse into inline boxes. * rendering/InlineElementBox.cpp: (WebCore::InlineElementBox::paint): * rendering/RenderElement.cpp: (WebCore::RenderElement::paintAsInlineBlock): 2019-05-08 Carlos Garcia Campos REGRESSION(r239915): [FreeType] White space skipped when rendering plain text with noto CJK font https://bugs.webkit.org/show_bug.cgi?id=197658 Reviewed by Michael Catanzaro. Since r239915 we no longer overwrite control characters with zero width space, they are handled later when filling the glyph pages. In Font::platformGlyphInit() there's an optimization to get the glyph of zero with space character that assumes that control characters are always overwritten. Since the glyph for character at 0 index is always overwritten with zero width space, we can avoid loading the page for the actual zero width space character and use the first page instead. In the particular case of noto CJK font, character at 0 is mapped to the same glyph as space character, so space and zero width space end up being the same glyph. That breaks the space width calculation, that returns 0 when isZeroWidthSpaceGlyph() is true. That's why spaces are no longer rendered, ComplexTextController::adjustGlyphsAndAdvances() is setting the x advance for the space glyphs to 0. * platform/graphics/Font.cpp: (WebCore::Font::platformGlyphInit): Use the actual zero width space page to get the glyph instead of 0 when using FreeType. 2019-05-08 Alex Christensen Fix WPE build. * CMakeLists.txt: Bots wanted a "PUBLIC" or "PRIVATE" keyword here. 2019-05-08 Alex Christensen Try to fix Linux build * platform/graphics/ANGLEWebKitBridge.h: Include headers consistently on all platforms. 2019-05-08 Don Olmstead Update ANGLE https://bugs.webkit.org/show_bug.cgi?id=197676 Reviewed by Alex Christensen. * CMakeLists.txt: * PlatformGTK.cmake: * PlatformMac.cmake: * PlatformPlayStation.cmake: * PlatformWPE.cmake: * PlatformWin.cmake: * platform/graphics/GLContext.cpp: * platform/graphics/egl/GLContextEGL.cpp: * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp: * platform/graphics/opengl/Extensions3DOpenGLES.h: * platform/graphics/opengl/TemporaryOpenGLSetting.cpp: * platform/graphics/texmap/TextureMapperGLHeaders.h: 2019-05-08 Chris Dumez [iOS Debug] ASSERTION FAILED: !m_originalNode in WebCore::JSLazyEventListener::checkValidityForEventTarget(WebCore::EventTarget &) https://bugs.webkit.org/show_bug.cgi?id=197696 Reviewed by Simon Fraser. Setting the onorientationchange / onresize event handler on the body should set the event handler on the window object, as per the HTML specification. However, calling body.addEventListener() with 'orientationchange' or 'resize' should not set the event listener on the window object, only the body. Blink and Gecko seem to behave as per specification but WebKit had a quirk for the addEventListener case. The quirk's implementation is slightly wrong (because it is unsafe to take a JSLazyEventListener from a body element and add it to the window, given that the JSLazyEventListener keeps a raw pointer to its element) and was causing crashes such as . As a result, this patch simply drops the WebKit quirk, which will align our behavior with other browsers and fix the crashes altogether. Test: fast/events/ios/rotation/orientationchange-event-listener-on.body.html * dom/Node.cpp: (WebCore::tryAddEventListener): (WebCore::tryRemoveEventListener): 2019-05-08 Ryan Haddad Unreviewed, rolling out r245058. Causes crashes under ASan / GuardMalloc Reverted changeset: "Implement backing-sharing in compositing layers, allowing overlap layers to paint into the backing store of another layer" https://bugs.webkit.org/show_bug.cgi?id=197561 https://trac.webkit.org/changeset/245058 2019-05-08 Ryan Haddad Unreviewed, rolling out r245068. Caused debug layout tests to exit early due to an assertion failure. Reverted changeset: "All prototypes should call didBecomePrototype()" https://bugs.webkit.org/show_bug.cgi?id=196315 https://trac.webkit.org/changeset/245068 2019-05-08 Megan Gardner Add quirks to emulate undo and redo in hidden editable areas on some websites https://bugs.webkit.org/show_bug.cgi?id=197452 Reviewed by Alex Christensen. UI change, not testable. We need to send synthetic keyboard events to the web process to emulate undo and redo key combinations for when we are trying to get our undo and redo UI to work on rich editing websites that only listen to keystrokes, and don't let us use our undo manager to help manage the input content. * page/EventHandler.cpp: (WebCore::EventHandler::keyEvent): * platform/PlatformKeyboardEvent.h: (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): (WebCore::PlatformKeyboardEvent::isSyntheticEvent): (WebCore::PlatformKeyboardEvent::setSyntheticEvent): * platform/ios/KeyEventIOS.mm: (WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys): * platform/ios/PlatformEventFactoryIOS.mm: (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder): * platform/mac/PlatformEventFactoryMac.mm: (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder): 2019-05-08 Don Olmstead CSSFontFaceSource fails to compile when !ENABLE(SVG_FONTS) https://bugs.webkit.org/show_bug.cgi?id=197720 Unreviewed build fix. Add usesInDocumentSVGFont to the !ENABLE(SVG_FONT) path. * css/CSSFontFaceSource.cpp: (WebCore::CSSFontFaceSource::font): 2019-05-08 Timothy Hatcher Add plumbing for inactive system colors in RenderTheme cache. https://bugs.webkit.org/show_bug.cgi?id=197699 rdar://problem/49406936 Reviewed by Tim Horton. * css/StyleColor.h: * page/Page.cpp: (WebCore::Page::effectiveAppearanceDidChange): Renamed from setUseDarkAppearance. * page/Page.h: (WebCore::Page::useInactiveAppearance const): * rendering/RenderTheme.cpp: (WebCore::RenderTheme::purgeCaches): (WebCore::RenderTheme::platformColorsDidChange): (WebCore::RenderTheme::colorCache const): * rendering/RenderTheme.h: * testing/InternalSettings.cpp: (WebCore::InternalSettings::setUseDarkAppearanceInternal): 2019-05-08 Robin Morisset All prototypes should call didBecomePrototype() https://bugs.webkit.org/show_bug.cgi?id=196315 Reviewed by Saam Barati. This changelog already landed, but the commit was missing the actual changes. It was found by existing tests, with the new assert in JSC::Structure * bindings/js/JSWindowProxy.cpp: (WebCore::JSWindowProxy::setWindow): * bindings/scripts/CodeGeneratorJS.pm: (GeneratePrototypeDeclaration): (GenerateConstructorHelperMethods): * bindings/scripts/test/JS/JSInterfaceName.cpp: (WebCore::JSInterfaceNamePrototype::JSInterfaceNamePrototype): * bindings/scripts/test/JS/JSMapLike.cpp: (WebCore::JSMapLikePrototype::JSMapLikePrototype): * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp: (WebCore::JSReadOnlyMapLikePrototype::JSReadOnlyMapLikePrototype): * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: (WebCore::JSTestActiveDOMObjectPrototype::JSTestActiveDOMObjectPrototype): * bindings/scripts/test/JS/JSTestCEReactions.cpp: (WebCore::JSTestCEReactionsPrototype::JSTestCEReactionsPrototype): * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp: (WebCore::JSTestCEReactionsStringifierPrototype::JSTestCEReactionsStringifierPrototype): * bindings/scripts/test/JS/JSTestCallTracer.cpp: (WebCore::JSTestCallTracerPrototype::JSTestCallTracerPrototype): * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp: (WebCore::JSTestClassWithJSBuiltinConstructorPrototype::JSTestClassWithJSBuiltinConstructorPrototype): * bindings/scripts/test/JS/JSTestDOMJIT.cpp: (WebCore::JSTestDOMJITPrototype::JSTestDOMJITPrototype): (WebCore::JSTestDOMJITConstructor::prototypeForStructure): * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp: (WebCore::JSTestEnabledBySettingPrototype::JSTestEnabledBySettingPrototype): * bindings/scripts/test/JS/JSTestEventConstructor.cpp: (WebCore::JSTestEventConstructorPrototype::JSTestEventConstructorPrototype): (WebCore::JSTestEventConstructorConstructor::prototypeForStructure): * bindings/scripts/test/JS/JSTestEventTarget.cpp: (WebCore::JSTestEventTargetPrototype::JSTestEventTargetPrototype): (WebCore::JSTestEventTargetConstructor::prototypeForStructure): * bindings/scripts/test/JS/JSTestException.cpp: (WebCore::JSTestExceptionPrototype::JSTestExceptionPrototype): * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp: (WebCore::JSTestGenerateIsReachablePrototype::JSTestGenerateIsReachablePrototype): * bindings/scripts/test/JS/JSTestGlobalObject.h: (WebCore::JSTestGlobalObjectPrototype::JSTestGlobalObjectPrototype): * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp: (WebCore::JSTestIndexedSetterNoIdentifierPrototype::JSTestIndexedSetterNoIdentifierPrototype): * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp: (WebCore::JSTestIndexedSetterThrowingExceptionPrototype::JSTestIndexedSetterThrowingExceptionPrototype): * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp: (WebCore::JSTestIndexedSetterWithIdentifierPrototype::JSTestIndexedSetterWithIdentifierPrototype): * bindings/scripts/test/JS/JSTestInterface.cpp: (WebCore::JSTestInterfacePrototype::JSTestInterfacePrototype): * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp: (WebCore::JSTestInterfaceLeadingUnderscorePrototype::JSTestInterfaceLeadingUnderscorePrototype): * bindings/scripts/test/JS/JSTestIterable.cpp: (WebCore::JSTestIterablePrototype::JSTestIterablePrototype): * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp: (WebCore::JSTestJSBuiltinConstructorPrototype::JSTestJSBuiltinConstructorPrototype): * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: (WebCore::JSTestMediaQueryListListenerPrototype::JSTestMediaQueryListListenerPrototype): * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp: (WebCore::JSTestNamedAndIndexedSetterNoIdentifierPrototype::JSTestNamedAndIndexedSetterNoIdentifierPrototype): * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp: (WebCore::JSTestNamedAndIndexedSetterThrowingExceptionPrototype::JSTestNamedAndIndexedSetterThrowingExceptionPrototype): * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp: (WebCore::JSTestNamedAndIndexedSetterWithIdentifierPrototype::JSTestNamedAndIndexedSetterWithIdentifierPrototype): * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: (WebCore::JSTestNamedConstructorPrototype::JSTestNamedConstructorPrototype): * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp: (WebCore::JSTestNamedDeleterNoIdentifierPrototype::JSTestNamedDeleterNoIdentifierPrototype): * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp: (WebCore::JSTestNamedDeleterThrowingExceptionPrototype::JSTestNamedDeleterThrowingExceptionPrototype): * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp: (WebCore::JSTestNamedDeleterWithIdentifierPrototype::JSTestNamedDeleterWithIdentifierPrototype): * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp: (WebCore::JSTestNamedDeleterWithIndexedGetterPrototype::JSTestNamedDeleterWithIndexedGetterPrototype): * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp: (WebCore::JSTestNamedGetterCallWithPrototype::JSTestNamedGetterCallWithPrototype): * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp: (WebCore::JSTestNamedGetterNoIdentifierPrototype::JSTestNamedGetterNoIdentifierPrototype): * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp: (WebCore::JSTestNamedGetterWithIdentifierPrototype::JSTestNamedGetterWithIdentifierPrototype): * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp: (WebCore::JSTestNamedSetterNoIdentifierPrototype::JSTestNamedSetterNoIdentifierPrototype): * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp: (WebCore::JSTestNamedSetterThrowingExceptionPrototype::JSTestNamedSetterThrowingExceptionPrototype): * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp: (WebCore::JSTestNamedSetterWithIdentifierPrototype::JSTestNamedSetterWithIdentifierPrototype): * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp: (WebCore::JSTestNamedSetterWithIndexedGetterPrototype::JSTestNamedSetterWithIndexedGetterPrototype): * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp: (WebCore::JSTestNamedSetterWithIndexedGetterAndSetterPrototype::JSTestNamedSetterWithIndexedGetterAndSetterPrototype): * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp: (WebCore::JSTestNamedSetterWithOverrideBuiltinsPrototype::JSTestNamedSetterWithOverrideBuiltinsPrototype): * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp: (WebCore::JSTestNamedSetterWithUnforgablePropertiesPrototype::JSTestNamedSetterWithUnforgablePropertiesPrototype): * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp: (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype): * bindings/scripts/test/JS/JSTestNode.cpp: (WebCore::JSTestNodePrototype::JSTestNodePrototype): (WebCore::JSTestNodeConstructor::prototypeForStructure): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::JSTestObjPrototype::JSTestObjPrototype): * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: (WebCore::JSTestOverloadedConstructorsPrototype::JSTestOverloadedConstructorsPrototype): * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp: (WebCore::JSTestOverloadedConstructorsWithSequencePrototype::JSTestOverloadedConstructorsWithSequencePrototype): * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp: (WebCore::JSTestOverrideBuiltinsPrototype::JSTestOverrideBuiltinsPrototype): * bindings/scripts/test/JS/JSTestPluginInterface.cpp: (WebCore::JSTestPluginInterfacePrototype::JSTestPluginInterfacePrototype): * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp: (WebCore::JSTestPromiseRejectionEventPrototype::JSTestPromiseRejectionEventPrototype): (WebCore::JSTestPromiseRejectionEventConstructor::prototypeForStructure): * bindings/scripts/test/JS/JSTestSerialization.cpp: (WebCore::JSTestSerializationPrototype::JSTestSerializationPrototype): * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp: (WebCore::JSTestSerializationIndirectInheritancePrototype::JSTestSerializationIndirectInheritancePrototype): (WebCore::JSTestSerializationIndirectInheritanceConstructor::prototypeForStructure): * bindings/scripts/test/JS/JSTestSerializationInherit.cpp: (WebCore::JSTestSerializationInheritPrototype::JSTestSerializationInheritPrototype): (WebCore::JSTestSerializationInheritConstructor::prototypeForStructure): * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp: (WebCore::JSTestSerializationInheritFinalPrototype::JSTestSerializationInheritFinalPrototype): (WebCore::JSTestSerializationInheritFinalConstructor::prototypeForStructure): * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: (WebCore::JSTestSerializedScriptValueInterfacePrototype::JSTestSerializedScriptValueInterfacePrototype): * bindings/scripts/test/JS/JSTestStringifier.cpp: (WebCore::JSTestStringifierPrototype::JSTestStringifierPrototype): * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp: (WebCore::JSTestStringifierAnonymousOperationPrototype::JSTestStringifierAnonymousOperationPrototype): * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp: (WebCore::JSTestStringifierNamedOperationPrototype::JSTestStringifierNamedOperationPrototype): * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp: (WebCore::JSTestStringifierOperationImplementedAsPrototype::JSTestStringifierOperationImplementedAsPrototype): * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp: (WebCore::JSTestStringifierOperationNamedToStringPrototype::JSTestStringifierOperationNamedToStringPrototype): * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp: (WebCore::JSTestStringifierReadOnlyAttributePrototype::JSTestStringifierReadOnlyAttributePrototype): * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp: (WebCore::JSTestStringifierReadWriteAttributePrototype::JSTestStringifierReadWriteAttributePrototype): * bindings/scripts/test/JS/JSTestTypedefs.cpp: (WebCore::JSTestTypedefsPrototype::JSTestTypedefsPrototype): 2019-05-08 Don Olmstead WEBCORE_EXPORT shouldn't be on the class and its methods https://bugs.webkit.org/show_bug.cgi?id=197681 Reviewed by Simon Fraser. Remove WEBCORE_EXPORT from the methods. * page/scrolling/ScrollingTreeFrameScrollingNode.h: * page/scrolling/ScrollingTreeScrollingNode.h: 2019-05-08 Wenson Hsieh [iOS] Add a quirk to synthesize mouse events when modifying the selection https://bugs.webkit.org/show_bug.cgi?id=197683 Reviewed by Tim Horton. See WebKit ChangeLog for more details. Test: editing/selection/ios/dispatch-mouse-events-when-modifying-selection-quirk.html * page/EventHandler.cpp: (WebCore::EventHandler::handleMousePressEvent): (WebCore::EventHandler::supportsSelectionUpdatesOnMouseDrag const): Add some platform hooks to prevent mousemove events from updating the selection on iOS. (WebCore::EventHandler::shouldAllowMouseDownToStartDrag const): Add some platform hooks to prevent drag and drop from kicking in when sending synthetic mousemove events to the page on iOS (drag and drop is instead triggered by EventHandler::tryToBeginDragAtPoint). (WebCore::EventHandler::updateSelectionForMouseDrag): * page/EventHandler.h: * page/Quirks.cpp: (WebCore::Quirks::shouldDispatchSyntheticMouseEventsWhenModifyingSelection const): * page/Quirks.h: Add the new site-specific quirk. * page/Settings.yaml: * page/ios/EventHandlerIOS.mm: (WebCore::EventHandler::tryToBeginDragAtPoint): (WebCore::EventHandler::supportsSelectionUpdatesOnMouseDrag const): (WebCore::EventHandler::shouldAllowMouseDownToStartDrag const): * testing/InternalSettings.cpp: (WebCore::InternalSettings::Backup::Backup): (WebCore::InternalSettings::Backup::restoreTo): (WebCore::InternalSettings::setShouldDispatchSyntheticMouseEventsWhenModifyingSelection): * testing/InternalSettings.h: * testing/InternalSettings.idl: Add an internal settings hook to opt into this quirk, for use in layout tests. 2019-05-08 Simon Fraser Implement backing-sharing in compositing layers, allowing overlap layers to paint into the backing store of another layer https://bugs.webkit.org/show_bug.cgi?id=197561 Reviewed by Antti Koivisto. This change introduces the concept of layers that share backing store for compositing. A layer which is sharing its backing store first paints itself, and then some set of layers which come later in paint order in the same stacking context. This reduces the composited layer count in some overflow scrolling scenarios, thereby also simplifying the scrolling tree. A backing-shared layer stores a vector of "sharing" RenderLayer* in its RenderLayerBacking. At paint time, the owning layer is painted, then the sharing layers, setting the owning layer as the painting root so that positioning and clipping just work. Sharing layer relationships are constructed in RenderLayerCompositor::computeCompositingRequirements(). We track the last layer which was composited in paint order as a shared candidate. If a later layer would composite for overlap (and no other reasons), then we allow it to share with the candidate if the candidate is in its ancestor containing block chain. Sharing is currently limited to layers in the same stacking context. isComposited() returns false for sharing layers, but they are like composited layers in that they behave as painting boundaries, so RenderLayer::paintLayer() needs to stop at them, and repaints in shared layers have to be directed to their shared layer, hence changes to RenderLayer::clippingRootForPainting() and RenderLayer::enclosingCompositingLayerForRepaint(). The clipping boundary logic in RenderLayer::backgroundClipRect() needed to be generalized so that all calls to RenderLayer::parentClipRects() check for crossing painting boundaries and use TemporaryClipRects in that case. Tests: compositing/shared-backing/overflow-scroll/absolute-in-stacking-relative-in-scroller.html compositing/shared-backing/overflow-scroll/composited-absolute-in-absolute-in-relative-in-scroller.html compositing/shared-backing/overflow-scroll/nested-absolute-with-clipping-in-stacking-overflow.html compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness.html compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-clipping.html compositing/shared-backing/overflow-scroll/relative-in-clipping-in-scroller-in-relative-clipping.html compositing/shared-backing/overflow-scroll/relative-in-div-in-overflow-scroll.html compositing/shared-backing/overflow-scroll/scrolled-contents-has-painted-content.html compositing/shared-backing/overflow-scroll/scrolled-contents-unconstrained-clip.html compositing/shared-backing/overflow-scroll/shared-layer-clipping.html compositing/shared-backing/overflow-scroll/shared-layer-composited-bounds.html compositing/shared-backing/overflow-scroll/shared-layer-nested-relative-stacking.html compositing/shared-backing/overflow-scroll/shared-layer-repaint.html compositing/shared-backing/partial-compositing-update.html compositing/shared-backing/partial-compositing-update2.html compositing/shared-backing/remove-sharing-layer.html compositing/shared-backing/sharing-cached-clip-rects.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::~RenderLayer): (WebCore::RenderLayer::ancestorLayerIsInContainingBlockChain const): (WebCore::RenderLayer::setBackingProviderLayer): (WebCore::RenderLayer::disconnectFromBackingProviderLayer): (WebCore::RenderLayer::enclosingCompositingLayerForRepaint const): (WebCore::RenderLayer::clippingRootForPainting const): (WebCore::RenderLayer::clipToRect): (WebCore::RenderLayer::paintLayer): (WebCore::RenderLayer::updateClipRects): (WebCore::RenderLayer::clipCrossesPaintingBoundary const): (WebCore::RenderLayer::calculateClipRects const): (WebCore::outputPaintOrderTreeLegend): (WebCore::outputPaintOrderTreeRecursive): (WebCore::inContainingBlockChain): Deleted. * rendering/RenderLayer.h: * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::willBeDestroyed): (WebCore::clearBackingSharingLayerProviders): (WebCore::RenderLayerBacking::setBackingSharingLayers): (WebCore::RenderLayerBacking::removeBackingSharingLayer): (WebCore::RenderLayerBacking::clearBackingSharingLayers): (WebCore::RenderLayerBacking::updateCompositedBounds): (WebCore::RenderLayerBacking::updateDrawsContent): (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer const): (WebCore::RenderLayerBacking::paintIntoLayer): (WebCore::RenderLayerBacking::paintContents): * rendering/RenderLayerBacking.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::CompositingState::stateForPaintOrderChildren const): (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildren): (WebCore::RenderLayerCompositor::CompositingState::propagateStateFromChildrenForUnchangedSubtree): (WebCore::RenderLayerCompositor::BackingSharingState::resetBackingProviderCandidate): (WebCore::RenderLayerCompositor::updateCompositingLayers): (WebCore::backingProviderLayerCanIncludeLayer): (WebCore::RenderLayerCompositor::computeCompositingRequirements): (WebCore::RenderLayerCompositor::traverseUnchangedSubtree): (WebCore::RenderLayerCompositor::updateBacking): (WebCore::RenderLayerCompositor::layerWillBeRemoved): (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const): * rendering/RenderLayerCompositor.h: * rendering/RenderTreeAsText.cpp: 2019-05-08 Brent Fulgham Correct delayed load event handling https://bugs.webkit.org/show_bug.cgi?id=197679 Reviewed by Alex Christensen. We need to properly account for the fact that JavaScript might run while performing loads. * dom/Document.cpp: (WebCore::Document::loadEventDelayTimerFired): 2019-05-08 Philippe Normand REGRESSION(r243197): [GStreamer] Error playing redirected streams https://bugs.webkit.org/show_bug.cgi?id=197410 Reviewed by Carlos Garcia Campos. Revert the change introduced in r243197 that was checking the redirected URI instead of the original URI. Non-main URIs should be ignored only when they are HLS (or similar) fragments. Test http/tests/security/canvas-remote-read-remote-video-hls.html still passes. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::handleMessage): 2019-05-08 Rob Buis Link prefetch not useful for top-level navigation https://bugs.webkit.org/show_bug.cgi?id=195623 Reviewed by Youenn Fablet. Cache cross-domain top-level prefetches in a dedicated cache and not in the memory cache. Tests: http/tests/cache/link-prefetch-main-resource-iframe.html http/tests/cache/link-prefetch-main-resource.html http/tests/contentextensions/prefetch-blocked.html * loader/LinkLoader.cpp: (WebCore::LinkLoader::prefetchIfNeeded): * loader/ResourceLoadInfo.cpp: (WebCore::toResourceType): 2019-05-07 Don Olmstead Fix !HAVE(ACCESSIBILITY) build https://bugs.webkit.org/show_bug.cgi?id=197680 Reviewed by Fujii Hironori. * accessibility/AXObjectCache.h: (WebCore::AXObjectCache::focusedUIElementForPage): Update declaration for !HAVE(ACCESSIBILITY) * accessibility/AccessibilityObject.h: Add wrapper implementation for !HAVE(ACCESSIBILITY) * accessibility/AccessibilityProgressIndicator.cpp: (WebCore::AccessibilityProgressIndicator::roleValue const): Add ENABLE(METER_ELEMENT) guard. 2019-05-07 Ryan Haddad Unreviewed, rolling out r245038. Breaks internal builds. Reverted changeset: "Add SPI to set a list of hosts to which to send custom header fields cross-origin" https://bugs.webkit.org/show_bug.cgi?id=197397 https://trac.webkit.org/changeset/245038 2019-05-07 Jiewen Tan [WebAuthN] A new request should always suppress the pending request if any https://bugs.webkit.org/show_bug.cgi?id=191517 Reviewed by Brent Fulgham. Blocking new requests from the same page when there is a pending request could DoS the WebAuthN API in the period between [the page is refreshed, the pending request is hanedled/timeout]. Therefore, the policy will be to always cancel any pending requests whenever a new request is made. This will enforce the policy of handling only one request at a time. Covered by new tests in existing files. * Modules/webauthn/AuthenticatorCoordinatorClient.cpp: (WebCore::AuthenticatorCoordinatorClient::requestReply): (WebCore::AuthenticatorCoordinatorClient::setRequestCompletionHandler): (WebCore::AuthenticatorCoordinatorClient::addQueryCompletionHandler): * Modules/webauthn/AuthenticatorCoordinatorClient.h: 2019-05-07 Eric Carlson Define media buffering policy https://bugs.webkit.org/show_bug.cgi?id=196979 Reviewed by Jer Noble. Test: MediaBufferingPolicy API test. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::HTMLMediaElement): (WebCore::HTMLMediaElement::suspend): (WebCore::HTMLMediaElement::resume): (WebCore::HTMLMediaElement::createMediaPlayer): (WebCore::HTMLMediaElement::setBufferingPolicy): (WebCore::HTMLMediaElement::purgeBufferedDataIfPossible): (WebCore::HTMLMediaElement::bufferingPolicy const): (WebCore::HTMLMediaElement::setShouldBufferData): Deleted. * html/HTMLMediaElement.h: (WebCore::HTMLMediaElement::shouldBufferData const): Deleted. * html/MediaElementSession.cpp: (WebCore::MediaElementSession::updateClientDataBuffering): (WebCore::MediaElementSession::preferredBufferingPolicy const): (WebCore::MediaElementSession::dataBufferingPermitted const): Deleted. * html/MediaElementSession.h: * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::setBufferingPolicy): (WebCore::convertEnumerationToString): (WebCore::MediaPlayer::setShouldBufferData): Deleted. * platform/graphics/MediaPlayer.h: * platform/graphics/MediaPlayerEnums.h: (WTF::LogArgument::toString): * platform/graphics/MediaPlayerPrivate.h: (WebCore::MediaPlayerPrivateInterface::setBufferingPolicy): (WebCore::MediaPlayerPrivateInterface::setShouldBufferData): Deleted. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): (WebCore::MediaPlayerPrivateAVFoundationObjC::setBufferingPolicy): (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldBufferData): Deleted. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setBufferingPolicy): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::flushAndRemoveVideoSampleBuffers): Deleted. (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setShouldBufferData): Deleted. * testing/Internals.cpp: (WebCore::Internals::elementShouldBufferData): (WebCore::Internals::elementBufferingPolicy): * testing/Internals.h: * testing/Internals.idl: 2019-05-07 Alex Christensen Add SPI to set a list of hosts to which to send custom header fields cross-origin https://bugs.webkit.org/show_bug.cgi?id=197397 Reviewed by Geoff Garen. In r223001 I added the ability to send custom headers, but with a restriction that they will not be sent except to the origin of the main document. We need the ability to specify what origins to send these headers to even if they are not first party requests. We get this information in a list of strings which are the hosts to send the headers to. Some of the strings have an asterisk at the beginning, indicating that the headers are to be sent to all subdomains. I repurposed some ObjC SPI that was never adopted, but I keep testing the C API that was to verify no regression. I also added some new API tests for the new behavior. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * loader/CustomHeaderFields.cpp: Added. (WebCore::CustomHeaderFields::thirdPartyDomainsMatch const): * loader/CustomHeaderFields.h: Added. (WebCore::CustomHeaderFields::encode const): (WebCore::CustomHeaderFields::decode): * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::setCustomHeaderFields): Deleted. * loader/DocumentLoader.h: (WebCore::DocumentLoader::setCustomHeaderFields): (WebCore::DocumentLoader::customHeaderFields const): (WebCore::DocumentLoader::customHeaderFields): Deleted. * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::requestResource): 2019-05-07 Andy Estes run-bindings-tests should test global scope constructor generation https://bugs.webkit.org/show_bug.cgi?id=197669 Reviewed by Alex Christensen. For interfaces that are exposed on a global object, preprocess-idls.pl generates a partial interface for the global object defining attributes for the interfaces' constructors. Most interfaces don't specify a global object, so preprocess-idls.pl defaults to DOMWindow. Since there is no DOMWindow.idl test case, we never generate the code for exposed interface constructors when running bindings tests. This means that we can't test changes to how these constructors are generated. To fix this, teach preprocess-idls.pl to treat 'TestGlobalObject' as the default global object when running bindings tests. This means that all exposed interface test cases will generate their constructors as part of JSTestGlobalObject (unless otherwise specified by the 'Exposed' extended attribute). * bindings/scripts/preprocess-idls.pl: Added --testGlobalContextName and --testGlobalScopeConstructorsFile arguments for use by run-bindings-tests. * bindings/scripts/test/JS/JSTestGlobalObject.cpp: Updated expected results. 2019-05-07 Youenn Fablet Video stream freeze on front camera orientation changing https://bugs.webkit.org/show_bug.cgi?id=197227 Reviewed by Eric Carlson. Use m_currentRotationSessionAngle instead of m_currentRotation to create or not a new rotation session. Covered by updated test. * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h: * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm: (WebCore::RealtimeOutgoingVideoSourceCocoa::rotatePixelBuffer): 2019-05-07 Youenn Fablet getUserMedia framerate unusable under low light in iOS 12.2 https://bugs.webkit.org/show_bug.cgi?id=196214 Reviewed by Geoffrey Garen. When setting the frame rate, set it to the exact value instead of a range. Otherwise, the capture device might use the lowest frame rate according the light conditions for best picture quality which is not what is expected by most web pages. Move frame rate range computation to closer where actually used. Since frame rate matching is fuzzy, add some checks in case the expected frame rate is slightly out of min/max range. Manually tested on a real device. * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset): 2019-05-07 Robin Morisset All prototypes should call didBecomePrototype() https://bugs.webkit.org/show_bug.cgi?id=196315 Reviewed by Saam Barati. It was found by existing tests, with the new assert in JSC::Structure * bindings/js/JSWindowProxy.cpp: (WebCore::JSWindowProxy::setWindow): * bindings/scripts/CodeGeneratorJS.pm: (GeneratePrototypeDeclaration): (GenerateConstructorHelperMethods): 2019-05-07 John Wilander Storage Access API: Make two changes requested by developers and complete refactoring and cleanup https://bugs.webkit.org/show_bug.cgi?id=197648 Reviewed by Chris Dumez. Developers have requested two minor changes to the Storage Access API: - Only consume the user gesture when the user explicitly denies access. - Make document.hasStorageAccess() return true instead of false when the feature is off. In addition to this, we have refactoring and cleanup to do. Namely: - Make use of WebCore::RegistrableDomain all the way. - Remove dead code in WebKit::NetworkProcess since the calls now go through NetworkConnectionToWebProcess. - Introduce boolean enums for state handling. - Break out the Storage Access API functionality into a supplement of WebCore::Document. Reviewed by Chris Dumez. Tests: http/tests/storageAccess/deny-with-prompt-does-not-preserve-gesture.html http/tests/storageAccess/deny-without-prompt-preserves-gesture.html http/tests/storageAccess/grant-with-prompt-preserves-gesture.html http/tests/storageAccess/has-storage-access-true-if-feature-off.html * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * dom/Document.cpp: (WebCore::Document::hasStorageAccess): Deleted. (WebCore::Document::requestStorageAccess): Deleted. (WebCore::Document::enableTemporaryTimeUserGesture): Deleted. (WebCore::Document::consumeTemporaryTimeUserGesture): Deleted. (WebCore::Document::hasFrameSpecificStorageAccess const): Deleted. (WebCore::Document::setHasFrameSpecificStorageAccess): Deleted. * dom/Document.h: (WebCore::Document::setUserGrantsStorageAccessOverride): Deleted. All of this has been moved to the supplement WebCore::DocumentStorageAccess. * dom/Document.idl: The Storage Access API has been moved to DocumentStorageAccess.idl. * dom/DocumentStorageAccess.cpp: Added. (WebCore::DocumentStorageAccess::from): (WebCore::DocumentStorageAccess::supplementName): (WebCore::DocumentStorageAccess::hasStorageAccess): (WebCore::DocumentStorageAccess::requestStorageAccess): (WebCore::DocumentStorageAccess::enableTemporaryTimeUserGesture): (WebCore::DocumentStorageAccess::consumeTemporaryTimeUserGesture): (WebCore::DocumentStorageAccess::hasFrameSpecificStorageAccess const): (WebCore::DocumentStorageAccess::setHasFrameSpecificStorageAccess): * dom/DocumentStorageAccess.h: Added. * dom/DocumentStorageAccess.idl: Added. * page/ChromeClient.h: * testing/Internals.cpp: (WebCore::Internals::setUserGrantsStorageAccess): Deleted. This was dead code. * testing/Internals.h: * testing/Internals.idl: 2019-05-07 Antoine Quint [Pointer Events] isPrimary property of pointercancel events should match previous events for that pointer https://bugs.webkit.org/show_bug.cgi?id=197665 Reviewed by Dean Jackson. The test at web-platform-tests/pointerevents/pointerevent_pointercancel_touch.html would fail early because one of the first assertions would check that isPrimary for a pointercancel event would match the isPrimary property of the previous pointer event dispatched for that pointer id. This prevented many further assertions from passing and also was the cause of flakiness for the next test since this test was ended early and the state of touches created using UIScriptController were not in a clean state. We now track the isPrimary state for a given pointer using the CapturingData and use that value when dispatching a pointercancel event. * dom/PointerEvent.cpp: (WebCore::PointerEvent::create): (WebCore::PointerEvent::PointerEvent): * dom/PointerEvent.h: * page/PointerCaptureController.cpp: (WebCore::PointerCaptureController::pointerEventWasDispatched): (WebCore::PointerCaptureController::cancelPointer): * page/PointerCaptureController.h: 2019-05-07 Ryan Haddad Unreviewed, rolling out r244900. Caused media/track/track-cue-missing.html to fail on debug queues Reverted changeset: "Add logging for RenderLayer clip rects" https://bugs.webkit.org/show_bug.cgi?id=197547 https://trac.webkit.org/changeset/244900 2019-05-07 Antti Koivisto with overflow:hidden CSS is scrollable on iOS https://bugs.webkit.org/show_bug.cgi?id=153852 Reviewed by Antoine Quint. Tests: fast/scrolling/ios/body-overflow-hidden-frame.html fast/scrolling/ios/body-overflow-hidden.html * page/scrolling/ScrollingTreeScrollingNode.h: 2019-05-07 Antoine Quint Mouse event simulation should be limited to the graphing calculator on Desmos.com https://bugs.webkit.org/show_bug.cgi?id=197652 Reviewed by Antti Koivisto. * page/Quirks.cpp: (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const): 2019-05-06 James Savage Improve coordination for creating UIWindow instances. https://bugs.webkit.org/show_bug.cgi?id=197578. . Reviewed by Wenson Hsieh. * platform/ios/VideoFullscreenInterfaceAVKit.mm: (makeWindowFromView): Pull out window creation. (VideoFullscreenInterfaceAVKit::doSetup): Call new helper function. 2019-05-06 Tim Horton _overrideViewportWithArguments does not work when called before loading https://bugs.webkit.org/show_bug.cgi?id=197638 Reviewed by Wenson Hsieh. * dom/Document.cpp: (WebCore::Document::viewportArguments const): (WebCore::Document::updateViewportArguments): (WebCore::Document::setOverrideViewportArguments): Deleted. * dom/Document.h: (WebCore::Document::viewportArguments const): Deleted. * page/Page.cpp: (WebCore::Page::setOverrideViewportArguments): * page/Page.h: (WebCore::Page::overrideViewportArguments const): * page/ViewportConfiguration.cpp: (WebCore::ViewportConfiguration::setViewportArguments): Move overrideViewportArguments to Page, since it is view-global in the API. 2019-05-06 Chris Dumez Add assertions to JSLazyEventListener to help catch the cause of a crash https://bugs.webkit.org/show_bug.cgi?id=197617 Reviewed by Alexey Proskuryakov. Add assertions to JSLazyEventListener to help catch the cause of . * bindings/js/JSLazyEventListener.cpp: (WebCore::JSLazyEventListener::checkValidityForEventTarget): * bindings/js/JSLazyEventListener.h: * dom/EventListener.h: (WebCore::EventListener::checkValidityForEventTarget): * dom/EventTarget.cpp: (WebCore::EventTarget::addEventListener): (WebCore::EventTarget::setAttributeEventListener): (WebCore::EventTarget::innerInvokeEventListeners): 2019-05-04 Per Arne Vollan -[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:] doesn't delete _WKWebsiteDataTypeCredentials https://bugs.webkit.org/show_bug.cgi?id=197510 Reviewed by Alex Christensen. This patch implements deletion of non persistent credentials for a set of origins. In order for this to work, fetching credentials from the credential storage needs to return a set of SecurityOriginData objects, instead of a set of origin strings. This is implemented by iterating over all the elements in the credential map, and creating a SecurityOriginData object for each credential based on the protection space. API test: WKWebsiteDataStore.RemoveNonPersistentCredentials * platform/network/CredentialStorage.cpp: (WebCore::CredentialStorage::removeCredentialsWithOrigin): (WebCore::CredentialStorage::originsWithCredentials const): * platform/network/CredentialStorage.h: (WebCore::CredentialStorage::originsWithCredentials const): Deleted. 2019-05-06 Keith Rollin Temporarily disable generate-xcfilelists https://bugs.webkit.org/show_bug.cgi?id=197619 Reviewed by Alex Christensen. We need to perform a significant update to the generate-xcfilelist scripts. This work involves coordinated work with another facility. If the work does not occur in tandem, the build will be broken. To avoid this, disable the invoking of the scripts during the transition. The checking will be restored once the new scripts are in place. No new tests -- no change in user-visible functionality. * Scripts/check-xcfilelists.sh: 2019-05-06 Andres Gonzalez Hitpoint for link which spans two lines in web content is incorrect https://bugs.webkit.org/show_bug.cgi?id=197511 Reviewed by Chris Fleizach. - Special case for links to return first char location as clickPoint instead of middle point of bounding rect. - Modified iOS ActivationPoint to use clickPoint. This way all code paths go through the same function. - Made boundsForRects to return content coordinates in all platforms. Adjusted all callers, directly or indirectly, appropriately. Tests: accessibility/ios-simulator/links-activation.html accessibility/links-activation.html * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::clickPoint): (WebCore::AccessibilityRenderObject::boundsForRects): (WebCore::AccessibilityRenderObject::boundsForRects const): Deleted. * accessibility/AccessibilityRenderObject.h: * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityActivationPoint]): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]): 2019-05-06 Jer Noble Adopt AVStreamDataParser.audiovisualMIMETypes https://bugs.webkit.org/show_bug.cgi?id=197581 Reviewed by Eric Carlson. Add a new singleton class, AVStreamDataParserMIMETypeCache, and rename AVFoundationMIMETypeCache to the more precise AVAssetMIMETypeCache. Update all the old AVFoundationMIMETypeCache with the new name. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.h: Renamed from Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.h. (WebCore::AVAssetMIMETypeCache::setCacheMIMETypesCallback): * platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm: Renamed from Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm. (WebCore::AVAssetMIMETypeCache::singleton): (WebCore::AVAssetMIMETypeCache::setSupportedTypes): (WebCore::AVAssetMIMETypeCache::types): (WebCore::AVAssetMIMETypeCache::supportsContentType): (WebCore::AVAssetMIMETypeCache::canDecodeType): (WebCore::AVAssetMIMETypeCache::isAvailable const): (WebCore::AVAssetMIMETypeCache::loadMIMETypes): * platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.h: Added. * platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.mm: Added. (WebCore::AVStreamDataParserMIMETypeCache::singleton): (WebCore::AVStreamDataParserMIMETypeCache::types): (WebCore::AVStreamDataParserMIMETypeCache::supportsContentType): (WebCore::AVStreamDataParserMIMETypeCache::canDecodeType): (WebCore::AVStreamDataParserMIMETypeCache::isAvailable const): (WebCore::AVStreamDataParserMIMETypeCache::loadMIMETypes): * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: (WebCore::ImageDecoderAVFObjC::create): (WebCore::ImageDecoderAVFObjC::supportsMediaType): (WebCore::ImageDecoderAVFObjC::supportsContentType): (WebCore::ImageDecoderAVFObjC::canDecodeType): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::registerMediaEngine): (WebCore::MediaPlayerPrivateAVFoundationObjC::getSupportedTypes): (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType): (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::getSupportedTypes): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType): 2019-05-06 Youenn Fablet WebAudio Node JS wrappers should not be collected if events can be fired https://bugs.webkit.org/show_bug.cgi?id=197533 Reviewed by Jer Noble. Before the patch, some web audio nodes could fire event listeners, but were not protected from GC. Use CustomIsReachable to ensure theses nodes can be collected if: - their AudioContext is stopped (typically due to document being navigated away). - their AudioContext is closed. - nodes do not have event listeners. Covered by WPT mediacapture-streams/MediaStreamTrack-MediaElement-disabled-audio-is-silence.https.html and WPT webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/mediaElementAudioSourceToScriptProcessorTest.html and web audio WebRTC tests. Specific newly added test: webaudio/webaudio-gc.html * Modules/webaudio/AudioContext.h: (WebCore::AudioContext::isClosed const): * Modules/webaudio/AudioNode.idl: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSAudioNodeCustom.cpp: Added. (WebCore::JSAudioNodeOwner::isReachableFromOpaqueRoots): 2019-05-06 Daniel Bates Google Docs & Yahoo! Japan: Can’t compose characters with Chinese or Japanese keyboard https://bugs.webkit.org/show_bug.cgi?id=197474 Reviewed by Ryosuke Niwa. Fix up some #if defs to compile more Mac code when building on iOS. * dom/KeyboardEvent.cpp: (WebCore::KeyboardEvent::KeyboardEvent): * platform/PlatformKeyboardEvent.h: (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): 2019-05-06 Chris Dumez Add assertions to CachedFrame to help figure out crash in CachedFrame constructor https://bugs.webkit.org/show_bug.cgi?id=197621 Reviewed by Geoffrey Garen. Add release assertions to try and figure out who is sometimes detaching the document from its frame while constructing CachedFrames for its descendants. * dom/Document.cpp: (WebCore::Document::detachFromFrame): * dom/Document.h: (WebCore::Document::setMayBeDetachedFromFrame): * history/CachedFrame.cpp: (WebCore::CachedFrame::CachedFrame): 2019-05-06 Zan Dobersek [GLib] WebCore::MainThreadSharedTimer should use the appropriate GSource priority, name https://bugs.webkit.org/show_bug.cgi?id=197606 Reviewed by Carlos Garcia Campos. * platform/MainThreadSharedTimer.cpp: (WebCore::MainThreadSharedTimer::MainThreadSharedTimer): Use the MainThreadSharedTimer GLib priority for this timer. The name is also adjusted accordingly. 2019-05-05 Wenson Hsieh fast/attachment/attachment-folder-icon.html is an Image Only failure on recent macOS builds https://bugs.webkit.org/show_bug.cgi?id=197593 Reviewed by Tim Horton. On recent versions of macOS, -[NSWorkspace iconForFileType:] returns the generic document icon for "public.directory". Instead of using this UTI to generate attachment icons for "multipart/x-folder" and "application/vnd.apple.folder", we should instead be using "public.folder", which has a folder icon. This fixes the existing test fast/attachment/attachment-folder-icon.html, which currently results in an image diff on these builds of macOS. * rendering/RenderThemeMac.mm: (WebCore::iconForAttachment): 2019-05-04 Alex Christensen Revert r244953 and r244954 because they broke internal builds. https://bugs.webkit.org/show_bug.cgi?id=197534 * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::changeCount const): (WebCore::PlatformPasteboard::write): 2019-05-04 Alex Christensen Merge the three UIKitSPI.h files into a single one in PAL https://bugs.webkit.org/show_bug.cgi?id=197534 Reviewed by Darin Adler. * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::changeCount const): (WebCore::PlatformPasteboard::write): 2019-05-04 Youenn Fablet Convert some RealtimeOutgoingVideoSourceCocoa logging to ERROR_LOG https://bugs.webkit.org/show_bug.cgi?id=197549 Reviewed by Eric Carlson. No change of behavior. * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm: (WebCore::RealtimeOutgoingVideoSourceCocoa::rotatePixelBuffer): 2019-05-03 Simon Fraser [macOS] Fix programmatic scrolling with async overflow scroll https://bugs.webkit.org/show_bug.cgi?id=197590 Reviewed by Sam Weinig. ScrollingTreeOverflowScrollingNodeMac needs to handle RequestedScrollPosition. Tests: scrollingcoordinator/mac/programmatic-frame-scroll.html scrollingcoordinator/mac/programmatic-overflow-scroll.html * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm: (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateAfterChildren): 2019-05-03 Zalan Bujtas [iOS] outlook.live.com: Compose email frame not fully visible and not scrollable https://bugs.webkit.org/show_bug.cgi?id=197573 Reviewed by Wenson Hsieh. The outlook mail view's flex column setup produces a somewhat unfortunate layout at certain viewport widths. This patch addresses the issue by ensuring that we never fall into that range. * page/Quirks.cpp: (WebCore::Quirks::shouldIgnoreShrinkToFitContent const): (WebCore::Quirks::overriddenViewportLayoutWidth const): * page/Quirks.h: 2019-05-02 Jiewen Tan [WebAuthN] A focused document should be required https://bugs.webkit.org/show_bug.cgi?id=197543 Reviewed by Brent Fulgham. This patch adds a check to see if the invoking document is focused before calling into WebAuthN. This patch also removes some out-to-dated comments. Test: http/wpt/webauthn/public-key-credential-unfocused-document.https.html * Modules/credentialmanagement/CredentialsContainer.cpp: (WebCore::CredentialsContainer::get): (WebCore::CredentialsContainer::isCreate): * Modules/webauthn/AuthenticatorCoordinator.cpp: (WebCore::AuthenticatorCoordinator::create const): (WebCore::AuthenticatorCoordinator::discoverFromExternalSource const): 2019-05-03 Devin Rousso Web Inspector: DOM: rename "low power" to "display composited" https://bugs.webkit.org/show_bug.cgi?id=197296 Reviewed by Joseph Pecoraro. Removed specific ChangeLog entries since it is almost entirely mechanical changes. * inspector/agents/InspectorDOMAgent.h: * inspector/agents/InspectorDOMAgent.cpp: 2019-05-03 Daniel Bates Pass KeyboardEvent by reference in more places https://bugs.webkit.org/show_bug.cgi?id=197480 Reviewed by Wenson Hsieh. * editing/Editor.cpp: (WebCore::Editor::handleKeyboardEvent): (WebCore::Editor::handleInputMethodKeydown): * loader/EmptyClients.cpp: * page/EditorClient.h: 2019-05-03 Chris Dumez [iOS Sim Debug] ASSERTION FAILED The atomic string comes from an other thread! Layout Test imported/w3c/web-platform-tests/workers/WorkerNavigator_appName.htm is a flaky crash https://bugs.webkit.org/show_bug.cgi?id=197530 Reviewed by Geoffrey Garen. The issue is that NavigatorBase::platform() was not thread safe but was called by both Navigator on the main thread and WorkerNavigator on worker threads. No new tests, covered by existing tests. * page/Navigator.cpp: (WebCore::Navigator::platform const): * page/Navigator.h: * page/NavigatorBase.cpp: (WebCore::NavigatorBase::platform const): * page/NavigatorBase.h: Make NavigatorBase::platform() thread safe. * platform/ios/Device.cpp: (WebCore::deviceName): * platform/ios/Device.h: Make WebCore::deviceName() thread safe. * platform/ios/UserAgentIOS.mm: (WebCore::deviceNameForUserAgent): Cache value returned by WebCore::deviceName() for performance. 2019-05-03 Chris Dumez Use WeakPtr for JSLazyEventListener::m_originalNode for safety https://bugs.webkit.org/show_bug.cgi?id=197576 Reviewed by Alex Christensen. * bindings/js/JSLazyEventListener.cpp: (WebCore::JSLazyEventListener::JSLazyEventListener): (WebCore::JSLazyEventListener::create): * bindings/js/JSLazyEventListener.h: 2019-05-03 Eric Carlson AVFoundation framework isn't always installed https://bugs.webkit.org/show_bug.cgi?id=197577 Reviewed by Jer Noble. Use PAL::isAVFoundationFrameworkAvailable() to check to see if AVFoundation is installed, not PAL::AVFoundationLibrary(). * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm: (WebCore::AVFoundationMIMETypeCache::isAvailable const): (WebCore::AVFoundationMIMETypeCache::loadMIMETypes): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::isAvailable): (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType const): (WebCore::exernalDeviceDisplayNameForPlayer): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable): * platform/graphics/cocoa/HEVCUtilitiesCocoa.mm: (WebCore::validateHEVCParameters): * platform/mediastream/mac/AVCaptureDeviceManager.mm: (WebCore::AVCaptureDeviceManager::isAvailable): 2019-05-03 Sihui Liu Add assertion to check whether shm files have maximum FileProtection of CompleteUnlessOpen https://bugs.webkit.org/show_bug.cgi?id=197390 Reviewed by Geoffrey Garen. We have seen crashes about accessing database files after device is locked. We are suspecting this is because shm files have wrong data protection class, but shm files should not have Complete class protection when it is created. It is likely the protection class is changed later. Add an assertion to verify our guess. If the crash signature changes after this patch, we probably need to change database implementation. If it is not, we have other problem than data protection. * platform/sql/SQLiteDatabase.cpp: (WebCore::SQLiteDatabase::open): 2019-05-03 Youenn Fablet Cache.add and Cache.addAll should compute a correct response body size https://bugs.webkit.org/show_bug.cgi?id=197464 Reviewed by Chris Dumez. Compute the response body size as we do for regular Cache.put Test: http/wpt/cache-storage/cache-quota-add.any.html * Modules/cache/CacheStorageConnection.cpp: (WebCore::CacheStorageConnection::computeRecordBodySize): * Modules/cache/CacheStorageConnection.h: * Modules/cache/DOMCache.cpp: (WebCore::FetchTasksHandler::addResponseBody): (WebCore::DOMCache::addAll): Compute the response body size requires getting access to the connection. 'this' is added to the lambda which is fine since taskHandler keeps a Ref to 'this' in its completion handler. (WebCore::DOMCache::toConnectionRecord): * Modules/fetch/FetchResponse.h: 2019-05-03 Tomoki Imai [Cairo] Improve ShadowBlur performance using tiling optimization https://bugs.webkit.org/show_bug.cgi?id=197308 Reviewed by Žan Doberšek. Enable tiling tiling-based optimization for drawRectShadow() and drawInsetShadow(). Since r228776, cairo ports doesn't have tiling-based optimization. For AppleWin, this patch refactors code and it shares almost same code as cairo port. Only the difference is that AppleWin uses ScratchBuffer, but cairo ports doesn't. This should avoid a performance regression for AppleWin. No new tests, covered by existing tests. * platform/graphics/ShadowBlur.cpp: (WebCore::calculateLobes): Fix stylecheck errors (WebCore::ShadowBlur::blurLayerImage): Fix stylecheck errors (WebCore::ShadowBlur::calculateLayerBoundingRect): We don't use position of m_sourceRect, so change the type to FloatSize. (WebCore::ShadowBlur::drawShadowBuffer): Use m_layerSize instead of m_shadowedResultSize to fillRect, as m_layerSize is always smaller than m_shadowedResultSize. It's because in m_layerSize is equal to m_shadowedResultSize if it's not clipped. Clipping doesn't increase size of m_layerSize, so m_layerSize is always smaller than or equal to m_shadowedResultSize. (WebCore::ShadowBlur::templateSize const): Fix stylecheck errors (WebCore::ShadowBlur::drawRectShadow): (WebCore::ShadowBlur::drawInsetShadow): (WebCore::ShadowBlur::drawRectShadowWithoutTiling): (WebCore::ShadowBlur::drawInsetShadowWithoutTiling): (WebCore::ShadowBlur::drawRectShadowWithTiling): (WebCore::ShadowBlur::drawInsetShadowWithTiling): Incorporate tile-based drawing. To accomplish it, this patch abstracts GraphicsContext::drawImageBuffer to ShadowBlur::DrawImageCallback, GraphicsContext::fillRect to ShadowBlur::FillRectCallback, drawing rect with hole to ShadowBlur::FillRectWithHoleCallback. Variants which takes GraphicsContext as parameter now just calls another drawRectShadow. (WebCore::ShadowBlur::drawLayerPieces): Instead of graphicsContext.drawImageBuffer, call corresponding callback. (WebCore::ShadowBlur::drawLayerPiecesAndFillCenter): This function calls drawLayerPieces and fill center for outer shadow. Drawing outer shadow requires another callback for graphicsContext.fillRect. (WebCore::ShadowBlur::drawShadowLayer): Use m_layerSize instead of m_shadowedResultSize to fillRect, as m_layerSize is always smaller than m_shadowedResultSize. * platform/graphics/ShadowBlur.h: Rename m_sourceRect to m_shadowedResultSize, and change it to FloatSize from FloatRect. Remove GraphicsContext usage as much as possible and replace them by corresponding callbacks. * platform/graphics/cairo/CairoOperations.cpp: (WebCore::Cairo::drawShadowImage): This function corresponds to ShadowBlur::DrawImageCallback. (WebCore::Cairo::fillShadowBuffer): Erase sourceRect, as it's always bigger than layerSize. (WebCore::Cairo::drawPathShadow): (WebCore::Cairo::drawGlyphsShadow): Erase unused parameter. (WebCore::Cairo::fillRect): (WebCore::Cairo::fillRoundedRect): (WebCore::Cairo::fillRectWithRoundedHole): For tile-based optimization, add extra arguments to drawRectShadow. (WebCore::Cairo::drawSurface): Erase unused parameter. 2019-05-03 Antti Koivisto Add a quirk to make youtube navigation bar scrollable without mouse hover on iOS https://bugs.webkit.org/show_bug.cgi?id=197555 Reviewed by Brent Fulgham. * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyleForSiteSpecificQuirks): Turn 'overflow:hidden' into 'overflow:auto' on element with id="guide-inner-content". * page/Quirks.cpp: (WebCore::Quirks::needsYouTubeOverflowScrollQuirk const): * page/Quirks.h: 2019-05-03 Devin Rousso Web Inspector: Record actions performed on WebGL2RenderingContext https://bugs.webkit.org/show_bug.cgi?id=176008 Reviewed by Joseph Pecoraro. Tests: inspector/canvas/recording-webgl2.html inspector/canvas/recording-webgl2-snapshots.html * html/canvas/WebGL2RenderingContext.idl: * bindings/js/CallTracerTypes.h: * inspector/RecordingSwizzleTypes.h: * inspector/InspectorCanvas.h: * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::canvasChanged): Added. (WebCore::InspectorCanvas::resetRecordingData): (WebCore::shouldSnapshotWebGL2Action): Added. (WebCore::InspectorCanvas::recordAction): (WebCore::InspectorCanvas::releaseObjectForRecording): (WebCore::InspectorCanvas::appendActionSnapshotIfNeeded): (WebCore::InspectorCanvas::buildAction): * inspector/agents/InspectorCanvasAgent.h: * inspector/agents/InspectorCanvasAgent.cpp: (WebCore::InspectorCanvasAgent::canvasChanged): Added. (WebCore::InspectorCanvasAgent::startRecording): Provide an actual implementation of `CanvasObserver::canvasChanged` since it can be used to determine whether or not an action needs a snapshot. * page/PageConsoleClient.cpp: (WebCore::canvasRenderingContext): 2019-05-03 Commit Queue Unreviewed, rolling out r244881. https://bugs.webkit.org/show_bug.cgi?id=197559 Breaks compilation of jsconly on linux, breaking compilation for jsc-i386-ews, jsc-mips-ews and jsc-armv7-ews (Requested by guijemont on #webkit). Reverted changeset: "[CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into WEBKIT_COPY_FILES" https://bugs.webkit.org/show_bug.cgi?id=197174 https://trac.webkit.org/changeset/244881 2019-05-03 Joonghun Park Resolve the percentage values of inset properties against proper box. https://bugs.webkit.org/show_bug.cgi?id=189549 Reviewed by Antti Koivisto. Before this CL, sticky element's layout was executed relative to a box's overflow container, but the value returned by getComputedStyle was resolved against its containing block. So, the computed value and the actual value used in layout was different before this change. Tests: imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-sticky-container-for-abspos.html imported/w3c/web-platform-tests/css/cssom/getComputedStyle-sticky-pos-percent.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::positionOffsetValue): * rendering/RenderBox.cpp: (WebCore::RenderBox::enclosingScrollportBox const): * rendering/RenderBox.h: 2019-05-02 Antti Koivisto Add a quirk to make gmail navigation bar scrollable without mouse hover on iOS https://bugs.webkit.org/show_bug.cgi?id=197529 Reviewed by Simon Fraser. * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): (WebCore::StyleResolver::adjustRenderStyleForSiteSpecificQuirks): Turn 'overflow:hidden' to 'overflow:auto' on element with role="navigation". This should be both reasonably targeted and robust. * css/StyleResolver.h: * page/Quirks.cpp: (WebCore::Quirks::needsGMailOverflowScrollQuirk const): * page/Quirks.h: 2019-05-02 Simon Fraser Add logging for RenderLayer clip rects https://bugs.webkit.org/show_bug.cgi?id=197547 Reviewed by Zalan Bujtas. Add a ClipRects log channel, and stream output for ClipRect and ClipRects. * platform/Logging.h: * rendering/ClipRect.cpp: (WebCore::operator<<): * rendering/ClipRect.h: * rendering/RenderLayer.cpp: (WebCore::operator<<): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayer.h: 2019-05-02 Youenn Fablet Make AudioContext::scriptExecutionContext() private https://bugs.webkit.org/show_bug.cgi?id=197512 Reviewed by Eric Carlson. Refactor code to make audio nodes not rely on AudioContext::scriptExecutionContext. Instead, let AudioContext provide the necessary API for its nodes. Covered by existing tests. * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::looping): (WebCore::AudioBufferSourceNode::setLooping): * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::postTask): (WebCore::AudioContext::origin const): (WebCore::AudioContext::addConsoleMessage): * Modules/webaudio/AudioContext.h: (WebCore::AudioContext::isStopped const): * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::scriptExecutionContext const): * Modules/webaudio/AudioNode.h: * Modules/webaudio/AudioScheduledSourceNode.cpp: (WebCore::AudioScheduledSourceNode::finish): * Modules/webaudio/DefaultAudioDestinationNode.cpp: (WebCore::DefaultAudioDestinationNode::resume): (WebCore::DefaultAudioDestinationNode::suspend): (WebCore::DefaultAudioDestinationNode::close): * Modules/webaudio/MediaElementAudioSourceNode.cpp: (WebCore::MediaElementAudioSourceNode::wouldTaintOrigin): * Modules/webaudio/MediaStreamAudioDestinationNode.cpp: (WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode): * Modules/webaudio/ScriptProcessorNode.cpp: (WebCore::ScriptProcessorNode::fireProcessEvent): 2019-05-02 Ryosuke Niwa Disable software keyboard for a math field textarea on desmos.com https://bugs.webkit.org/show_bug.cgi?id=197488 Reviewed by Wenson Hsieh. Treat a textarea inside a math field span as if it had inputmode content attribute set to none to suppress the software keyboard on desmos.com as it interferes with website's own UI. * html/HTMLElement.cpp: (WebCore::HTMLElement::canonicalInputMode const): * page/Quirks.cpp: (WebCore::Quirks::needsInputModeNoneImplicitly const): * page/Quirks.h: 2019-05-02 Timothy Hatcher NSAttributedString conversion in a loop returns nil and WKUnknownError every other time. https://bugs.webkit.org/show_bug.cgi?id=197523 Reviewed by Darin Adler. * editing/cocoa/HTMLConverter.mm: (HTMLConverter::convert): Don't return early if m_dataSource is nil. This is already null checked later and only needed in specific cases, it shouldn't fail the whole conversion. 2019-05-02 Chris Dumez Setting a frame's src to a javascript URL should not run it synchronously https://bugs.webkit.org/show_bug.cgi?id=197466 Reviewed by Darin Adler. When an iframe's src attribute is set to a javascript URL, whether when parsing or later on via JS, we now execute the URL's JavaScript asynchronously. We used to execute it synchronously, which was a source of bugs and also did not match other browsers. I have verified that our new behavior is aligned with both Firefox and Chrome. Note that for backward-compatibility and interoperability with Blink (https://bugs.chromium.org/p/chromium/issues/detail?id=923585), the "javascript:''" URL will still run synchronously. We should consider dropping this quirk at some point. Test: fast/dom/frame-src-javascript-url-async.html * loader/NavigationScheduler.cpp: (WebCore::ScheduledLocationChange::ScheduledLocationChange): (WebCore::ScheduledLocationChange::~ScheduledLocationChange): (WebCore::NavigationScheduler::scheduleLocationChange): * loader/NavigationScheduler.h: (WebCore::NavigationScheduler::scheduleLocationChange): * loader/SubframeLoader.cpp: (WebCore::SubframeLoader::requestFrame): 2019-05-02 Gary Katsevman WebVTT: fix vertical cue alignment. https://bugs.webkit.org/show_bug.cgi?id=136627. Reviewed by Eric Carlson. Updated existing test results. * html/track/VTTCue.cpp: (WebCore::VTTCueBox::applyCSSProperties): 2019-05-02 Don Olmstead [CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into WEBKIT_COPY_FILES https://bugs.webkit.org/show_bug.cgi?id=197174 Reviewed by Alex Christensen. Replace WEBKIT_MAKE_FORWARDING_HEADERS with WEBKIT_COPY_FILES and make dependencies for framework headers explicit. * CMakeLists.txt: 2019-05-02 Jiewen Tan [WebAuthN] Add a quirk for google.com when processing AppID extension https://bugs.webkit.org/show_bug.cgi?id=196046 Reviewed by Brent Fulgham. Relaxing the same site restriction on AppID while in google.com and any of its subdomains to allow two www.gstatic.com AppIDs to slip in. Covered by manual tests on Google.com. * Modules/webauthn/AuthenticatorCoordinator.cpp: (WebCore::AuthenticatorCoordinatorInternal::needsAppIdQuirks): (WebCore::AuthenticatorCoordinatorInternal::processAppIdExtension): 2019-05-02 Ross Kirsling Unreviewed fix for non-unified build after r244853. * page/SecurityOrigin.cpp: 2019-05-02 Frederic Wang [GTK][WPE] Disable "thin", "thick", "medium" values of mfrac@linethickness at runtime https://bugs.webkit.org/show_bug.cgi?id=196142 This patch introduces some experimental runtime flag to let users disable MathML features that are removed from MathML Core [1]. For now, these features are only disabled on GTK and WPE ports. This patch also adds a condition to disable "thin", "thick", "medium" values of mfrac@linethickness at runtime as agreed in [2]. [1] https://mathml-refresh.github.io/mathml-core/ [2] https://github.com/mathml-refresh/mathml/issues/4 Reviewed by Rob Buis. No new tests, covered by frac-linethickness-0001.html * mathml/MathMLFractionElement.cpp: (WebCore::MathMLFractionElement::lineThickness): Just do standard parsing for MathML lengths when non-core MathML features are disabled. * page/Settings.yaml: Add WebCore setting. 2019-05-01 Jiewen Tan [WebAuthN] Adopt SecurityOrigin::isMatchingRegistrableDomainSuffix() https://bugs.webkit.org/show_bug.cgi?id=197481 Reviewed by Brent Fulgham. This patch implements Step 6-7 from: https://www.w3.org/TR/webauthn/#createCredential, https://www.w3.org/TR/webauthn/#discover-from-external-source. Test: http/wpt/webauthn/public-key-credential-ip-address.html * Modules/webauthn/AuthenticatorCoordinator.cpp: (WebCore::AuthenticatorCoordinator::create const): (WebCore::AuthenticatorCoordinator::discoverFromExternalSource const): 2019-05-01 Youenn Fablet Add back hasNullReferences() assert in Document::updateIsPlayingMedia https://bugs.webkit.org/show_bug.cgi?id=197477 Reviewed by Eric Carlson. AudioContext had a special scriptExecutionContext() getter that was returning nullptr when AudioContext is stopped. Instead, make this getter behave as all other scriptExecutionContext() getters and make sure existing call sites of the getter are fine with the change. Covered by existing tests. * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::AudioContext): No need to check whether offline since this constructor is for non offline AudioContext. (WebCore::AudioContext::scriptExecutionContext const): (WebCore::AudioContext::fireCompletionEvent): * dom/Document.cpp: (WebCore::Document::updateIsPlayingMedia): 2019-05-01 Justin Fan Update WebGPU class names based on sketch.idl https://bugs.webkit.org/show_bug.cgi?id=194260 Reviewed by Dean Jackson. Update all exposed Web GPU interface names to GPU* prefix. Existing Web GPU tests updated to expect new names. * Modules/webgpu/WebGPU.idl: * Modules/webgpu/WebGPUAdapter.idl: * Modules/webgpu/WebGPUBindGroup.idl: * Modules/webgpu/WebGPUBindGroupLayout.idl: * Modules/webgpu/WebGPUBuffer.idl: * Modules/webgpu/WebGPUDevice.idl: * Modules/webgpu/WebGPUInputStepMode.h: Removed. * Modules/webgpu/WebGPUPipelineLayout.idl: * Modules/webgpu/WebGPUProgrammablePassEncoder.idl: * Modules/webgpu/WebGPUQueue.idl: * Modules/webgpu/WebGPURenderPassEncoder.idl: * Modules/webgpu/WebGPURenderPipeline.idl: * Modules/webgpu/WebGPUSampler.idl: * Modules/webgpu/WebGPUTexture.idl: * Modules/webgpu/WebGPUTextureView.idl: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: 2019-05-01 Jiewen Tan Move Document::domainIsRegisterable to SecurityOrigin::isMatchingRegistrableDomainSuffix https://bugs.webkit.org/show_bug.cgi?id=181950 Reviewed by Brent Fulgham. This patch moves Document::domainIsRegisterable to SecurityOrigin::isMatchingRegistrableDomainSuffix to be more aligned with the HTML standard: https://html.spec.whatwg.org/multipage/origin.html#is-a-registrable-domain-suffix-of-or-is-equal-to. Besides that, it also removes redundant codes within the original method that is also done in OriginAccessEntry::matchesOrigin. Covered by new API tests. * dom/Document.cpp: (WebCore::Document::setDomain): (WebCore::Document::domainIsRegisterable const): Deleted. * dom/Document.h: * page/SecurityOrigin.cpp: (WebCore::SecurityOrigin::isMatchingRegistrableDomainSuffix const): * page/SecurityOrigin.h: 2019-05-01 Ryosuke Niwa [iOS] Element::focus and Element::scrollIntoView do not clamp scroll positions https://bugs.webkit.org/show_bug.cgi?id=197211 Reviewed by Simon Fraser. Fixed the bug that Element::focus and Element::scrollIntoView were not clamping scroll offsets, which causes scrollTop etc... to return a bogus negative scrolling offset. Unfortunately, we can't just use FrameView's ScrollableArea::constrainScrollPosition since scrollRectToVisible relies on the visible rect being expanded by the content insets in order to scroll to a position within the content insets of UIScrollView; e.g. revealing the top of the page as the center. We manually expand minimumScrollPosition() and maximumScrollPosition() by the content insets instead. Tests: fast/scrolling/ios/programmatic-scroll-via-focus-should-clamp-top.html fast/scrolling/ios/programmatic-scroll-via-scrollIntoView-inside-iframe-should-clamp-top.html fast/scrolling/ios/programmatic-scroll-via-scrollIntoView-should-clamp-top.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::scrollRectToVisible): 2019-05-01 Wenson Hsieh [iOS] Add a version of viewport shrink-to-fit heuristics that preserves page layout https://bugs.webkit.org/show_bug.cgi?id=197342 Reviewed by Tim Horton. Adds support for a new shrink-to-fit heuristic that attempts to lay out the contents of the page at a larger width in order to shrink content to fit the viewport. See WebKit ChangeLog for more details. Tests: fast/viewport/ios/shrink-to-fit-content-constant-width.html fast/viewport/ios/shrink-to-fit-content-large-width-breakpoint.html fast/viewport/ios/shrink-to-fit-content-no-viewport.html fast/viewport/ios/shrink-to-fit-content-responsive-viewport-with-horizontal-overflow.html fast/viewport/ios/shrink-to-fit-content-temporary-overflow.html * page/ViewportConfiguration.cpp: (WebCore::ViewportConfiguration::setMinimumEffectiveDeviceWidth): (WebCore::ViewportConfiguration::setIsKnownToLayOutWiderThanViewport): (WebCore::ViewportConfiguration::description const): * page/ViewportConfiguration.h: (WebCore::ViewportConfiguration::canIgnoreScalingConstraints const): (WebCore::ViewportConfiguration::minimumEffectiveDeviceWidth const): Add several new getters and setters in ViewportConfiguration. (WebCore::ViewportConfiguration::isKnownToLayOutWiderThanViewport const): (WebCore::ViewportConfiguration::shouldIgnoreMinimumEffectiveDeviceWidth const): Importantly, only allow ignoring the minimum effective device width in webpages with responsive viewports, if they also have *not* laid out wider than the viewport. (WebCore::ViewportConfiguration::setForceAlwaysUserScalable): 2019-05-01 Zalan Bujtas [iOS] Star rating is covered with a black circle when writing a review on Yelp https://bugs.webkit.org/show_bug.cgi?id=197469 Reviewed by Dean Jackson. This patch moves the background painting of the radio/checkbox form controls in checked state to RenderTheme. It enables content authors to disable default appearance using -webkit-appearance: none (it is also inline with what we do on macOS). Test: fast/forms/radio-and-checkbox-checked-with-no-appearance.html * css/html.css: (input:matches([type="checkbox"], [type="radio"]):checked): * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::paintCheckboxDecorations): (WebCore::RenderThemeIOS::paintRadioDecorations): 2019-05-01 Said Abou-Hallawa REGRESSION (r244182): RenderingUpdate should not be scheduled for invisible pages https://bugs.webkit.org/show_bug.cgi?id=197451 Reviewed by Simon Fraser. Before r244182, some web pages never need to schedule a RenderingUpdate. Only pages with rAF callbacks, web animations, intersection and resize observers needed to do so. After r244182, all pages have to schedule a RenderingUpdate when a page rendering update is required. When Safari opens, it create a 'blank' web page. The blank page will not be visible unless the user selects to show the 'Empty page' in the new tab. Although the blank page is not visible, the loader needs to resolveStyle() which requires to scheduleLayerFlushNow(). We need to optimize this case: calling scheduleLayerFlushNow() for invisible pages. We do that by checking if the page is visible before scheduling the RenderingUpdate. Also we need to change or get rid of scheduleLayerFlushNow() since its name has become confusing. It suggests that it is going to schedule flushing the layer 'now'. But after r244182, it does scheduleRenderingUpdate() first. And when it fires, scheduleCompositingLayerFlush() will be called. * page/RenderingUpdateScheduler.cpp: (WebCore::RenderingUpdateScheduler::scheduleRenderingUpdate): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::scheduleLayerFlush): (WebCore::RenderLayerCompositor::didChangeVisibleRect): (WebCore::RenderLayerCompositor::frameViewDidScroll): (WebCore::RenderLayerCompositor::attachRootLayer): (WebCore::RenderLayerCompositor::setLayerFlushThrottlingEnabled): (WebCore::RenderLayerCompositor::layerFlushTimerFired): (WebCore::RenderLayerCompositor::scheduleLayerFlushNow): Deleted. * rendering/RenderLayerCompositor.h: 2019-05-01 Darin Adler WebKit has too much of its own UTF-8 code and should rely more on ICU's UTF-8 support https://bugs.webkit.org/show_bug.cgi?id=195535 Reviewed by Alexey Proskuryakov. * platform/SharedBuffer.cpp: (WebCore::utf8Buffer): Removed unnecessary "strict" argument to convertUTF16ToUTF8 since that is the default behavior. Also updated for changes to return values. * xml/XSLTProcessorLibxslt.cpp: (WebCore::writeToStringBuilder): Removed unnecessary use of StringBuffer for a temporary buffer for characters. Rewrote to use U8_NEXT and U16_APPEND directly. * xml/parser/XMLDocumentParserLibxml2.cpp: (WebCore::convertUTF16EntityToUTF8): Updated for changes to CompletionResult. 2019-05-01 Shawn Roberts Unreviewed, rolling out r244821. Causing Reverted changeset: "WebKit has too much of its own UTF-8 code and should rely more on ICU's UTF-8 support" https://bugs.webkit.org/show_bug.cgi?id=195535 https://trac.webkit.org/changeset/244821 2019-05-01 Shawn Roberts Unreviewed, rolling out r244822. Causing Reverted changeset: https://trac.webkit.org/changeset/244822 2019-05-01 Youenn Fablet Reject/throw when calling AudioContext methods on a stopped AudioContext https://bugs.webkit.org/show_bug.cgi?id=197391 Reviewed by Eric Carlson. Return InvalidStateError in that case. ASSERT that we do not call lazyInitialize after being stopped since this would mean we are doing unneeded processing. Test: http/wpt/webaudio/audiocontext-stopped.html * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::lazyInitialize): (WebCore::AudioContext::createBufferSource): (WebCore::AudioContext::createMediaElementSource): (WebCore::AudioContext::createMediaStreamSource): (WebCore::AudioContext::createMediaStreamDestination): (WebCore::AudioContext::createScriptProcessor): (WebCore::AudioContext::createBiquadFilter): (WebCore::AudioContext::createWaveShaper): (WebCore::AudioContext::createPanner): (WebCore::AudioContext::createConvolver): (WebCore::AudioContext::createDynamicsCompressor): (WebCore::AudioContext::createAnalyser): (WebCore::AudioContext::createGain): (WebCore::AudioContext::createDelay): (WebCore::AudioContext::createChannelSplitter): (WebCore::AudioContext::createChannelMerger): (WebCore::AudioContext::createOscillator): (WebCore::AudioContext::createPeriodicWave): (WebCore::AudioContext::startRendering): (WebCore::AudioContext::suspend): (WebCore::AudioContext::resume): (WebCore::AudioContext::close): * Modules/webaudio/AudioContext.h: * Modules/webaudio/AudioContext.idl: 2019-05-01 Eric Carlson XMLHttpRequest should propagate user gestures for media playback https://bugs.webkit.org/show_bug.cgi?id=197428 Reviewed by Jer Noble. A user gesture the would allow media state change in effect when XMLHttpRequest.send is called should be active when the event handlers fire after the transaction completes successfully. Test: http/tests/media/user-gesture-preserved-across-xmlhttprequest.html * dom/UserGestureIndicator.cpp: (WebCore::UserGestureIndicator::UserGestureIndicator): Add a 'scope' parameter to potentially limit the scope of the gesture to just media. (WebCore::UserGestureIndicator::~UserGestureIndicator): Clear the scope. * dom/UserGestureIndicator.h: (WebCore::UserGestureToken::processingUserGesture const): (WebCore::UserGestureToken::setScope): (WebCore::UserGestureToken::resetScope): (WebCore::UserGestureToken::hasExpired const): * page/DOMTimer.cpp: (WebCore::DOMTimerFireState::DOMTimerFireState): Don't need to store the nested timer interval, UserGestureIndicator knows when it started. (WebCore::DOMTimer::DOMTimer): Ditto. (WebCore::DOMTimer::fired): Ditto. (WebCore::DOMTimerFireState::nestedTimerInterval const): Deleted. (WebCore::shouldForwardUserGesture): Deleted. (WebCore::userGestureTokenToForward): Deleted. (WebCore::currentNestedTimerInterval): Deleted. * page/DOMTimer.h: * testing/Internals.cpp: (WebCore::Internals::setXHRMaximumIntervalForUserGestureForwarding): Override the maximum user gesture interval for testing. * testing/Internals.h: * testing/Internals.idl: * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::XMLHttpRequest): (WebCore::XMLHttpRequest::send): Stash the user gesture token. (WebCore::XMLHttpRequest::dispatchEvent): Clear user gesture token if it has expired. If still valid, activate it. * xml/XMLHttpRequest.h: 2019-04-29 Darin Adler WebKit has too much of its own UTF-8 code and should rely more on ICU's UTF-8 support https://bugs.webkit.org/show_bug.cgi?id=195535 Reviewed by Alexey Proskuryakov. * platform/SharedBuffer.cpp: (WebCore::utf8Buffer): Removed unnecessary "strict" argument to convertUTF16ToUTF8 since that is the default behavior. Also updated for changes to return values. * xml/XSLTProcessorLibxslt.cpp: (WebCore::writeToStringBuilder): Removed unnecessary use of StringBuffer for a temporary buffer for characters. Rewrote to use U8_NEXT and U16_APPEND directly. * xml/parser/XMLDocumentParserLibxml2.cpp: (WebCore::convertUTF16EntityToUTF8): Updated for changes to CompletionResult. 2019-04-30 John Wilander Add logging of Ad Click Attribution errors and events to a dedicated channel https://bugs.webkit.org/show_bug.cgi?id=197332 Reviewed by Youenn Fablet. This patch adds an experimental Ad Click Attribution debug mode which logs information. No new tests. * loader/AdClickAttribution.cpp: (WebCore::AdClickAttribution::parseConversionRequest): (WebCore::AdClickAttribution::debugModeEnabled): * loader/AdClickAttribution.h: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::adClickAttributionDebugModeEnabled const): (WebCore::RuntimeEnabledFeatures::setAdClickAttributionDebugModeEnabled): * platform/Logging.h: 2019-04-30 Myles C. Maxfield font-weight: 1000 is not parsed successfully https://bugs.webkit.org/show_bug.cgi?id=197427 Reviewed by Dean Jackson. The spec says: "Only values greater than or equal to 1, and less than or equal to 1000, are valid" This change brings us in-line with all the other browsers. Test: fast/text/font-weight-1-1000.html * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber): 2019-04-30 Youenn Fablet Make Document audio producers use WeakPtr https://bugs.webkit.org/show_bug.cgi?id=197382 Reviewed by Eric Carlson. Move from a hash set of raw pointers to a hash set of weak pointers. This helps make the code cleaner. No observable change of behavior. * Modules/mediastream/MediaStreamTrack.h: * dom/Document.cpp: (WebCore::Document::addAudioProducer): (WebCore::Document::removeAudioProducer): (WebCore::Document::updateIsPlayingMedia): (WebCore::Document::pageMutedStateDidChange): * dom/Document.h: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::updateActiveTextTrackCues): * html/HTMLMediaElement.h: * page/MediaProducer.h: 2019-04-30 Youenn Fablet [macOS WK1] ASSERTION FAILED: formData in WebCore::ResourceRequest::doUpdateResourceHTTPBody() https://bugs.webkit.org/show_bug.cgi?id=196864 Reviewed by Alex Christensen. In case of redirection, it is sometimes not possible to retrieve the form data from its NSInputStream in case of redirections. To handle this case, reuse the first request form data if the new request has a body. We also clear the HTTP content type in such a case if the original request has no content type. Covered by re-enabled tests. * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm: (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]): 2019-04-30 Commit Queue Unreviewed, rolling out r244773. https://bugs.webkit.org/show_bug.cgi?id=197436 Causing assertion failures on debug queues (Requested by ShawnRoberts on #webkit). Reverted changeset: "Make Document audio producers use WeakPtr" https://bugs.webkit.org/show_bug.cgi?id=197382 https://trac.webkit.org/changeset/244773 2019-04-30 Commit Queue Unreviewed, rolling out r244774. https://bugs.webkit.org/show_bug.cgi?id=197431 Causing assertion failures on debug queues (Requested by ShawnRoberts on #webkit). Reverted changeset: "Reject/throw when calling AudioContext methods on a stopped AudioContext" https://bugs.webkit.org/show_bug.cgi?id=197391 https://trac.webkit.org/changeset/244774 2019-04-30 Alex Christensen Add WKContentRuleList ping resource-type https://bugs.webkit.org/show_bug.cgi?id=197325 Reviewed by Geoff Garen. Tests: http/tests/contentextensions/block-ping-resource-type-ping.html and http/tests/contentextensions/block-ping-resource-type-raw.html * contentextensions/ContentExtensionsBackend.cpp: (WebCore::ContentExtensions::ContentExtensionsBackend::processContentRuleListsForLoad): * contentextensions/ContentExtensionsBackend.h: * loader/PingLoader.cpp: (WebCore::processContentRuleListsForLoad): (WebCore::PingLoader::sendPing): * loader/ResourceLoadInfo.cpp: (WebCore::ContentExtensions::readResourceType): (WebCore::ContentExtensions::ResourceLoadInfo::getResourceFlags const): * loader/ResourceLoadInfo.h: * page/UserContentProvider.cpp: (WebCore::UserContentProvider::processContentRuleListsForLoad): * page/UserContentProvider.h: 2019-04-30 Justin Fan [WebGPU] Move 'gpu' API entry point from DOMWindow to Navigator https://bugs.webkit.org/show_bug.cgi?id=197348 Reviewed by Myles C. Maxfield. Latest API provides 'gpu' through Navigator instead of DOMWindow. Replace DOMWindowWebGPU with NavigatorGPU. Existing tests updated to match. Add test: webgpu-enabled-in-worker.html to ensure workers can access WebGPU. * CMakeLists.txt: * DerivedSources.make: * Modules/webgpu/NavigatorGPU.cpp: (WebCore::NavigatorGPU::from): (WebCore::NavigatorGPU::supplementName): (WebCore::NavigatorGPU::gpu): (WebCore::NavigatorGPU::gpu const): * Modules/webgpu/NavigatorGPU.h: * Modules/webgpu/NavigatorGPU.idl: * Modules/webgpu/WorkerNavigatorGPU.cpp: (WebCore::WorkerNavigatorGPU::from): (WebCore::WorkerNavigatorGPU::supplementName): (WebCore::WorkerNavigatorGPU::gpu): (WebCore::WorkerNavigatorGPU::gpu const): * Modules/webgpu/WorkerNavigatorGPU.h: * Modules/webgpu/WorkerNavigatorGPU.idl: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2019-04-30 Zalan Bujtas Double-tapping a post to like doesn't work on Instagram.com (needs 'dblclick' event) https://bugs.webkit.org/show_bug.cgi?id=197347 Reviewed by Wenson Hsieh. Tests: fast/events/touch/ios/double-tap-for-double-click1.html fast/events/touch/ios/double-tap-for-double-click2.html * page/Frame.h: * page/ios/FrameIOS.mm: (WebCore::Frame::nodeRespondingToDoubleClickEvent): 2019-04-30 Youenn Fablet Reject/throw when calling AudioContext methods on a stopped AudioContext https://bugs.webkit.org/show_bug.cgi?id=197391 Reviewed by Eric Carlson. Return InvalidStateError in that case. ASSERT that we do not call lazyInitialize after being stopped since this would mean we are doing unneeded processing. Test: http/wpt/webaudio/audiocontext-stopped.html * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::lazyInitialize): (WebCore::AudioContext::createBufferSource): (WebCore::AudioContext::createMediaElementSource): (WebCore::AudioContext::createMediaStreamSource): (WebCore::AudioContext::createMediaStreamDestination): (WebCore::AudioContext::createScriptProcessor): (WebCore::AudioContext::createBiquadFilter): (WebCore::AudioContext::createWaveShaper): (WebCore::AudioContext::createPanner): (WebCore::AudioContext::createConvolver): (WebCore::AudioContext::createDynamicsCompressor): (WebCore::AudioContext::createAnalyser): (WebCore::AudioContext::createGain): (WebCore::AudioContext::createDelay): (WebCore::AudioContext::createChannelSplitter): (WebCore::AudioContext::createChannelMerger): (WebCore::AudioContext::createOscillator): (WebCore::AudioContext::createPeriodicWave): (WebCore::AudioContext::startRendering): (WebCore::AudioContext::suspend): (WebCore::AudioContext::resume): (WebCore::AudioContext::close): * Modules/webaudio/AudioContext.h: * Modules/webaudio/AudioContext.idl: 2019-04-30 Youenn Fablet Make Document audio producers use WeakPtr https://bugs.webkit.org/show_bug.cgi?id=197382 Reviewed by Eric Carlson. Move from a hash set of raw pointers to a hash set of weak pointers. This helps make the code cleaner. No observable change of behavior. * Modules/mediastream/MediaStreamTrack.h: * dom/Document.cpp: (WebCore::Document::addAudioProducer): (WebCore::Document::removeAudioProducer): (WebCore::Document::updateIsPlayingMedia): (WebCore::Document::pageMutedStateDidChange): * dom/Document.h: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::updateActiveTextTrackCues): * html/HTMLMediaElement.h: * page/MediaProducer.h: 2019-04-30 Antti Koivisto Tighten type of ScrollingTree:rootNode() to ScrollingTreeFrameScrollingNode https://bugs.webkit.org/show_bug.cgi?id=197414 Reviewed by Frédéric Wang. * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously): (WebCore::ScrollingTree::handleWheelEvent): (WebCore::ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling): (WebCore::ScrollingTree::updateTreeFromStateNode): * page/scrolling/ScrollingTree.h: (WebCore::ScrollingTree::rootNode const): 2019-04-30 Youenn Fablet Refactor AudioContext to register/unregister itself at construction/destruction time https://bugs.webkit.org/show_bug.cgi?id=197383 Reviewed by Eric Carlson. Registering/Unregistering is cheap. Instead of registering/unregistering in initialize/uninitialize, move this code to constructor/destructor. No observable change of behavior. * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::AudioContext): (WebCore::AudioContext::~AudioContext): (WebCore::AudioContext::lazyInitialize): (WebCore::AudioContext::uninitialize): (WebCore::AudioContext::visibilityStateChanged): 2019-04-30 Michael Catanzaro WebCore::StyleColorScheme should not have explicitly-declared copy constructor https://bugs.webkit.org/show_bug.cgi?id=197412 Reviewed by Don Olmstead. Either we need to explicitly declare a copy assignment operator here, or the copy constructor needs to be removed. Having one without the other causes a huge warning spam with GCC 9. In this case, the copy constructor is redundant because it's identical to an implicitly-declared copy constructor, so let's just remove it. * rendering/style/StyleColorScheme.h: 2019-04-30 Carlos Garcia Campos [GTK] Support prefers-color-scheme media query https://bugs.webkit.org/show_bug.cgi?id=196685 Reviewed by Michael Catanzaro. Change the gtk-application-prefer-dark-theme setting when tests change the useDarkModeAppearance setting. * PlatformGTK.cmake: * testing/InternalSettings.cpp: (WebCore::InternalSettings::resetToConsistentState): (WebCore::InternalSettings::setUseDarkAppearanceInternal): (WebCore::InternalSettings::setUseDarkAppearance): * testing/InternalSettings.h: 2019-04-29 Truitt Savell Unreviewed, rolling out r244755. Casued several test failures on iOS Reverted changeset: "Double-tapping a post to like doesn't work on Instagram.com (needs 'dblclick' event)" https://bugs.webkit.org/show_bug.cgi?id=197347 https://trac.webkit.org/changeset/244755 2019-04-29 Alex Christensen Fix internal High Sierra build https://bugs.webkit.org/show_bug.cgi?id=197388 * Configurations/Base.xcconfig: 2019-04-29 Zalan Bujtas Double-tapping a post to like doesn't work on Instagram.com (needs 'dblclick' event) https://bugs.webkit.org/show_bug.cgi?id=197347 Reviewed by Wenson Hsieh. Tests: fast/events/touch/ios/double-tap-for-double-click1.html fast/events/touch/ios/double-tap-for-double-click2.html * page/Frame.h: * page/ios/FrameIOS.mm: (WebCore::Frame::nodeRespondingToDoubleClickEvent): 2019-04-30 Simon Fraser Transform is sometimes left in a bad state after an animation https://bugs.webkit.org/show_bug.cgi?id=197401 rdar://problem/48179186 Reviewed by Dean Jackson. In some more complex compositing scenarios, at the end of an animation we'd fail to push a new transform onto a layer, because updateGeometry() would think there's an animation running (which there is, but in the "Ending" state). It's simpler in this code to just always push transform and opacity to the layer; they will get overridden by the animation while it's running. The current code dates from the first landing of the file, and the reason for the if (!isRunningAcceleratedTransformAnimation) check is lost in the sands of time. I was not able to get a reliable ref or layer tree test for this, because the next compositing update fixes it, and WTR seems to trigger one. But the added test does show the bug in Safari, and is a good test to have. Test: compositing/animation/transform-after-animation.html * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateGeometry): 2019-04-29 Youenn Fablet getDisplayMedia should be called on user gesture https://bugs.webkit.org/show_bug.cgi?id=197356 Reviewed by Eric Carlson. Allow getDisplayMedia on user gesture only. Otherwise reject the promise. Minor refactoring to align getDisplayMedia, getUserMedia and enumerateDevices when called with no document. Test: fast/mediastream/screencapture-user-gesture.html * Modules/mediastream/MediaDevices.cpp: (WebCore::MediaDevices::getUserMedia const): * Modules/mediastream/MediaDevices.h: * Modules/mediastream/NavigatorMediaDevices.h: * page/DOMWindow.h: * testing/Internals.cpp: (WebCore::Internals::setDisableGetDisplayMediaUserGestureConstraint): * testing/Internals.h: * testing/Internals.idl: 2019-04-29 Javier Fernandez line should not be broken before the first space after a word https://bugs.webkit.org/show_bug.cgi?id=197278 Reviewed by Myles C. Maxfield. The 'white-space: break-spaces' only adds breaking opportunities after a white space character. However, it's possible to break before the first space after a word when the feature is used in combination with other properties, like overflow-wrap. However, breaking before the first space should not be allowed if there are previous opportunities. We wrongly assumed that we had to consider these previous breaking opportunities if the proper combination of line breaking properties is being used, so that breaking before the first space after a word is allowed. This wrong assumption caused several issues, like the one described in the bug, that lead to incorrectly break before the first space even though there are previous opportunities, either white spaces or between letters. Theses issues have been analyzed [1] by the CSS WG and finally agreed on a expected behavior, represented in the Web Platform tests added in this patch. For the later case, of considering previous opportunities between letters, we have a seperated issue #952254, so the tests covering such cases will be added to the TestExpecations as Failure entries. [1] https://github.com/w3c/csswg-drafts/issues/3701 Tests: imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-001.html imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-002.html imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-003.html imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-004.html imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-005.html imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-006.html imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-007.html imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-008.html imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-009.html imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-010.html imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-011.html imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-012.html imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-before-first-char-013.html * rendering/line/BreakingContext.h: (WebCore::BreakingContext::handleText): (WebCore::BreakingContext::trailingSpacesHang): 2019-04-29 Simon Fraser REGRESSION (r238090): animation on https://www.robotodyssey.online gets stuck; site broken https://bugs.webkit.org/show_bug.cgi?id=197381 Reviewed by Zalan Bujtas. When -webkit-clip-path changes on a composited layer, we need to trigger a backing geometry update to push the changes to GraphicsLayers. Test: compositing/style-change/clip-path-change.html * rendering/RenderLayerCompositor.cpp: (WebCore::recompositeChangeRequiresGeometryUpdate): 2019-04-29 Chris Dumez User-facing strings should use curly quotes instead of straight https://bugs.webkit.org/show_bug.cgi?id=197370 Reviewed by Geoffrey Garen. Update localizable strings. * en.lproj/Localizable.strings: 2019-04-29 Ross Kirsling Unreviewed fix for non-unified build after r244687. * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h: 2019-04-29 Youenn Fablet RTCTrackEvent should be delayed until the whole remote description is set https://bugs.webkit.org/show_bug.cgi?id=196808 Reviewed by Eric Carlson. As per https://w3c.github.io/webrtc-pc/#set-description, fire events just before resolving the setRemoteDescription promise. This ensures that the exposed stream has all necessary tracks from the beginning. Pending track events are created in LibWebRTCMediaEndpoint and stored in PeerConnectionBackend. Covered by updated test. * Modules/mediastream/PeerConnectionBackend.cpp: (WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded): (WebCore::PeerConnectionBackend::setRemoteDescriptionFailed): (WebCore::PeerConnectionBackend::addPendingTrackEvent): (WebCore::PeerConnectionBackend::stop): * Modules/mediastream/PeerConnectionBackend.h: * Modules/mediastream/RTCPeerConnection.cpp: * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::addRemoteTrack): (WebCore::LibWebRTCMediaEndpoint::addPendingTrackEvent): (WebCore::LibWebRTCMediaEndpoint::newTransceiver): * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: 2019-04-25 Carlos Garcia Campos REGRESSION(r244635): [GTK] Wrong background color used in non-dark mode https://bugs.webkit.org/show_bug.cgi?id=197276 Reviewed by Michael Catanzaro. Since r244635, we are now getting the frame view background color from the theme. That's correct for dark mode, but in non-dark mode we still want to use white backgrounds by default. This made a lot of tests to fail. * css/CSSValueKeywords.in: Add -webkit-control-background when HAVE(OS_DARK_MODE_SUPPORT). * css/html.css: Use -webkit-control-background instead of -apple-system-control-background. * page/FrameView.cpp: (WebCore::FrameView::updateBackgroundRecursively): Use CSSValueWindow instead of CSSValueWindowframe. * rendering/RenderThemeGtk.cpp: (WebCore::RenderThemeGtk::systemColor const): Only get the window background from the theme in dark mode. Handle also CSSValueWebkitControlBackground. * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::systemColor const): Handle CSSValueWebkitControlBackground when HAVE(OS_DARK_MODE_SUPPORT). 2019-04-28 Andy Estes [Apple Pay] Increment the API version from 6 to 7 https://bugs.webkit.org/show_bug.cgi?id=197041 Reviewed by Geoffrey Garen. * Modules/applepay/PaymentCoordinatorClient.cpp: (WebCore::PaymentCoordinatorClient::supportsVersion): 2019-04-28 Andy Estes Fix the watchOS engineering build. * Modules/webgpu/WebGPUComputePassEncoder.cpp: Included Logging.h. 2019-04-28 Youenn Fablet Remove no longer needed mDNS ICE candidate resolution code https://bugs.webkit.org/show_bug.cgi?id=197315 Reviewed by Eric Carlson. No change of behavior. Removed code is no longer exercised as mDNS resolution happens inside libwebrtc using the same resolution mechanism as for TURN/STUN server names. * Modules/mediastream/PeerConnectionBackend.cpp: (WebCore::PeerConnectionBackend::addIceCandidateSucceeded): (WebCore::PeerConnectionBackend::addIceCandidateFailed): * Modules/mediastream/PeerConnectionBackend.h: 2019-04-27 Simon Fraser Move some Compositing logging to the Layers log channel https://bugs.webkit.org/show_bug.cgi?id=197345 Reviewed by Sam Weinig. Make Compositing logging a bit less verbose by moving the GraphicsLayer tree dump to the Layers log channel. Also log GraphicsLayers after flushing, when we'll have accurate visible rects. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::updateCoverage): * rendering/RenderLayerCompositor.cpp: (WebCore::layersLogEnabled): (WebCore::RenderLayerCompositor::flushPendingLayerChanges): (WebCore::RenderLayerCompositor::updateCompositingLayers): 2019-04-27 Megan Gardner Lookup only looking up the first word in selection https://bugs.webkit.org/show_bug.cgi?id=197341 Reviewed by Wenson Hsieh. Lookup is not testable. Reveal needs the full range in order to correctly create the item for the popover. * editing/cocoa/DictionaryLookup.mm: (WebCore::showPopupOrCreateAnimationController): 2019-04-26 Jer Noble Reduce the number of copies made during SourceBufferPrivateAVFObjC::append() using SharedBuffer https://bugs.webkit.org/show_bug.cgi?id=197335 Rubber-stamped by Alex Christensen. * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::append): 2019-04-26 Jessie Berlin Add new mac target numbers https://bugs.webkit.org/show_bug.cgi?id=197313 Reviewed by Alex Christensen. * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: 2019-04-26 Commit Queue Unreviewed, rolling out r244708. https://bugs.webkit.org/show_bug.cgi?id=197334 "Broke the debug build" (Requested by rmorisset on #webkit). Reverted changeset: "All prototypes should call didBecomePrototype()" https://bugs.webkit.org/show_bug.cgi?id=196315 https://trac.webkit.org/changeset/244708 2019-04-26 Robin Morisset All prototypes should call didBecomePrototype() https://bugs.webkit.org/show_bug.cgi?id=196315 Reviewed by Saam Barati. It was found by existing tests, with the new assert in JSC::Structure * bindings/js/JSWindowProxy.cpp: (WebCore::JSWindowProxy::setWindow): * bindings/scripts/CodeGeneratorJS.pm: (GeneratePrototypeDeclaration): (GenerateConstructorHelperMethods): 2019-04-26 Eric Carlson Create AVFoundationSoftLink.{h,mm} to reduce duplicate code https://bugs.webkit.org/show_bug.cgi?id=197171 Reviewed by Youenn Fablet. Tests: TestWebKitAPI/Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm * Modules/plugins/QuickTimePluginReplacement.mm: (WebCore::jsValueWithValueInContext): (WebCore::jsValueWithAVMetadataItemInContext): * WebCore.xcodeproj/project.pbxproj: * platform/audio/ios/AudioSessionIOS.mm: (WebCore::AudioSession::setCategory): (WebCore::AudioSession::category const): (WebCore::AudioSession::routeSharingPolicy const): (WebCore::AudioSession::routingContextUID const): (WebCore::AudioSession::sampleRate const): (WebCore::AudioSession::bufferSize const): (WebCore::AudioSession::numberOfOutputChannels const): (WebCore::AudioSession::tryToSetActiveInternal): (WebCore::AudioSession::preferredBufferSize const): (WebCore::AudioSession::setPreferredBufferSize): * platform/audio/ios/MediaSessionManagerIOS.mm: (-[WebMediaSessionHelper initWithCallback:]): (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]): * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm: (WebCore::AVTrackPrivateAVFObjCImpl::audioKind const): (WebCore::AVTrackPrivateAVFObjCImpl::videoKind const): (WebCore::AVTrackPrivateAVFObjCImpl::label const): * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm: (WebCore::AudioSourceProviderAVFObjC::createMix): * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm: * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm: (WebCore::MediaSelectionGroupAVFObjC::updateOptions): * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm: (WebCore::AVFoundationMIMETypeCache::canDecodeType): (WebCore::AVFoundationMIMETypeCache::loadMIMETypes): * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistableState): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistentKeys): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsMediaCapability): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::ensureSession): * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm: (WebCore::CDMSessionAVContentKeySession::isAvailable): (WebCore::CDMSessionAVContentKeySession::releaseKeys): (WebCore::CDMSessionAVContentKeySession::update): (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage): (WebCore::CDMSessionAVContentKeySession::contentKeySession): * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm: * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm: (WebCore::CDMSessionAVStreamSession::releaseKeys): (WebCore::CDMSessionAVStreamSession::update): (WebCore::CDMSessionAVStreamSession::setStreamSession): (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage): * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: (WebCore::imageDecoderAssetOptions): (WebCore::ImageDecoderAVFObjC::ImageDecoderAVFObjC): (WebCore::ImageDecoderAVFObjC::firstEnabledTrack): (WebCore::ImageDecoderAVFObjC::readSamples): (SOFT_LINK_CONSTANT_MAY_FAIL): Deleted. * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm: (WebCore::InbandTextTrackPrivateAVFObjC::label const): * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm: (WebCore::InbandTextTrackPrivateLegacyAVFObjC::label const): * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm: (WebCore::MediaPlaybackTargetPickerMac::devicePicker): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::assetCacheForPath): (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache): (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins): (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad): (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageGenerator): (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer): (WebCore::MediaPlayerPrivateAVFoundationObjC::synchronizeTextTrackState): (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): (WebCore::MediaPlayerPrivateAVFoundationObjC::setAVPlayerItem): (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem): (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType): (WebCore::MediaPlayerPrivateAVFoundationObjC::isAvailable): (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged): (WebCore::determineChangedTracksFromNewTracksAndOldItems): (WebCore::MediaPlayerPrivateAVFoundationObjC::updateAudioTracks): (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoTracks): (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput): (WebCore::MediaPlayerPrivateAVFoundationObjC::outputMediaDataWillChange): (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForLegibleMedia): (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForAudibleMedia): (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForVisualMedia): (WebCore::MediaPlayerPrivateAVFoundationObjC::processMediaSelectionOptions): (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack): (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack const): (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType const): (WebCore::exernalDeviceDisplayNameForPlayer): (WebCore::metadataType): (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive): (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]): (-[WebCoreAVFPullDelegate outputMediaDataWillChange:]): (-[WebCoreAVFPullDelegate outputSequenceWasFlushed:]): (WebCore::MediaPlayerPrivateAVFoundationObjC::processLegacyClosedCaptionsTracks): Deleted. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::streamSession): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (-[WebAVSampleBufferStatusChangeListener observeValueForKeyPath:ofObject:change:context:]): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]): (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer): (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa): (WebCore::PlatformCALayerCocoa::clone const): (WebCore::PlatformCALayerCocoa::avPlayerLayer const): * platform/graphics/cocoa/HEVCUtilitiesCocoa.mm: (WebCore::validateHEVCParameters): * platform/ios/PlatformSpeechSynthesizerIOS.mm: (getAVSpeechUtteranceDefaultSpeechRate): (getAVSpeechUtteranceMaximumSpeechRate): (-[WebSpeechSynthesisWrapper speakUtterance:]): (WebCore::PlatformSpeechSynthesizer::initializeVoiceList): (SOFT_LINK_CONSTANT): Deleted. * platform/ios/VideoFullscreenInterfaceAVKit.mm: (-[WebAVPlayerLayer init]): (-[WebAVPlayerLayer layoutSublayers]): (-[WebAVPlayerLayer setVideoGravity:]): (-[WebAVPlayerLayer videoRect]): (WebAVPlayerLayerView_startRoutingVideoToPictureInPicturePlayerLayerView): * platform/mac/SerializedPlatformRepresentationMac.mm: (WebCore::jsValueWithValueInContext): (WebCore::jsValueWithAVMetadataItemInContext): * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (WebCore::getAVFormatIDKeyWithFallback): (WebCore::getAVNumberOfChannelsKeyWithFallback): (WebCore::getAVSampleRateKeyWithFallback): (WebCore::getAVEncoderBitRateKeyWithFallback): (WebCore::MediaRecorderPrivateWriter::create): (WebCore::MediaRecorderPrivateWriter::setVideoInput): (WebCore::MediaRecorderPrivateWriter::setAudioInput): * platform/mediastream/RealtimeVideoSource.h: * platform/mediastream/VideoPreset.h: * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm: (WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices): * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm: (-[WebCoreAudioCaptureSourceIOSListener initWithCallback:]): (-[WebCoreAudioCaptureSourceIOSListener handleInterruption:]): * platform/mediastream/mac/AVCaptureDeviceManager.mm: (WebCore::deviceIsAvailable): (WebCore::AVCaptureDeviceManager::updateCachedAVCaptureDevices): (WebCore::AVCaptureDeviceManager::refreshCaptureDevices): (WebCore::AVCaptureDeviceManager::isAvailable): (WebCore::AVCaptureDeviceManager::~AVCaptureDeviceManager): * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoPreset::create): (WebCore::AVVideoPreset::AVVideoPreset): (WebCore::AVVideoCaptureSource::create): (WebCore::AVVideoCaptureSource::AVVideoCaptureSource): (WebCore::AVVideoCaptureSource::capabilities): (WebCore::sensorOrientationFromVideoOutput): (WebCore::AVVideoCaptureSource::setupSession): (WebCore::AVVideoCaptureSource::frameDurationForFrameRate): (WebCore::AVVideoCaptureSource::setupCaptureSession): (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection): (WebCore::AVVideoCaptureSource::generatePresets): (-[WebCoreAVVideoCaptureSourceObserver addNotificationObservers]): (-[WebCoreAVVideoCaptureSourceObserver captureOutput:didOutputSampleBuffer:fromConnection:]): 2019-04-26 Commit Queue Unreviewed, rolling out r244683. https://bugs.webkit.org/show_bug.cgi?id=197320 Causing crash on iOS Simulator and EWS failures (Requested by sroberts on #webkit). Reverted changeset: "[iOS] Add internal setting to force -webkit-text-size-adjust to "auto"" https://bugs.webkit.org/show_bug.cgi?id=197275 https://trac.webkit.org/changeset/244683 2019-04-26 Youenn Fablet Use normal loading path for ping loads https://bugs.webkit.org/show_bug.cgi?id=196807 Reviewed by Alex Christensen. Make use of regular code path for ping loads and beacon. This is done conditionally on KeepAlive flag. The benefits are a single loading code path and service worker interception. For that purpose, introduce a LoaderStrategy switch based on KeepAlive runtime flag. This switch is used to use ping loads when keepAlive is set or regular loads. In case of regular loads, the keepAlive flag should be used to extend the lifetime of the load. Migrate ping loads to use CachedResourceLoader instead of PingLoad. For that purpose, introduce a new Ping CachedResource type. Covered by existing tests. * Modules/beacon/NavigatorBeacon.cpp: (WebCore::NavigatorBeacon::sendBeacon): * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::inspectorResourceType): * loader/LinkLoader.cpp: (WebCore::createLinkPreloadResourceClient): * loader/LoaderStrategy.h: * loader/PingLoader.cpp: (WebCore::PingLoader::loadImage): (WebCore::PingLoader::sendPing): (WebCore::PingLoader::sendViolationReport): (WebCore::PingLoader::startPingLoad): * loader/PingLoader.h: * loader/ResourceLoadInfo.cpp: (WebCore::toResourceType): * loader/SubresourceLoader.cpp: (WebCore::logResourceLoaded): * loader/cache/CachedResource.cpp: (WebCore::CachedResource::defaultPriorityForResourceType): (WebCore::CachedResource::load): (WebCore::CachedResource::cancelLoad): * loader/cache/CachedResource.h: (WebCore::CachedResource::shouldUsePingLoad): (WebCore::CachedResource::isMainOrMediaOrIconOrRawResource const): * loader/cache/CachedResourceLoader.cpp: (WebCore::createResource): (WebCore::CachedResourceLoader::requestPingResource): (WebCore::contentTypeFromResourceType): (WebCore::CachedResourceLoader::checkInsecureContent const): (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy const): (WebCore::CachedResourceLoader::canRequest): (WebCore::isResourceSuitableForDirectReuse): (WebCore::destinationForType): * loader/cache/CachedResourceLoader.h: 2019-04-26 Alex Christensen Fix Windows build after r244695 ​https://bugs.webkit.org/show_bug.cgi?id=197165 * loader/PingLoader.cpp: 2019-04-26 Alex Christensen Fix internal High Sierra build after r244653 https://bugs.webkit.org/show_bug.cgi?id=197131 * DerivedSources.make: -std=gnu++17 didn't exist yet. -std=gnu++1z did. 2019-04-26 Alex Christensen Add ENABLE(CONTENT_EXTENSIONS) and namespace ContentExtensions to ResourceLoadInfo.h https://bugs.webkit.org/show_bug.cgi?id=197165 Reviewed by Youenn Fablet. No change in behavior. This will just make it harder for people working on the loader to mistake these ContentExtension specific structures for other structures general to loading. One such mistake was made in r244248. * Modules/websockets/WebSocketChannel.cpp: (WebCore::WebSocketChannel::connect): * contentextensions/ContentExtensionsBackend.h: * css/StyleSheetContents.cpp: (WebCore::StyleSheetContents::subresourcesAllowReuse const): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::loadResource): * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadResourceSynchronously): * loader/NetscapePlugInStreamLoader.cpp: (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader): * loader/PingLoader.cpp: (WebCore::processContentRuleListsForLoad): (WebCore::PingLoader::loadImage): (WebCore::PingLoader::sendPing): (WebCore::PingLoader::sendViolationReport): * loader/ResourceLoadInfo.cpp: (WebCore::toResourceType): Deleted. (WebCore::readResourceType): Deleted. (WebCore::readLoadType): Deleted. (WebCore::ResourceLoadInfo::isThirdParty const): Deleted. (WebCore::ResourceLoadInfo::getResourceFlags const): Deleted. * loader/ResourceLoadInfo.h: * loader/ResourceLoader.cpp: (WebCore::ResourceLoader::willSendRequestInternal): * loader/ResourceLoader.h: * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::SubresourceLoader): * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::requestResource): * page/DOMWindow.cpp: (WebCore::DOMWindow::open): * page/UserContentProvider.cpp: (WebCore::UserContentProvider::processContentRuleListsForLoad): (WebCore::UserContentProvider::actionsForResourceLoad): * page/UserContentProvider.h: 2019-04-26 Alex Christensen Fix an internal High Sierra build after r244653 ​https://bugs.webkit.org/show_bug.cgi?id=197131 * DerivedSources.make: Apparently we can't use gnu++17 when preprocessing Platform.h in the makefile. 2019-04-26 Chris Fleizach AX: Provide iOS method for setting focus https://bugs.webkit.org/show_bug.cgi?id=197200 Reviewed by Alex Christensen. Put the focus setting code in a place that iOS and macOS can access. Override a platform level method for setting focus on iOS. * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper _accessibilitySetFocus:]): * accessibility/mac/WebAccessibilityObjectWrapperBase.h: * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: (-[WebAccessibilityObjectWrapperBase baseAccessibilitySetFocus:]): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]): 2019-04-26 Said Abou-Hallawa propertyRegistry() was not overridden for SVGFEFloodElement and SVGFEMergeElement https://bugs.webkit.org/show_bug.cgi?id=197303 Reviewed by Alex Christensen. Therefore SVGElement::propertyRegistry() was called instead. This means these two elements will not have access to the properties of the base class SVGFilterPrimitiveStandardAttributes. Tests: svg/dom/SVGFEFloodElement-filter-standard-attributes.svg * svg/SVGElement.cpp: (WebCore::SVGElement::commitPropertyChange): * svg/SVGFEFloodElement.h: * svg/SVGFEMergeElement.h: 2019-04-26 Youenn Fablet [Mac WK2 iOS Sim] Layout Test imported/w3c/web-platform-tests/webrtc/RTCRtpReceiver-getSynchronizationSources.https.html is a flaky failure https://bugs.webkit.org/show_bug.cgi?id=196633 Reviewed by Alex Christensen. Use formula defined in https://w3c.github.io/webrtc-stats/#dom-rtcrtpcontributingsourcestats-audiolevel to compute the audio level from the RTP header information. Covered by rebased test. * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp: (WebCore::fillRTCRtpContributingSource): 2019-04-26 Sihui Liu Stop IDB transactions to release locked database files when network process is ready to suspend https://bugs.webkit.org/show_bug.cgi?id=196372 Reviewed by Brady Eidson. Suspend IDB database thread and finish ongoing IDB transactions on the main thread before suspending network process. API test: IndexedDB.IndexedDBSuspendImminently * Modules/indexeddb/server/IDBBackingStore.h: * Modules/indexeddb/server/IDBServer.cpp: (WebCore::IDBServer::IDBServer::tryStop): (WebCore::IDBServer::IDBServer::resume): * Modules/indexeddb/server/IDBServer.h: * Modules/indexeddb/server/MemoryIDBBackingStore.h: * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: Remove some error log messages, because now we may try performing database operations without an active transaction if the transaction is finished on the main thread. (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore): (WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore): (WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore): (WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore): (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex): (WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex): (WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex): (WebCore::IDBServer::SQLiteIDBBackingStore::keyExistsInObjectStore): (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange): (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords): (WebCore::IDBServer::SQLiteIDBBackingStore::getAllIndexRecords): (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::getCount): (WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber): (WebCore::IDBServer::SQLiteIDBBackingStore::revertGeneratedKeyNumber): (WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber): (WebCore::IDBServer::SQLiteIDBBackingStore::openCursor): (WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor): (WebCore::IDBServer::SQLiteIDBBackingStore::hasTransaction const): * Modules/indexeddb/server/SQLiteIDBBackingStore.h: * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::prepareToFinishTransaction): (WebCore::IDBServer::UniqueIDBDatabase::commitTransactionAfterQuotaCheck): (WebCore::IDBServer::UniqueIDBDatabase::didPerformCommitTransaction): (WebCore::IDBServer::UniqueIDBDatabase::abortTransaction): (WebCore::IDBServer::UniqueIDBDatabase::didPerformAbortTransaction): (WebCore::IDBServer::UniqueIDBDatabase::abortTransactionOnMainThread): (WebCore::IDBServer::UniqueIDBDatabase::commitTransactionOnMainThread): (WebCore::IDBServer::UniqueIDBDatabase::finishActiveTransactions): * Modules/indexeddb/server/UniqueIDBDatabase.h: * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h: (WebCore::IDBServer::UniqueIDBDatabaseTransaction::setState): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::state const): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::setResult): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::result const): * platform/sql/SQLiteDatabaseTracker.cpp: (WebCore::SQLiteDatabaseTracker::hasTransactionInProgress): * platform/sql/SQLiteDatabaseTracker.h: 2019-04-26 Takashi Komori [Curl] Fix Curl Request Scheduler not to release wrong Curl handle when request is cancelled. https://bugs.webkit.org/show_bug.cgi?id=191650 Reviewed by Fujii Hironori. Test: http/tests/misc/repeat-open-cancel.html * platform/network/curl/CurlRequest.cpp: (WebCore::CurlRequest::cancel): (WebCore::CurlRequest::isCancelled): (WebCore::CurlRequest::isCompletedOrCancelled): (WebCore::CurlRequest::didCompleteTransfer): (WebCore::CurlRequest::completeDidReceiveResponse): (WebCore::CurlRequest::pausedStatusChanged): * platform/network/curl/CurlRequest.h: (WebCore::CurlRequest::isCompleted const): Deleted. (WebCore::CurlRequest::isCancelled const): Deleted. (WebCore::CurlRequest::isCompletedOrCancelled const): Deleted. * platform/network/curl/CurlRequestScheduler.cpp: (WebCore::CurlRequestScheduler::cancel): (WebCore::CurlRequestScheduler::callOnWorkerThread): (WebCore::CurlRequestScheduler::startThreadIfNeeded): (WebCore::CurlRequestScheduler::stopThreadIfNoMoreJobRunning): (WebCore::CurlRequestScheduler::stopThread): (WebCore::CurlRequestScheduler::executeTasks): (WebCore::CurlRequestScheduler::workerThread): (WebCore::CurlRequestScheduler::startTransfer): (WebCore::CurlRequestScheduler::completeTransfer): (WebCore::CurlRequestScheduler::cancelTransfer): (WebCore::CurlRequestScheduler::finalizeTransfer): * platform/network/curl/CurlRequestScheduler.h: 2019-04-25 Myles C. Maxfield [iOS] Add internal setting to force -webkit-text-size-adjust to "auto" https://bugs.webkit.org/show_bug.cgi?id=197275 Reviewed by Simon Fraser. This setting makes it easier to investigate the autosizing work we've been doing in https://bugs.webkit.org/show_bug.cgi?id=197250. * page/Settings.yaml: * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::adjustComputedFontSizes): * rendering/TextAutoSizing.cpp: (WebCore::TextAutoSizingValue::adjustTextNodeSizes): 2019-04-25 Myles C. Maxfield [iOS] Implement idempotent mode for text autosizing https://bugs.webkit.org/show_bug.cgi?id=197250 Reviewed by Jon Lee. Our text autosizing code has this interesting behavior where it is sensitive to the width of the text's container and the number of lines of text inside the element. Not only is it sensitive to those things, but as those things change, their values are stored inside the RenderObject itself and then never recomputed. This means that the text autosizing parameters are sensitive to the entire history of an element. So, a newly created element with the same style as an existing element can have dramatically different results. This patch adds a new mode for text autosizing, which isn't sensitive to either of those things, and therefore maintains the invariant that a newly created element will behave the same as an existing element with the same style. Instead of using container size, it instead uses the viewport's initial scale. As the viewport's initial scale changes, new layouts will be triggered, which will cause the autosizing code to use the new value. Tests: fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-identity.html fast/text-autosizing/ios/idempotentmode/idempotent-autosizing.html * page/FrameViewLayoutContext.cpp: (WebCore::FrameViewLayoutContext::applyTextSizingIfNeeded): * page/Page.cpp: (WebCore::Page::setInitialScale): WebKit will push the initial scale down into the page. * page/Page.h: (WebCore::Page::initialScale const): * page/SettingsBase.h: * page/cocoa/SettingsBaseCocoa.mm: (WebCore::SettingsBase::textAutosizingUsesIdempotentMode): (WebCore::SettingsBase::defaultTextAutosizingEnabled): * rendering/RenderBlockFlow.cpp: (WebCore::idempotentTextSize): Describe a piecewise-linear curve for the text size to follow. The curve scales depending on the viewport's initial scale. (WebCore::RenderBlockFlow::adjustComputedFontSizes): * rendering/RenderBlockFlow.h: * rendering/RenderElement.cpp: (WebCore::includeNonFixedHeight): This new mode should consider max-height as well as height when determining if content overflows. (WebCore::RenderElement::adjustComputedFontSizesOnBlocks): (WebCore::RenderElement::resetTextAutosizing): * rendering/RenderElement.h: * rendering/RenderObject.h: 2019-04-25 Simon Fraser REGRESSION (r234330): 3 legacy-animation-engine/compositing tests are flaky failures https://bugs.webkit.org/show_bug.cgi?id=188357 Reviewed by Dean Jackson. DumpRenderTree had no code that set page.setCompositingPolicyOverride() to Normal, so some tests would fall into low memory mode and have different behavior. Fix by moving the code that calls setCompositingPolicyOverride(Normal) from the WK2 layer to Internals, so it's shared by DRT and WTR. We no longer need the WK2 C SPI glue. * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): 2019-04-25 Sihui Liu [ iOS Sim ] REGRESSION (r242986) Layout Test storage/indexeddb/modern/idbtransaction-objectstore-failures-private.html is a flaky failure https://bugs.webkit.org/show_bug.cgi?id=196357 Reviewed by Geoffrey Garen. Dispatch IDBRequest event to IDBTransaction if event of IDBTransaction has not been dispatched. Covered by existing tests. * Modules/indexeddb/IDBRequest.cpp: (WebCore::IDBRequest::dispatchEvent): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::dispatchEvent): * Modules/indexeddb/IDBTransaction.h: 2019-04-25 Chris Dumez ASSERT(scriptExecutionContext()) in Performance::resourceTimingBufferFullTimerFired() https://bugs.webkit.org/show_bug.cgi?id=197300 Reviewed by Youenn Fablet. We crash because the scriptExecutionContext has been destroyed by the time the m_resourceTimingBufferFullTimer timer fires. However, r241598 already makes sure that we stop the timer when the script execution context is destroyed. This makes me think that somebody restarts the timer *after* the script execution context has been destroyed. The thing is that we only start the timer in Performance::addResourceTiming() and there are only 2 call sites for this method. Both call sites get the Performance object from the Window object, which they get from the Document object. As a result, I would believe that the Window's document is alive, even though the Performance object's scriptExecutionContext is not. This could indicate that the Performance object's scriptExecutionContext gets out of sync with its Window's document. I have found one place where it could happen in theory (DOMWindow::didSecureTransitionTo()). I have not been able to write a test confirming my theory though so this is a speculative fix. I have also added a few assertions to help us track down the issue if my speculative fix turns out to be ineffective. No new tests, we do not know how to reproduce. * page/DOMWindow.cpp: (WebCore::DOMWindow::didSecureTransitionTo): This is a speculative fix for the crash. When a DOMWindow transitions from one document to another, reset its data members which store the DOMWindow's document to make sure that they do not get out of sync. (WebCore::DOMWindow::crypto const): (WebCore::DOMWindow::navigator): (WebCore::DOMWindow::performance const): Add assertions to make sure that the member's scriptExecutionContext is in sync with the window's. * page/Performance.cpp: (WebCore::Performance::addResourceTiming): Add assertion to make sure that the scriptExecutionContext() is non-null when calling this as this may start the m_resourceTimingBufferFullTimer timer. If my speculative fix above does not work, we should hit this and this should tell us which call site is causing this. 2019-04-25 Timothy Hatcher Disable ContentChangeObserver on iOSMac. https://bugs.webkit.org/show_bug.cgi?id=197292 rdar://problem/49039957 Reviewed by Zalan Bujtas. We don’t need to run any of ContentChangeObserver, because we have hover events on iOSMac. Disabling it skips the synthetic mouse move events and speeds up clicks. * page/SettingsBase.cpp: (WebCore::SettingsBase::defaultContentChangeObserverEnabled): Return false for PLATFORM(IOSMAC). 2019-04-25 Timothy Hatcher Disable date and time inputs on iOSMac. https://bugs.webkit.org/show_bug.cgi?id=197287 rdar://problem/46794376 Reviewed by Wenson Hsieh. * Configurations/FeatureDefines.xcconfig: * platform/text/mac/LocaleMac.h: * platform/text/mac/LocaleMac.mm: (WebCore::LocaleMac::formatDateTime): 2019-04-25 Alex Christensen Fix more Windows builds after r244653 https://bugs.webkit.org/show_bug.cgi?id=197131 * svg/properties/SVGAnimatedPropertyList.h: * svg/properties/SVGProperty.h: * svg/properties/SVGPropertyList.h: 2019-04-25 Alex Christensen Fix more builds after r244653 https://bugs.webkit.org/show_bug.cgi?id=197131 * svg/properties/SVGValuePropertyList.h: Something is preventing MSVC from seeing protected constructors from subclasses. 2019-04-25 Per Arne Vollan -[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:] never returns _WKWebsiteDataTypeCredentials https://bugs.webkit.org/show_bug.cgi?id=196991 Reviewed by Alex Christensen. Add method to get all origins with persistent credentials from credential storage. API tests: WKWebsiteDataStore.FetchNonPersistentCredentials WKWebsiteDataStore.FetchPersistentCredentials * platform/network/CredentialStorage.h: * platform/network/mac/CredentialStorageMac.mm: (WebCore::CredentialStorage::originsWithPersistentCredentials): 2019-04-25 Alex Christensen Fix MSVC build after r244653 https://bugs.webkit.org/show_bug.cgi?id=197131 * svg/properties/SVGValueProperty.h: MSVC doesn't think it can access these protected constructors from subclasses. Make the build work and investigate this later. 2019-04-25 Alex Christensen Start using C++17 https://bugs.webkit.org/show_bug.cgi?id=197131 Reviewed by Darin Adler. * Configurations/Base.xcconfig: * DerivedSources.make: 2019-04-25 Commit Queue Unreviewed, rolling out r244627. https://bugs.webkit.org/show_bug.cgi?id=197282 Causing internal build failures (Requested by ShawnRoberts on #webkit). Reverted changeset: "Create AVFoundationSoftLink.{h,mm} to reduce duplicate code" https://bugs.webkit.org/show_bug.cgi?id=197171 https://trac.webkit.org/changeset/244627 2019-04-25 Antti Koivisto redefinition of enumerator 'NSAttachmentCharacter' with Apple internal build https://bugs.webkit.org/show_bug.cgi?id=197279 Reviewed by Antoine Quint. Try to fix the build. * platform/mac/WebNSAttributedStringExtras.mm: 2019-04-25 Antti Koivisto Visited link hash should be computed only once https://bugs.webkit.org/show_bug.cgi?id=197229 Reviewed by Alex Christensen. Test: fast/history/visited-href-mutation.html Visited link style is now based on the first target URL of the link element. Further href mutations don't affect styling. * dom/Document.cpp: (WebCore::Document::updateBaseURL): * dom/VisitedLinkState.cpp: (WebCore::linkAttribute): (WebCore::linkHashForElement): Visited link support is now limited to HTML and SVG
elements. (WebCore::VisitedLinkState::invalidateStyleForLink): (WebCore::VisitedLinkState::determineLinkStateSlowCase): * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::HTMLAnchorElement): (WebCore::HTMLAnchorElement::parseAttribute): * html/HTMLAnchorElement.h: (WebCore::HTMLAnchorElement::visitedLinkHash const): (WebCore::HTMLAnchorElement::invalidateCachedVisitedLinkHash): Deleted. * svg/SVGAElement.cpp: (WebCore::SVGAElement::visitedLinkHash const): * svg/SVGAElement.h: 2019-04-25 Philippe Normand [GStreamer] gst_element_get_state: assertion 'GST_IS_ELEMENT (element)' failed in WebCore::MediaPlayerPrivateGStreamer::paused https://bugs.webkit.org/show_bug.cgi?id=196691 Reviewed by Eric Carlson. For gif assets, fail media loading early and notify the MediaPlayer by setting both network and ready states, so that the MediaPlayer will try with with the next media engine or pass the error to HTMLMediaElement if there are none. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::loadFull): (WebCore::MediaPlayerPrivateGStreamer::loadingFailed): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: 2019-04-25 Philippe Normand [REGRESSION(r243197)][GStreamer] http/tests/media/clearkey/collect-webkit-media-session.html hits an ASSERT https://bugs.webkit.org/show_bug.cgi?id=197230 Reviewed by Xabier Rodriguez-Calvar. Perform the resource loader disposal and destruction from the main thread. Also ensure there's no circular reference between the CachedResourceStreamingClient and WebKitWebSrc when disposing of the private WebKitWebSrc storage. * platform/graphics/gstreamer/MainThreadNotifier.h: * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (_WebKitWebSrcPrivate::~_WebKitWebSrcPrivate): (webkit_web_src_class_init): (webKitWebSrcDispose): (webKitWebSrcCloseSession): (webKitWebSrcFinalize): Deleted. 2019-04-24 Carlos Garcia Campos [GTK] Hardcoded text color in input fields https://bugs.webkit.org/show_bug.cgi?id=126907 Reviewed by Michael Catanzaro. Enable HAVE_OS_DARK_MODE_SUPPORT for GTK port to ensure that dark mode is used when Page::useDarkAppearance() returns true. This patch reverts r232913, I'll reopen the bug, I think we need to find a better solution for that. * CMakeLists.txt: Add HAVE_OS_DARK_MODE_SUPPORT to FEATURE_DEFINES_WITH_SPACE_SEPARATOR if enabled. * css/CSSDefaultStyleSheets.cpp: Ensure html{color:text} is used in simple style sheet when HAVE_OS_DARK_MODE_SUPPORT is enabled. * page/FrameView.cpp: (WebCore::FrameView::updateBackgroundRecursively): Use CSSValueWindowframe to get the frame view background color when HAVE_OS_DARK_MODE_SUPPORT is enabled for non-mac ports. * platform/gtk/RenderThemeWidget.cpp: (WebCore::RenderThemeWidget::getOrCreate): Create window widget. (WebCore::RenderThemeWindow::RenderThemeWindow): Add window widget. * platform/gtk/RenderThemeWidget.h: * rendering/RenderThemeGtk.cpp: (WebCore::RenderThemeGtk::disabledTextColor const): Always use the color from the theme for consistency with other form controls. (WebCore::RenderThemeGtk::systemColor const): Get the color from the theme for CSSValueText, CSSValueGraytext and CSSValueWindowframe. * rendering/RenderThemeGtk.h: 2019-04-24 Zalan Bujtas Regression (r244291): Broken API Test AutoLayoutRenderingProgressRelativeOrdering https://bugs.webkit.org/show_bug.cgi?id=196948 Reviewed by Tim Horton. Covered by existing tests. * loader/EmptyClients.h: * page/ChromeClient.h: * page/FrameView.cpp: (WebCore::FrameView::autoSizeIfEnabled): (WebCore::FrameView::enableAutoSizeMode): * page/FrameView.h: 2019-04-24 Youenn Fablet Do not restart WebRTC stats timer if backend is stopped https://bugs.webkit.org/show_bug.cgi?id=197257 Reviewed by Eric Carlson. We used to stop and reschedule the stat gathering timer in case the gathering delay is changing. Timer should not be rescheduled if the backend is stopped. * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered): 2019-04-24 Andres Gonzalez Flaky crash under WebCore::AXObjectCache::stopCachingComputedObjectAttributes() https://bugs.webkit.org/show_bug.cgi?id=187391 REGRESSION (r242132): Nested position:sticky elements move incorrectly https://bugs.webkit.org/show_bug.cgi?id=197255 rdar://problem/50137744 Reviewed by Zalan Bujtas. Revert to the behavior of the code before r242132, where we looked at the direct parent scrolling tree node instead of walking up the ancestor chain to find an enclosing scrolling node. This fixes nested sticky behavior. Test: scrollingcoordinator/mac/nested-sticky.html * page/scrolling/cocoa/ScrollingTreeStickyNode.mm: (WebCore::ScrollingTreeStickyNode::applyLayerPositions): 2019-04-24 Eric Carlson Create AVFoundationSoftLink.{h,mm} to reduce duplicate code https://bugs.webkit.org/show_bug.cgi?id=197171 Reviewed by Youenn Fablet. Tests: TestWebKitAPI/Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm * Modules/plugins/QuickTimePluginReplacement.mm: (WebCore::jsValueWithValueInContext): (WebCore::jsValueWithAVMetadataItemInContext): * WebCore.xcodeproj/project.pbxproj: * platform/audio/ios/AudioSessionIOS.mm: (WebCore::AudioSession::setCategory): (WebCore::AudioSession::category const): (WebCore::AudioSession::routeSharingPolicy const): (WebCore::AudioSession::routingContextUID const): (WebCore::AudioSession::sampleRate const): (WebCore::AudioSession::bufferSize const): (WebCore::AudioSession::numberOfOutputChannels const): (WebCore::AudioSession::tryToSetActiveInternal): (WebCore::AudioSession::preferredBufferSize const): (WebCore::AudioSession::setPreferredBufferSize): * platform/audio/ios/MediaSessionManagerIOS.mm: (-[WebMediaSessionHelper initWithCallback:]): (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]): * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm: (WebCore::AVTrackPrivateAVFObjCImpl::audioKind const): (WebCore::AVTrackPrivateAVFObjCImpl::videoKind const): (WebCore::AVTrackPrivateAVFObjCImpl::label const): * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm: (WebCore::AudioSourceProviderAVFObjC::createMix): * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm: * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm: (WebCore::MediaSelectionGroupAVFObjC::updateOptions): * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm: (WebCore::AVFoundationMIMETypeCache::canDecodeType): (WebCore::AVFoundationMIMETypeCache::loadMIMETypes): * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistableState): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistentKeys): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsMediaCapability): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::ensureSession): * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm: (WebCore::CDMSessionAVContentKeySession::isAvailable): (WebCore::CDMSessionAVContentKeySession::releaseKeys): (WebCore::CDMSessionAVContentKeySession::update): (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage): (WebCore::CDMSessionAVContentKeySession::contentKeySession): * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm: * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm: (WebCore::CDMSessionAVStreamSession::releaseKeys): (WebCore::CDMSessionAVStreamSession::update): (WebCore::CDMSessionAVStreamSession::setStreamSession): (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage): * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: (WebCore::imageDecoderAssetOptions): (WebCore::ImageDecoderAVFObjC::ImageDecoderAVFObjC): (WebCore::ImageDecoderAVFObjC::firstEnabledTrack): (WebCore::ImageDecoderAVFObjC::readSamples): (SOFT_LINK_CONSTANT_MAY_FAIL): Deleted. * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm: (WebCore::InbandTextTrackPrivateAVFObjC::label const): * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm: (WebCore::InbandTextTrackPrivateLegacyAVFObjC::label const): * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm: (WebCore::MediaPlaybackTargetPickerMac::devicePicker): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::assetCacheForPath): (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache): (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins): (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad): (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageGenerator): (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer): (WebCore::MediaPlayerPrivateAVFoundationObjC::synchronizeTextTrackState): (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): (WebCore::MediaPlayerPrivateAVFoundationObjC::setAVPlayerItem): (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem): (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType): (WebCore::MediaPlayerPrivateAVFoundationObjC::isAvailable): (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged): (WebCore::determineChangedTracksFromNewTracksAndOldItems): (WebCore::MediaPlayerPrivateAVFoundationObjC::updateAudioTracks): (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoTracks): (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput): (WebCore::MediaPlayerPrivateAVFoundationObjC::outputMediaDataWillChange): (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForLegibleMedia): (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForAudibleMedia): (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForVisualMedia): (WebCore::MediaPlayerPrivateAVFoundationObjC::processMediaSelectionOptions): (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack): (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack const): (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType const): (WebCore::exernalDeviceDisplayNameForPlayer): (WebCore::metadataType): (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive): (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]): (-[WebCoreAVFPullDelegate outputMediaDataWillChange:]): (-[WebCoreAVFPullDelegate outputSequenceWasFlushed:]): (WebCore::MediaPlayerPrivateAVFoundationObjC::processLegacyClosedCaptionsTracks): Deleted. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::streamSession): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (-[WebAVSampleBufferStatusChangeListener observeValueForKeyPath:ofObject:change:context:]): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]): (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer): (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa): (WebCore::PlatformCALayerCocoa::clone const): (WebCore::PlatformCALayerCocoa::avPlayerLayer const): * platform/graphics/cocoa/HEVCUtilitiesCocoa.mm: (WebCore::validateHEVCParameters): * platform/ios/PlatformSpeechSynthesizerIOS.mm: (getAVSpeechUtteranceDefaultSpeechRate): (getAVSpeechUtteranceMaximumSpeechRate): (-[WebSpeechSynthesisWrapper speakUtterance:]): (WebCore::PlatformSpeechSynthesizer::initializeVoiceList): (SOFT_LINK_CONSTANT): Deleted. * platform/ios/VideoFullscreenInterfaceAVKit.mm: (-[WebAVPlayerLayer init]): (-[WebAVPlayerLayer layoutSublayers]): (-[WebAVPlayerLayer setVideoGravity:]): (-[WebAVPlayerLayer videoRect]): (WebAVPlayerLayerView_startRoutingVideoToPictureInPicturePlayerLayerView): * platform/mac/SerializedPlatformRepresentationMac.mm: (WebCore::jsValueWithValueInContext): (WebCore::jsValueWithAVMetadataItemInContext): * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (WebCore::getAVFormatIDKeyWithFallback): (WebCore::getAVNumberOfChannelsKeyWithFallback): (WebCore::getAVSampleRateKeyWithFallback): (WebCore::getAVEncoderBitRateKeyWithFallback): (WebCore::MediaRecorderPrivateWriter::create): (WebCore::MediaRecorderPrivateWriter::setVideoInput): (WebCore::MediaRecorderPrivateWriter::setAudioInput): * platform/mediastream/RealtimeVideoSource.h: * platform/mediastream/VideoPreset.h: * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm: (WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices): * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm: (-[WebCoreAudioCaptureSourceIOSListener initWithCallback:]): (-[WebCoreAudioCaptureSourceIOSListener handleInterruption:]): * platform/mediastream/mac/AVCaptureDeviceManager.mm: (WebCore::deviceIsAvailable): (WebCore::AVCaptureDeviceManager::updateCachedAVCaptureDevices): (WebCore::AVCaptureDeviceManager::refreshCaptureDevices): (WebCore::AVCaptureDeviceManager::isAvailable): (WebCore::AVCaptureDeviceManager::~AVCaptureDeviceManager): * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoPreset::create): (WebCore::AVVideoPreset::AVVideoPreset): (WebCore::AVVideoCaptureSource::create): (WebCore::AVVideoCaptureSource::AVVideoCaptureSource): (WebCore::AVVideoCaptureSource::capabilities): (WebCore::sensorOrientationFromVideoOutput): (WebCore::AVVideoCaptureSource::setupSession): (WebCore::AVVideoCaptureSource::frameDurationForFrameRate): (WebCore::AVVideoCaptureSource::setupCaptureSession): (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection): (WebCore::AVVideoCaptureSource::generatePresets): (-[WebCoreAVVideoCaptureSourceObserver addNotificationObservers]): (-[WebCoreAVVideoCaptureSourceObserver captureOutput:didOutputSampleBuffer:fromConnection:]): 2019-04-24 Brady Eidson XMLHTTPRequest POSTs to a custom WKURLSchemeHandler protocol are missing the HTTP body. https://bugs.webkit.org/show_bug.cgi?id=191362 Reviewed by Alex Christensen. Covered by new API tests. In 2008 some refactoring added an HTTP(S)-only restriction to copying the form body for XHRs that POST, and it added that restriction with no explanation. We definitely want to allow that. Blobs are broken at this time (covered by bug 197237) * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::send): (WebCore::XMLHttpRequest::sendBytesData): 2019-04-24 John Wilander Age out unconverted Ad Click Attributions after one week. https://bugs.webkit.org/show_bug.cgi?id=197238 Reviewed by Chris Dumez. This patch adds the two functions AdClickAttribution::markAsExpired() and AdClickAttribution::hasExpired() which make use of the existing m_timeOfAdClick member. Test: http/tests/adClickAttribution/expired-attributions-removed.html * loader/AdClickAttribution.cpp: (WebCore::AdClickAttribution::markAsExpired): (WebCore::AdClickAttribution::hasExpired const): * loader/AdClickAttribution.h: 2019-04-24 Simon Fraser REGRESSION (iOS 12.2): CSS perspective property value can only be set correctly once https://bugs.webkit.org/show_bug.cgi?id=197105 rdar://problem/50068230 Reviewed by Zalan Bujtas. Make sure we trigger a geometry update when style properties change that result in a StyleDifference::RecompositeLayer, and which are updated on layers via RenderLayerBacking::updateGeometry(). Tests: compositing/style-change/backface-visibility-change.html compositing/style-change/perspective-change.html compositing/style-change/perspective-origin-change.html compositing/style-change/transform-origin-change.html compositing/style-change/transform-style-change.html * rendering/RenderLayerCompositor.cpp: (WebCore::recompositeChangeRequiresGeometryUpdate): (WebCore::RenderLayerCompositor::layerStyleChanged): 2019-04-24 Simon Fraser Make it possible to control the renderTreeAsText output by setting options on testRunner https://bugs.webkit.org/show_bug.cgi?id=197133 Reviewed by Sam Weinig. Add testRunner.setRenderTreeDumpOptions() and expose the subset of RenderAsTextFlag flags that make sense in testing (those that don't dump unstable data like addresses), and plumb these flags through the various framework layers. Convert RenderAsTextBehavior to an OptionSet. Fix code generation in WebKitTestRunner to generate bindings for IDL const values, and hand-code DumpRenderTree bindings. Some cleanup of the TestRunners, using member initializers. Test: fast/harness/render-tree-as-text-options.html * rendering/RenderLayer.cpp: (WebCore::showLayerTree): * rendering/RenderTreeAsText.cpp: (WebCore::RenderTreeAsText::writeRenderObject): (WebCore::writeDebugInfo): (WebCore::write): (WebCore::writeLayer): (WebCore::writeLayerRenderers): (WebCore::writeLayers): (WebCore::externalRepresentation): * rendering/RenderTreeAsText.h: (WebCore::externalRepresentation): (WebCore::write): (WebCore::writeDebugInfo): (): Deleted. * rendering/svg/SVGRenderTreeAsText.cpp: (WebCore::writePositionAndStyle): (WebCore::writeStandardPrefix): (WebCore::writeChildren): (WebCore::writeSVGResourceContainer): (WebCore::writeSVGContainer): (WebCore::write): (WebCore::writeSVGText): (WebCore::writeSVGInlineText): (WebCore::writeSVGImage): (WebCore::writeSVGGradientStop): (WebCore::writeResources): * rendering/svg/SVGRenderTreeAsText.h: 2019-04-24 Antoine Quint [iOS] Calling preventDefault() when handling a pointerdown event should not prevent panning, zooming or click event dispatch https://bugs.webkit.org/show_bug.cgi?id=195839 Reviewed by Brent Fulgham. Tests: pointerevents/ios/pointer-events-prevent-default-allows-click-event.html pointerevents/ios/pointer-events-prevent-default-allows-scrolling.html The Pointer Events specification defines that the default action of any and all pointer events MUST NOT be a manipulation of the viewport (e.g. panning or zooming). In practice, this means that calling preventDefault() while handling a Pointer Event has no effect on the inner workings of the user agent, so we change the method signature of PointerCaptureController::dispatchEventForTouchAtIndex() to return void since we don't need to know whether preventDefault() was called. https://www.w3.org/TR/pointerevents/#declaring-candidate-regions-for-default-touch-behaviors * page/PointerCaptureController.cpp: (WebCore::PointerCaptureController::dispatchEventForTouchAtIndex): * page/PointerCaptureController.h: 2019-04-24 Frederic Wang With async scrolling enabled, this MathML test asserts https://bugs.webkit.org/show_bug.cgi?id=196123 This patch ensures that updateScrollInfoAfterLayout() is called during MathML layout. This fixes assertions when async scrolling is enabled and MathML elements have non-visible overflow. Reviewed by Rob Buis. Test: mathml/mathml-overflow-crash.html * rendering/mathml/RenderMathMLBlock.cpp: (WebCore::RenderMathMLBlock::layoutBlock): (WebCore::RenderMathMLBlock::layoutInvalidMarkup): * rendering/mathml/RenderMathMLFraction.cpp: (WebCore::RenderMathMLFraction::layoutBlock): * rendering/mathml/RenderMathMLMath.cpp: (WebCore::RenderMathMLMath::layoutBlock): * rendering/mathml/RenderMathMLMenclose.cpp: (WebCore::RenderMathMLMenclose::layoutBlock): * rendering/mathml/RenderMathMLOperator.cpp: (WebCore::RenderMathMLOperator::layoutBlock): * rendering/mathml/RenderMathMLPadded.cpp: (WebCore::RenderMathMLPadded::layoutBlock): * rendering/mathml/RenderMathMLRoot.cpp: (WebCore::RenderMathMLRoot::layoutBlock): * rendering/mathml/RenderMathMLRow.cpp: (WebCore::RenderMathMLRow::layoutBlock): * rendering/mathml/RenderMathMLScripts.cpp: (WebCore::RenderMathMLScripts::layoutBlock): * rendering/mathml/RenderMathMLSpace.cpp: (WebCore::RenderMathMLSpace::layoutBlock): * rendering/mathml/RenderMathMLToken.cpp: (WebCore::RenderMathMLToken::layoutBlock): * rendering/mathml/RenderMathMLUnderOver.cpp: (WebCore::RenderMathMLUnderOver::layoutBlock): 2019-04-24 Greg V Fix -Wc++11-narrowing on unsigned char platforms like FreeBSD/aarch64 https://bugs.webkit.org/show_bug.cgi?id=197148 Reviewed by Alex Christensen. * contentextensions/DFACombiner.cpp: * contentextensions/NFAToDFA.cpp: 2019-04-24 Chris Dumez X-Frame-Options header should be ignored when frame-ancestors CSP directive is present https://bugs.webkit.org/show_bug.cgi?id=197226 Reviewed by Alex Christensen. X-Frame-Options header should be ignored when frame-ancestors CSP directive is present: - https://www.w3.org/TR/CSP3/#frame-ancestors-and-frame-options Specification says: """ In order to allow backwards-compatible deployment, the frame-ancestors directive _obsoletes_ the X-Frame-Options header. If a resource is delivered with an policy that includes a directive named frame-ancestors and whose disposition is "enforce", then the X-Frame-Options header MUST be ignored. """ Gecko and Blink follow the specification, WebKit does not. As a result, page [1] is broken with WebKit-only on Schwab.com. The page height is wrong and you cannot see all the ETFs as a result. [1] https://www.schwab.com/public/schwab/investing/investment_help/investment_research/etf_research/etfs.html?&path=/Prospect/Research/etfs/overview/oneSourceETFs.asp Test: http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-overrides-X-Frames-Options.html * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::responseReceived): * page/csp/ContentSecurityPolicy.cpp: (WebCore::ContentSecurityPolicy::overridesXFrameOptions const): * page/csp/ContentSecurityPolicy.h: * page/csp/ContentSecurityPolicyDirectiveList.h: (WebCore::ContentSecurityPolicyDirectiveList::hasFrameAncestorsDirective const): 2019-04-24 Zalan Bujtas [ContentChangeObserver] Do not use the global _WKContentChange in WebKitLegacy https://bugs.webkit.org/show_bug.cgi?id=196286 Reviewed by Simon Fraser. By reporting WKContentIndeterminateChange in sendMouseMoveEvent enables us to remove the global _WKContentChange state. Using _WKContentChange is fine as long as only the observed frame reports content change during the synthetic click event. In case of multiple frames, we should really consult the local state instead. Unfortunately sendMouseMoveEvent has no access to the observed Document object so we can't really identify the observed content change. WKContentIndeterminateChange triggers asynchronous decision making at the callsite and in the callback we have access to the active Document/ContentChangeObverver object and can report the correct state. This is inline with current WebKit(WK2) behaviour. Manually tested with a WebKitLegacy test app. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * page/ios/ContentChangeObserver.h: (WebCore::ContentChangeObserver::setHasNoChangeState): (WebCore::ContentChangeObserver::setHasIndeterminateState): (WebCore::ContentChangeObserver::setHasVisibleChangeState): (WebCore::ContentChangeObserver::setObservedContentState): Deleted. * page/ios/EventHandlerIOS.mm: (WebCore::EventHandler::mouseMoved): * platform/ios/wak/WAKWindow.mm: (-[WAKWindow sendMouseMoveEvent:contentChange:]): * platform/ios/wak/WKContentObservation.cpp: Removed. * platform/ios/wak/WKContentObservation.h: 2019-04-24 Philippe Normand [GTK][GStreamer] Flaky ASSERTION FAILED: m_lock.isHeld() in TextureMapperPlatformLayerProxy https://bugs.webkit.org/show_bug.cgi?id=196739 Reviewed by Xabier Rodriguez-Calvar. The crash was triggered because m_videoDecoderPlatform not being explicitely set, its value would be inferred as one of the enum class values. Making it Optional avoids this issue. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: 2019-04-24 Philippe Normand [GStreamer] Crash in AudioTrackPrivate with playbin3 enabled https://bugs.webkit.org/show_bug.cgi?id=196913 Reviewed by Xabier Rodriguez-Calvar. The crash was due to a playbin3 code path being triggered during MSE playback, which is not supposed to work in playbin3 anyway. The problem is that setting the USE_PLAYBIN3 environment variable to "1" makes the GStreamer playback plugin register the playbin3 element under the playbin name. So that leads to playbin3 being used everywhere in WebKit where we assume the playbin element is used. So the proposed solution is to: - use a WebKit-specific environment variable instead of the GStreamer USE_PLAYBIN3 variable. - emit a warning if the USE_PLAYBIN3 environment variable is detected. We can't unset it ourselves for security reasons. The patch also includes a code cleanup of the player method handling the pipeline creation. The previous code had a bug leading to playbin3 being used for MSE. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): 2019-04-24 chris fleizach AX: Remove deprecated Accessibility Object Model events https://bugs.webkit.org/show_bug.cgi?id=197073 Reviewed by Ryosuke Niwa. Test: accessibility/mac/replace-text-with-range.html * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * accessibility/AccessibilityListBoxOption.cpp: (WebCore::AccessibilityListBoxOption::setSelected): * accessibility/AccessibilityMediaObject.cpp: (WebCore::AccessibilityMediaObject::increment): (WebCore::AccessibilityMediaObject::decrement): * accessibility/AccessibilityMenuListOption.cpp: (WebCore::AccessibilityMenuListOption::setSelected): * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::increment): (WebCore::AccessibilityNodeObject::decrement): * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::press): (WebCore::AccessibilityObject::replaceTextInRange): (WebCore::AccessibilityObject::scrollToMakeVisible const): (WebCore::AccessibilityObject::shouldDispatchAccessibilityEvent const): Deleted. (WebCore::AccessibilityObject::dispatchAccessibilityEvent const): Deleted. (WebCore::AccessibilityObject::dispatchAccessibilityEventWithType const): Deleted. (WebCore::AccessibilityObject::dispatchAccessibleSetValueEvent const): Deleted. * accessibility/AccessibilityObject.h: * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::setFocused): (WebCore::AccessibilityRenderObject::setValue): * accessibility/AccessibilityScrollbar.cpp: (WebCore::AccessibilityScrollbar::setValue): * accessibility/AccessibilitySlider.cpp: (WebCore::AccessibilitySlider::setValue): * accessibility/ios/AccessibilityObjectIOS.mm: (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const): (WebCore::AccessibilityObject::hasAccessibleDismissEventListener const): Deleted. * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityPerformEscape]): Deleted. (-[WebAccessibilityObjectWrapper accessibilityElementDidBecomeFocused]): Deleted. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper accessibilityPerformShowMenuAction]): * dom/Element.idl: * dom/EventNames.h: * dom/EventNames.in: * html/HTMLAttributeNames.in: * html/HTMLElement.cpp: (WebCore::HTMLElement::createEventHandlerNameMap): * page/Settings.yaml: * testing/InternalSettings.cpp: (WebCore::InternalSettings::Backup::Backup): (WebCore::InternalSettings::Backup::restoreTo): (WebCore::InternalSettings::setAccessibilityEventsEnabled): Deleted. * testing/InternalSettings.h: * testing/InternalSettings.idl: 2019-04-23 Andy Estes [iOS] QuickLook documents loaded from file: URLs should be allowed to perform same-document navigations https://bugs.webkit.org/show_bug.cgi?id=196749 Reviewed by Daniel Bates. QuickLook previews are in a non-local origin defined by a unique x-apple-ql-id: URL, which isolates the origin that hosted the document from the document preview itself. When a QuickLook document is loaded as a file: URL, SecurityOrigin's protections against loading local resources from non-local origins prevented navigations like location.reload() and fragment navigations. To allow reloads and same-document navigations in QuickLook documents loaded from file: URLs, we should grant the QuickLook document's SecurityOrigin access to the file path that loaded the preview. Added a new API test. * dom/Document.cpp: (WebCore::Document::applyQuickLookSandbox): * page/SecurityOrigin.cpp: (WebCore::SecurityOrigin::createNonLocalWithAllowedFilePath): (WebCore::SecurityOrigin::canDisplay const): * page/SecurityOrigin.h: 2019-04-23 Devin Rousso Web Inspector: Debugger: remove ASSERT_NOT_REACHED where it's possible to reach https://bugs.webkit.org/show_bug.cgi?id=197210 Reviewed by Joseph Pecoraro. * inspector/agents/page/PageDebuggerAgent.cpp: (WebCore::PageDebuggerAgent::didAddEventListener): (WebCore::PageDebuggerAgent::didPostMessage): * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::consoleAgentEnabled): (WebCore::InspectorInstrumentation::timelineAgentEnabled): Drive-by: add additional `FAST_RETURN_IF_NO_FRONTENDS`. 2019-04-23 Commit Queue Unreviewed, rolling out r244556. https://bugs.webkit.org/show_bug.cgi?id=197212 Causing build failures on multiple builders (Requested by ShawnRoberts on #webkit). Reverted changeset: "Create AVFoundationSoftLink.{h,mm} to reduce duplicate code" https://bugs.webkit.org/show_bug.cgi?id=197171 https://trac.webkit.org/changeset/244556 2019-04-23 Devin Rousso Web Inspector: Uncaught Exception: null is not an object (evaluating 'this.ownerDocument.frameIdentifier') https://bugs.webkit.org/show_bug.cgi?id=196420 Reviewed by Timothy Hatcher. Modify the existing `frameId` to represent the owner frame of the node, rather than the frame it holds (in the case of an `